mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
[STX] fixed Hall of Oracles third ability activation condition
This commit is contained in:
parent
6788a4c930
commit
4711aa0ff3
1 changed files with 3 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue