[ZNR] Implemented Moss-Pit Skeleton

This commit is contained in:
Evan Kranzler 2020-09-09 16:12:25 -04:00
parent 41ccd409ce
commit de8f89e20f
2 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,103 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutOnLibrarySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MossPitSkeleton extends CardImpl {
public MossPitSkeleton(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}");
this.subtype.add(SubType.PLANT);
this.subtype.add(SubType.SKELETON);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Kicker {3}
this.addAbility(new KickerAbility(new ManaCostsImpl<>("{3}")));
// If Moss-Pit Skeleton was kicked, it enters the battlefield with three +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), KickedCondition.instance,
"If {this} was kicked, it enters the battlefield with three +1/+1 counters on it.", ""
));
// Whenever one or more +1/+1 counters are put on a creature you control, if Moss-Pit Skeleton is in your graveyard, you may put Moss-Pit Skeleton on top of your library.
this.addAbility(new MossPitSkeletonTriggeredAbility());
}
private MossPitSkeleton(final MossPitSkeleton card) {
super(card);
}
@Override
public MossPitSkeleton copy() {
return new MossPitSkeleton(this);
}
}
class MossPitSkeletonTriggeredAbility extends TriggeredAbilityImpl {
MossPitSkeletonTriggeredAbility() {
super(Zone.GRAVEYARD, new PutOnLibrarySourceEffect(true), true);
}
MossPitSkeletonTriggeredAbility(final MossPitSkeletonTriggeredAbility ability) {
super(ability);
}
@Override
public MossPitSkeletonTriggeredAbility copy() {
return new MossPitSkeletonTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COUNTERS_ADDED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getData().equals(CounterType.P1P1.getName())) {
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (permanent == null) {
permanent = game.getPermanentEntering(event.getTargetId());
}
return (permanent != null
&& permanent.isCreature()
&& permanent.isControlledBy(this.getControllerId()));
}
return false;
}
@Override
public boolean checkInterveningIfClause(Game game) {
return game.getState().getZone(getSourceId()) == Zone.GRAVEYARD;
}
@Override
public String getRule() {
return "Whenever one or more +1/+1 counters are put on a creature you control, " +
"if {this} is in your graveyard, you may put {this} on top of your library.";
}
}

View file

@ -239,6 +239,7 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Mind Carver", 113, Rarity.UNCOMMON, mage.cards.m.MindCarver.class));
cards.add(new SetCardInfo("Mind Drain", 114, Rarity.COMMON, mage.cards.m.MindDrain.class));
cards.add(new SetCardInfo("Molten Blast", 149, Rarity.COMMON, mage.cards.m.MoltenBlast.class));
cards.add(new SetCardInfo("Moss-Pit Skeleton", 228, Rarity.UNCOMMON, mage.cards.m.MossPitSkeleton.class));
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Murasa Brute", 195, Rarity.COMMON, mage.cards.m.MurasaBrute.class));
cards.add(new SetCardInfo("Murasa Rootgrazer", 229, Rarity.UNCOMMON, mage.cards.m.MurasaRootgrazer.class));