diff --git a/src/main/java/arcane/ui/CardPanel.java b/src/main/java/arcane/ui/CardPanel.java index 0ba10ed211f..10044ddded0 100644 --- a/src/main/java/arcane/ui/CardPanel.java +++ b/src/main/java/arcane/ui/CardPanel.java @@ -293,8 +293,8 @@ public class CardPanel extends JPanel implements CardContainer { if (getCard().getName().equals("Mana Pool") && !isAnimationPanel) { - if (AllZone.getManaPool() != null) { - String s = AllZone.getManaPool().getManaList(); + if (AllZone.getHumanPlayer().getManaPool() != null) { + String s = AllZone.getHumanPlayer().getManaPool().getManaList(); if (!s.equals("|||||||||||")) { String mList[] = s.split("\\|", 12); diff --git a/src/main/java/forge/AllZone.java b/src/main/java/forge/AllZone.java index 2cc5b2921db..57fee057a7b 100644 --- a/src/main/java/forge/AllZone.java +++ b/src/main/java/forge/AllZone.java @@ -5,7 +5,6 @@ import net.slightlymagic.braids.util.UtilFunctions; import forge.Constant.Zone; import forge.card.cardFactory.CardFactoryInterface; import forge.card.cardFactory.PreloadingCardFactory; -import forge.card.mana.ManaPool; import forge.card.trigger.TriggerHandler; import forge.deck.DeckManager; import forge.game.GameSummary; @@ -376,26 +375,6 @@ public final class AllZone implements NewConstants { return Singletons.getModel().getGameState().getStackZone(); } - /** - *
getManaPool.
- * - * @return a {@link forge.card.mana.ManaPool} object. - * @since 1.0.15 - */ - public static ManaPool getManaPool() { - return AllZone.getHumanPlayer().getManaPool(); - } - - /** - *getComputerManaPool.
- * - * @return a {@link forge.card.mana.ManaPool} object. - * @since 1.0.15 - */ - public static ManaPool getComputerManaPool() { - return AllZone.getComputerPlayer().getManaPool(); - } - /** *getDisplay.
* diff --git a/src/main/java/forge/ComputerAI_General.java b/src/main/java/forge/ComputerAI_General.java index ca8a496ce63..13d1fdb16f4 100644 --- a/src/main/java/forge/ComputerAI_General.java +++ b/src/main/java/forge/ComputerAI_General.java @@ -77,7 +77,7 @@ public class ComputerAI_General implements Computer { //Card list of all cards to consider CardList hand = AllZone.getComputerPlayer().getCardsIn(Zone.Hand); - if (AllZone.getComputerManaPool().isEmpty()) { + if (AllZone.getComputerPlayer().getManaPool().isEmpty()) { hand = hand.filter(new CardListFilter() { public boolean addCard(final Card c) { diff --git a/src/main/java/forge/ComputerUtil.java b/src/main/java/forge/ComputerUtil.java index d01e55b38e9..85379d9c295 100644 --- a/src/main/java/forge/ComputerUtil.java +++ b/src/main/java/forge/ComputerUtil.java @@ -455,8 +455,7 @@ public class ComputerUtil { cost = AllZone.getGameAction().getSpellCostChange(sa, cost); - ManaPool manapool = AllZone.getComputerManaPool(); - if (player.isHuman()) manapool = AllZone.getManaPool(); + ManaPool manapool = player.getManaPool(); Card card = sa.getSourceCard(); // Tack xMana Payments into mana here if X is a set value diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index a7b3767adc4..4ff8efffd6d 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -1256,7 +1256,7 @@ public class GameAction { } // TODO ManaPool should be moved to Player and be represented in the player panel - ManaPool mp = AllZone.getManaPool(); + ManaPool mp = AllZone.getHumanPlayer().getManaPool(); mp.setImageFilename("mana_pool"); AllZone.getHumanPlayer().getZone(Zone.Battlefield).add(mp); diff --git a/src/main/java/forge/GameActionUtil.java b/src/main/java/forge/GameActionUtil.java index 9b3b7e73238..27204441f26 100644 --- a/src/main/java/forge/GameActionUtil.java +++ b/src/main/java/forge/GameActionUtil.java @@ -2725,11 +2725,7 @@ public final class GameActionUtil { } //empty mana pool - if (p.isHuman()) { - AllZone.getManaPool().clearPool(); - } else { - AllZone.getComputerManaPool().clearPool(); - } + p.getManaPool().clearPool(); } } //end class GameActionUtil diff --git a/src/main/java/forge/GuiDisplay4.java b/src/main/java/forge/GuiDisplay4.java index e6f6e2e879d..3d7aecb9293 100644 --- a/src/main/java/forge/GuiDisplay4.java +++ b/src/main/java/forge/GuiDisplay4.java @@ -522,7 +522,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo oppLifeLabel.addMouseMotionListener(new MouseMotionAdapter() { @Override public void mouseMoved(final MouseEvent me) { - setCard(AllZone.getComputerManaPool()); + setCard(AllZone.getComputerPlayer().getManaPool()); } //mouseMoved }); diff --git a/src/main/java/forge/Phase.java b/src/main/java/forge/Phase.java index fb25a6ed9e9..e99037da84b 100644 --- a/src/main/java/forge/Phase.java +++ b/src/main/java/forge/Phase.java @@ -410,8 +410,8 @@ public class Phase extends MyObservable implements java.io.Serializable { } this.bPhaseEffects = true; if (!AllZoneUtil.isCardInPlay("Upwelling")) { - AllZone.getManaPool().clearPool(); - AllZone.getComputerManaPool().clearPool(); + AllZone.getHumanPlayer().getManaPool().clearPool(); + AllZone.getComputerPlayer().getManaPool().clearPool(); } if (getPhase().equals(Constant.Phase.Combat_Declare_Attackers)) { diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java index 791e43f64b5..aa88755a554 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Mana.java @@ -897,11 +897,7 @@ public class AbilityFactory_Mana { for (Player p : tgtPlayers) { if (tgt == null || p.canTarget(sa)) { - if (p.isHuman()) { - AllZone.getManaPool().clearPool(); - } else if (p.isComputer()) { - AllZone.getComputerManaPool().clearPool(); - } + p.getManaPool().clearPool(); } } } diff --git a/src/main/java/forge/card/cardFactory/CardFactoryUtil.java b/src/main/java/forge/card/cardFactory/CardFactoryUtil.java index 56b31bcbe34..2b59caf5a90 100644 --- a/src/main/java/forge/card/cardFactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardFactory/CardFactoryUtil.java @@ -2867,7 +2867,7 @@ public class CardFactoryUtil { // Manapool if (l[0].contains("ManaPool")) { String color = l[0].split(":")[1]; - return AllZone.getManaPool().getAmountOfColor(color); + return AllZone.getHumanPlayer().getManaPool().getAmountOfColor(color); } // count valid cards on the battlefield diff --git a/src/main/java/forge/card/cost/Cost_Payment.java b/src/main/java/forge/card/cost/Cost_Payment.java index 16de246cbac..cc97fc74092 100644 --- a/src/main/java/forge/card/cost/Cost_Payment.java +++ b/src/main/java/forge/card/cost/Cost_Payment.java @@ -196,7 +196,7 @@ public class Cost_Payment { } // Move this to CostMana - AllZone.getManaPool().unpaid(ability, false); + AllZone.getHumanPlayer().getManaPool().unpaid(ability, false); } /** diff --git a/src/main/java/forge/card/spellability/Ability_Mana.java b/src/main/java/forge/card/spellability/Ability_Mana.java index f7d31c5fc34..9b442a3d02b 100644 --- a/src/main/java/forge/card/spellability/Ability_Mana.java +++ b/src/main/java/forge/card/spellability/Ability_Mana.java @@ -117,10 +117,7 @@ abstract public class Ability_Mana extends Ability_Activated implements java.io. */ public void produceMana(String produced, Player player) { final Card source = this.getSourceCard(); - ManaPool manaPool; - if (player.isHuman()) - manaPool = AllZone.getManaPool(); - else manaPool = AllZone.getComputerManaPool(); + ManaPool manaPool = player.getManaPool(); // change this, once ManaPool moves to the Player // this.getActivatingPlayer().ManaPool.addManaToFloating(origProduced, getSourceCard()); manaPool.addManaToFloating(produced, source); diff --git a/src/main/java/forge/card/spellability/SpellAbility_Requirements.java b/src/main/java/forge/card/spellability/SpellAbility_Requirements.java index 669ba222b51..878bf492b67 100644 --- a/src/main/java/forge/card/spellability/SpellAbility_Requirements.java +++ b/src/main/java/forge/card/spellability/SpellAbility_Requirements.java @@ -183,7 +183,7 @@ public class SpellAbility_Requirements { ability.setStackDescription(sb.toString()); } - AllZone.getManaPool().clearPay(ability, false); + AllZone.getHumanPlayer().getManaPool().clearPay(ability, false); AllZone.getStack().addAndUnfreeze(ability); } } diff --git a/src/main/java/forge/gui/input/Input_PayManaCost.java b/src/main/java/forge/gui/input/Input_PayManaCost.java index 41d17bd1013..7807620266e 100644 --- a/src/main/java/forge/gui/input/Input_PayManaCost.java +++ b/src/main/java/forge/gui/input/Input_PayManaCost.java @@ -141,7 +141,7 @@ public class Input_PayManaCost extends Input { } else AllZone.getInputControl().resetInput(); } else { - AllZone.getManaPool().clearPay(spell, false); + AllZone.getHumanPlayer().getManaPool().clearPay(spell, false); resetManaCost(); // if tap ability, tap card @@ -172,7 +172,7 @@ public class Input_PayManaCost extends Input { @Override public void selectButtonCancel() { resetManaCost(); - AllZone.getManaPool().unpaid(spell, true); + AllZone.getHumanPlayer().getManaPool().unpaid(spell, true); AllZone.getHumanPlayer().getZone(Zone.Battlefield).updateObservers();//DO NOT REMOVE THIS, otherwise the cards don't always tap stop(); diff --git a/src/main/java/forge/gui/input/Input_PayManaCostUtil.java b/src/main/java/forge/gui/input/Input_PayManaCostUtil.java index 9a6a5f6cb7c..950fb6a61e2 100644 --- a/src/main/java/forge/gui/input/Input_PayManaCostUtil.java +++ b/src/main/java/forge/gui/input/Input_PayManaCostUtil.java @@ -112,7 +112,7 @@ public class Input_PayManaCostUtil { AllZone.getGameAction().playSpellAbility(chosen); - manaCost = AllZone.getManaPool().subtractMana(sa, manaCost, chosen); + manaCost = AllZone.getHumanPlayer().getManaPool().subtractMana(sa, manaCost, chosen); AllZone.getHumanPlayer().getZone(Zone.Battlefield).updateObservers();//DO NOT REMOVE THIS, otherwise the cards don't always tap (copied) return manaCost; diff --git a/src/main/java/forge/gui/input/Input_PayManaCost_Ability.java b/src/main/java/forge/gui/input/Input_PayManaCost_Ability.java index d7769a7fbab..97e68485a96 100644 --- a/src/main/java/forge/gui/input/Input_PayManaCost_Ability.java +++ b/src/main/java/forge/gui/input/Input_PayManaCost_Ability.java @@ -108,7 +108,7 @@ public class Input_PayManaCost_Ability extends Input { if (manaCost.isPaid()) { resetManaCost(); - AllZone.getManaPool().clearPay(fakeAbility, false); + AllZone.getHumanPlayer().getManaPool().clearPay(fakeAbility, false); paidCommand.execute(); @@ -120,7 +120,7 @@ public class Input_PayManaCost_Ability extends Input { @Override public void selectButtonCancel() { resetManaCost(); - AllZone.getManaPool().unpaid(fakeAbility, true); + AllZone.getHumanPlayer().getManaPool().unpaid(fakeAbility, true); unpaidCommand.execute(); AllZone.getInputControl().resetInput(); }