Merge pull request #827 from kevlahnota/master
TokenAndAbility for AACloner & AACopier
This commit is contained in:
@@ -3692,6 +3692,8 @@ public:
|
|||||||
//andability
|
//andability
|
||||||
if(andAbility)
|
if(andAbility)
|
||||||
{
|
{
|
||||||
|
//backup andAbility for copier and cloner
|
||||||
|
spell->source->TokenAndAbility = andAbility->clone();
|
||||||
MTGAbility * andAbilityClone = andAbility->clone();
|
MTGAbility * andAbilityClone = andAbility->clone();
|
||||||
andAbilityClone->target = spell->source;
|
andAbilityClone->target = spell->source;
|
||||||
if(andAbility->oneShot)
|
if(andAbility->oneShot)
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ public:
|
|||||||
MTGGameZone * previousZone;
|
MTGGameZone * previousZone;
|
||||||
MTGCardInstance * previous;
|
MTGCardInstance * previous;
|
||||||
MTGCardInstance * next;
|
MTGCardInstance * next;
|
||||||
|
MTGAbility * TokenAndAbility;
|
||||||
int doDamageTest;
|
int doDamageTest;
|
||||||
bool skipDamageTestOnce;
|
bool skipDamageTestOnce;
|
||||||
int summoningSickness;
|
int summoningSickness;
|
||||||
|
|||||||
@@ -1503,6 +1503,20 @@ int AACopier::resolve()
|
|||||||
source->basicAbilities.reset();
|
source->basicAbilities.reset();
|
||||||
source->getManaCost()->resetCosts();
|
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 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3971,6 +3985,20 @@ int AACloner::resolve()
|
|||||||
if(_target->model->data->basicAbilities[k])
|
if(_target->model->data->basicAbilities[k])
|
||||||
spell->source->basicAbilities[k] = _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;
|
delete spell;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -265,6 +265,7 @@ void MTGCardInstance::initMTGCI()
|
|||||||
previousZone = NULL;
|
previousZone = NULL;
|
||||||
previous = NULL;
|
previous = NULL;
|
||||||
next = NULL;
|
next = NULL;
|
||||||
|
TokenAndAbility = NULL;
|
||||||
lastController = NULL;
|
lastController = NULL;
|
||||||
regenerateTokens = 0;
|
regenerateTokens = 0;
|
||||||
blocked = false;
|
blocked = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user