From b36d711d75df51bdf9d48d22a09ab914ca367d6b Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 13 Nov 2012 20:32:37 +0000 Subject: [PATCH] - AdditionalCostsPaid will now be cleared when a card hits the graveyard. --- src/main/java/forge/Card.java | 24 +++++++++++------------- src/main/java/forge/GameAction.java | 29 ++--------------------------- 2 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index ec1028041ab..2ee0455ff28 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -1257,9 +1257,6 @@ public class Card extends GameEntity implements Comparable { Singletons.getModel().getGame().getTriggerHandler().runTrigger(TriggerType.CounterAdded, runParams); } - // play the Add Counter sound - Sounds.AddCounter.play(); - this.updateObservers(); } @@ -1293,9 +1290,6 @@ public class Card extends GameEntity implements Comparable { Singletons.getModel().getGame().getTriggerHandler().runTrigger(TriggerType.CounterAdded, runParams); } - // play the Add Counter sound - Sounds.AddCounter.play(); - this.updateObservers(); } @@ -1366,10 +1360,6 @@ public class Card extends GameEntity implements Comparable { } } } - - // play the Subtract Counter sound - Sounds.RemoveCounter.play(); - this.updateObservers(); } } @@ -3865,9 +3855,6 @@ public class Card extends GameEntity implements Comparable { this.addEquipping(c); c.addEquippedBy(this); this.equip(); - - // Play the Equip sound - Sounds.Equip.play(); } /** @@ -5827,6 +5814,17 @@ public class Card extends GameEntity implements Comparable { } this.optionalAdditionalCostsPaid.add(cost); } + + /** + *

+ * optionalAdditionalCostsPaid. + *

+ */ + public final void clearAdditionalCostsPaid() { + if (optionalAdditionalCostsPaid != null) { + optionalAdditionalCostsPaid.clear(); + } + } /** *

diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index a164310f664..89f80ac1eee 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -131,8 +131,6 @@ public class GameAction { return c; } -// System.err.println(String.format("%s moves from %s to %s", c.toString(), zoneFrom.getZoneType().name(), zoneTo.getZoneType().name())); - boolean suppress; if ((zoneFrom == null) && !c.isToken()) { suppress = true; @@ -299,6 +297,7 @@ public class GameAction { if (!zoneTo.is(ZoneType.Graveyard) || !c.getName().equals("Skullbriar, the Walking Grave")) { copied.clearCounters(); } + copied.clearAdditionalCostsPaid(); if (copied.isFaceDown()) { copied.turnFaceUp(); } @@ -322,6 +321,7 @@ public class GameAction { copied.removeHiddenExtrinsicKeyword(s); } } + copied.clearAdditionalCostsPaid(); if (copied.isFaceDown()) { copied.turnFaceUp(); } @@ -1254,9 +1254,6 @@ public class GameAction { if (c.getCounters(Counters.LOYALTY) <= 0) { Singletons.getModel().getGame().getAction().moveToGraveyard(c); - - // Play the Destroy sound - Sounds.Destroy.play(); } final ArrayList types = c.getType(); @@ -1301,9 +1298,6 @@ public class GameAction { for (int i = 0; i < b.size(); i++) { Singletons.getModel().getGame().getAction().sacrificeDestroy(b.get(i)); } - - // Play the Destroy sound - Sounds.Destroy.play(); } } } // destroyLegendaryCreatures() @@ -1331,9 +1325,6 @@ public class GameAction { } this.sacrificeDestroy(c); - // Play the Sacrifice sound - Sounds.Sacrifice.play(); - // Run triggers final HashMap runParams = new HashMap(); runParams.put("Card", c); @@ -1385,8 +1376,6 @@ public class GameAction { GameAction.this.destroy(crd); card.setDamage(0); - // Play the Destroy sound - Sounds.Destroy.play(); } }; @@ -1399,9 +1388,6 @@ public class GameAction { } } // totem armor - // Play the Destroy sound - Sounds.Destroy.play(); - return this.sacrificeDestroy(c); } @@ -1547,10 +1533,6 @@ public class GameAction { c.tap(); c.addRegeneratedThisTurn(); game.getCombat().removeFromCombat(c); - - // Play the Regeneration sound - Sounds.Regen.play(); - return false; } @@ -1578,18 +1560,11 @@ public class GameAction { c.setDamage(0); this.destroy(crd); - - // Play the Destroy sound - Sounds.Destroy.play(); - System.out.println("Totem armor destroyed instead of original card"); return false; } } // totem armor - // Play the Destroy sound - Sounds.Destroy.play(); - return this.sacrificeDestroy(c); }