- Added "TriggeredCardOpponent" as a defined player.

- Fixed Kokusho, the Evening Star (is there a better solution for this, otherwise a lot of cards need the same treatment).
This commit is contained in:
Sloth
2011-12-07 10:54:36 +00:00
parent 2375cace43
commit 212aadf753
2 changed files with 12 additions and 2 deletions

View File

@@ -5,8 +5,8 @@ Text:no text
PT:5/5
K:Flying
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigLoseLife | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, each opponent loses 5 life. You gain life equal to the life lost this way.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ Opponent | LifeAmount$ 5 | SubAbility$ SVar=DBGainLife
SVar:DBGainLife:DB$GainLife | Defined$ You | LifeAmount$ 5
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ TriggeredCardOpponent | LifeAmount$ 5 | SubAbility$ DBGainLife
SVar:DBGainLife:DB$GainLife | Defined$ TriggeredCardController | LifeAmount$ 5
SVar:Rarity:Rare
SVar:Picture:http://resources.wizards.com/magic/cards/chk/en-us/card50445.jpg
SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/122.jpg

View File

@@ -1773,6 +1773,16 @@ public class AbilityFactory {
if (c instanceof SpellAbility) {
o = ((SpellAbility) c).getSourceCard().getController();
}
} else if (defined.endsWith("Opponent")) {
String triggeringType = defined.substring(9);
triggeringType = triggeringType.substring(0, triggeringType.length() - 8);
final Object c = root.getTriggeringObject(triggeringType);
if (c instanceof Card) {
o = ((Card) c).getController().getOpponent();
}
if (c instanceof SpellAbility) {
o = ((SpellAbility) c).getSourceCard().getController().getOpponent();
}
} else if (defined.endsWith("Owner")) {
String triggeringType = defined.substring(9);
triggeringType = triggeringType.substring(0, triggeringType.length() - 5);