From c9b5bba65b603bbfec99c7786f00c18f9afeb4f3 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Tue, 26 Jul 2016 08:42:59 +0000 Subject: [PATCH] CardFactoryUtil: do Escalate as Keyword --- .../src/main/java/forge/game/card/Card.java | 2 +- .../java/forge/game/card/CardFactoryUtil.java | 22 ++++++++++++++++--- .../main/java/forge/game/keyword/Keyword.java | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 71069288a77..09d3b50edce 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -1400,7 +1400,7 @@ public class Card extends GameEntity implements Comparable { sbLong.append(keyword).append("\r\n"); } else if (keyword.startsWith("Sunburst") && hasStartOfKeyword("Modular")) { } else if (keyword.startsWith("Modular") || keyword.startsWith("Soulshift") || keyword.startsWith("Bloodthirst") - || keyword.startsWith("Strive") + || keyword.startsWith("Strive") || keyword.startsWith("Escalate") || keyword.startsWith("ETBReplacement") || keyword.startsWith("MayEffectFromOpeningHand")) { } else if (keyword.startsWith("Provoke") || keyword.startsWith("Devour") || keyword.equals("Unleash")) { sbLong.append(keyword + " (" + Keyword.getInstance(keyword).getReminderText() + ")"); diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index f97b8dc0784..ca4eb33f8ea 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -2529,11 +2529,14 @@ public class CardFactoryUtil { addReplacementEffect(keyword, card, null); addStaticAbility(keyword, card, null); } + else if (keyword.startsWith("Escalate")) { + addStaticAbility(keyword, card, null); + } else if (keyword.startsWith("Rampage")) { addTriggerAbility(keyword, card, null); } else if (keyword.startsWith("Strive")) { - addStaticAbility(keyword, card, null); + addStaticAbility(keyword, card, null); } else if (keyword.startsWith("Bushido")) { addTriggerAbility(keyword, card, null); @@ -3277,10 +3280,23 @@ public class CardFactoryUtil { public static void addStaticAbility(final String keyword, final Card card, final KeywordsChange kws) { final boolean intrinsic = kws == null; - if (keyword.startsWith("Strive")) { + + if (keyword.startsWith("Escalate")) { final String[] k = keyword.split(":"); final String manacost = k[1]; - + final Cost cost = new Cost(manacost, false); + + final String effect = "Mode$ RaiseCost | ValidCard$ Card.Self | Type$ Spell | Amount$ Escalate | Cost$ "+ manacost +" | EffectZone$ All" + + " | Description$ Escalate " + cost.toSimpleString() + " (" + Keyword.getInstance(keyword).getReminderText() + ")"; + StaticAbility st = card.addStaticAbility(effect); + st.setIntrinsic(intrinsic); + if (!intrinsic) { + kws.addStaticAbility(st); + } + } else if (keyword.startsWith("Strive")) { + final String[] k = keyword.split(":"); + final String manacost = k[1]; + final String effect = "Mode$ RaiseCost | ValidCard$ Card.Self | Type$ Spell | Amount$ Strive | Cost$ "+ manacost +" | EffectZone$ All" + " | Description$ Strive - CARDNAME costs " + ManaCostParser.parse(manacost) + " more to cast for each target beyond the first."; StaticAbility st = card.addStaticAbility(effect); diff --git a/forge-game/src/main/java/forge/game/keyword/Keyword.java b/forge-game/src/main/java/forge/game/keyword/Keyword.java index 80be036cdb9..39b0a90243b 100644 --- a/forge-game/src/main/java/forge/game/keyword/Keyword.java +++ b/forge-game/src/main/java/forge/game/keyword/Keyword.java @@ -41,6 +41,7 @@ public enum Keyword { ENTWINE(KeywordWithCost.class, true, "You may choose all modes of this spell instead of just one. If you do, you pay an additional %s."), EPIC(SimpleKeyword.class, true, "For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has any targets, you may choose new targets for the copy."), EQUIP(KeywordWithCost.class, false, "%s: Attach this permanent to target creature you control. Activate this ability only any time you could cast a sorcery."), + ESCALATE(KeywordWithCost.class, true, "Pay this cost for each mode chosen beyond the first."), EVOKE(KeywordWithCost.class, false, "You may cast this card by paying %s rather than paying its mana cost. If you do, it's sacrificed when it enters the battlefield."), EVOLVE(SimpleKeyword.class, false, "Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature."), EXALTED(SimpleKeyword.class, false, "Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn."),