diff --git a/projects/mtg/include/ActionStack.h b/projects/mtg/include/ActionStack.h index ebd592609..e394e374d 100644 --- a/projects/mtg/include/ActionStack.h +++ b/projects/mtg/include/ActionStack.h @@ -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(); diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 9aa680447..4ca7c10ea 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -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; } diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index 69f575bf2..490eb4840 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -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); diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 5d0bcc81d..7cccfed67 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -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 */ diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 64430d16c..610f6ffa2 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -245,14 +245,6 @@ int Spell::computeX(MTGCardInstance * card) return x; } -int Spell::computeXX(MTGCardInstance * card) -{ - ManaCost * c = cost->Diff(card->getManaCost()); - int xx = c->getCost(Constants::MTG_NB_COLORS) / 2; - delete c; - return xx; -} - bool Spell::FullfilledAlternateCost(const int &costType) { bool hasFullfilledAlternateCost = false; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 18e078727..d42b82131 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -16,7 +16,6 @@ int GenericActivatedAbility::resolve() { ManaCost * diff = abilityCost->Diff(cost); source->X = diff->hasX(); - source->XX = source->X/2; SAFE_DELETE(diff); //SAFE_DELETE(abilityCost); this line has been reported as a bug. removing it doesn't seem to break anything, although I didn't get any error in the test suite by leaving it either, so... leaving it for now as a comment, in case. ability->target = target; //may have been updated... diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index dd3bd44a5..117bda474 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1549,10 +1549,10 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG sabilities.append(tokenParameters[i]); } int value = 0; - if (spt.find("x/x") != string::npos) + if (spt.find("xx/xx") != string::npos) + value = card->X / 2; + else if (spt.find("x/x") != string::npos) value = card->X; - else if (spt.find("xx/xx") != string::npos) - value = card->XX; int power, toughness; parsePowerToughness(spt, &power, &toughness); @@ -2389,16 +2389,6 @@ int AbilityFactory::computeX(Spell * spell, MTGCardInstance * card) return 0; } -//Returns the "XX" cost that was paid for a spell -int AbilityFactory::computeXX(Spell * spell, MTGCardInstance * card) -{ - if (spell) - return spell->computeXX(card); - if(card) - return card->XX; - return 0; -} - int AbilityFactory::getAbilities(vector * v, Spell * spell, MTGCardInstance * card, int id, MTGGameZone * dest) { @@ -3150,7 +3140,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell) } if (card->basicAbilities[(int)Constants::MOUNTAINHOME]) { - game->addObserver(NEW AStrongLandLinkCreature(_id, card, "moutain")); + game->addObserver(NEW AStrongLandLinkCreature(_id, card, "mountain")); } if (card->basicAbilities[(int)Constants::SWAMPHOME]) { @@ -3641,7 +3631,6 @@ int TargetAbility::resolve() { ManaCost * diff = abilityCost->Diff(cost); source->X = diff->hasX(); - source->XX = source->X/2; delete (diff); ability->target = t; //do nothing if the target controller responded by phasing out the target. diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index fc3210c87..1810e6123 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -102,7 +102,6 @@ int MTGCardInstance::init() CardPrimitive::init(); data = this; X = 0; - XX = 0; return 1; } diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 8680f26c8..6ceae0c5e 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -467,7 +467,6 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy copy->view = card->view; copy->isToken = card->isToken; copy->X = card->X; - copy->XX = card->X/2; //stupid bug with tokens... if (card->model == card) diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 0a5a8bbb4..d9b268abc 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -447,7 +447,6 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card) if (!card->has(Constants::STORM)) { copy->X = spell->computeX(copy); - copy->XX = spell->computeXX(copy); } } @@ -573,7 +572,6 @@ int MTGKickerRule::reactToClick(MTGCardInstance * card) if (!card->has(Constants::STORM)) { copy->X = spell->computeX(copy); - copy->XX = spell->computeXX(copy); } } @@ -737,7 +735,6 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter else { copy->X = spell->computeX(copy); - copy->XX = copy->X/2; } } @@ -1133,7 +1130,6 @@ int MTGMorphCostRule::reactToClick(MTGCardInstance * card) if (!card->has(Constants::STORM)) { copy->X = spell->computeX(copy); - copy->XX = copy->X/2; } return 1; }