forked from External/mage
[SPM] Electro, Assaulting Battery
This commit is contained in:
parent
86cd18beb9
commit
1a550b48d7
3 changed files with 160 additions and 0 deletions
93
Mage.Sets/src/mage/cards/e/ElectroAssaultingBattery.java
Normal file
93
Mage.Sets/src/mage/cards/e/ElectroAssaultingBattery.java
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.YouDontLoseManaEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.util.ManaUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jmlundeen
|
||||
*/
|
||||
public final class ElectroAssaultingBattery extends CardImpl {
|
||||
|
||||
public ElectroAssaultingBattery(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.VILLAIN);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// You don't lose unspent red mana as steps and phases end.
|
||||
this.addAbility(new SimpleStaticAbility(new YouDontLoseManaEffect(ManaType.RED)));
|
||||
|
||||
// Whenever you cast an instant or sorcery spell, add {R}.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new AddManaToManaPoolSourceControllerEffect(Mana.RedMana(1)), false));
|
||||
|
||||
// When Electro leaves the battlefield, you may pay x. When you do, he deals X damage to target player.
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new ElectroAssaultingBatteryEffect()));
|
||||
}
|
||||
|
||||
private ElectroAssaultingBattery(final ElectroAssaultingBattery card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectroAssaultingBattery copy() {
|
||||
return new ElectroAssaultingBattery(this);
|
||||
}
|
||||
}
|
||||
class ElectroAssaultingBatteryEffect extends OneShotEffect {
|
||||
|
||||
ElectroAssaultingBatteryEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "you may pay x. When you do, he deals X damage to target player";
|
||||
}
|
||||
|
||||
private ElectroAssaultingBatteryEffect(final ElectroAssaultingBatteryEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectroAssaultingBatteryEffect copy() {
|
||||
return new ElectroAssaultingBatteryEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
if (controller.chooseUse(outcome, "Pay x mana to deal x damage to target player?", source, game)) {
|
||||
TargetPlayer target = new TargetPlayer();
|
||||
target.chooseTarget(outcome, controller.getId(), source, game);
|
||||
int amount = ManaUtil.playerPaysXGenericMana(false, "Electro, Assaulting Battery", controller, source, game);
|
||||
Player targetOpponent = game.getPlayer(target.getFirstTarget());
|
||||
if (targetOpponent != null) {
|
||||
targetOpponent.damage(amount, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -46,6 +46,8 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Eddie Brock", 55, Rarity.MYTHIC, mage.cards.e.EddieBrock.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Eerie Gravestone", 163, Rarity.COMMON, mage.cards.e.EerieGravestone.class));
|
||||
cards.add(new SetCardInfo("Electro's Bolt", 77, Rarity.COMMON, mage.cards.e.ElectrosBolt.class));
|
||||
cards.add(new SetCardInfo("Electro, Assaulting Battery", 260, Rarity.RARE, mage.cards.e.ElectroAssaultingBattery.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Electro, Assaulting Battery", 76, Rarity.RARE, mage.cards.e.ElectroAssaultingBattery.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Flying Octobot", 31, Rarity.UNCOMMON, mage.cards.f.FlyingOctobot.class));
|
||||
cards.add(new SetCardInfo("Forest", 193, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Forest", 198, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
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 ElectroAssaultingBatteryTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Electro, Assaulting Battery
|
||||
{1}{R}{R}
|
||||
Legendary Creature - Human Villain
|
||||
Flying
|
||||
You don't lose unspent red mana as steps and phases end.
|
||||
Whenever you cast an instant or sorcery spell, add {R}.
|
||||
When Electro leaves the battlefield, you may pay {X}. When you do, he deals X damage to target player.
|
||||
2/3
|
||||
*/
|
||||
private static final String electroAssaultingBattery = "Electro, Assaulting Battery";
|
||||
|
||||
/*
|
||||
Pyretic Ritual
|
||||
{1}{R}
|
||||
Instant
|
||||
Add {R}{R}{R}.
|
||||
*/
|
||||
private static final String pyreticRitual = "Pyretic Ritual";
|
||||
|
||||
/*
|
||||
Lightning Bolt
|
||||
{R}
|
||||
Instant
|
||||
Lightning Bolt deals 3 damage to any target.
|
||||
*/
|
||||
private static final String lightningBolt = "Lightning Bolt";
|
||||
|
||||
|
||||
@Test
|
||||
public void testElectroAssaultingBattery() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, electroAssaultingBattery);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
addCard(Zone.HAND, playerA, pyreticRitual);
|
||||
addCard(Zone.HAND, playerB, lightningBolt);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, pyreticRitual);
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, lightningBolt, electroAssaultingBattery);
|
||||
setChoice(playerA, true);
|
||||
setChoiceAmount(playerA, 4); // 3 from ritual + 1 from electro
|
||||
addTarget(playerA, playerB);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20 - 4);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue