diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index e243b172934..a698e4bbe0b 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -612,11 +612,8 @@ public class GameAction { } public final Card moveToStack(final Card c, SpellAbility cause) { - return moveToStack(c, cause, null); - } - public final Card moveToStack(final Card c, SpellAbility cause, Map params) { final Zone stack = game.getStackZone(); - return moveTo(stack, c, cause, params); + return moveTo(stack, c, cause); } public final Card moveToGraveyard(final Card c, SpellAbility cause) { @@ -638,12 +635,8 @@ public class GameAction { } public final Card moveToPlay(final Card c, SpellAbility cause) { - return moveToPlay(c, cause, null); - } - - public final Card moveToPlay(final Card c, SpellAbility cause, Map params) { final PlayerZone play = c.getController().getZone(ZoneType.Battlefield); - return moveTo(play, c, cause, params); + return moveTo(play, c, cause, null); } public final Card moveToPlay(final Card c, final Player p, SpellAbility cause) { @@ -685,15 +678,11 @@ public class GameAction { } public final Card moveToVariantDeck(Card c, ZoneType zone, int deckPosition, SpellAbility cause) { - return moveToVariantDeck(c, zone, deckPosition, cause, null); - } - - public final Card moveToVariantDeck(Card c, ZoneType zone, int deckPosition, SpellAbility cause, Map params) { final PlayerZone deck = c.getOwner().getZone(zone); if (deckPosition == -1 || deckPosition > deck.size()) { deckPosition = deck.size(); } - return changeZone(game.getZoneOf(c), deck, c, deckPosition, cause, params); + return changeZone(game.getZoneOf(c), deck, c, deckPosition, cause); } public final Card exile(final Card c, SpellAbility cause) { @@ -729,16 +718,16 @@ public class GameAction { public final Card moveTo(final ZoneType name, final Card c, final int libPosition, SpellAbility cause) { // Call specific functions to set PlayerZone, then move onto moveTo switch(name) { - case Hand: return moveToHand(c, cause, null); - case Library: return moveToLibrary(c, libPosition, cause, null); - case Battlefield: return moveToPlay(c, cause, null); - case Graveyard: return moveToGraveyard(c, cause, null); - case Exile: return exile(c, cause, null); - case Stack: return moveToStack(c, cause, null); - case PlanarDeck: return moveToVariantDeck(c, ZoneType.PlanarDeck, libPosition, cause, null); - case SchemeDeck: return moveToVariantDeck(c, ZoneType.SchemeDeck, libPosition, cause, null); + case Hand: return moveToHand(c, cause); + case Library: return moveToLibrary(c, libPosition, cause); + case Battlefield: return moveToPlay(c, cause); + case Graveyard: return moveToGraveyard(c, cause); + case Exile: return exile(c, cause); + case Stack: return moveToStack(c, cause); + case PlanarDeck: return moveToVariantDeck(c, ZoneType.PlanarDeck, libPosition, cause); + case SchemeDeck: return moveToVariantDeck(c, ZoneType.SchemeDeck, libPosition, cause); default: // sideboard will also get there - return moveTo(c.getOwner().getZone(name), c, cause, null); + return moveTo(c.getOwner().getZone(name), c, cause); } } diff --git a/forge-game/src/main/java/forge/game/ability/AbilityKey.java b/forge-game/src/main/java/forge/game/ability/AbilityKey.java index 372eaa1331e..3b3543dc332 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityKey.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityKey.java @@ -9,7 +9,15 @@ public enum AbilityKey { Attackers("Attackers"), AttackingPlayer("AttackingPlayer"), AttackedTarget("AttackedTarget"), - Player("Player"); + Card("Card"), + Cause("Cause"), + Destination("Destination"), + Player("Player"), + IndividualCostPaymentInstance("IndividualCostPaymentInstance"), + Origin("Origin"), + SpellAbilityStackInstance("SpellAbilityStackInstance") + ; + private String key; diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java index 01445323772..1464c6716e1 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java @@ -470,7 +470,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect { } } - movedCard = game.getAction().moveToLibrary(tgtC, libraryPosition, sa, null); + movedCard = game.getAction().moveToLibrary(tgtC, libraryPosition, sa); } else { if (destination.equals(ZoneType.Battlefield)) { @@ -967,7 +967,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect { Card movedCard = null; final Zone originZone = game.getZoneOf(c); if (destination.equals(ZoneType.Library)) { - movedCard = game.getAction().moveToLibrary(c, libraryPos, sa, null); + movedCard = game.getAction().moveToLibrary(c, libraryPos, sa); } else if (destination.equals(ZoneType.Battlefield)) { if (sa.hasParam("Tapped")) { @@ -1108,7 +1108,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect { movedCard.setTimestamp(ts); } else if (destination.equals(ZoneType.Exile)) { - movedCard = game.getAction().exile(c, sa, null); + movedCard = game.getAction().exile(c, sa); if (!c.isToken()) { Card host = sa.getOriginalHost(); if (host == null) { diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java index 612737941e8..d544b9a21fc 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java @@ -181,7 +181,7 @@ public class CopyPermanentEffect extends SpellAbilityEffect { // Temporarily register triggers of an object created with CopyPermanent //game.getTriggerHandler().registerActiveTrigger(copy, false); - final Card copyInPlay = game.getAction().moveToPlay(t, sa, null); + final Card copyInPlay = game.getAction().moveToPlay(t, sa); if (copyInPlay.getZone() != null) { triggerList.put(ZoneType.None, copyInPlay.getZone().getZoneType(), copyInPlay); diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index 75d87c49e64..554a7697404 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -223,7 +223,7 @@ public class CostAdjustment { cardsToDelveOut.add(c); } else if (!test) { sa.getHostCard().addDelved(c); - final Card d = game.getAction().exile(c, null, null); + final Card d = game.getAction().exile(c, null); table.put(ZoneType.Graveyard, d.getZone().getZoneType(), d); } } diff --git a/forge-game/src/main/java/forge/game/mulligan/AbstractMulligan.java b/forge-game/src/main/java/forge/game/mulligan/AbstractMulligan.java index 16bf06b1915..0e7e4989eb3 100644 --- a/forge-game/src/main/java/forge/game/mulligan/AbstractMulligan.java +++ b/forge-game/src/main/java/forge/game/mulligan/AbstractMulligan.java @@ -30,7 +30,7 @@ public abstract class AbstractMulligan { CardCollection toMulligan = new CardCollection(player.getCardsIn(ZoneType.Hand)); revealPreMulligan(toMulligan); for (final Card c : toMulligan) { - player.getGame().getAction().moveToLibrary(c, null, null); + player.getGame().getAction().moveToLibrary(c, null); } try { Thread.sleep(100); //delay for a tiny bit to give UI a chance catch up diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index 2d826253bfb..e2ccc819b1d 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -1308,7 +1308,7 @@ public class Player extends GameEntity implements Comparable { if (toGrave != null) { for(Card c : toGrave) { - getGame().getAction().moveToGraveyard(c, cause, null); + getGame().getAction().moveToGraveyard(c, cause); numToGrave++; } } @@ -1316,7 +1316,7 @@ public class Player extends GameEntity implements Comparable { if (toTop != null) { Collections.reverse(toTop); // the last card in list will become topmost in library, have to revert thus. for(Card c : toTop) { - getGame().getAction().moveToLibrary(c, cause, null); + getGame().getAction().moveToLibrary(c, cause); numToTop++; } } @@ -1399,7 +1399,7 @@ public class Player extends GameEntity implements Comparable { } } - c = game.getAction().moveToHand(c, null, null); + c = game.getAction().moveToHand(c, null); drawn.add(c); if (topCardRevealed) { @@ -1574,16 +1574,16 @@ public class Player extends GameEntity implements Comparable { sb.append(this).append(" discards ").append(c); final Card newCard; if (discardToTopOfLibrary) { - newCard = game.getAction().moveToLibrary(c, 0, sa, null); + newCard = game.getAction().moveToLibrary(c, 0, sa); sb.append(" to the library"); // Play the Discard sound } else if (discardMadness) { - newCard = game.getAction().exile(c, sa, null); + newCard = game.getAction().exile(c, sa); sb.append(" with Madness"); } else { - newCard = game.getAction().moveToGraveyard(c, sa, null); + newCard = game.getAction().moveToGraveyard(c, sa); // Play the Discard sound } if (table != null) { diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index eb4dc80fa2f..39a47df9958 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -2433,9 +2433,9 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont TextUtil.concatWithSpace("Should", forgeCard.toString(), "be added to the top or to the bottom of the library?"), true, Arrays.asList("Top", "Bottom")); } if (lastTopOfTheLibrary) { - game.getAction().moveToLibrary(forgeCard, null, null); + game.getAction().moveToLibrary(forgeCard, null); } else { - game.getAction().moveToBottomOfLibrary(forgeCard, null, null); + game.getAction().moveToBottomOfLibrary(forgeCard, null); } } else { game.getAction().moveTo(targetZone, forgeCard, null);