mirror of
https://github.com/correl/mage.git
synced 2025-04-12 17:00:08 -09:00
[MID] Implemented Corpse Cobble
This commit is contained in:
parent
2df79a95dd
commit
bd67b7af22
3 changed files with 112 additions and 0 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/game/permanent/token
82
Mage.Sets/src/mage/cards/c/CorpseCobble.java
Normal file
82
Mage.Sets/src/mage/cards/c/CorpseCobble.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.ZombieMenaceToken;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class CorpseCobble extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter
|
||||
= new FilterControlledCreaturePermanent("any number of creatures");
|
||||
|
||||
public CorpseCobble(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{B}");
|
||||
|
||||
// As an additional cost to cast this spell, sacrifice any number of creatures.
|
||||
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, filter, true)));
|
||||
|
||||
// Create an X/X blue and black Zombie creature token with menace, where X is the total power of the sacrificed creatures.
|
||||
this.getSpellAbility().addEffect(new CorpseCobbleEffect());
|
||||
|
||||
// Flashback {3}{U}{B}
|
||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{U}{B}"), TimingRule.INSTANT));
|
||||
}
|
||||
|
||||
private CorpseCobble(final CorpseCobble card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorpseCobble copy() {
|
||||
return new CorpseCobble(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CorpseCobbleEffect extends OneShotEffect {
|
||||
|
||||
public CorpseCobbleEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
staticText = "Create an X/X blue and black Zombie creature token with menace, where X is the total power of the sacrificed creatures";
|
||||
}
|
||||
|
||||
private CorpseCobbleEffect(final CorpseCobbleEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorpseCobbleEffect copy() {
|
||||
return new CorpseCobbleEffect(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 ZombieMenaceToken(xValue).putOntoBattlefield(1, game, source, source.getControllerId());
|
||||
}
|
||||
}
|
|
@ -50,6 +50,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Clear Shot", 176, Rarity.UNCOMMON, mage.cards.c.ClearShot.class));
|
||||
cards.add(new SetCardInfo("Consider", 44, Rarity.COMMON, mage.cards.c.Consider.class));
|
||||
cards.add(new SetCardInfo("Contortionist Troupe", 178, Rarity.UNCOMMON, mage.cards.c.ContortionistTroupe.class));
|
||||
cards.add(new SetCardInfo("Corpse Cobble", 214, Rarity.UNCOMMON, mage.cards.c.CorpseCobble.class));
|
||||
cards.add(new SetCardInfo("Croaking Counterpart", 215, Rarity.RARE, mage.cards.c.CroakingCounterpart.class));
|
||||
cards.add(new SetCardInfo("Curse of Shaken Faith", 134, Rarity.RARE, mage.cards.c.CurseOfShakenFaith.class));
|
||||
cards.add(new SetCardInfo("Curse of Silence", 326, Rarity.RARE, mage.cards.c.CurseOfSilence.class));
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
public class ZombieMenaceToken extends TokenImpl {
|
||||
|
||||
public ZombieMenaceToken(int xValue) {
|
||||
super("Zombie", "X/X blue and black Zombie creature token with menace");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlue(true);
|
||||
color.setBlack(true);
|
||||
subtype.add(SubType.ZOMBIE);
|
||||
power = new MageInt(xValue);
|
||||
toughness = new MageInt(xValue);
|
||||
addAbility(new MenaceAbility());
|
||||
}
|
||||
|
||||
private ZombieMenaceToken(final ZombieMenaceToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZombieMenaceToken copy() {
|
||||
return new ZombieMenaceToken(this);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue