1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-02-19 11:07:01 +00:00

[VOW] Implemented Geralf, Visionary Stitcher

This commit is contained in:
Daniel Bomar 2021-10-31 09:09:04 -05:00
parent cedf99edfd
commit 0e2c58d35f
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,98 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.StitcherGeralfZombieToken;
/**
*
* @author weirddan455
*/
public final class GeralfVisionaryStitcher extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.ZOMBIE, "Zombies");
private static final FilterControlledCreaturePermanent filter2
= new FilterControlledCreaturePermanent("another nontoken creature");
static {
filter2.add(AnotherPredicate.instance);
filter2.add(TokenPredicate.FALSE);
}
public GeralfVisionaryStitcher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(4);
// Zombies you control have flying.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
// {U}, {T}, Sacrifice another nontoken creature: Create an X/X blue Zombie token, where X is the sacrificed creature's power.
Ability ability = new SimpleActivatedAbility(new GeralfVisionaryStitcherEffect(), new ManaCostsImpl<>("{U}"));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(filter2));
this.addAbility(ability);
}
private GeralfVisionaryStitcher(final GeralfVisionaryStitcher card) {
super(card);
}
@Override
public GeralfVisionaryStitcher copy() {
return new GeralfVisionaryStitcher(this);
}
}
class GeralfVisionaryStitcherEffect extends OneShotEffect {
public GeralfVisionaryStitcherEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "Create an X/X blue Zombie token, where X is the sacrificed creature's power";
}
private GeralfVisionaryStitcherEffect(final GeralfVisionaryStitcherEffect effect) {
super(effect);
}
@Override
public GeralfVisionaryStitcherEffect copy() {
return new GeralfVisionaryStitcherEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int xValue = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
for (Permanent permanent : ((SacrificeTargetCost) cost).getPermanents()) {
xValue += permanent.getPower().getValue();
}
}
}
return new StitcherGeralfZombieToken(xValue).putOntoBattlefield(1, game, source, source.getControllerId());
}
}

View file

@ -47,6 +47,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
cards.add(new SetCardInfo("Fell Stinger", 112, Rarity.UNCOMMON, mage.cards.f.FellStinger.class));
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Geistlight Snare", 60, Rarity.UNCOMMON, mage.cards.g.GeistlightSnare.class));
cards.add(new SetCardInfo("Geralf, Visionary Stitcher", 61, Rarity.RARE, mage.cards.g.GeralfVisionaryStitcher.class));
cards.add(new SetCardInfo("Gluttonous Guest", 114, Rarity.COMMON, mage.cards.g.GluttonousGuest.class));
cards.add(new SetCardInfo("Gnarled Grovestrider", 198, Rarity.UNCOMMON, mage.cards.g.GnarledGrovestrider.class));
cards.add(new SetCardInfo("Grolnok, the Omnivore", 238, Rarity.RARE, mage.cards.g.GrolnokTheOmnivore.class));