[ZNR] Implemented Grakmaw, Skyclave Ravager

This commit is contained in:
Evan Kranzler 2020-09-12 18:20:49 -04:00
parent 06d0ac0974
commit 3b52b4b833
3 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,104 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.GrakmawSkyclaveRavagerToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GrakmawSkyclaveRavager extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("another creature you control");
static {
filter.add(AnotherPredicate.instance);
filter.add(new CounterPredicate(CounterType.P1P1));
}
public GrakmawSkyclaveRavager(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HYDRA);
this.subtype.add(SubType.HORROR);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Grakmaw, Skyclave Ravager enters the battlefield with three +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)),
"with three +1/+1 counters on it"
));
// Whenever another creature you control dies, if it had a +1/+1 counter on it, put a +1/+1 counter on Grakmaw.
this.addAbility(new DiesCreatureTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance())
.setText("if it had a +1/+1 counter on it, put a +1/+1 counter on {this}"),
false, filter
));
// When Grakmaw dies, create an X/X black and green Hydra creature token, where X is the number of +1/+1 counters on Grakmaw.
this.addAbility(new DiesTriggeredAbility(new GrakmawSkyclaveRavagerEffect()));
}
private GrakmawSkyclaveRavager(final GrakmawSkyclaveRavager card) {
super(card);
}
@Override
public GrakmawSkyclaveRavager copy() {
return new GrakmawSkyclaveRavager(this);
}
}
class GrakmawSkyclaveRavagerEffect extends OneShotEffect {
GrakmawSkyclaveRavagerEffect() {
super(Outcome.Benefit);
staticText = "create an X/X black and green Hydra creature token, " +
"where X is the number of +1/+1 counters on {this}";
}
private GrakmawSkyclaveRavagerEffect(final GrakmawSkyclaveRavagerEffect effect) {
super(effect);
}
@Override
public GrakmawSkyclaveRavagerEffect copy() {
return new GrakmawSkyclaveRavagerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int counters = 0;
Permanent permanent = source.getSourcePermanentOrLKI(game);
if (permanent != null) {
counters = permanent.getCounters(game).getCount(CounterType.P1P1);
}
return new GrakmawSkyclaveRavagerToken(counters).putOntoBattlefield(
1, game, source.getSourceId(), source.getControllerId()
);
}
}

View file

@ -189,6 +189,7 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Glasspool Shore", 60, Rarity.RARE, mage.cards.g.GlasspoolShore.class));
cards.add(new SetCardInfo("Gnarlid Colony", 185, Rarity.COMMON, mage.cards.g.GnarlidColony.class));
cards.add(new SetCardInfo("Goma Fada Vanguard", 141, Rarity.UNCOMMON, mage.cards.g.GomaFadaVanguard.class));
cards.add(new SetCardInfo("Grakmaw, Skyclave Ravager", 223, Rarity.RARE, mage.cards.g.GrakmawSkyclaveRavager.class));
cards.add(new SetCardInfo("Grimclimb Pathway", 259, Rarity.RARE, mage.cards.g.GrimclimbPathway.class));
cards.add(new SetCardInfo("Grotag Bug-Catcher", 142, Rarity.COMMON, mage.cards.g.GrotagBugCatcher.class));
cards.add(new SetCardInfo("Grotag Night-Runner", 143, Rarity.UNCOMMON, mage.cards.g.GrotagNightRunner.class));

View file

@ -0,0 +1,29 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author TheElk801
*/
public final class GrakmawSkyclaveRavagerToken extends TokenImpl {
public GrakmawSkyclaveRavagerToken(int xValue) {
super("Hydra", "X/X black and green Hydra creature token");
cardType.add(CardType.CREATURE);
color.setBlack(true);
color.setGreen(true);
subtype.add(SubType.HYDRA);
power = new MageInt(xValue);
toughness = new MageInt(xValue);
}
private GrakmawSkyclaveRavagerToken(final GrakmawSkyclaveRavagerToken token) {
super(token);
}
public GrakmawSkyclaveRavagerToken copy() {
return new GrakmawSkyclaveRavagerToken(this);
}
}