From 13dd07973eeb5bb38405fe3bce7e32505bf049c7 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew" Date: Mon, 2 May 2011 08:44:02 +0000 Subject: [PATCH] Removing "oldSchoolDeathtouch", as it seems Cockatrice and Thicket Basislisk are now softcoded. Zeth, Dr.Solomat, please review :) --- projects/mtg/include/AllAbilities.h | 64 ----------------------------- projects/mtg/src/MTGAbility.cpp | 25 +---------- projects/mtg/src/PhaseRing.cpp | 1 + 3 files changed, 2 insertions(+), 88 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index ffeae57c8..9aa680447 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3452,70 +3452,6 @@ public: return a; } }; - -//Creatures that kill their blockers -//Ex : Cockatrice -class AOldSchoolDeathtouch: public MTGAbility -{ -public: - MTGCardInstance * opponents[20]; - int nbOpponents; - AOldSchoolDeathtouch(int _id, MTGCardInstance * _source) : - MTGAbility(_id, _source) - { - nbOpponents = 0; - } - - void Update(float dt) - { - if (newPhase != currentPhase) - { - if (newPhase == Constants::MTG_PHASE_COMBATDAMAGE) - { - nbOpponents = 0; - MTGCardInstance * opponent = source->getNextOpponent(); - while (opponent && !opponent->hasSubtype("wall")) - { - opponents[nbOpponents] = opponent; - nbOpponents++; - opponent = source->getNextOpponent(opponent); - } - } - else if (newPhase == Constants::MTG_PHASE_COMBATEND) - { - for (int i = 0; i < nbOpponents; i++) - { - if (game->isInPlay(opponents[i])) - opponents[i]->destroy(); - } - } - } - } - - int testDestroy() - { - if (!game->isInPlay(source) && currentPhase != Constants::MTG_PHASE_UNTAP) - { - return 0; - } - else - { - return MTGAbility::testDestroy(); - } - } - - virtual ostream& toString(ostream& out) const - { - out << "AOldSchoolDeathtouch ::: opponents : " << opponents << " ; nbOpponents : " << nbOpponents << " ("; - return MTGAbility::toString(out) << ")"; - } - AOldSchoolDeathtouch * clone() const - { - AOldSchoolDeathtouch * a = NEW AOldSchoolDeathtouch(*this); - a->isClone = 1; - return a; - } -}; //bloodthirst ability------------------------------------------ class ABloodThirst: public MTGAbility { diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index d14e8442a..dd3bd44a5 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -953,8 +953,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG break; } } - if (s1.find("endofturn") != string::npos) //stupid edge case, let's get rid of this - phase = Constants::MTG_PHASE_ENDOFTURN; s1 = s1.substr(0, seperator - 1); } ManaCost * cost = ManaCost::parseManaCost(s1); @@ -1000,9 +998,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } } - if (s1.find("endofturn") != string::npos) //stupid edge case, let's get rid of this - phase = Constants::MTG_PHASE_ENDOFTURN; - bool opponentturn = (s1.find("my") == string::npos); bool myturn = (s1.find("opponent") == string::npos); @@ -1364,8 +1359,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG break; } } - if (s1.find("endofturn") != string::npos) //stupid edge case, let's get rid of this - phase = Constants::MTG_PHASE_ENDOFTURN; bool opponentturn = (s1.find("my") == string::npos); bool myturn = (s1.find("opponent") == string::npos); @@ -1413,8 +1406,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } } - if (s1.find("endofturn") != string::npos) //stupid edge case, let's get rid of this - phase = Constants::MTG_PHASE_ENDOFTURN; s1 = s1.substr(0, seperator - 1); } ManaCost * cost = ManaCost::parseManaCost(s1); @@ -2967,21 +2958,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell) game->addObserver(NEW AFastbond(_id, card)); break; } - case 1238: //Cockatrice - { - game->addObserver(NEW AOldSchoolDeathtouch(_id, card)); - break; - } case 1225: //Stasis { game->addObserver(NEW AStasis(_id, card)); break; } - case 1267: //Thicket Basilic - { - game->addObserver(NEW AOldSchoolDeathtouch(_id, card)); - break; - } case 1227: //Toughtlace { if (card->target) @@ -3660,11 +3641,7 @@ int TargetAbility::resolve() { ManaCost * diff = abilityCost->Diff(cost); source->X = diff->hasX(); - source->XX = 0; - if(source->X > 0) - { - source->XX = source->X/2; - } + 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/PhaseRing.cpp b/projects/mtg/src/PhaseRing.cpp index 1ec7539e7..6e392753f 100644 --- a/projects/mtg/src/PhaseRing.cpp +++ b/projects/mtg/src/PhaseRing.cpp @@ -20,6 +20,7 @@ int PhaseRing::phaseStrToInt(string s) if (s.compare("combatends") == 0) return Constants::MTG_PHASE_COMBATEND; if (s.compare("secondmain") == 0) return Constants::MTG_PHASE_SECONDMAIN; if (s.compare("endofturn") == 0) return Constants::MTG_PHASE_ENDOFTURN; + if (s.compare("end") == 0) return Constants::MTG_PHASE_ENDOFTURN; if (s.compare("cleanup") == 0) return Constants::MTG_PHASE_CLEANUP; DebugTrace("PHASERING: Unknown Phase name: " << s);