diff --git a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java index 9241e07133e..0f28bdd4894 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java @@ -378,7 +378,6 @@ public class AnimateAi extends SpellAbilityAi { becomeAnimated(copy, card.hasSickness(), sa); return copy; } - private static void becomeAnimated(final Card card, final boolean hasOriginalCardSickness, final SpellAbility sa) { // duplicating AnimateEffect.resolve final Card source = sa.getHostCard(); @@ -485,7 +484,7 @@ public class AnimateAi extends SpellAbilityAi { AnimateEffectBase.doAnimate(card, sa, power, toughness, types, removeTypes, finalColors, keywords, removeKeywords, hiddenKeywords, abilities, triggers, replacements, stAbs, - timestamp); + timestamp, "Permanent"); // check if animate added static Abilities CardTraitChanges traits = card.getChangedCardTraits().get(timestamp, 0); diff --git a/forge-game/src/main/java/forge/game/ability/effects/AnimateAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/AnimateAllEffect.java index 357331bd1d0..b6903ecb81e 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AnimateAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AnimateAllEffect.java @@ -7,7 +7,6 @@ import java.util.Map; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import forge.GameCommand; import forge.card.CardType; import forge.card.ColorSet; import forge.game.Game; @@ -44,8 +43,6 @@ public class AnimateAllEffect extends AnimateEffectBase { // Every Animate event needs a unique time stamp final long timestamp = game.getNextTimestamp(); - final boolean permanent = "Permanent".equals(sa.getParam("Duration")); - final CardType types = new CardType(true); if (sa.hasParam("Types")) { types.addAll(Arrays.asList(sa.getParam("Types").split(","))); @@ -146,7 +143,7 @@ public class AnimateAllEffect extends AnimateEffectBase { for (final Card c : list) { doAnimate(c, sa, power, toughness, types, removeTypes, finalColors, keywords, removeKeywords, - hiddenKeywords, abilities, triggers, replacements, stAbs, timestamp); + hiddenKeywords, abilities, triggers, replacements, stAbs, timestamp, sa.getParam("Duration")); // give sVars if (!sVarsMap.isEmpty() ) { @@ -154,21 +151,6 @@ public class AnimateAllEffect extends AnimateEffectBase { } game.fireEvent(new GameEventCardStatsChanged(c)); - - if (!permanent) { - final GameCommand unanimate = new GameCommand() { - private static final long serialVersionUID = -5861759814760561373L; - - @Override - public void run() { - doUnanimate(c, timestamp); - - game.fireEvent(new GameEventCardStatsChanged(c)); - } - }; - - addUntilCommand(sa, unanimate); - } } } diff --git a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java index 6c773890214..b0a255becee 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java @@ -26,16 +26,17 @@ public class AnimateEffect extends AnimateEffectBase { @Override public void resolve(final SpellAbility sa) { final Card source = sa.getHostCard(); + String duration = sa.getParam("Duration"); String animateRemembered = null; String animateImprinted = null; //if host is not on the battlefield don't apply - if (("UntilHostLeavesPlay".equals(sa.getParam("Duration")) || "UntilLoseControlOfHost".equals(sa.getParam("Duration"))) + if (("UntilHostLeavesPlay".equals(duration) || "UntilLoseControlOfHost".equals(duration)) && !source.isInPlay()) { return; } - if ("UntilLoseControlOfHost".equals(sa.getParam("Duration")) && source.getController() != sa.getActivatingPlayer()) { + if ("UntilLoseControlOfHost".equals(duration) && source.getController() != sa.getActivatingPlayer()) { return; } @@ -175,7 +176,7 @@ public class AnimateEffect extends AnimateEffectBase { doAnimate(c, sa, power, toughness, types, removeTypes, finalColors, keywords, removeKeywords, hiddenKeywords, - abilities, triggers, replacements, stAbs, timestamp); + abilities, triggers, replacements, stAbs, timestamp, duration); if (sa.hasParam("Name")) { c.addChangedName(sa.getParam("Name"), false, timestamp, 0); diff --git a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java index a9acad609de..c936cd5ca46 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffectBase.java @@ -49,7 +49,7 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect { final CardType addType, final CardType removeType, final ColorSet colors, final List keywords, final List removeKeywords, final List hiddenKeywords, List abilities, final List triggers, final List replacements, final List stAbs, - final long timestamp) { + final long timestamp, final String duration) { final Card source = sa.getHostCard(); final Game game = source.getGame(); @@ -185,8 +185,8 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect { addedStaticAbilities, removeAll, removeNonManaAbilities, timestamp, 0); } - if (!"Permanent".equals(sa.getParam("Duration"))) { - if ("UntilControllerNextUntap".equals(sa.getParam("Duration"))) { + if (!"Permanent".equals(duration)) { + if ("UntilControllerNextUntap".equals(duration)) { game.getUntap().addUntil(c.getController(), unanimate); } else { addUntilCommand(sa, unanimate); diff --git a/forge-game/src/main/java/forge/game/card/CardDamageHistory.java b/forge-game/src/main/java/forge/game/card/CardDamageHistory.java index 04e9fcf00de..a38ef9c33c4 100644 --- a/forge-game/src/main/java/forge/game/card/CardDamageHistory.java +++ b/forge-game/src/main/java/forge/game/card/CardDamageHistory.java @@ -247,6 +247,9 @@ public class CardDamageHistory { * @param player */ public void registerDamage(int damage, boolean isCombat, Card sourceLKI, GameEntity target, Map lkiCache) { + if (damage <= 0) { + return; + } damagedThisGame.add(target); hasdealtDamagetoAny = true; if (isCombat && target instanceof Player) { diff --git a/forge-game/src/main/java/forge/game/card/CardDamageMap.java b/forge-game/src/main/java/forge/game/card/CardDamageMap.java index f3b977f987e..128ef62066f 100644 --- a/forge-game/src/main/java/forge/game/card/CardDamageMap.java +++ b/forge-game/src/main/java/forge/game/card/CardDamageMap.java @@ -113,6 +113,9 @@ public class CardDamageMap extends ForwardingTable { for (Integer i : this.column(damaged.getKey()).values()) { sum += i; } + if (sum == 0) { + continue; + } int excess = sum - (damaged.getKey().hasBeenDealtDeathtouchDamage() ? 1 : damaged.getValue()); diff --git a/forge-gui/res/cardsfolder/g/grow_from_the_ashes.txt b/forge-gui/res/cardsfolder/g/grow_from_the_ashes.txt index 3268c3972bf..73358cd989e 100644 --- a/forge-gui/res/cardsfolder/g/grow_from_the_ashes.txt +++ b/forge-gui/res/cardsfolder/g/grow_from_the_ashes.txt @@ -2,6 +2,6 @@ Name:Grow from the Ashes ManaCost:2 G Types:Sorcery K:Kicker:2 -A:SP$ ChangeZone | Cost$ 2 G | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ X | Mandatory$ True | SpellDescription$ Search your library for a basic land card, put it onto the battlefield, then shuffle. If this spell was kicked, instead search your library for two basic land cards, put them onto the battlefield, then shuffle. +A:SP$ ChangeZone | Cost$ 2 G | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ X | SpellDescription$ Search your library for a basic land card, put it onto the battlefield, then shuffle. If this spell was kicked, instead search your library for two basic land cards, put them onto the battlefield, then shuffle. SVar:X:Count$Kicked.2.1 Oracle:Kicker {2} (You may pay an additional {2} as you cast this spell.)\nSearch your library for a basic land card, put it onto the battlefield, then shuffle. If this spell was kicked, instead search your library for two basic land cards, put them onto the battlefield, then shuffle. diff --git a/forge-gui/res/cardsfolder/h/harvest_season.txt b/forge-gui/res/cardsfolder/h/harvest_season.txt index 4c36f9419a3..c8578e4fad6 100644 --- a/forge-gui/res/cardsfolder/h/harvest_season.txt +++ b/forge-gui/res/cardsfolder/h/harvest_season.txt @@ -3,5 +3,4 @@ ManaCost:2 G Types:Sorcery A:SP$ ChangeZone | Cost$ 2 G | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ X | Tapped$ True | SpellDescription$ Search your library for up to X basic land cards, where X is the number of tapped creatures you control, put those cards onto the battlefield tapped, then shuffle. SVar:X:Count$Valid Creature.tapped+YouCtrl -SVar:NeedsToPlay:Creature.tapped+YouCtrl Oracle:Search your library for up to X basic land cards, where X is the number of tapped creatures you control, put those cards onto the battlefield tapped, then shuffle. diff --git a/forge-gui/res/cardsfolder/i/insidious_dreams.txt b/forge-gui/res/cardsfolder/i/insidious_dreams.txt index 844d5553050..07b630d560e 100644 --- a/forge-gui/res/cardsfolder/i/insidious_dreams.txt +++ b/forge-gui/res/cardsfolder/i/insidious_dreams.txt @@ -1,7 +1,7 @@ Name:Insidious Dreams ManaCost:3 B Types:Instant -A:SP$ ChangeZone | Cost$ 3 B Discard | Origin$ Library | Destination$ Library | ChangeType$ Card | ChangeNum$ X | LibraryPosition$ 0 | SpellDescription$ Search your library for X cards, then shuffle and put those cards on top in any order. +A:SP$ ChangeZone | Cost$ 3 B Discard | Origin$ Library | Destination$ Library | ChangeType$ Card | ChangeNum$ X | LibraryPosition$ 0 | Mandatory$ True | SpellDescription$ Search your library for X cards, then shuffle and put those cards on top in any order. SVar:X:Count$xPaid AI:RemoveDeck:All Oracle:As an additional cost to cast this spell, discard X cards.\nSearch your library for X cards, then shuffle and put those cards on top in any order. diff --git a/forge-gui/res/cardsfolder/j/jaheiras_respite.txt b/forge-gui/res/cardsfolder/j/jaheiras_respite.txt index e5dfe1645bb..929ef0dc8a7 100644 --- a/forge-gui/res/cardsfolder/j/jaheiras_respite.txt +++ b/forge-gui/res/cardsfolder/j/jaheiras_respite.txt @@ -1,7 +1,7 @@ Name:Jaheira's Respite ManaCost:4 G Types:Instant -A:SP$ ChangeZone | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ X | AILogic$ Fog | Tapped$ True | SubAbility$ DBFog | SpellDescription$ Search your library for up to X basic land cards, where X is the number of creatures attacking you, put those cards onto the battlefield tapped, then shuffle. Prevent all combat damage that would be dealt this turn. +A:SP$ ChangeZone | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | ChangeNum$ X | Tapped$ True | SubAbility$ DBFog | SpellDescription$ Search your library for up to X basic land cards, where X is the number of creatures attacking you, put those cards onto the battlefield tapped, then shuffle. Prevent all combat damage that would be dealt this turn. SVar:X:Count$Valid Creature.attackingYou SVar:DBFog:DB$ Fog Oracle:Search your library for up to X basic land cards, where X is the number of creatures attacking you, put those cards onto the battlefield tapped, then shuffle.\nPrevent all combat damage that would be dealt this turn.