* Ravnica: City of Guilds - Added 3 cards.

This commit is contained in:
LevelX2 2017-05-07 10:46:01 +02:00
parent a587119644
commit 757c01343f
7 changed files with 369 additions and 3 deletions

View file

@ -39,6 +39,8 @@ public final class StaticFilters {
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_SLIVERS = new FilterCreaturePermanent("Sliver", "Sliver creatures");
public static final FilterCreatureSpell FILTER_SPELL_A_CREATURE = new FilterCreatureSpell("a creature spell");
public static final FilterSpell FILTER_SPELL_NON_CREATURE
= (FilterSpell) new FilterSpell("noncreature spell").add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
public static final FilterPermanent FILTER_CREATURE_TOKENS = new FilterCreaturePermanent("creature tokens");

View file

@ -12,6 +12,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -25,6 +26,7 @@ import mage.watchers.Watcher;
public class SpellsCastWatcher extends Watcher {
private final HashMap<UUID, List<Spell>> spellsCast = new HashMap<>();
private int nonCreatureSpells;
public SpellsCastWatcher() {
super(SpellsCastWatcher.class.getSimpleName(), WatcherScope.GAME);
@ -59,6 +61,9 @@ public class SpellsCastWatcher extends Watcher {
spells = spellsCast.get(spell.getControllerId());
}
spells.add(spell.copy()); // copy needed because attributes like color could be changed later
if (StaticFilters.FILTER_SPELL_NON_CREATURE.match(spell, game)) {
nonCreatureSpells++;
}
}
}
}
@ -66,10 +71,15 @@ public class SpellsCastWatcher extends Watcher {
@Override
public void reset() {
super.reset();
nonCreatureSpells = 0;
spellsCast.clear();
}
public List<Spell> getSpellsCastThisTurn(UUID playerId) {
return spellsCast.get(playerId);
}
public int getNumberOfNonCreatureSpells() {
return nonCreatureSpells;
}
}