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) {
if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility)
{
for(Target target: abilityToModify.getTargets()) {
for(UUID id: target.getTargets()) {
if(id.equals(source.getSourceObject(game).getId())) {
return true;
for(UUID modeId: abilityToModify.getModes().getSelectedModes()) {
abilityToModify.getModes().setActiveMode(modeId);
for(Target target: abilityToModify.getTargets()) {
for(UUID id: target.getTargets()) {
if(id.equals(source.getSourceObject(game).getId())) {
return true;
}
}
}
}
}
}
return false;
}