mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Additional changes to Card and Spell to support the visual flickering-free Bestow check
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user