[STX] fixed Hall of Oracles third ability activation condition

This commit is contained in:
Evan Kranzler 2021-05-06 21:04:09 -04:00
parent 6788a4c930
commit 4711aa0ff3

View file

@ -17,11 +17,9 @@ import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.SpellsCastWatcher;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
@ -68,15 +66,10 @@ enum HallOfOraclesCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class);
if (watcher == null) {
return false;
}
List<Spell> spells = watcher.getSpellsCastThisTurn(source.getControllerId());
return spells != null && spells
return watcher != null
&& watcher.getSpellsCastThisTurn(source.getControllerId())
.stream()
.filter(Objects::nonNull)
.filter(MageObject::isInstantOrSorcery)
.map(Spell::getSourceId)
.anyMatch(source.getSourceId()::equals);
.anyMatch(MageObject::isInstantOrSorcery);
}
}