added support for transfroming after being moved. ie:card"raise from the grave"

This commit is contained in:
omegablast2002@yahoo.com
2010-08-18 23:13:43 +00:00
parent 5ef6091ca6
commit 19e07a649f

View File

@@ -2520,6 +2520,8 @@ public:
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
if (_target){
while (_target->next) _target=_target->next;
for (int j = 0; j < Constants::MTG_NB_COLORS; j++){
if (_target->hasColor(j))
oldcolors.push_back(j);
@@ -2530,15 +2532,21 @@ public:
for ( it=colors.begin(); it != colors.end(); it++){_target->setColor(*it);}
for ( it=abilities.begin() ; it != abilities.end(); it++ ){_target->basicAbilities[*it]++;}
for ( it=oldcolors.begin() ; it != oldcolors.end(); it++ ){}
return MTGAbility::addToGame();}
}
return MTGAbility::addToGame();
}
int destroy(){
MTGCardInstance * _target = (MTGCardInstance *)target;
if (_target){
while (_target->next) _target=_target->next;
list<int>::iterator it;
for ( it=types.begin() ; it != types.end(); it++ ){_target->removeType(*it);}
for ( it=colors.begin() ; it != colors.end(); it++ ){_target->removeColor(*it);}
for ( it=abilities.begin() ; it != abilities.end(); it++ ){_target->basicAbilities[*it]--;}
for ( it=oldcolors.begin() ; it != oldcolors.end(); it++ ){_target->setColor(*it);}
return 1;}
}
return 1;
}
ATransformer * clone() const{
ATransformer * a = NEW ATransformer(*this);
a->isClone = 1;
@@ -2596,12 +2604,16 @@ public:
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
if (_target){
while (_target->next) _target=_target->next;
list<int>::iterator it;
for( it=colors.begin(); it != colors.end();it++){ _target->setColor(0,1);}
for ( it=types.begin() ; it != types.end(); it++ ){_target->addType(*it);}
for ( it=colors.begin() ; it != colors.end(); it++ ){_target->setColor(*it);}
for ( it=abilities.begin() ; it != abilities.end(); it++ ){_target->basicAbilities[*it]++;}
return MTGAbility::addToGame();}
}
return MTGAbility::addToGame();
}
ATransformerFOREVER * clone() const{
ATransformerFOREVER * a = NEW ATransformerFOREVER(*this);
a->isClone = 1;