[TDM] Focus the Mind and Sage of the Skies (#13524)

* [TDM] Implement Focus the Mind
* [TDM] Implement Sage of the Skies
* Extracted cast another spell this turn condition from Rally the Monastery
* Add condition to Rally the Monastery and Slick Sequence
This commit is contained in:
Jmlundeen 2025-04-09 13:16:48 -05:00 committed by GitHub
parent 0848382dcd
commit e552a54e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 152 additions and 116 deletions

View file

@ -0,0 +1,44 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.hint.ConditionHint;
import mage.abilities.hint.Hint;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.watchers.common.SpellsCastWatcher;
import java.util.List;
import java.util.Objects;
/**
* @author balazskristof, Jmlundeen
*/
public enum CastAnotherSpellThisTurnCondition implements Condition {
instance;
private final Hint hint = new ConditionHint(
this, "You've cast another spell this turn"
);
@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
.stream()
.filter(Objects::nonNull)
.anyMatch(spell -> !spell.getSourceId().equals(source.getSourceId()) || spell.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter());
}
public Hint getHint() {
return hint;
}
@Override
public String toString() {
return "you've cast another spell this turn";
}
}