fixed Rayami, First of the Fallen replacement effect not applying

This commit is contained in:
Evan Kranzler 2019-09-11 17:02:09 -04:00
parent a5fe53b2fc
commit 6417c0f244

View file

@ -18,6 +18,7 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken; import mage.game.permanent.PermanentToken;
import mage.players.Player; import mage.players.Player;
import java.util.Collection;
import java.util.UUID; import java.util.UUID;
/** /**
@ -76,25 +77,24 @@ class RayamiFirstOfTheFallenEffect extends ContinuousEffectImpl {
.stream() .stream()
.filter(Card::isCreature) .filter(Card::isCreature)
.filter(card -> card.getCounters(game).getCount(CounterType.BLOOD) > 0) .filter(card -> card.getCounters(game).getCount(CounterType.BLOOD) > 0)
.forEach(card -> { .map(card -> card.getAbilities(game))
card.getAbilities(game).stream().forEach(ability -> { .flatMap(Collection::stream)
if (ability instanceof FlyingAbility .forEach(ability -> {
|| ability instanceof FirstStrikeAbility if (ability instanceof FlyingAbility
|| ability instanceof DoubleStrikeAbility || ability instanceof FirstStrikeAbility
|| ability instanceof DeathtouchAbility || ability instanceof DoubleStrikeAbility
|| ability instanceof HasteAbility || ability instanceof DeathtouchAbility
|| ability instanceof HexproofAbility || ability instanceof HasteAbility
|| ability instanceof IndestructibleAbility || ability instanceof HexproofAbility
|| ability instanceof LifelinkAbility || ability instanceof IndestructibleAbility
|| ability instanceof MenaceAbility || ability instanceof LifelinkAbility
|| ability instanceof ReachAbility || ability instanceof MenaceAbility
|| ability instanceof TrampleAbility || ability instanceof ReachAbility
|| ability instanceof VigilanceAbility) { || ability instanceof TrampleAbility
sourcePermanent.addAbility(ability, source.getSourceId(), game); || ability instanceof VigilanceAbility
} else if (ability instanceof ProtectionAbility) { || ability instanceof ProtectionAbility) {
sourcePermanent.addAbility(ability, source.getSourceId(), game); sourcePermanent.addAbility(ability, source.getSourceId(), game);
} }
});
}); });
return true; return true;
} }
@ -108,7 +108,7 @@ class RayamiFirstOfTheFallenEffect extends ContinuousEffectImpl {
class RayamiFirstOfTheFallenReplacementEffect extends ReplacementEffectImpl { class RayamiFirstOfTheFallenReplacementEffect extends ReplacementEffectImpl {
RayamiFirstOfTheFallenReplacementEffect() { RayamiFirstOfTheFallenReplacementEffect() {
super(Duration.EndOfTurn, Outcome.Exile); super(Duration.WhileOnBattlefield, Outcome.Exile);
staticText = "If a nontoken creature would die, exile that card with a blood counter on it instead"; staticText = "If a nontoken creature would die, exile that card with a blood counter on it instead";
} }