mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
Fixed Killian, Ink Duelist's cost reduction not applying for getPlayable (#7786)
* Fixed Killian, Ink Duelist's cost reduction not applying for getPlayable
This commit is contained in:
parent
de55367af4
commit
8826a8a543
1 changed files with 19 additions and 8 deletions
|
@ -69,19 +69,30 @@ class KillianInkDuelistEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
CardUtil.reduceCost(abilityToModify, 2);
|
||||
// Bug #7762: https://github.com/magefree/mage/issues/7762
|
||||
// Check possible targets for getPlayable
|
||||
if (game.inCheckPlayableState()) {
|
||||
if (CardUtil.getAllPossibleTargets(abilityToModify, game)
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.anyMatch(MageObject::isCreature)) {
|
||||
CardUtil.reduceCost(abilityToModify, 2);
|
||||
}
|
||||
// Check selected targets on actual cast
|
||||
} else if (CardUtil.getAllSelectedTargets(abilityToModify, game)
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.anyMatch(MageObject::isCreature)) {
|
||||
CardUtil.reduceCost(abilityToModify, 2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
return abilityToModify instanceof SpellAbility
|
||||
&& abilityToModify.isControlledBy(source.getControllerId())
|
||||
&& CardUtil
|
||||
.getAllSelectedTargets(abilityToModify, game)
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.anyMatch(MageObject::isCreature);
|
||||
&& abilityToModify.isControlledBy(source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue