-fix for issue 489 (protection prevents some triggers to happen)
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-12-07 14:12:04 +00:00
parent 7676ad5e79
commit c28c14171f
4 changed files with 11 additions and 5 deletions
+1
View File
@@ -469,6 +469,7 @@ sleeper_agent.txt
slith_bloodletter.txt slith_bloodletter.txt
sneak_attack.txt sneak_attack.txt
soulblast.txt soulblast.txt
souls_attendant_i489.txt
spark_elemental.txt spark_elemental.txt
sphinx_summoner.txt sphinx_summoner.txt
spirit_link.txt spirit_link.txt
+4 -2
View File
@@ -137,9 +137,10 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string magicText, int
found = end + 1; found = end + 1;
} }
toTcCard->setAllZones(); toTcCard->setAllZones();
toTcCard->targetter = NULL; //avoid protection from
starget = starget.substr(found, end - found).insert(0, "*|"); starget = starget.substr(found, end - found).insert(0, "*|");
toTc = tcf.createTargetChooser(starget, card); toTc = tcf.createTargetChooser(starget, card);
toTc->targetter = NULL; toTc->targetter = NULL; //avoid protection from
TargetChooser *fromTc = NULL; TargetChooser *fromTc = NULL;
TargetChooser * fromTcCard = NULL; TargetChooser * fromTcCard = NULL;
@@ -158,10 +159,11 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string magicText, int
found = end + 1; found = end + 1;
} }
fromTcCard->setAllZones(); fromTcCard->setAllZones();
fromTcCard->targetter=NULL; //avoid protection from
end = s.find(")", found); end = s.find(")", found);
starget = s.substr(found, end - found).insert(0, "*|"); starget = s.substr(found, end - found).insert(0, "*|");
fromTc = tcf.createTargetChooser(starget, card); fromTc = tcf.createTargetChooser(starget, card);
fromTc->targetter = NULL; fromTc->targetter = NULL; //avoid protection from
} }
return NEW TrCardAddedToZone(id, card, (TargetZoneChooser *) toTc, toTcCard, (TargetZoneChooser *) fromTc, fromTcCard); return NEW TrCardAddedToZone(id, card, (TargetZoneChooser *) toTc, toTcCard, (TargetZoneChooser *) fromTc, fromTcCard);
} }
+6 -3
View File
@@ -540,9 +540,12 @@ bool TargetChooser::canTarget(Targetable * target)
tempcard = tempcard->previous; tempcard = tempcard->previous;
} }
} }
if (source && targetter && card->isInPlay() && (card->has(Constants::SHROUD) || card->protectedAgainst(targetter))) return false; if (source && targetter && card->isInPlay())
if (source && targetter && card->isInPlay() && (targetter->controller() != card->controller()) && (card->has( {
Constants::OPPONENTSHROUD) || card->protectedAgainst(targetter))) return false; if (card->has(Constants::SHROUD)) return false;
if (card->protectedAgainst(targetter)) return false;
if ((targetter->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return false;
}
return true; return true;
} }
else if (target->typeAsTarget() == TARGET_STACKACTION) return true; else if (target->typeAsTarget() == TARGET_STACKACTION) return true;