From 00eb90bcc6ad629726dc8dfaf08350fc2f92a3d7 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Wed, 22 Nov 2017 14:15:30 +0000 Subject: [PATCH] CardFactory: remove copyCopiableAbilities because it isn't needed anymore --- .../java/forge/game/card/CardFactory.java | 68 ------------------- 1 file changed, 68 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/CardFactory.java b/forge-game/src/main/java/forge/game/card/CardFactory.java index 8a9eaedcf9c..615353d4cfd 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactory.java +++ b/forge-game/src/main/java/forge/game/card/CardFactory.java @@ -31,7 +31,6 @@ import forge.game.cost.Cost; import forge.game.player.Player; import forge.game.replacement.ReplacementHandler; import forge.game.spellability.*; -import forge.game.staticability.StaticAbility; import forge.game.trigger.Trigger; import forge.game.trigger.TriggerHandler; import forge.game.trigger.WrappedAbility; @@ -509,37 +508,6 @@ public class CardFactory { copyState(from, from.getCurrentStateName(), to, to.getCurrentStateName()); } } - - /** - * Copy the copiable abilities of one card to another, taking the states of - * both cards into account. - * - * @param from the {@link Card} to copy from. - * @param to the {@link Card} to copy to. - */ - public static void copyCopiableAbilities(final Card from, final Card to) { - final boolean toIsFaceDown = to.isFaceDown(); - if (toIsFaceDown) { - // If to is face down, copy to its front side - to.setState(CardStateName.Original, false); - copyCopiableAbilities(from, to); - to.setState(CardStateName.FaceDown, false); - return; - } - - final boolean fromIsFlipCard = from.isFlipCard(); - final boolean fromIsTransformedCard = from.getCurrentStateName() == CardStateName.Transformed || from.getCurrentStateName() == CardStateName.Meld; - - if (fromIsFlipCard) { - copyAbilities(from, CardStateName.Original, to, to.getCurrentStateName()); - copyAbilities(from, CardStateName.Flipped, to, CardStateName.Flipped); - } - else if (fromIsTransformedCard) { - copyAbilities(from, from.getCurrentStateName(), to, CardStateName.Original); - } else { - copyAbilities(from, from.getCurrentStateName(), to, to.getCurrentStateName()); - } - } /** *

@@ -612,42 +580,6 @@ public class CardFactory { toCharacteristics.copyFrom(from, fromCharacteristics); } - /** - * Copy the abilities (including static abilities, triggers, and replacement - * effects) from one card to another. - * - * @param from the {@link Card} to copy from. - * @param fromState the {@link CardStateName} of {@code from} to copy from. - * @param to the {@link Card} to copy to. - * @param toState the {@link CardStateName} of {@code to} to copy to. - */ - private static void copyAbilities(final Card from, final CardStateName fromState, final Card to, final CardStateName toState) { - final CardState fromCharacteristics = from.getState(fromState); - final CardStateName oldToState = to.getCurrentStateName(); - if (!to.getStates().contains(toState)) { - to.addAlternateState(toState, false); - } - - to.setState(toState, false); - // handle triggers and replacement effect through Card class interface - to.setTriggers(fromCharacteristics.getTriggers(), true); - to.setReplacementEffects(fromCharacteristics.getReplacementEffects()); - // add abilities - for (SpellAbility sa : fromCharacteristics.getIntrinsicSpellAbilities()) { - to.addSpellAbility(sa.copy()); - } - - // add static abilities - to.getCurrentState().clearStaticAbilities(); - for (StaticAbility staticAbility : fromCharacteristics.getStaticAbilities()) { - if (staticAbility.isIntrinsic()) { - to.addStaticAbility(staticAbility, true); - } - } - // reset state - to.setState(oldToState, false); - } - public static void copySpellAbility(SpellAbility from, SpellAbility to, final Card host) { if (from.getActivatingPlayer() != null) { to.setActivatingPlayer(from.getActivatingPlayer());