* Fervent Champion - Fixed that it's possible to equip the Champion also without having the regular mana (#6698).

This commit is contained in:
LevelX2 2020-07-27 22:27:11 +02:00
parent 6e68e038b6
commit 82dfd76ee3
4 changed files with 58 additions and 13 deletions

View file

@ -90,14 +90,22 @@ class FerventChampionEffect extends CostModificationEffectImpl {
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
return abilityToModify instanceof EquipAbility
&& abilityToModify.isControlledBy(source.getControllerId())
&& abilityToModify
if (abilityToModify instanceof EquipAbility
&& abilityToModify.isControlledBy(source.getControllerId())) {
if (game != null && game.inCheckPlayableState()) {
return !abilityToModify.getTargets().isEmpty() &&
abilityToModify.getTargets().get(0).canTarget(source.getSourceId(), abilityToModify, game);
} else {
return abilityToModify
.getTargets()
.stream()
.map(Target::getTargets)
.flatMap(Collection::stream)
.anyMatch(source.getSourceId()::equals);
.anyMatch(source.getSourceId()::equals);
}
}
return false;
}
@Override

View file

@ -41,7 +41,7 @@ public final class SwordOfFireAndIce extends CardImpl {
// Whenever equipped creature deals combat damage to a player, Sword of Fire
// and Ice deals 2 damage to any target and you draw a card.
this.addAbility(new SwordOfFireAndIceAbility());
// Equip
// Equip {2}
this.addAbility(new EquipAbility(Outcome.Benefit, new GenericManaCost(2)));
}