cleanup: Remove "computeXX" functions and XX variables, these were always returning X/2 in all cases.

Test suite passes
This commit is contained in:
wagic.the.homebrew
2011-05-02 11:28:04 +00:00
parent 13dd07973e
commit 53f45a8b8e
10 changed files with 5 additions and 40 deletions

View File

@@ -127,7 +127,6 @@ public:
ManaCost * cost;
int payResult;
int computeX(MTGCardInstance * card);
int computeXX(MTGCardInstance * card);
Spell(MTGCardInstance* _source);
Spell(int id, MTGCardInstance* _source, TargetChooser *_tc, ManaCost * _cost, int payResult);
~Spell();

View File

@@ -36,12 +36,6 @@ public:
if (card) return card->X;
return 1; //this should only hapen when the ai calls the ability. This is to give it an idea of the "direction" of X (positive/negative)
}
int computeXX(Spell * spell, MTGCardInstance * card)
{
if (spell) return spell->computeXX(card);
if (card) return card->XX;
return 1; //this should only hapen when the ai calls the ability. This is to give it an idea of the "direction" of X (positive/negative)
}
WParsedInt(int value = 0)
{
intValue = value;
@@ -82,7 +76,7 @@ public:
}
else if (s == "xx" || s == "XX")
{
intValue = computeXX(spell, card);
intValue = computeX(spell, card) / 2;
if(intValue < 0)
intValue = 0;
}

View File

@@ -484,7 +484,6 @@ public:
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY, TargetChooser * tc = NULL,Targetable * target = NULL);
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL, int mode = MODE_PUTINTOPLAY, TargetChooser * tc = NULL, MTGGameZone * dest = NULL);
static int computeX(Spell * spell, MTGCardInstance * card);
static int computeXX(Spell * spell, MTGCardInstance * card);
static MTGAbility * getCoreAbility(MTGAbility * a);
int destroyAllInPlay(TargetChooser * tc, int bury = 0);
int moveAll(TargetChooser * tc, string destinationZone);

View File

@@ -48,7 +48,6 @@ public:
MTGGameZone * currentZone;
Pos* view;
int X;
int XX;
int alternateCostPaid[ManaCost::MANA_PAID_WITH_RETRACE + 1];
int paymenttype;
int castMethod; /* Tells if the card reached its current zone by being cast or not (brought into the zone by an effect). non 0 == cast, 0 == not cast */