slight adjustments to transforms parsing to allow for newability to also be a transforms. xx wasnt being set in a couple cases, removed the space i added to the 3 variables so they can be anywhere in the line.

This commit is contained in:
omegablast2002@yahoo.com
2011-03-30 17:45:05 +00:00
parent 8557e441b0
commit cba0c1218f
4 changed files with 70 additions and 16 deletions
+46 -8
View File
@@ -2307,7 +2307,26 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t
{
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
{
MTGAbility * aNew = newAbilitiesList[k]->clone();
GenericTargetAbility * gta = dynamic_cast<GenericTargetAbility*> (aNew);
if (gta)
{
((GenericTargetAbility *)aNew)->source = _target;
((GenericTargetAbility *)aNew)->ability->source = _target;
}
GenericActivatedAbility * gaa = dynamic_cast<GenericActivatedAbility*> (aNew);
if (gaa)
{
((GenericActivatedAbility *)aNew)->source = _target;
((GenericActivatedAbility *)aNew)->ability->source = _target;
}
if (MultiAbility * abi = dynamic_cast<MultiAbility*>(aNew))
{
((MultiAbility *)aNew)->source = _target;
((MultiAbility *)aNew)->abilities[0]->source = _target;
}
aNew->target = _target;
aNew->source = (MTGCardInstance *) _target;
aNew->addToGame();
@@ -2471,14 +2490,33 @@ int AForeverTransformer::addToGame()
}
if(newAbilityFound)
{
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
{
MTGAbility * aNew = newAbilitiesList[k]->clone();
aNew->target = _target;
aNew->source = (MTGCardInstance *) _target;
aNew->addToGame();
newAbilities[_target].push_back(aNew);
}
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
{
MTGAbility * aNew = newAbilitiesList[k]->clone();
GenericTargetAbility * gta = dynamic_cast<GenericTargetAbility*> (aNew);
if (gta)
{
((GenericTargetAbility *)aNew)->source = _target;
((GenericTargetAbility *)aNew)->ability->source = _target;
}
GenericActivatedAbility * gaa = dynamic_cast<GenericActivatedAbility*> (aNew);
if (gaa)
{
((GenericActivatedAbility *)aNew)->source = _target;
((GenericActivatedAbility *)aNew)->ability->source = _target;
}
if (MultiAbility * abi = dynamic_cast<MultiAbility*>(aNew))
{
((MultiAbility *)aNew)->source = _target;
((MultiAbility *)aNew)->abilities[0]->source = _target;
}
aNew->target = _target;
aNew->source = (MTGCardInstance *) _target;
aNew->addToGame();
newAbilities[_target].push_back(aNew);
}
}
if(newpowerfound )
{