AACloner & AACopier TokenAndAbility

if the token has andAbility, the cloner/copier also has that andAbility
also...
This commit is contained in:
Anthony Calosa
2016-08-04 02:12:59 +08:00
parent 067279d2e8
commit 52fb40d543
4 changed files with 32 additions and 0 deletions
+28
View File
@@ -1503,6 +1503,20 @@ int AACopier::resolve()
source->basicAbilities.reset();
source->getManaCost()->resetCosts();
}
if(_target->TokenAndAbility)
{//the source copied a token with andAbility
MTGAbility * andAbilityClone = _target->TokenAndAbility->clone();
andAbilityClone->target = source;
if(_target->TokenAndAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);
}
else
{
andAbilityClone->addToGame();
}
}
return 1;
}
return 0;
@@ -3971,6 +3985,20 @@ int AACloner::resolve()
if(_target->model->data->basicAbilities[k])
spell->source->basicAbilities[k] = _target->model->data->basicAbilities[k];
}
if(_target->TokenAndAbility)
{//the source copied a token with andAbility
MTGAbility * andAbilityClone = _target->TokenAndAbility->clone();
andAbilityClone->target = spell->source;
if(_target->TokenAndAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);
}
else
{
andAbilityClone->addToGame();
}
}
delete spell;
}
return 1;