From a694d5b1b03e8cfb1337e1801aec3c6701d4550f Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 05:19:37 +0000 Subject: [PATCH] - Added Rogue Kavu (using "Whenever CARDNAME attacks alone, it gets +2/+0 until end of turn" keyword, hmm maybe I should've expanded beached as' "Whenever" keyword instead). --- res/cards.txt | 7 +++++++ src/forge/CombatUtil.java | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/res/cards.txt b/res/cards.txt index 6fe443eaa04..e35b7fa8758 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,10 @@ +Rogue Kavu +1 R +Creature Kavu +no text +1/1 +Whenever CARDNAME attacks alone, it gets +2/+0 until end of turn. + Niv-Mizzet, the Firemind 2 U U R R Legendary Creature Dragon Wizard diff --git a/src/forge/CombatUtil.java b/src/forge/CombatUtil.java index 1fa13ffa9c9..181e7f8368a 100644 --- a/src/forge/CombatUtil.java +++ b/src/forge/CombatUtil.java @@ -971,7 +971,42 @@ public class CombatUtil { AllZone.Stack.add(ability); }//Raging Ravine - // + if ((AllZone.Combat.getAttackers().length + AllZone.pwCombat.getAttackers().length) == 1) + { + if (c.getKeyword().contains("Whenever this creature attacks alone, it gets +2/+0 until end of turn") || + c.getKeyword().contains("Whenever CARDNAME attacks alone, it gets +2/+0 until end of turn")) + { + final Card charger = c; + Ability ability2 = new Ability(c, "0") { + @Override + public void resolve() { + + final Command untilEOT = new Command() { + private static final long serialVersionUID = -6039349249335745813L; + + public void execute() { + if(AllZone.GameAction.isCardInPlay(charger)) { + charger.addTempAttackBoost(-2); + charger.addTempDefenseBoost(0); + } + } + };//Command + + + if(AllZone.GameAction.isCardInPlay(charger)) { + charger.addTempAttackBoost(2); + charger.addTempDefenseBoost(0); + + AllZone.EndOfTurn.addUntil(untilEOT); + } + }//resolve + + };//ability + + ability2.setStackDescription(c.getName() + " - attacks alone and gets +2/+0 until EOT."); + AllZone.Stack.add(ability2); + } + } if(c.getName().equals("Zhang He, Wei General") && !c.getCreatureAttackedThisCombat()) {