Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions Mage.Sets/src/mage/cards/a/AlexWilderRunaway.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package mage.cards.a;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.EscapeAbility;
import mage.abilities.keyword.HasteAbility;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;

/**
*
* @author muz
*/
public final class AlexWilderRunaway extends CardImpl {

public AlexWilderRunaway(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");

this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.HERO);
this.subtype.add(SubType.VILLAIN);
this.power = new MageInt(1);
this.toughness = new MageInt(3);

// Whenever Alex Wilder or another creature you control enters, if you cast it from anywhere other than your hand, it gets +2/+0 and gains haste until end of turn.
Ability ability = new AlexWilderRunawayTriggeredAbility();
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance())
.setText("and gains haste until end of turn"));
this.addAbility(ability);

// Escape--{2}{R}, Exile three other cards from your graveyard.
this.addAbility(new EscapeAbility(this, "{2}{R}", 3));
}

private AlexWilderRunaway(final AlexWilderRunaway card) {
super(card);
}

@Override
public AlexWilderRunaway copy() {
return new AlexWilderRunaway(this);
}
}

class AlexWilderRunawayTriggeredAbility extends EntersBattlefieldThisOrAnotherTriggeredAbility {

AlexWilderRunawayTriggeredAbility() {
super(
new BoostTargetEffect(2, 0).setText("it gets +2/+0"),
StaticFilters.FILTER_PERMANENT_CREATURE_CONTROLLED,
false,
SetTargetPointer.PERMANENT,
true
);
setTriggerPhrase("Whenever {this} or another creature you control enters, if you cast it from anywhere other than your hand, ");
}

private AlexWilderRunawayTriggeredAbility(final AlexWilderRunawayTriggeredAbility ability) {
super(ability);
}

@Override
public AlexWilderRunawayTriggeredAbility copy() {
return new AlexWilderRunawayTriggeredAbility(this);
}

@Override
public boolean checkTrigger(GameEvent event, Game game) {
EntersTheBattlefieldEvent entersEvent = (EntersTheBattlefieldEvent) event;
if (entersEvent == null) {
return false;
}
Permanent permanent = entersEvent.getTarget();
if (permanent == null || entersEvent.getFromZone() != Zone.STACK) {
return false;
}

Spell spell = game.getSpellOrLKIStack(permanent.getId());
return spell != null
&& spell.getFromZone() != Zone.HAND
&& super.checkTrigger(event, game);
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/MarvelSuperHeroesCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private MarvelSuperHeroesCommander() {
cards.add(new SetCardInfo("Absorbing Man and Titania", 510, Rarity.RARE, mage.cards.a.AbsorbingManAndTitania.class));
cards.add(new SetCardInfo("Accelerated Evolution", 711, Rarity.COMMON, mage.cards.a.AcceleratedEvolution.class));
cards.add(new SetCardInfo("Age of Ultron", 41, Rarity.RARE, mage.cards.a.AgeOfUltron.class));
cards.add(new SetCardInfo("Alex Wilder, Runaway", 677, Rarity.UNCOMMON, mage.cards.a.AlexWilderRunaway.class));
cards.add(new SetCardInfo("Alien Symbiosis", 791, Rarity.UNCOMMON, mage.cards.a.AlienSymbiosis.class));
cards.add(new SetCardInfo("Amazing Spider-Girl", 583, Rarity.RARE, mage.cards.a.AmazingSpiderGirl.class));
cards.add(new SetCardInfo("Ancestral Communion", 376, Rarity.RARE, mage.cards.a.AncestralCommunion.class, NON_FULL_USE_VARIOUS));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package org.mage.test.cards.single.msc;

import mage.abilities.keyword.HasteAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;

public class AlexWilderRunawayTest extends CardTestPlayerBase {

private static final String alex = "Alex Wilder, Runaway";
private static final String skywayRobber = "Skyway Robber";

@Test
public void test_NoBonus_WhenCastFromHand() {
addCard(Zone.HAND, playerA, alex);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, alex);

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertPowerToughness(playerA, alex, 1, 3);
assertAbility(playerA, alex, HasteAbility.getInstance(), false);
}

@Test
public void test_Bonus_WhenAnotherCreatureCastFromNonHand() {
addCard(Zone.BATTLEFIELD, playerA, alex);
addCard(Zone.GRAVEYARD, playerA, skywayRobber);
addCard(Zone.GRAVEYARD, playerA, "Mountain", 5);
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, skywayRobber + " with Escape");
setChoice(playerA, "Mountain^Mountain^Mountain^Mountain^Mountain");

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertPowerToughness(playerA, skywayRobber, 5, 3);
assertAbility(playerA, skywayRobber, HasteAbility.getInstance(), true);
}
}
Loading