Implemented Drannith Magistrate

This commit is contained in:
Evan Kranzler 2020-04-05 15:06:50 -04:00
parent 77ad5eab87
commit 9d75f29f3c
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DrannithMagistrate extends CardImpl {
public DrannithMagistrate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Your opponents can't cast spells from anywhere other than their hands.
this.addAbility(new SimpleStaticAbility(new DrannithMagistrateEffect()));
}
private DrannithMagistrate(final DrannithMagistrate card) {
super(card);
}
@Override
public DrannithMagistrate copy() {
return new DrannithMagistrate(this);
}
}
class DrannithMagistrateEffect extends ContinuousRuleModifyingEffectImpl {
DrannithMagistrateEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "Your opponents can't cast spells from anywhere other than their hands";
}
private DrannithMagistrateEffect(final DrannithMagistrateEffect effect) {
super(effect);
}
@Override
public DrannithMagistrateEffect copy() {
return new DrannithMagistrateEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.CAST_SPELL;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (!game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
return false;
}
Card card = game.getCard(event.getSourceId());
if (card == null) {
return false;
}
return game.getState().getZone(card.getId()) != Zone.HAND;
}
}

View file

@ -38,6 +38,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet {
cards.add(new SetCardInfo("Crystalline Giant", 234, Rarity.RARE, mage.cards.c.CrystallineGiant.class));
cards.add(new SetCardInfo("Dire Tactics", 183, Rarity.UNCOMMON, mage.cards.d.DireTactics.class));
cards.add(new SetCardInfo("Dirge Bat", 84, Rarity.RARE, mage.cards.d.DirgeBat.class));
cards.add(new SetCardInfo("Drannith Magistrate", 11, Rarity.RARE, mage.cards.d.DrannithMagistrate.class));
cards.add(new SetCardInfo("Drannith Stinger", 113, Rarity.COMMON, mage.cards.d.DrannithStinger.class));
cards.add(new SetCardInfo("Dreamtail Heron", 47, Rarity.COMMON, mage.cards.d.DreamtailHeron.class));
cards.add(new SetCardInfo("Essence Scatter", 49, Rarity.COMMON, mage.cards.e.EssenceScatter.class));