Implemented Syr Konrad, the Grim

This commit is contained in:
Evan Kranzler 2019-09-07 21:22:37 -04:00
parent 7e6e7c6b90
commit 3391ebf0bc
2 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,98 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamagePlayersEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveEachPlayerEffect;
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 mage.game.events.ZoneChangeEvent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SyrKonradTheGrim extends CardImpl {
public SyrKonradTheGrim(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Whenever another creature dies, or a creature card is put into a graveyard from anywhere other than the battlefield, or a creature card leaves your graveyard, Syr Konrad, the Grim deals 1 damage to each opponent.
this.addAbility(new SyrKonradTheGrimTriggeredAbility());
// {1}{B}: Each player puts the top card of their library into their graveyard.
this.addAbility(new SimpleActivatedAbility(new PutTopCardOfLibraryIntoGraveEachPlayerEffect(
1, TargetController.ANY
), new ManaCostsImpl("{1}{B}")));
}
private SyrKonradTheGrim(final SyrKonradTheGrim card) {
super(card);
}
@Override
public SyrKonradTheGrim copy() {
return new SyrKonradTheGrim(this);
}
}
class SyrKonradTheGrimTriggeredAbility extends TriggeredAbilityImpl {
SyrKonradTheGrimTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT));
}
private SyrKonradTheGrimTriggeredAbility(final SyrKonradTheGrimTriggeredAbility ability) {
super(ability);
}
@Override
public SyrKonradTheGrimTriggeredAbility copy() {
return new SyrKonradTheGrimTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()
&& zEvent.getTarget() != null
&& !zEvent.getTargetId().equals(this.getSourceId())
&& zEvent.getTarget().isCreature()) {
return true;
}
Card card = game.getCard(zEvent.getTargetId());
if (card == null || !card.isCreature()) {
return false;
}
if (zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getFromZone() != Zone.BATTLEFIELD) {
return true;
}
return zEvent.getFromZone() == Zone.GRAVEYARD;
}
@Override
public String getRule() {
return "Whenever another creature dies, or a creature card is put into a graveyard " +
"from anywhere other than the battlefield, or a creature card leaves your graveyard, " +
"{this} deals 1 damage to each opponent.";
}
}

View file

@ -81,6 +81,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Steelbane Hydra", 322, Rarity.RARE, mage.cards.s.SteelbaneHydra.class)); cards.add(new SetCardInfo("Steelbane Hydra", 322, Rarity.RARE, mage.cards.s.SteelbaneHydra.class));
cards.add(new SetCardInfo("Steelclaw Lance", 202, Rarity.UNCOMMON, mage.cards.s.SteelclawLance.class)); cards.add(new SetCardInfo("Steelclaw Lance", 202, Rarity.UNCOMMON, mage.cards.s.SteelclawLance.class));
cards.add(new SetCardInfo("Syr Gwyn, Hero of Ashvale", 330, Rarity.MYTHIC, mage.cards.s.SyrGwynHeroOfAshvale.class)); cards.add(new SetCardInfo("Syr Gwyn, Hero of Ashvale", 330, Rarity.MYTHIC, mage.cards.s.SyrGwynHeroOfAshvale.class));
cards.add(new SetCardInfo("Syr Konrad, the Grim", 107, Rarity.UNCOMMON, mage.cards.s.SyrKonradTheGrim.class));
cards.add(new SetCardInfo("Taste of Death", 320, Rarity.RARE, mage.cards.t.TasteOfDeath.class)); cards.add(new SetCardInfo("Taste of Death", 320, Rarity.RARE, mage.cards.t.TasteOfDeath.class));
cards.add(new SetCardInfo("The Circle of Loyalty", 9, Rarity.MYTHIC, mage.cards.t.TheCircleOfLoyalty.class)); cards.add(new SetCardInfo("The Circle of Loyalty", 9, Rarity.MYTHIC, mage.cards.t.TheCircleOfLoyalty.class));
cards.add(new SetCardInfo("Thorn Mammoth", 323, Rarity.RARE, mage.cards.t.ThornMammoth.class)); cards.add(new SetCardInfo("Thorn Mammoth", 323, Rarity.RARE, mage.cards.t.ThornMammoth.class));