forked from External/mage
[SPM] Implement Carnage, Crimson Chaos
This commit is contained in:
parent
3c6a18f24e
commit
33c19fbc0f
3 changed files with 177 additions and 0 deletions
116
Mage.Sets/src/mage/cards/c/CarnageCrimsonChaos.java
Normal file
116
Mage.Sets/src/mage/cards/c/CarnageCrimsonChaos.java
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
package mage.cards.c;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.AttacksEachCombatStaticAbility;
|
||||||
|
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||||
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
|
import mage.abilities.keyword.MayhemAbility;
|
||||||
|
import mage.abilities.keyword.TrampleAbility;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jmlundeen
|
||||||
|
*/
|
||||||
|
public final class CarnageCrimsonChaos extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterCard("creature card with mana value 3 or less");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ManaValuePredicate(ComparisonType.OR_LESS, 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
public CarnageCrimsonChaos(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{R}");
|
||||||
|
|
||||||
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
|
this.subtype.add(SubType.SYMBIOTE);
|
||||||
|
this.subtype.add(SubType.VILLAIN);
|
||||||
|
this.power = new MageInt(4);
|
||||||
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
|
// Trample
|
||||||
|
this.addAbility(TrampleAbility.getInstance());
|
||||||
|
|
||||||
|
// When Carnage enters, return target creature card with mana value 3 or less from your graveyard to the battlefield. It gains "This creature attacks each combat if able" and "When this creature deals combat damage to a player, sacrifice it."
|
||||||
|
Ability ability = new EntersBattlefieldTriggeredAbility(new CarnageCrimsonChaosReturnEffect());
|
||||||
|
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||||
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
|
||||||
|
// Mayhem {B}{R}
|
||||||
|
this.addAbility(new MayhemAbility(this, "{B}{R}"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private CarnageCrimsonChaos(final CarnageCrimsonChaos card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CarnageCrimsonChaos copy() {
|
||||||
|
return new CarnageCrimsonChaos(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CarnageCrimsonChaosReturnEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public CarnageCrimsonChaosReturnEffect() {
|
||||||
|
super(Outcome.PutCreatureInPlay);
|
||||||
|
this.staticText = "return target creature card with mana value 3 or less from your graveyard to the battlefield. It gains \"This creature attacks each combat if able\" and \"When this creature deals combat damage to a player, sacrifice it.\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CarnageCrimsonChaosReturnEffect(final CarnageCrimsonChaosReturnEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CarnageCrimsonChaosReturnEffect copy() {
|
||||||
|
return new CarnageCrimsonChaosReturnEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Card card = game.getCard(source.getFirstTarget());
|
||||||
|
if (card == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
|
Permanent permanent = CardUtil.getPermanentFromCardPutToBattlefield(card, game);
|
||||||
|
if (permanent == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Ability attacksEachTurnAbility = new AttacksEachCombatStaticAbility();
|
||||||
|
Ability damageTriggerAbility = new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeSourceEffect());
|
||||||
|
ContinuousEffect effectOne = new GainAbilityTargetEffect(attacksEachTurnAbility, Duration.WhileOnBattlefield);
|
||||||
|
effectOne.setTargetPointer(new FixedTarget(permanent, game));
|
||||||
|
ContinuousEffect effectTwo = new GainAbilityTargetEffect(damageTriggerAbility, Duration.WhileOnBattlefield);
|
||||||
|
effectTwo.setTargetPointer(new FixedTarget(permanent, game));
|
||||||
|
game.addEffect(effectOne, source);
|
||||||
|
game.addEffect(effectTwo, source);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -25,6 +25,7 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Anti-Venom, Horrifying Healer", 244, Rarity.MYTHIC, mage.cards.a.AntiVenomHorrifyingHealer.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Anti-Venom, Horrifying Healer", 244, Rarity.MYTHIC, mage.cards.a.AntiVenomHorrifyingHealer.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Aunt May", 3, Rarity.UNCOMMON, mage.cards.a.AuntMay.class));
|
cards.add(new SetCardInfo("Aunt May", 3, Rarity.UNCOMMON, mage.cards.a.AuntMay.class));
|
||||||
cards.add(new SetCardInfo("Beetle, Legacy Criminal", 26, Rarity.COMMON, mage.cards.b.BeetleLegacyCriminal.class));
|
cards.add(new SetCardInfo("Beetle, Legacy Criminal", 26, Rarity.COMMON, mage.cards.b.BeetleLegacyCriminal.class));
|
||||||
|
cards.add(new SetCardInfo("Carnage, Crimson Chaos", 9999, Rarity.RARE, mage.cards.c.CarnageCrimsonChaos.class));
|
||||||
cards.add(new SetCardInfo("Daily Bugle Reporters", 6, Rarity.COMMON, mage.cards.d.DailyBugleReporters.class));
|
cards.add(new SetCardInfo("Daily Bugle Reporters", 6, Rarity.COMMON, mage.cards.d.DailyBugleReporters.class));
|
||||||
cards.add(new SetCardInfo("Doc Ock's Henchmen", 30, Rarity.COMMON, mage.cards.d.DocOcksHenchmen.class));
|
cards.add(new SetCardInfo("Doc Ock's Henchmen", 30, Rarity.COMMON, mage.cards.d.DocOcksHenchmen.class));
|
||||||
cards.add(new SetCardInfo("Doc Ock, Sinister Scientist", 29, Rarity.COMMON, mage.cards.d.DocOckSinisterScientist.class));
|
cards.add(new SetCardInfo("Doc Ock, Sinister Scientist", 29, Rarity.COMMON, mage.cards.d.DocOckSinisterScientist.class));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package org.mage.test.cards.single.spm;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jmlundeen
|
||||||
|
*/
|
||||||
|
public class CarnageCrimsonChaosTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
/*
|
||||||
|
Carnage, Crimson Chaos
|
||||||
|
{2}{B}{R}
|
||||||
|
Legendary Creature - Symbiote Villain
|
||||||
|
Trample
|
||||||
|
When Carnage enters, return target creature card with mana value 3 or less from your graveyard to the battlefield. It gains "This creature attacks each combat if able" and "When this creature deals combat damage to a player, sacrifice it."
|
||||||
|
Mayhem {B}{R}
|
||||||
|
4/3
|
||||||
|
*/
|
||||||
|
private static final String carnageCrimsonChaos = "Carnage, Crimson Chaos";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Concordant Crossroads
|
||||||
|
{G}
|
||||||
|
World Enchantment
|
||||||
|
All creatures have haste.
|
||||||
|
*/
|
||||||
|
private static final String concordantCrossroads = "Concordant Crossroads";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bear Cub
|
||||||
|
{1}{G}
|
||||||
|
Creature - Bear
|
||||||
|
|
||||||
|
2/2
|
||||||
|
*/
|
||||||
|
private static final String bearCub = "Bear Cub";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCarnageCrimsonChaos() {
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, concordantCrossroads);
|
||||||
|
addCard(Zone.HAND, playerA, carnageCrimsonChaos);
|
||||||
|
addCard(Zone.GRAVEYARD, playerA, bearCub);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Badlands", 4);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, carnageCrimsonChaos);
|
||||||
|
addTarget(playerA, bearCub);
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertGraveyardCount(playerA, bearCub, 1);
|
||||||
|
assertLife(playerB, 20 - 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue