- 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() {
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<String>(), false, bestowTimestamp, false);
new CardType(Collections.singletonList("Creature")), false, false, false, true, bestowTimestamp, updateView);
addChangedCardKeywords(Collections.singletonList("Enchant creature"), new ArrayList<String>(), 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;
}

View File

@@ -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