From f15b5ba4f98806af4d42a06d05aa0e0bbe3ebef2 Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 10 Dec 2016 18:59:59 +0000 Subject: [PATCH] - Additional changes to Card and Spell to support the visual flickering-free Bestow check --- .../src/main/java/forge/game/card/Card.java | 16 ++++++++++++---- .../main/java/forge/game/spellability/Spell.java | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 23440c46c7d..7ae884ca79a 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -6253,15 +6253,23 @@ public class Card extends GameEntity implements Comparable { } public final void animateBestow() { + animateBestow(true); + } + + public final void animateBestow(final boolean updateView) { bestowTimestamp = getGame().getNextTimestamp(); addChangedCardTypes(new CardType(Collections.singletonList("Aura")), - new CardType(Collections.singletonList("Creature")), false, false, false, true, bestowTimestamp, false); - addChangedCardKeywords(Collections.singletonList("Enchant creature"), new ArrayList(), false, bestowTimestamp, false); + new CardType(Collections.singletonList("Creature")), false, false, false, true, bestowTimestamp, updateView); + addChangedCardKeywords(Collections.singletonList("Enchant creature"), new ArrayList(), false, bestowTimestamp, updateView); } public final void unanimateBestow() { - removeChangedCardKeywords(bestowTimestamp, false); - removeChangedCardTypes(bestowTimestamp, false); + unanimateBestow(true); + } + + public final void unanimateBestow(final boolean updateView) { + removeChangedCardKeywords(bestowTimestamp, updateView); + removeChangedCardTypes(bestowTimestamp, updateView); bestowTimestamp = -1; } diff --git a/forge-game/src/main/java/forge/game/spellability/Spell.java b/forge-game/src/main/java/forge/game/spellability/Spell.java index b33909f01c5..4c3829ea2be 100644 --- a/forge-game/src/main/java/forge/game/spellability/Spell.java +++ b/forge-game/src/main/java/forge/game/spellability/Spell.java @@ -86,10 +86,10 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable // Rule 601.3: cast Bestow with Flash // for the check the card does need to be animated // otherwise the StaticAbility will not found them - card.animateBestow(); + card.animateBestow(false); // when animating and unanimating Bestow, do not update the view to prevent flickering game.getAction().checkStaticAbilities(false, Sets.newHashSet(card)); flash = card.hasKeyword("Flash"); - card.unanimateBestow(); + card.unanimateBestow(false); } if (!(card.isInstant() || activator.canCastSorcery() || flash