mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[MSC] Implement Mister Fantastic
This commit is contained in:
parent
ff4470e681
commit
b50b14ba96
6 changed files with 134 additions and 105 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.game.Game;
|
||||
import mage.watchers.common.SpellsCastWatcher;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum CastNoncreatureSpellThisTurnCondition implements Condition {
|
||||
instance;
|
||||
private static final Hint hint = new ConditionHint(instance);
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game
|
||||
.getState()
|
||||
.getWatcher(SpellsCastWatcher.class)
|
||||
.getSpellsCastThisTurn(source.getControllerId())
|
||||
.stream()
|
||||
.anyMatch(spell -> !spell.isCreature(game));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you've cast a noncreature spell this turn";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue