forked from External/mage
[OTJ] Implement Wrangler of the Damned
This commit is contained in:
parent
b0f283c6f5
commit
93457c24ca
3 changed files with 85 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
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.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.SpellsCastWatcher;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public enum HaventCastSpellFromHandThisTurnCondition implements Condition {
|
||||
instance;
|
||||
|
||||
public static final Hint hint = new ConditionHint(instance, "No cast from hand this turn", null, "Have cast from hand this turn", null, true);
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getState()
|
||||
.getWatcher(SpellsCastWatcher.class)
|
||||
.getSpellsCastThisTurn(source.getControllerId())
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.noneMatch(spell -> Zone.HAND.equals(spell.getFromZone()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if you haven't cast a spell from hand this turn";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue