From 651d0b4623cb37d5488cf5ea72549894a89e5db0 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Mon, 24 Dec 2012 16:19:32 +0000 Subject: [PATCH] added gatecrash "evole" mechanic. auto=evole --- projects/mtg/include/AllAbilities.h | 27 +++++++++++++++++++++++++++ projects/mtg/src/MTGAbility.cpp | 6 ++++++ 2 files changed, 33 insertions(+) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 5ca46ef11..52ba198e6 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -5263,6 +5263,33 @@ public: } }; +//Evole ability +class AEvoleAbility: public MTGAbility +{ +public: + AEvoleAbility(GameObserver* observer, int _id, MTGCardInstance * _source) : + MTGAbility(observer, _id, _source) + { + } + int receiveEvent(WEvent * event) + { + WEventZoneChange * enters = (WEventZoneChange *) event; + if (enters->to == game->currentlyActing()->game->inPlay && game->currentlyActing() == source->controller() && enters->card->isCreature()) + { + if(enters->card != source && (enters->card->power > source->power || enters->card->toughness > source->toughness)) + { + source->counters->addCounter(1,1); + } + } + return 1; + } + + AEvoleAbility * clone() const + { + return NEW AEvoleAbility(*this); + } +}; + //flanking ability class AFlankerAbility: public MTGAbility { diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 354d4c4fe..675323d21 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2284,6 +2284,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NEW ARampageAbility(observer, id, card, power, toughness, MaxOpponent); } + //evole + if (s.find("evole") != string::npos) + { + return NEW AEvoleAbility(observer, id, card); + } + //flanking if (s.find("flanker") != string::npos) {