Erwan
-removing useless code -fixed a few cards (incorrect set)
This commit is contained in:
@@ -731,14 +731,12 @@ int AIPlayerBaka::Act(float dt){
|
||||
g->userRequestNextGamePhase();
|
||||
}
|
||||
} else {
|
||||
//if (!clickstream.empty()){
|
||||
AIAction * action = clickstream.front();
|
||||
action->Act();
|
||||
SAFE_DELETE(action);
|
||||
clickstream.pop();
|
||||
}
|
||||
|
||||
//if (clickstream.empty()) computeActions();
|
||||
|
||||
return 1;
|
||||
};
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "../include/DeckDataWrapper.h"
|
||||
|
||||
static const char* GAME_VERSION = "WTH?! 0.7.1 - by WilLoW";
|
||||
#define ALPHA_WARNING 0
|
||||
|
||||
#define DEFAULT_ANGLE_MULTIPLIER 0.4
|
||||
#define MAX_ANGLE_MULTIPLIER (3*M_PI)
|
||||
@@ -27,7 +26,6 @@ enum ENUM_MENU_STATE_MAJOR
|
||||
MENU_STATE_MAJOR_LOADING_MENU = 0x03,
|
||||
MENU_STATE_MAJOR_LOADING_CARDS = 0x04,
|
||||
MENU_STATE_MAJOR_FIRST_TIME = 0x05,
|
||||
MENU_STATE_MAJOR_WARNING = 0x06,
|
||||
MENU_STATE_MAJOR_DUEL = 0x07,
|
||||
|
||||
MENU_STATE_MAJOR = 0xFF
|
||||
@@ -81,8 +79,6 @@ GameStateMenu::~GameStateMenu() {}
|
||||
|
||||
void GameStateMenu::Create()
|
||||
{
|
||||
|
||||
|
||||
mDip = NULL;
|
||||
mReadConf = 0;
|
||||
mCurrentSetName[0] = 0;
|
||||
@@ -100,20 +96,16 @@ void GameStateMenu::Create()
|
||||
mMovingW->SetHotSpot(72,16);
|
||||
//load all the icon images
|
||||
int n = 0;
|
||||
for (int i=0;i<5;i++)
|
||||
{
|
||||
for (int j=0;j<2;j++)
|
||||
{
|
||||
mIcons[n] = NEW JQuad(mIconsTexture, 2 + i*36, 2 + j*36, 32, 32);
|
||||
mIcons[n]->SetHotSpot(16,16);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
for (int i=0;i<5;i++){
|
||||
for (int j=0;j<2;j++){
|
||||
mIcons[n] = NEW JQuad(mIconsTexture, 2 + i*36, 2 + j*36, 32, 32);
|
||||
mIcons[n]->SetHotSpot(16,16);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
JLBFont * mFont = GameApp::CommonRes->GetJLBFont(Constants::MENU_FONT);
|
||||
//mFont->SetBase(0); // using 2nd font
|
||||
mGuiController = NEW JGuiController(100, this);
|
||||
//mGuiController->SetShadingBackground(10, 45, 80, 100, ARGB(255,0,0,0));
|
||||
if (mGuiController)
|
||||
{
|
||||
mGuiController->Add(NEW MenuItem(MENUITEM_PLAY, mFont, "Play", 80, 50 + SCREEN_HEIGHT/2, mIcons[8], mIcons[9],"graphics/particle1.psi",GameApp::CommonRes->GetQuad("particles"), true));
|
||||
@@ -147,7 +139,6 @@ void GameStateMenu::Destroy()
|
||||
SAFE_DELETE(bgTexture);
|
||||
SAFE_DELETE(scroller);
|
||||
|
||||
//SAFE_DELETE (bgMusic);
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +280,7 @@ void GameStateMenu::Update(float dt)
|
||||
std::ifstream file(RESPATH"/player/collection.dat");
|
||||
if(file){
|
||||
file.close();
|
||||
currentState = MENU_STATE_MAJOR_WARNING | MENU_STATE_MINOR_NONE;
|
||||
currentState = MENU_STATE_MAJOR_MAINMENU | MENU_STATE_MINOR_NONE;
|
||||
}else{
|
||||
currentState = MENU_STATE_MAJOR_FIRST_TIME | MENU_STATE_MINOR_NONE;
|
||||
}
|
||||
@@ -311,14 +302,7 @@ void GameStateMenu::Update(float dt)
|
||||
}
|
||||
createUsersFirstDeck(setId);
|
||||
}
|
||||
currentState = MENU_STATE_MAJOR_WARNING | MENU_STATE_MINOR_NONE;
|
||||
break;
|
||||
case MENU_STATE_MAJOR_WARNING :
|
||||
if (!ALPHA_WARNING){
|
||||
currentState = MENU_STATE_MAJOR_MAINMENU | MENU_STATE_MINOR_NONE;
|
||||
}else{
|
||||
if (mEngine->GetButtonClick(PSP_CTRL_CIRCLE)) currentState = MENU_STATE_MAJOR_MAINMENU | MENU_STATE_MINOR_NONE;
|
||||
}
|
||||
currentState = MENU_STATE_MAJOR_MAINMENU | MENU_STATE_MINOR_NONE;
|
||||
break;
|
||||
case MENU_STATE_MAJOR_MAINMENU :
|
||||
if (!scrollerSet) fillScroller();
|
||||
@@ -487,21 +471,6 @@ void GameStateMenu::Render()
|
||||
if (subMenuController){
|
||||
subMenuController->Render();
|
||||
}
|
||||
|
||||
if ((currentState & MENU_STATE_MAJOR) == MENU_STATE_MAJOR_WARNING){
|
||||
renderer->FillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,ARGB(128,0,0,0));
|
||||
|
||||
mFont->DrawString("IMPORTANT NOTE" ,SCREEN_WIDTH/2,10,JGETEXT_CENTER);
|
||||
mFont->DrawString("This is an alpha version with lots of bugs.",SCREEN_WIDTH/2,35,JGETEXT_CENTER);
|
||||
mFont->DrawString("It WILL crash your psp" ,SCREEN_WIDTH/2,50,JGETEXT_CENTER);
|
||||
mFont->DrawString("If you use it anyway, your feedback is welcome" ,SCREEN_WIDTH/2,65,JGETEXT_CENTER);
|
||||
|
||||
mFont->DrawString("This freeware game is NOT published or endorsed" ,SCREEN_WIDTH/2,110,JGETEXT_CENTER);
|
||||
mFont->DrawString("by Wizard of the Coast, Inc." ,SCREEN_WIDTH/2,125,JGETEXT_CENTER);
|
||||
mFont->DrawString("Infos & updates at http://wololo.net/wagic/" ,SCREEN_WIDTH/2,170,JGETEXT_CENTER);
|
||||
mFont->DrawString("PRESS CIRCLE TO CONTINUE OR HOME TO QUIT" ,SCREEN_WIDTH/2,210,JGETEXT_CENTER);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2227,11 +2227,6 @@ ostream& TriggeredAbility::toString(ostream& out) const
|
||||
//
|
||||
InstantAbility::InstantAbility(int _id, MTGCardInstance * source):MTGAbility(_id, source){
|
||||
init = 0;
|
||||
for (int i = 0; i < 2; i++){
|
||||
if(game->players[i]->game->inPlay->hasCard(source)){
|
||||
//game->players[i]->game->putInGraveyard(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InstantAbility::Update(float dt){
|
||||
@@ -2242,11 +2237,6 @@ void InstantAbility::Update(float dt){
|
||||
|
||||
InstantAbility::InstantAbility(int _id, MTGCardInstance * source, Damageable * _target):MTGAbility(_id, source, _target){
|
||||
init = 0;
|
||||
for (int i = 0; i < 2; i++){
|
||||
if(game->players[i]->game->inPlay->hasCard(source)){
|
||||
//game->players[i]->game->putInGraveyard(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -288,7 +288,6 @@ MTGCardInstance * MTGCardInstance::changeController(Player * newController){
|
||||
Player * originalOwner = controller();
|
||||
if (originalOwner == newController) return 0;
|
||||
MTGCardInstance * copy = originalOwner->game->putInZone(this, originalOwner->game->inPlay, newController->game->inPlay);
|
||||
//summoningSickness = 1;
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ MTGGamePhase::MTGGamePhase(int id):ActionElement(id){
|
||||
}
|
||||
|
||||
|
||||
void MTGGamePhase::Render(){
|
||||
}
|
||||
|
||||
|
||||
void MTGGamePhase::Update(float dt){
|
||||
|
||||
int newState = GameObserver::GetInstance()->getCurrentGamePhase();
|
||||
|
||||
@@ -276,7 +276,7 @@ int ManaCost::pay(ManaCost * _cost){
|
||||
//TODO return 0 if can't afford the cost!
|
||||
}
|
||||
|
||||
//return 1 if _cost can be paid with current data
|
||||
//return 1 if _cost can be paid with current data, 0 otherwise
|
||||
int ManaCost::canAfford(ManaCost * _cost){
|
||||
ManaCost * diff = Diff(_cost);
|
||||
int positive = diff->isPositive();
|
||||
@@ -340,21 +340,16 @@ ManaCost * ManaCost::Diff(ManaCost * _cost){
|
||||
//Colorless mana, special case
|
||||
int colorless_idx = Constants::MTG_COLOR_ARTIFACT * 2 + 1;
|
||||
if (diff[colorless_idx] < 0){
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
//char buf[4096], *p = buf;
|
||||
//sprintf(buf, "--Diff color TEST %i : %i\n", i, cost[i]);
|
||||
OutputDebugString("Colorless mana not enough\n");
|
||||
#endif
|
||||
for (int i=0; i < Constants::MTG_NB_COLORS; i++){
|
||||
if (diff[i*2 + 1] > 0){
|
||||
if (diff[i*2 + 1] + diff[colorless_idx] > 0){
|
||||
diff[i*2 + 1] += diff[colorless_idx];
|
||||
diff[colorless_idx] = 0;
|
||||
break;
|
||||
}else{
|
||||
diff[colorless_idx] += diff[i*2 + 1];
|
||||
diff[i*2 + 1] = 0;
|
||||
}
|
||||
if (diff[i*2 + 1] + diff[colorless_idx] > 0){
|
||||
diff[i*2 + 1] += diff[colorless_idx];
|
||||
diff[colorless_idx] = 0;
|
||||
break;
|
||||
}else{
|
||||
diff[colorless_idx] += diff[i*2 + 1];
|
||||
diff[i*2 + 1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -364,8 +359,8 @@ ManaCost * ManaCost::Diff(ManaCost * _cost){
|
||||
diff[Constants::MTG_NB_COLORS * 2 + 1] = 0;
|
||||
for (int i=0; i < Constants::MTG_NB_COLORS; i++){
|
||||
if (diff[i*2 + 1] > 0){
|
||||
diff[Constants::MTG_NB_COLORS * 2 + 1] += diff[i*2 + 1];
|
||||
diff[i*2 + 1] = 0;
|
||||
diff[Constants::MTG_NB_COLORS * 2 + 1] += diff[i*2 + 1];
|
||||
diff[i*2 + 1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,6 @@ OptionItem::OptionItem(string _id, string _displayValue, int _maxValue, int _inc
|
||||
y = 0;
|
||||
}
|
||||
|
||||
OptionItem::~OptionItem(){
|
||||
//TODO
|
||||
}
|
||||
|
||||
void OptionItem::setData(){
|
||||
GameOptions::GetInstance()->values[id] = GameOption(value);
|
||||
}
|
||||
|
||||
@@ -67,21 +67,8 @@ ManaCost * Player::getManaPool(){
|
||||
return manaPool;
|
||||
}
|
||||
|
||||
|
||||
int Player::testLife(){
|
||||
if (life <=0){
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
//char buf[4096], *p = buf;
|
||||
//sprintf(buf, "--Diff color TEST %i : %i\n", i, cost[i]);
|
||||
OutputDebugString("GAME OVER\n");
|
||||
#endif
|
||||
//return GameObserver::GetInstance()->endOfGame();
|
||||
}
|
||||
return life;
|
||||
}
|
||||
|
||||
int Player::afterDamage(){
|
||||
return testLife();
|
||||
return life;
|
||||
}
|
||||
|
||||
//Cleanup phase at the end of a turn
|
||||
|
||||
Reference in New Issue
Block a user