diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index d3e2fb2ce10..66869a3b3b3 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -971,10 +971,14 @@ public class AbilityUtils { } } else if (defined.startsWith("Triggered")) { + String defParsed = defined.endsWith("AndYou") ? defined.substring(0, defined.indexOf("AndYou")) : defined; + if (defined.endsWith("AndYou")) { + players.add(sa.getHostCard().getController()); + } final SpellAbility root = sa.getRootAbility(); Object o = null; - if (defined.endsWith("Controller")) { - String triggeringType = defined.substring(9); + if (defParsed.endsWith("Controller")) { + String triggeringType = defParsed.substring(9); triggeringType = triggeringType.substring(0, triggeringType.length() - 10); final Object c = root.getTriggeringObject(triggeringType); if (c instanceof Card) { @@ -984,8 +988,8 @@ public class AbilityUtils { o = ((SpellAbility) c).getActivatingPlayer(); } } - else if (defined.endsWith("Opponent")) { - String triggeringType = defined.substring(9); + else if (defParsed.endsWith("Opponent")) { + String triggeringType = defParsed.substring(9); triggeringType = triggeringType.substring(0, triggeringType.length() - 8); final Object c = root.getTriggeringObject(triggeringType); if (c instanceof Card) { @@ -995,8 +999,8 @@ public class AbilityUtils { o = ((SpellAbility) c).getActivatingPlayer().getOpponents(); } } - else if (defined.endsWith("Owner")) { - String triggeringType = defined.substring(9); + else if (defParsed.endsWith("Owner")) { + String triggeringType = defParsed.substring(9); triggeringType = triggeringType.substring(0, triggeringType.length() - 5); final Object c = root.getTriggeringObject(triggeringType); if (c instanceof Card) { @@ -1004,7 +1008,7 @@ public class AbilityUtils { } } else { - final String triggeringType = defined.substring(9); + final String triggeringType = defParsed.substring(9); o = root.getTriggeringObject(triggeringType); } if (o != null) { diff --git a/forge-gui/res/cardsfolder/upcoming/curse_of_bounty.txt b/forge-gui/res/cardsfolder/upcoming/curse_of_bounty.txt index 5c6713ca72c..60a43058048 100644 --- a/forge-gui/res/cardsfolder/upcoming/curse_of_bounty.txt +++ b/forge-gui/res/cardsfolder/upcoming/curse_of_bounty.txt @@ -5,7 +5,8 @@ K:Enchant player A:SP$ Attach | Cost$ 1 G | ValidTgts$ Player | AILogic$ Curse # TODO: ensure that TriggeredAttackerController would work correctly (or expand as needed) for multiple opponents attacking # the player (Player.EnchantedBy) after shared turns are implemented. -T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigUntap | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, you gain 2 life. Each opponent attacking that player does the same. -SVar:TrigUntap:DB$ UntapAll | Defined$ TriggeredAttackingPlayer | ValidCards$ Permanent.nonLand | SpellDescription$ Whenever enchanted player is attacked, untap all nonland permanents you control. Each opponent attacking that player untaps all nonland permanents he or she controls. +T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigRepeat | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, untap all nonland permanents you control. Each opponent attacking that player untaps all nonland permanents he or she controls. +SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ TriggeredAttackingPlayerAndYou | RepeatSubAbility$ TrigUntap +SVar:TrigUntap:DB$ UntapAll | Defined$ Player.IsRemembered | ValidCards$ Permanent.nonLand | SpellDescription$ Whenever enchanted player is attacked, untap all nonland permanents you control. Each opponent attacking that player untaps all nonland permanents he or she controls. SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_vitality.jpg Oracle:Enchant player\nWhenever enchanted player is attacked, untap all nonland permanents you control. Each opponent attacking that player untaps all nonland permanents he or she controls. diff --git a/forge-gui/res/cardsfolder/upcoming/curse_of_disturbance.txt b/forge-gui/res/cardsfolder/upcoming/curse_of_disturbance.txt index 3700a206189..097aa03f788 100644 --- a/forge-gui/res/cardsfolder/upcoming/curse_of_disturbance.txt +++ b/forge-gui/res/cardsfolder/upcoming/curse_of_disturbance.txt @@ -5,7 +5,8 @@ K:Enchant player A:SP$ Attach | Cost$ 2 B | ValidTgts$ Player | AILogic$ Curse # TODO: ensure that TriggeredAttackerController would work correctly (or expand as needed) for multiple opponents attacking # the player (Player.EnchantedBy) after shared turns are implemented. -T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigToken | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, create a 2/2 black Zombie creature token. Each opponent attacking that player does the same. -SVar:TrigToken:DB$ Token | TokenOwner$ TriggeredAttackingPlayer | TokenAmount$ 1 | TokenName$ Zombie | TokenTypes$ Creature,Zombie | TokenColors$ Black | TokenPower$ 2 | TokenToughness$ 2 | TokenImage$ b 2 2 zombie C17 | SpellDescription$ Create a 2/2 black Zombie creature token. Activate this ability only any time you could cast a sorcery. +T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigRepeat | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, create a 2/2 black Zombie creature token. Each opponent attacking that player does the same. +SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ TriggeredAttackingPlayerAndYou | RepeatSubAbility$ TrigToken +SVar:TrigToken:DB$ Token | TokenOwner$ Player.IsRemembered | TokenAmount$ 1 | TokenName$ Zombie | TokenTypes$ Creature,Zombie | TokenColors$ Black | TokenPower$ 2 | TokenToughness$ 2 | TokenImage$ b 2 2 zombie C17 | SpellDescription$ Create a 2/2 black Zombie creature token. Activate this ability only any time you could cast a sorcery. SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_vitality.jpg Oracle:Enchant player\nWhenever enchanted player is attacked, create a 2/2 black Zombie creature token. Each opponent attacking that player does the same. diff --git a/forge-gui/res/cardsfolder/upcoming/curse_of_opulence.txt b/forge-gui/res/cardsfolder/upcoming/curse_of_opulence.txt index 107c65f470f..4389f914a8a 100644 --- a/forge-gui/res/cardsfolder/upcoming/curse_of_opulence.txt +++ b/forge-gui/res/cardsfolder/upcoming/curse_of_opulence.txt @@ -5,8 +5,9 @@ K:Enchant player A:SP$ Attach | Cost$ R | ValidTgts$ Player | AILogic$ Curse # TODO: ensure that TriggeredAttackerController would work correctly (or expand as needed) for multiple opponents attacking # the player (Player.EnchantedBy) after shared turns are implemented. -T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigToken | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, create a colorless artifact token named Gold. It has "sacrifice this artifact: Add one mana of any color to your mana pool." Each opponent attacking that player does the same. -SVar:TrigToken:DB$ Token | TokenName$ Gold | TokenTypes$ Artifact | TokenColors$ Colorless | TokenOwner$ TriggeredAttackingPlayer | TokenAmount$ 1 | TokenImage$ c gold C17 | TokenAbilities$ ABMana | References$ ABMana +T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigRepeat | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, create a colorless artifact token named Gold. It has "sacrifice this artifact: Add one mana of any color to your mana pool." Each opponent attacking that player does the same. +SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ TriggeredAttackingPlayerAndYou | RepeatSubAbility$ TrigToken +SVar:TrigToken:DB$ Token | TokenName$ Gold | TokenTypes$ Artifact | TokenColors$ Colorless | TokenOwner$ Player.IsRemembered | TokenAmount$ 1 | TokenImage$ c gold C17 | TokenAbilities$ ABMana | References$ ABMana SVar:ABMana:AB$ Mana | Cost$ Sac<1/CARDNAME> | Produced$ Any | SpellDescription$ Add one mana of any color to your mana pool. SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_vitality.jpg Oracle:Enchant player\nWhenever enchanted player is attacked, create a colorless artifact token named Gold. It has "sacrifice this artifact: Add one mana of any color to your mana pool." Each opponent attacking that player does the same. diff --git a/forge-gui/res/cardsfolder/upcoming/curse_of_verbosity.txt b/forge-gui/res/cardsfolder/upcoming/curse_of_verbosity.txt index fd92e74b001..a6035a4ea2f 100644 --- a/forge-gui/res/cardsfolder/upcoming/curse_of_verbosity.txt +++ b/forge-gui/res/cardsfolder/upcoming/curse_of_verbosity.txt @@ -5,7 +5,8 @@ K:Enchant player A:SP$ Attach | Cost$ 2 U | ValidTgts$ Player | AILogic$ Curse # TODO: ensure that TriggeredAttackerController would work correctly (or expand as needed) for multiple opponents attacking # the player (Player.EnchantedBy) after shared turns are implemented. -T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, draw a card. Each opponent attacking that player does the same. -SVar:TrigDraw:DB$ Draw | NumCards$ 1 | Defined$ TriggeredAttackingPlayer +T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigRepeat | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, draw a card. Each opponent attacking that player does the same. +SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ TriggeredAttackingPlayerAndYou | RepeatSubAbility$ TrigDraw +SVar:TrigDraw:DB$ Draw | NumCards$ 1 | Defined$ Player.IsRemembered SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_verbosity.jpg Oracle:Enchant player\nWhenever enchanted player is attacked, draw a card. Each opponent attacking that player does the same. diff --git a/forge-gui/res/cardsfolder/upcoming/curse_of_vitality.txt b/forge-gui/res/cardsfolder/upcoming/curse_of_vitality.txt index de0baf16b44..44a94dd9106 100644 --- a/forge-gui/res/cardsfolder/upcoming/curse_of_vitality.txt +++ b/forge-gui/res/cardsfolder/upcoming/curse_of_vitality.txt @@ -5,7 +5,8 @@ K:Enchant player A:SP$ Attach | Cost$ 2 W | ValidTgts$ Player | AILogic$ Curse # TODO: ensure that TriggeredAttackerController would work correctly (or expand as needed) for multiple opponents attacking # the player (Player.EnchantedBy) after shared turns are implemented. -T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigGainLife | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, you gain 2 life. Each opponent attacking that player does the same. -SVar:TrigGainLife:DB$ GainLife | Defined$ TriggeredAttackerController | LifeAmount$ 2 +T:Mode$ AttackersDeclared | ValidCard$ Creature | AttackedTarget$ Player.EnchantedBy | Execute$ TrigRepeat | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player is attacked, you gain 2 life. Each opponent attacking that player does the same. +SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ TriggeredAttackingPlayerAndYou | RepeatSubAbility$ TrigGainLife +SVar:TrigGainLife:DB$ GainLife | Defined$ Player.IsRemembered | LifeAmount$ 2 SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_vitality.jpg Oracle:Enchant player\nWhenever enchanted player is attacked, you gain 2 life. Each opponent attacking that player does the same.