From 7891d7d6ff41e08ba8432aad70f6b03a7bb42840 Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 6 May 2013 09:12:06 +0000 Subject: [PATCH] - Improved shouldPumpCard for triggers. --- res/cardsfolder/b/battle_rattle_shaman.txt | 2 +- src/main/java/forge/card/ability/ai/PumpAiBase.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/res/cardsfolder/b/battle_rattle_shaman.txt b/res/cardsfolder/b/battle_rattle_shaman.txt index e0959274c61..52cef513f19 100644 --- a/res/cardsfolder/b/battle_rattle_shaman.txt +++ b/res/cardsfolder/b/battle_rattle_shaman.txt @@ -3,7 +3,7 @@ ManaCost:3 R Types:Creature Goblin Shaman PT:2/2 T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigPump | TriggerDescription$ At the beginning of combat on your turn, you may have target creature get +2/+0 until end of turn. -SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ 2 +SVar:TrigPump:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ 2 SVar:Picture:http://www.wizards.com/global/images/magic/general/battle_rattle_shaman.jpg Oracle:At the beginning of combat on your turn, you may have target creature get +2/+0 until end of turn. SetInfo:ROE Common \ No newline at end of file diff --git a/src/main/java/forge/card/ability/ai/PumpAiBase.java b/src/main/java/forge/card/ability/ai/PumpAiBase.java index 4345bb0dfc6..55c621017c2 100644 --- a/src/main/java/forge/card/ability/ai/PumpAiBase.java +++ b/src/main/java/forge/card/ability/ai/PumpAiBase.java @@ -408,6 +408,18 @@ public abstract class PumpAiBase extends SpellAbilityAi { return true; } + if (sa.isTrigger() && phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) { + if (phase.isPlayerTurn(ai)) { + if (CombatUtil.canAttack(c)) { + return true; + } + } else { + if (CombatUtil.canBlock(c)) { + return true; + } + } + } + // is the creature blocking and unable to destroy the attacker // or would be destroyed itself? if (phase.is(PhaseType.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY) && c.isBlocking()) {