From b73a3f6b4ef4ee1b04f30a558f1fc5627f27610e Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 11:17:11 +0000 Subject: [PATCH] fix AEther Flash when AI has it in play. It was damaging human, not the creature that entered play. It was using WheneverKeyword, and this specific section of code makes no sense to me. It's the only card using this branch of code, so I changed this to card-specific code. --- res/cardsfolder/aether_flash.txt | 3 ++- src/forge/PlayerZone_ComesIntoPlay.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/res/cardsfolder/aether_flash.txt b/res/cardsfolder/aether_flash.txt index eccf692f17a..8c7d099b2fd 100644 --- a/res/cardsfolder/aether_flash.txt +++ b/res/cardsfolder/aether_flash.txt @@ -2,7 +2,8 @@ Name:AEther Flash ManaCost:2 R R Types:Enchantment Text:no text -K:WheneverKeyword:EntersBattleField:Type/Creature:Play:Damage/2:Initiating_Card:ASAP:No_Condition:No Special Condition:Whenever a creature enters the battlefield, AEther Flash deals 2 damage to it. +#WheneverKeyword was dealing damage to player +#K:WheneverKeyword:EntersBattleField:Type/Creature:Play:Damage/2:Initiating_Card:ASAP:No_Condition:No Special Condition:Whenever a creature enters the battlefield, AEther Flash deals 2 damage to it. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/aether_flash.jpg diff --git a/src/forge/PlayerZone_ComesIntoPlay.java b/src/forge/PlayerZone_ComesIntoPlay.java index 7c20825114b..3116eb09998 100644 --- a/src/forge/PlayerZone_ComesIntoPlay.java +++ b/src/forge/PlayerZone_ComesIntoPlay.java @@ -99,6 +99,24 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone { } } + if(c.isCreature()) { + CardList flashes = AllZoneUtil.getCardsInPlay("AEther Flash"); + final Card enteringCard = c; + for(final Card flash:flashes){ + SpellAbility ability = new Ability(flash, "") { + @Override + public void resolve() { + enteringCard.addDamage(2, flash); + } + }; + StringBuilder sb = new StringBuilder(); + sb.append(flash).append(" - deals 2 damage to ").append(enteringCard.getName()); + ability.setStackDescription(sb.toString()); + + AllZone.Stack.add(ability); + } + } + if(c.isCreature() && AllZoneUtil.isCardInPlay("Intruder Alarm")) { CardList alarms = AllZoneUtil.getCardsInPlay("Intruder Alarm"); for(Card alarm:alarms) {