Laurent - Update to the foreach parser with "add" to be used for instant and sorcery (e.g. spoil of evil) also removed/added corresponding cards (spoil of evil, song of the damned and ancestor chosen).

Also added the ability "INDESTRUCTIBLE" did not test it yet + not sure about the ruling ...
This commit is contained in:
wagic.laurent
2009-06-30 21:29:59 +00:00
parent 6c335232c7
commit 01316167fc
7 changed files with 30 additions and 35 deletions

View File

@@ -129,7 +129,7 @@ int MTGCardInstance::afterDamage(){
if (!doDamageTest) return 0;
doDamageTest = 0;
if (!isACreature()) return 0;
if (life <=0 && isInPlay()){
if (life <=0 && isInPlay() && !basicAbilities[Constants::INDESTRUCTIBLE]){
return destroy();
}
return 0;
@@ -137,11 +137,13 @@ int MTGCardInstance::afterDamage(){
int MTGCardInstance::bury(){
Player * p = controller();
if (!basicAbilities[Constants::INDESTRUCTIBLE]){
p->game->putInZone(this,p->game->inPlay,owner->game->graveyard);
return 1;
}
return 1;
}
int MTGCardInstance::destroy(){
if (!triggerRegenerate()) return bury();
if (!triggerRegenerate() || !basicAbilities[Constants::INDESTRUCTIBLE]) return bury();
return 0;
}