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 ed8a1175373..4ddeb2c05f2 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -2035,6 +2035,8 @@ public class Card extends GameEntity implements Comparable, IHasSVars { sbx.append(" (").append(inst.getReminderText()).append(")"); sbLong.append(sbx).append("\r\n"); } + } else if (keyword.startsWith("Trample:")) { + sbLong.append("Trample over planeswalkers").append(" (").append(inst.getReminderText()).append(")").append("\r\n"); } else if (keyword.startsWith("Hexproof:")) { final String[] k = keyword.split(":"); sbLong.append("Hexproof from ").append(k[2]) @@ -2061,7 +2063,6 @@ public class Card extends GameEntity implements Comparable, IHasSVars { || keyword.equals("Suspend") // for the ones without amount || keyword.equals("Foretell") // for the ones without cost || keyword.equals("Hideaway") || keyword.equals("Ascend") - || keyword.equals("Trample over planeswalkers") || keyword.equals("Totem armor") || keyword.equals("Battle cry") || keyword.equals("Devoid") || keyword.equals("Riot")){ sbLong.append(keyword).append(" (").append(inst.getReminderText()).append(")"); 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 790eb54da79..c739451f738 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -518,6 +518,7 @@ public class CardFactoryUtil { final Set protectionkw = Sets.newHashSet(); final Set protectionColorkw = Sets.newHashSet(); final Set hexproofkw = Sets.newHashSet(); + final Set tramplekw = Sets.newHashSet(); final Set allkw = Sets.newHashSet(); for (Card c : CardLists.getValidCards(cardlist, restrictions, p, host, null)) { @@ -535,6 +536,8 @@ public class CardFactoryUtil { } } else if (k.startsWith("Hexproof")) { hexproofkw.add(k); + } else if (k.startsWith("Trample")) { + tramplekw.add(k); } allkw.add(k); } @@ -548,6 +551,8 @@ public class CardFactoryUtil { filteredkw.addAll(landkw); } else if (keyword.equals("Hexproof")) { filteredkw.addAll(hexproofkw); + } else if (keyword.equals("Trample")) { + filteredkw.addAll(tramplekw); } else if (allkw.contains(keyword)) { filteredkw.add(keyword); } diff --git a/forge-game/src/main/java/forge/game/card/CounterType.java b/forge-game/src/main/java/forge/game/card/CounterType.java index d64222b1691..c9e6d279f0d 100644 --- a/forge-game/src/main/java/forge/game/card/CounterType.java +++ b/forge-game/src/main/java/forge/game/card/CounterType.java @@ -97,6 +97,9 @@ public class CounterType implements Comparable, Serializable { final String[] k = sVal.split(":"); return "Hexproof from " + k[2]; } + if (sVal.startsWith("Trample:")) { + return "Trample over Planeswalkers"; + } return sVal; } @@ -119,6 +122,9 @@ public class CounterType implements Comparable, Serializable { if (sVal.startsWith("Hexproof:")) { return true; } + if (sVal.startsWith("Trample:")) { + return true; + } return keywordCounter.contains(sVal); } diff --git a/forge-game/src/main/java/forge/game/combat/Combat.java b/forge-game/src/main/java/forge/game/combat/Combat.java index 27fe236bf35..4fccef7ba91 100644 --- a/forge-game/src/main/java/forge/game/combat/Combat.java +++ b/forge-game/src/main/java/forge/game/combat/Combat.java @@ -779,7 +779,7 @@ public class Combat { assignedDamage = true; GameEntity defender = getDefenderByAttacker(band); // If the Attacker is unblocked, or it's a trampler and has 0 blockers, deal damage to defender - if (defender instanceof Card && attacker.hasKeyword("Trample over planeswalkers")) { + if (defender instanceof Card && attacker.hasKeyword("Trample:Planeswalker")) { if (orderedBlockers == null || orderedBlockers.isEmpty()) { CardCollection cc = new CardCollection(); cc.add((Card)defender); 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 fe9dd404b4e..a31b1adbb0b 100644 --- a/forge-game/src/main/java/forge/game/keyword/Keyword.java +++ b/forge-game/src/main/java/forge/game/keyword/Keyword.java @@ -152,8 +152,7 @@ public enum Keyword { SURGE("Surge", KeywordWithCost.class, false, "You may cast this spell for its surge cost if you or a teammate has cast another spell this turn."), SUSPEND("Suspend", Suspend.class, false, "Rather than cast this card from your hand, you may pay %s and exile it with {%d:time counter} on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost."), TOTEM_ARMOR("Totem armor", SimpleKeyword.class, true, "If enchanted permanent would be destroyed, instead remove all damage marked on it and destroy this Aura."), - TRAMPLE("Trample", SimpleKeyword.class, true, "This creature can deal excess combat damage to the player or planeswalker it's attacking."), - TRAMPLE_OVER_PLANESWALKERS("Trample over planeswalkers", SimpleKeyword.class, true, "This creature can deal excess combat damage to the controller of the planeswalker it’s attacking."), + TRAMPLE("Trample", Trample.class, true, "This creature can deal excess combat damage to the player or planeswalker it's attacking."), TRANSFIGURE("Transfigure", KeywordWithCost.class, false, "%s, Sacrifice this creature: Search your library for a creature card with the same mana value as this creature and put that card onto the battlefield, then shuffle. Transfigure only as a sorcery."), TRANSMUTE("Transmute", KeywordWithCost.class, false, "%s, Discard this card: Search your library for a card with the same mana value as this card, reveal it, and put it into your hand, then shuffle. Transmute only as a sorcery."), TRIBUTE("Tribute", KeywordWithAmount.class, false, "As this creature enters the battlefield, an opponent of your choice may put {%d:+1/+1 counter} on it."), diff --git a/forge-game/src/main/java/forge/game/keyword/Trample.java b/forge-game/src/main/java/forge/game/keyword/Trample.java new file mode 100644 index 00000000000..d74920de663 --- /dev/null +++ b/forge-game/src/main/java/forge/game/keyword/Trample.java @@ -0,0 +1,35 @@ +package forge.game.keyword; + +import java.util.Collection; + +public class Trample extends KeywordInstance { + private String type = ""; + + @Override + protected void parse(String details) { + if (!details.isEmpty()) { + type = details.split(":")[0]; + } + } + + @Override + protected String formatReminderText(String reminderText) { + if (!type.isEmpty()) { + return "This creature can deal excess combat damage to the controller of the planeswalker it’s attacking."; + } + return reminderText; + } + + /* (non-Javadoc) + * @see forge.game.keyword.KeywordInstance#redundant(java.util.Collection) + */ + @Override + public boolean redundant(Collection list) { + for (KeywordInterface i : list) { + if (i.getOriginal().equals(getOriginal())) { + return true; + } + } + return false; + } +} diff --git a/forge-gui/res/cardsfolder/t/thrasta_tempests_roar.txt b/forge-gui/res/cardsfolder/t/thrasta_tempests_roar.txt index f50c47ab5d5..a26c4d27af0 100644 --- a/forge-gui/res/cardsfolder/t/thrasta_tempests_roar.txt +++ b/forge-gui/res/cardsfolder/t/thrasta_tempests_roar.txt @@ -6,6 +6,6 @@ S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ X | EffectZone SVar:X:Count$ThisTurnCast_Card.Other/Times.3 K:Trample K:Haste -K:Trample over planeswalkers +K:Trample:Planeswalker S:Mode$ Continuous | Affected$ Card.Self+ThisTurnEntered | AddKeyword$ Hexproof | Description$ CARDNAME has hexproof as long as it entered the battlefield this turn. Oracle:This spell costs {3} less to cast for each other spell cast this turn.\nTrample, haste\nTrample over planeswalkers (This creature can deal excess combat damage to the controller of the planeswalker it's attacking.)\nThrasta, Tempest's Roar has hexproof as long as it entered the battlefield this turn. diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index 1822c29ff50..b3fe1be293c 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -361,7 +361,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont if ((attacker.hasKeyword(Keyword.TRAMPLE) && defender != null) || (blockers.size() > 1) || ((attacker.hasKeyword("You may assign CARDNAME's combat damage divided as you choose among " + "defending player and/or any number of creatures they control.")) && overrideOrder && - blockers.size() >0) || (attacker.hasKeyword("Trample over planeswalkers") && defender instanceof Card)) { + blockers.size() >0) || (attacker.hasKeyword("Trample:Planeswalker") && defender instanceof Card)) { GameEntityViewMap gameCacheBlockers = GameEntityView.getMap(blockers); final CardView vAttacker = CardView.get(attacker); final GameEntityView vDefender = GameEntityView.get(defender);