From d1f3b3164b1aee9d31cddca2c3021636c05ba8cc Mon Sep 17 00:00:00 2001 From: Sloth Date: Sat, 24 Sep 2011 07:18:12 +0000 Subject: [PATCH] - Fixed destroyPlaneswalkers checking non-Planeswalker types (so two Artifact Planeswalker won't destroy each other). --- src/main/java/forge/CardUtil.java | 5 ++++- src/main/java/forge/GameAction.java | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/forge/CardUtil.java b/src/main/java/forge/CardUtil.java index 69db506ec77..39b5ac43feb 100644 --- a/src/main/java/forge/CardUtil.java +++ b/src/main/java/forge/CardUtil.java @@ -447,7 +447,6 @@ public final class CardUtil { return (!isASuperType(cardType) && !isACardType(cardType)); } - // Check if a Type is a Creature Type (by excluding all other types) /** *

isACreatureType.

* @@ -467,6 +466,10 @@ public final class CardUtil { public static boolean isALandType(final String cardType) { return (Constant.CardTypes.landTypes[0].list.contains(cardType)); } + + public static boolean isAPlaneswalkerType(final String cardType) { + return (Constant.CardTypes.walkerTypes[0].list.contains(cardType)); + } /** *

isABasicLandType.

diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index 6562116858d..08121d83808 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -826,16 +826,20 @@ public class GameAction { AllZone.getGameAction().moveToGraveyard(c); } - String subtype = c.getType().get(c.getType().size() - 1); - CardList cl = list.getType(subtype); + ArrayList types = c.getType(); + for (String type : types) { + if(!CardUtil.isAPlaneswalkerType(type)) + continue; + + CardList cl = list.getType(type); - if (cl.size() > 1) { - for (Card crd : cl) { - AllZone.getGameAction().moveToGraveyard(crd); + if (cl.size() > 1) { + for (Card crd : cl) { + AllZone.getGameAction().moveToGraveyard(crd); + } } } } - } /**