add AACloner andAbility

This commit is contained in:
Anthony Calosa
2016-08-22 10:18:23 +08:00
parent e9705b2cc5
commit ce92679be0
2 changed files with 18 additions and 3 deletions

View File

@@ -2021,6 +2021,7 @@ public:
list<int> awith;
list<int> colors;
list<int> typesToAdd;
MTGAbility * andAbility;
AACloner(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL, int who = 0,
string abilitiesStringList = "",string typeslist = "");

View File

@@ -3939,7 +3939,7 @@ AACloner::AACloner(GameObserver* observer, int _id, MTGCardInstance * _source, M
{
PopulateSubtypesIndexVector(typesToAdd,TypesList);
}
andAbility = NULL;
}
int AACloner::resolve()
@@ -4012,9 +4012,23 @@ int AACloner::resolve()
}
if(_target->TokenAndAbility)
{//the source copied a token with andAbility
MTGAbility * andAbilityClone = _target->TokenAndAbility->clone();
andAbilityClone->target = spell->source;
MTGAbility * TokenandAbilityClone = _target->TokenAndAbility->clone();
TokenandAbilityClone->target = spell->source;
if(_target->TokenAndAbility->oneShot)
{
TokenandAbilityClone->resolve();
SAFE_DELETE(TokenandAbilityClone);
}
else
{
TokenandAbilityClone->addToGame();
}
}
if(andAbility)
{
MTGAbility * andAbilityClone = andAbility->clone();
andAbilityClone->target = spell->source;
if(andAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);