[NEC] fixed Kotori, Pilot Prodigy's granted crew ability not animating vehicles (fixes #8713)

This commit is contained in:
Evan Kranzler 2022-02-18 22:22:44 -05:00
parent 4c32272505
commit 8040e7d1e8
2 changed files with 60 additions and 32 deletions

View file

@ -1247,15 +1247,18 @@ public class ContinuousEffects implements Serializable {
}
private boolean isAbilityStillExists(final Game game, final Ability ability, ContinuousEffect effect) {
final Card card = game.getPermanentOrLKIBattlefield(ability.getSourceId());
if (!(effect instanceof BecomesFaceDownCreatureEffect)
&& (effect != null && !effect.getDuration().equals(Duration.Custom))) { // Custom effects do not depend on the creating permanent
if (card != null) {
return card.hasAbility(ability, game);
}
switch (effect.getDuration()) { // effects with fixed duration don't need an object with the source ability (e.g. a silence cast with isochronic Scepter has no more a card object
case EndOfCombat:
case EndOfGame:
case EndOfStep:
case EndOfTurn:
case OneUse:
case Custom: // custom duration means the effect ends itself if needed
return true;
}
return true;
final Card card = game.getPermanentOrLKIBattlefield(ability.getSourceId());
return effect instanceof BecomesFaceDownCreatureEffect
|| effect == null || card == null || card.hasAbility(ability, game);
}
public Set<Ability> getLayeredEffectAbilities(ContinuousEffect effect) {