Fix Kaervek's Torch vs. multi-mode spells like Cryptic Command

This commit is contained in:
LoneFox 2015-06-18 21:40:38 +03:00
parent ee7cb581a2
commit f194af0321

View file

@ -97,13 +97,16 @@ class KaerveksTorchCostIncreaseEffect extends CostModificationEffectImpl {
public boolean applies(Ability abilityToModify, Ability source, Game game) { public boolean applies(Ability abilityToModify, Ability source, Game game) {
if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility)
{ {
for(Target target: abilityToModify.getTargets()) { for(UUID modeId: abilityToModify.getModes().getSelectedModes()) {
for(UUID id: target.getTargets()) { abilityToModify.getModes().setActiveMode(modeId);
if(id.equals(source.getSourceObject(game).getId())) { for(Target target: abilityToModify.getTargets()) {
return true; for(UUID id: target.getTargets()) {
if(id.equals(source.getSourceObject(game).getId())) {
return true;
}
} }
} }
} }
} }
return false; return false;
} }