mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 06:52:02 -08:00
[ORI] Added 5 red cards.
This commit is contained in:
parent
1acf0fa509
commit
0ef8fbf567
9 changed files with 493 additions and 75 deletions
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class SpellMasteryCondition implements Condition {
|
||||
|
||||
private static final FilterCard filter = new FilterCard();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
||||
}
|
||||
|
||||
private static SpellMasteryCondition fInstance = null;
|
||||
|
||||
public static SpellMasteryCondition getInstance() {
|
||||
if (fInstance == null) {
|
||||
fInstance = new SpellMasteryCondition();
|
||||
}
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
return player != null && player.getGraveyard().count(filter, game) >= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "there are two or more instant and/or sorcery cards in your graveyard";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue