Merge pull request #650 from kevlahnota/master
Persist & Undying ability revised
This commit is contained in:
@@ -1772,7 +1772,9 @@ public:
|
|||||||
string destination;
|
string destination;
|
||||||
MTGAbility * andAbility;
|
MTGAbility * andAbility;
|
||||||
string named;
|
string named;
|
||||||
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL);
|
bool undying;
|
||||||
|
bool persist;
|
||||||
|
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);
|
MTGGameZone * destinationZone(Targetable * target = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const string getMenuText();
|
const string getMenuText();
|
||||||
|
|||||||
@@ -2734,8 +2734,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT()
|
|||||||
|
|
||||||
|
|
||||||
//AAMover
|
//AAMover
|
||||||
AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost) :
|
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)
|
ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist)
|
||||||
{
|
{
|
||||||
if (_target)
|
if (_target)
|
||||||
target = _target;
|
target = _target;
|
||||||
@@ -2782,6 +2782,10 @@ int AAMover::resolve()
|
|||||||
andAbilityClone->addToGame();
|
andAbilityClone->addToGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(persist)
|
||||||
|
spell->source->counters->addCounter(-1,-1);
|
||||||
|
if(undying)
|
||||||
|
spell->source->counters->addCounter(1,1);
|
||||||
delete spell;
|
delete spell;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2289,19 +2289,28 @@ int MTGPersistRule::receiveEvent(WEvent * event)
|
|||||||
Player * p = game->players[i];
|
Player * p = game->players[i];
|
||||||
if (e->to == p->game->graveyard)
|
if (e->to == p->game->graveyard)
|
||||||
{
|
{
|
||||||
MTGCardInstance * copy = p->game->putInZone(e->card, p->game->graveyard, e->card->owner->game->temp);
|
MTGCardInstance * copy = e->card;
|
||||||
if (!copy)
|
if (!copy)
|
||||||
{
|
{
|
||||||
DebugTrace("MTGRULES: couldn't move card for persist/undying");
|
DebugTrace("MTGRULES: couldn't move card for persist/undying");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Spell * spell = NEW Spell(game, copy);
|
string code = "";
|
||||||
spell->resolve();
|
bool persist = false;
|
||||||
|
bool undying = false;
|
||||||
if(card->basicAbilities[(int)Constants::PERSIST])
|
if(card->basicAbilities[(int)Constants::PERSIST])
|
||||||
spell->source->counters->addCounter(-1, -1);
|
{
|
||||||
|
code = "Persist";
|
||||||
|
persist = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
spell->source->counters->addCounter(1,1);
|
{
|
||||||
delete spell;
|
code = "Undying";
|
||||||
|
undying = true;
|
||||||
|
}
|
||||||
|
AAMover *putinplay = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), copy, copy,"ownerbattlefield",code,NULL,undying,persist);
|
||||||
|
putinplay->oneShot = true;
|
||||||
|
putinplay->fireAbility();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user