- Additional changes to Card and Spell to support the visual flickering-free Bestow check

This commit is contained in:
Agetian
2016-12-10 18:59:59 +00:00
parent 86c30d0ffe
commit f15b5ba4f9
2 changed files with 14 additions and 6 deletions

View File

@@ -6253,15 +6253,23 @@ public class Card extends GameEntity implements Comparable<Card> {
} }
public final void animateBestow() { public final void animateBestow() {
animateBestow(true);
}
public final void animateBestow(final boolean updateView) {
bestowTimestamp = getGame().getNextTimestamp(); bestowTimestamp = getGame().getNextTimestamp();
addChangedCardTypes(new CardType(Collections.singletonList("Aura")), addChangedCardTypes(new CardType(Collections.singletonList("Aura")),
new CardType(Collections.singletonList("Creature")), false, false, false, true, bestowTimestamp, false); new CardType(Collections.singletonList("Creature")), false, false, false, true, bestowTimestamp, updateView);
addChangedCardKeywords(Collections.singletonList("Enchant creature"), new ArrayList<String>(), false, bestowTimestamp, false); addChangedCardKeywords(Collections.singletonList("Enchant creature"), new ArrayList<String>(), false, bestowTimestamp, updateView);
} }
public final void unanimateBestow() { public final void unanimateBestow() {
removeChangedCardKeywords(bestowTimestamp, false); unanimateBestow(true);
removeChangedCardTypes(bestowTimestamp, false); }
public final void unanimateBestow(final boolean updateView) {
removeChangedCardKeywords(bestowTimestamp, updateView);
removeChangedCardTypes(bestowTimestamp, updateView);
bestowTimestamp = -1; bestowTimestamp = -1;
} }

View File

@@ -86,10 +86,10 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
// Rule 601.3: cast Bestow with Flash // Rule 601.3: cast Bestow with Flash
// for the check the card does need to be animated // for the check the card does need to be animated
// otherwise the StaticAbility will not found them // 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)); game.getAction().checkStaticAbilities(false, Sets.newHashSet(card));
flash = card.hasKeyword("Flash"); flash = card.hasKeyword("Flash");
card.unanimateBestow(); card.unanimateBestow(false);
} }
if (!(card.isInstant() || activator.canCastSorcery() || flash if (!(card.isInstant() || activator.canCastSorcery() || flash