diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index b7b4766b6..0f03c63d6 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1665,7 +1665,7 @@ public: const string getMenuText(); AACopier * clone() const; }; -//imprint +//phaseout class AAPhaseOut: public ActivatedAbility { public: @@ -1674,6 +1674,15 @@ public: const string getMenuText(); AAPhaseOut * clone() const; }; +//AAImprint +class AAImprint: public ActivatedAbility +{ +public: + AAImprint(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL); + int resolve(); + const string getMenuText(); + AAImprint * clone() const; +}; //cloning...this makes a token thats a copy of the target. class AACloner: public ActivatedAbility { @@ -1703,8 +1712,7 @@ public: string named; bool undying; bool persist; - bool imprint; - AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false, bool imprint = false); + AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false); MTGGameZone * destinationZone(Targetable * target = NULL); int resolve(); const string getMenuText(); diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 7b4da141e..80020ecd2 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -511,7 +511,7 @@ AACopier * AACopier::clone() const return NEW AACopier(*this); } -//phaser +//phaseout AAPhaseOut::AAPhaseOut(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) : ActivatedAbility(observer, _id, _source, _cost, 0) { @@ -544,6 +544,42 @@ AAPhaseOut * AAPhaseOut::clone() const return NEW AAPhaseOut(*this); } +//AAImprint +AAImprint::AAImprint(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) : + ActivatedAbility(observer, _id, _source, _cost, 0) +{ + target = _target; +} + +int AAImprint::resolve() +{ + MTGCardInstance * _target = (MTGCardInstance *) target; + if (_target) + { + Player * p = _target->controller(); + if(p) + p->game->putInExile(_target); + + while(_target->next) + _target = _target->next; + + source->imprintedCards.push_back(_target); + + return 1; + } + return 0; +} + +const string AAImprint::getMenuText() +{ + return "Imprint"; +} + +AAImprint * AAImprint::clone() const +{ + return NEW AAImprint(*this); +} + //Counters AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness, int nb,int maxNb, ManaCost * cost) : @@ -2928,8 +2964,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT() //AAMover -AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist, bool imprint) : - ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist),imprint(imprint) +AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist) : + ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist) { if (_target) target = _target; @@ -2987,8 +3023,6 @@ int AAMover::resolve() p->game->putInZone(_target, fromZone, destZone); while(_target->next) _target = _target->next; - if (imprint) - source->imprintedCards.push_back(_target); if(andAbility) { MTGAbility * andAbilityClone = andAbility->clone(); @@ -3065,8 +3099,6 @@ const char* AAMover::getMenuText(TargetChooser * tc) // move card into exile else if (dest == game->players[i]->game->exile) { - if(imprint) - return "Imprint"; return "Exile"; } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 6d57241f6..58abcadce 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2378,7 +2378,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("imprint"); if (found != string::npos) { - MTGAbility * a = NEW AAMover(observer, id, card, target, "exile",newName,NULL,false,false,true); + MTGAbility * a = NEW AAImprint(observer, id, card, target); a->oneShot = 1; return a; }