mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Fixed token image handling so that images from the set of the creating card are used if possible. Not all tokens already reworked.
This commit is contained in:
parent
90c5c3c2f3
commit
dd7d57f574
49 changed files with 367 additions and 367 deletions
|
@ -28,11 +28,6 @@
|
|||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -41,6 +36,11 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
|||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
@ -54,9 +54,9 @@ import mage.target.TargetPlayer;
|
|||
* @author jeffwadsworth
|
||||
*/
|
||||
public class NecromancersCovenant extends CardImpl {
|
||||
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Zombies you control");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Zombie"));
|
||||
}
|
||||
|
@ -65,9 +65,6 @@ public class NecromancersCovenant extends CardImpl {
|
|||
super(ownerId, 82, "Necromancer's Covenant", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{B}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
|
||||
|
||||
|
||||
// When Necromancer's Covenant enters the battlefield, exile all creature cards from target player's graveyard, then put a 2/2 black Zombie creature token onto the battlefield for each card exiled this way.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new NecromancersConvenantEffect(), false);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
|
@ -110,7 +107,7 @@ class NecromancersConvenantEffect extends OneShotEffect {
|
|||
count += 1;
|
||||
}
|
||||
}
|
||||
ZombieToken zombieToken = new ZombieToken("ALA");
|
||||
ZombieToken zombieToken = new ZombieToken();
|
||||
if (zombieToken.putOntoBattlefield(count, game, source.getSourceId(), source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ class UnscytheEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD) && controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true)) {
|
||||
ZombieToken zombie = new ZombieToken("ALA");
|
||||
ZombieToken zombie = new ZombieToken();
|
||||
return zombie.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
package mage.sets.avacynrestored;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ public class MaalfeldTwins extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// When Maalfeld Twins dies, put two 2/2 black Zombie creature tokens onto the battlefield.
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ZombieToken("ALA"), 2)));
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ZombieToken(), 2)));
|
||||
}
|
||||
|
||||
public MaalfeldTwins(final MaalfeldTwins card) {
|
||||
|
|
|
@ -72,11 +72,11 @@ public class GhoulcallerGisa extends CardImpl {
|
|||
|
||||
// {B}, {tap}, Sacrifice another creature: Put X 2/2 black Zombie creature tokens onto the battlefield, where X is the sacrificed creature's power.
|
||||
DynamicValue xValue = new SacrificeCostCreaturesPower();
|
||||
Token zombie = new ZombieToken("C14");
|
||||
Token zombie = new ZombieToken();
|
||||
zombie.setTokenType(2);
|
||||
Effect effect = new CreateTokenEffect(zombie, xValue);
|
||||
effect.setText("Put X 2/2 black Zombie creature tokens onto the battlefield, where X is the sacrificed creature's power");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{B}"));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class OverseerOfTheDamned extends CardImpl {
|
|||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
// Whenever a nontoken creature an opponent controls dies, put a 2/2 black Zombie creature token onto the battlefield tapped.
|
||||
Token zombie = new ZombieToken("C14");
|
||||
Token zombie = new ZombieToken();
|
||||
zombie.setTokenType(2);
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(zombie, 1, true, false), false, filter));
|
||||
|
||||
|
|
|
@ -25,21 +25,19 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.conflux;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
|
@ -53,7 +51,7 @@ public class GrixisSlavedriver extends CardImpl {
|
|||
this.subtype.add("Giant");
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken("ALA")), false));
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false));
|
||||
this.addAbility(new UnearthAbility(new ManaCostsImpl("{3}{B}")));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
package mage.sets.darkascension;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||
|
@ -39,6 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
|||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
|
@ -71,7 +71,7 @@ public class HavengulRunebinder extends CardImpl {
|
|||
// {2}{U}, {tap}, Exile a creature card from your graveyard: Put a 2/2 black Zombie creature token onto the battlefield,
|
||||
// then put a +1/+1 counter on each Zombie creature you control.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new CreateTokenEffect(new ZombieToken("ISD")),
|
||||
new CreateTokenEffect(new ZombieToken()),
|
||||
new ManaCostsImpl("{2}{U}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(filter)));
|
||||
|
|
|
@ -19,8 +19,7 @@ public class ReapTheSeagraf extends CardImpl {
|
|||
super(ownerId, 72, "Reap the Seagraf", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}");
|
||||
this.expansionSetCode = "DKA";
|
||||
|
||||
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken("ISD")));
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken()));
|
||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{U}"), TimingRule.SORCERY));
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ import mage.game.permanent.token.ZombieToken;
|
|||
* @author Loki
|
||||
*/
|
||||
public class Wakedancer extends CardImpl {
|
||||
|
||||
private static final String staticText = "Morbid - When {this} enters the battlefield, if a creature died this turn, put a 2/2 black Zombie creature token onto the battlefield.";
|
||||
|
||||
public Wakedancer(UUID ownerId) {
|
||||
|
@ -57,7 +58,7 @@ public class Wakedancer extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Morbid - When Wakedancer enters the battlefield, if a creature died this turn, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken("ISD")));
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken()));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.getInstance(), staticText));
|
||||
}
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@ public class RakshasaGravecaller extends CardImpl {
|
|||
|
||||
// Exploit
|
||||
this.addAbility(new ExploitAbility());
|
||||
|
||||
|
||||
// When Rakshasa Gravecaller exploits a creature, put two 2/2 black Zombie creature tokens onto the battlefield.
|
||||
this.addAbility(new ExploitCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken("DTK"), 2), false));
|
||||
this.addAbility(new ExploitCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken(), 2), false));
|
||||
}
|
||||
|
||||
public RakshasaGravecaller(final RakshasaGravecaller card) {
|
||||
|
|
|
@ -86,7 +86,7 @@ public class IbHalfheartGoblinTactician extends CardImpl {
|
|||
// Sacrifice two Mountains: Put two 1/1 red Goblin creature tokens onto the battlefield.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new CreateTokenEffect(new GoblinToken(expansionSetCode), 2),
|
||||
new CreateTokenEffect(new GoblinToken(), 2),
|
||||
new SacrificeTargetCost(new TargetControlledPermanent(2, 2, filter, true))));
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ import mage.constants.Rarity;
|
|||
import mage.constants.TimingRule;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
|
@ -47,9 +46,8 @@ public class ArmyOfTheDamned extends CardImpl {
|
|||
super(ownerId, 87, "Army of the Damned", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{5}{B}{B}{B}");
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
|
||||
// Put thirteen 2/2 black Zombie creature tokens onto the battlefield tapped.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken("ISD"), 13, true, false));
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), 13, true, false));
|
||||
|
||||
// Flashback {7}{B}{B}{B}
|
||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{B}{B}{B}"), TimingRule.SORCERY));
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
@ -39,6 +35,10 @@ import mage.abilities.costs.mana.GenericManaCost;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
import mage.players.Player;
|
||||
|
@ -95,7 +95,7 @@ class CellarDoorEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
ZombieToken token = new ZombieToken("ISD");
|
||||
ZombieToken token = new ZombieToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
@ -41,8 +42,6 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
@ -53,11 +52,10 @@ public class EndlessRanksOfTheDead extends CardImpl {
|
|||
super(ownerId, 99, "Endless Ranks of the Dead", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
|
||||
// At the beginning of your upkeep, put X 2/2 black Zombie creature tokens onto the battlefield,
|
||||
// where X is half the number of Zombies you control, rounded down.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep",
|
||||
new CreateTokenEffect(new ZombieToken("ISD"), new HalfZombiesCount())));
|
||||
new CreateTokenEffect(new ZombieToken(), new HalfZombiesCount())));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,8 @@ public class MoanOfTheUnhallowed extends CardImpl {
|
|||
super(ownerId, 109, "Moan of the Unhallowed", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}");
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
|
||||
// Put two 2/2 black Zombie creature tokens onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken("ISD"), 2));
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), 2));
|
||||
|
||||
// Flashback {5}{B}{B}
|
||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{B}{B}"), TimingRule.SORCERY));
|
||||
|
|
|
@ -86,7 +86,7 @@ class UndeadAlchemistTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
public UndeadAlchemistTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new ExileTargetEffect(), true);
|
||||
this.addEffect(new CreateTokenEffect(new ZombieToken("ISD")));
|
||||
this.addEffect(new CreateTokenEffect(new ZombieToken()));
|
||||
}
|
||||
|
||||
public UndeadAlchemistTriggeredAbility(final UndeadAlchemistTriggeredAbility ability) {
|
||||
|
@ -105,7 +105,7 @@ class UndeadAlchemistTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.LIBRARY && zEvent.getToZone() == Zone.GRAVEYARD && game.getOpponents(this.getControllerId()).contains(zEvent.getPlayerId())) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
|
||||
|
|
|
@ -44,9 +44,8 @@ public class HordelingOutburst extends CardImpl {
|
|||
super(ownerId, 111, "Hordeling Outburst", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
|
||||
this.expansionSetCode = "KTK";
|
||||
|
||||
|
||||
// Put 3 1/1 red Goblin creature tokens onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(expansionSetCode), 3));
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(), 3));
|
||||
}
|
||||
|
||||
public HordelingOutburst(final HordelingOutburst card) {
|
||||
|
|
|
@ -64,9 +64,8 @@ public class MarduAscendancy extends CardImpl {
|
|||
super(ownerId, 185, "Mardu Ascendancy", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}{W}{B}");
|
||||
this.expansionSetCode = "KTK";
|
||||
|
||||
|
||||
// Whenever a nontoken creature you control attacks, put a 1/1 red Goblin creature token onto the battlefield tapped and attacking.
|
||||
this.addAbility(new AttacksCreatureYouControlTriggeredAbility(new CreateTokenEffect(new GoblinToken(expansionSetCode), 1, true, true), false, attackFilter));
|
||||
this.addAbility(new AttacksCreatureYouControlTriggeredAbility(new CreateTokenEffect(new GoblinToken(), 1, true, true), false, attackFilter));
|
||||
|
||||
// Sacrifice Mardu Ascendancy: Creatures you control get +0/+3 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 3, Duration.EndOfTurn, filter, false),
|
||||
|
|
|
@ -60,7 +60,7 @@ public class PonybackBrigade extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Ponyback Brigade enters the battlefield or is turned face up, put three 1/1 red Goblin creature tokens onto the battlefield.
|
||||
this.addAbility(new PonybackBrigadeAbility(new GoblinToken(expansionSetCode)));
|
||||
this.addAbility(new PonybackBrigadeAbility(new GoblinToken()));
|
||||
|
||||
// Morph {2}{R}{W}{B}
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{R}{W}{B}")));
|
||||
|
@ -102,7 +102,7 @@ class PonybackBrigadeAbility extends TriggeredAbilityImpl {
|
|||
if (event.getType() == EventType.TURNEDFACEUP && event.getTargetId().equals(this.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()) ) {
|
||||
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId())) {
|
||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
||||
if (sourcePermanent != null && !sourcePermanent.isFaceDown(game)) {
|
||||
return true;
|
||||
|
|
|
@ -112,7 +112,7 @@ class SidisiBroodTyrantAbility extends TriggeredAbilityImpl {
|
|||
class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public SidisiBroodTyrantTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken("KTK")), false);
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken()), false);
|
||||
}
|
||||
|
||||
public SidisiBroodTyrantTriggeredAbility(final SidisiBroodTyrantTriggeredAbility ability) {
|
||||
|
@ -126,12 +126,12 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent)event;
|
||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
||||
if (Zone.LIBRARY == zEvent.getFromZone() && Zone.GRAVEYARD == zEvent.getToZone()) {
|
||||
for (Card card: zEvent.getCards()) {
|
||||
for (Card card : zEvent.getCards()) {
|
||||
if (card.getOwnerId().equals(getControllerId()) && card.getCardType().contains(CardType.CREATURE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -142,7 +142,6 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl {
|
|||
return new SidisiBroodTyrantTriggeredAbility(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield.";
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
@ -20,12 +20,11 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.magic2011;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -74,7 +73,7 @@ public class GraveTitan extends CardImpl {
|
|||
class GraveTitanAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public GraveTitanAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken("M11"), 2), false);
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken(), 2), false);
|
||||
}
|
||||
|
||||
public GraveTitanAbility(final GraveTitanAbility ability) {
|
||||
|
@ -96,7 +95,7 @@ class GraveTitanAbility extends TriggeredAbilityImpl {
|
|||
if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()) ) {
|
||||
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.magic2012;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -55,7 +54,7 @@ import mage.target.common.TargetCardInGraveyard;
|
|||
public class CemeteryReaper extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombie creatures");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Zombie"));
|
||||
}
|
||||
|
@ -66,14 +65,14 @@ public class CemeteryReaper extends CardImpl {
|
|||
this.subtype.add("Zombie");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
|
||||
// Other Zombie creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
|
||||
|
||||
// {2}{B}, {T} : Exile target creature card from a graveyard. Put a 2/2 black Zombie creature token onto the battlefield.
|
||||
|
||||
// {2}{B}, {T} : Exile target creature card from a graveyard. Put a 2/2 black Zombie creature token onto the battlefield.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{2}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new CreateTokenEffect(new ZombieToken("M12")));
|
||||
ability.addEffect(new CreateTokenEffect(new ZombieToken()));
|
||||
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
package mage.sets.magic2012;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.DiscardTargetCost;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
@ -49,10 +49,9 @@ public class ZombieInfestation extends CardImpl {
|
|||
super(ownerId, 120, "Zombie Infestation", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
this.expansionSetCode = "M12";
|
||||
|
||||
|
||||
// Discard two cards: Put a 2/2 black Zombie creature token onto the battlefield.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new CreateTokenEffect(new ZombieToken("M12")),
|
||||
new CreateTokenEffect(new ZombieToken()),
|
||||
new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -37,8 +37,6 @@ import mage.filter.common.FilterCreatureCard;
|
|||
import mage.game.permanent.token.ZombieToken;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
@ -49,13 +47,12 @@ public class VileRebirth extends CardImpl {
|
|||
super(ownerId, 115, "Vile Rebirth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
|
||||
this.expansionSetCode = "M13";
|
||||
|
||||
|
||||
// Exile target creature card from a graveyard.
|
||||
this.getSpellAbility().addEffect(new ExileTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
|
||||
|
||||
// Put a 2/2 black Zombie creature token onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken("M13")));
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken()));
|
||||
}
|
||||
|
||||
public VileRebirth(final VileRebirth card) {
|
||||
|
|
|
@ -57,8 +57,8 @@ public class LilianasReaver extends CardImpl {
|
|||
this.addAbility(DeathtouchAbility.getInstance());
|
||||
// Whenever Liliana's Reaver deals combat damage to a player, that player discards a card and you put a 2/2 black Zombie creature token onto the battlefield tapped.
|
||||
|
||||
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1),false, true);
|
||||
ability.addEffect(new CreateTokenEffect(new ZombieToken("M14"), 1, true, false));
|
||||
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true);
|
||||
ability.addEffect(new CreateTokenEffect(new ZombieToken(), 1, true, false));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import mage.game.permanent.token.ZombieToken;
|
|||
public class XathridNecromancer extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creature you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new SubtypePredicate("Human"));
|
||||
|
@ -64,7 +65,7 @@ public class XathridNecromancer extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Xathrid Necromancer or another Human creature you control dies, put a 2/2 black Zombie creature token onto the battlefield tapped.
|
||||
Effect effect = new CreateTokenEffect(new ZombieToken("M14"), 1, true, false);
|
||||
Effect effect = new CreateTokenEffect(new ZombieToken(), 1, true, false);
|
||||
Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(effect, false, filter);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.sets.magic2015;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
|
@ -47,8 +48,6 @@ import mage.game.permanent.token.ZombieToken;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
|
@ -60,7 +59,6 @@ public class NecromancersStockpile extends CardImpl {
|
|||
super(ownerId, 108, "Necromancer's Stockpile", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
this.expansionSetCode = "M15";
|
||||
|
||||
|
||||
// {1}{B}, Discard a creature card: Draw a card.
|
||||
// If the discarded card was a Zombie card, put a 2/2 black Zombie creature token onto the battlefield tapped.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}{B}"));
|
||||
|
@ -97,7 +95,7 @@ class NecromancersStockpileDiscardTargetCost extends CostImpl {
|
|||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) {
|
||||
Player player = game.getPlayer(controllerId);
|
||||
for (UUID targetId: targets.get(0).getTargets()) {
|
||||
for (UUID targetId : targets.get(0).getTargets()) {
|
||||
Card card = player.getHand().get(targetId, game);
|
||||
if (card == null) {
|
||||
return false;
|
||||
|
@ -127,6 +125,7 @@ class NecromancersStockpileDiscardTargetCost extends CostImpl {
|
|||
}
|
||||
|
||||
class NecromancersStockpilePutTokenEffect extends OneShotEffect {
|
||||
|
||||
NecromancersStockpilePutTokenEffect() {
|
||||
super(Outcome.Neutral);
|
||||
staticText = "If the discarded card was a Zombie card, put a 2/2 black Zombie creature token onto the battlefield tapped";
|
||||
|
@ -140,7 +139,7 @@ class NecromancersStockpilePutTokenEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
NecromancersStockpileDiscardTargetCost cost = (NecromancersStockpileDiscardTargetCost) source.getCosts().get(0);
|
||||
if (cost != null && cost.isZombieCard()) {
|
||||
new CreateTokenEffect(new ZombieToken("M15"), 1, true, false).apply(game, source);
|
||||
new CreateTokenEffect(new ZombieToken(), 1, true, false).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -150,4 +149,3 @@ class NecromancersStockpilePutTokenEffect extends OneShotEffect {
|
|||
return new NecromancersStockpilePutTokenEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,13 +53,12 @@ public class WasteNot extends CardImpl {
|
|||
super(ownerId, 122, "Waste Not", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
this.expansionSetCode = "M15";
|
||||
|
||||
|
||||
// Whenever an opponent discards a creature card, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
this.addAbility(new WasteNotCreatureTriggeredAbility());
|
||||
|
||||
|
||||
// Whenever an opponent discards a land card, add {B}{B} to your mana pool.
|
||||
this.addAbility(new WasteNotLandTriggeredAbility());
|
||||
|
||||
|
||||
// Whenever an opponent discards a noncreature, nonland card, draw a card.
|
||||
this.addAbility(new WasteNotOtherTriggeredAbility());
|
||||
}
|
||||
|
@ -75,15 +74,15 @@ public class WasteNot extends CardImpl {
|
|||
}
|
||||
|
||||
class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
|
||||
WasteNotCreatureTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken("M15")), false);
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken()), false);
|
||||
}
|
||||
|
||||
|
||||
WasteNotCreatureTriggeredAbility(final WasteNotCreatureTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WasteNotCreatureTriggeredAbility copy() {
|
||||
return new WasteNotCreatureTriggeredAbility(this);
|
||||
|
@ -93,7 +92,7 @@ class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.DISCARDED_CARD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
|
||||
|
@ -104,7 +103,7 @@ class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent discards a creature card, put a 2/2 black Zombie creature token onto the battlefield.";
|
||||
|
@ -112,15 +111,15 @@ class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
|
||||
WasteNotLandTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 2, 0, 0)), false);
|
||||
}
|
||||
|
||||
|
||||
WasteNotLandTriggeredAbility(final WasteNotLandTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WasteNotLandTriggeredAbility copy() {
|
||||
return new WasteNotLandTriggeredAbility(this);
|
||||
|
@ -130,7 +129,7 @@ class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.DISCARDED_CARD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
|
||||
|
@ -141,7 +140,7 @@ class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent discards a land card, add {B}{B} to your mana pool.";
|
||||
|
@ -149,15 +148,15 @@ class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
class WasteNotOtherTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
|
||||
WasteNotOtherTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
|
||||
}
|
||||
|
||||
|
||||
WasteNotOtherTriggeredAbility(final WasteNotOtherTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WasteNotOtherTriggeredAbility copy() {
|
||||
return new WasteNotOtherTriggeredAbility(this);
|
||||
|
@ -167,7 +166,7 @@ class WasteNotOtherTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.DISCARDED_CARD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
|
||||
|
@ -178,9 +177,9 @@ class WasteNotOtherTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent discards a noncreature, nonland card, draw a card.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ public class AspiringAeronaut extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// When Aspiring Aeronaut enters the battlefield, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken("ORI"))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken())));
|
||||
}
|
||||
|
||||
public AspiringAeronaut(final AspiringAeronaut card) {
|
||||
|
|
|
@ -44,7 +44,7 @@ import mage.game.permanent.token.ThopterColorlessToken;
|
|||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
|
||||
*
|
||||
*/
|
||||
public class FoundryOfTheConsuls extends CardImpl {
|
||||
|
||||
|
@ -55,8 +55,8 @@ public class FoundryOfTheConsuls extends CardImpl {
|
|||
// {T}: Add {1} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {5}, {T}, Sacrifice Foundry of the Consuls: Put two 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken("ORI"), 2),
|
||||
new ManaCostsImpl("{5}"));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken(), 2),
|
||||
new ManaCostsImpl("{5}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -66,10 +66,10 @@ public class HangarbackWalker extends CardImpl {
|
|||
|
||||
// Hangarback Walker enters the battlefield with X +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new HangarbackWalkerEffect(), "with X +1/+1 counters on it"));
|
||||
|
||||
|
||||
// When Hangarback Walker dies, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield for each +1/+1 counter on Hangarback Walker.
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken("ORI"), new CountersCount(CounterType.P1P1)), false));
|
||||
|
||||
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), new CountersCount(CounterType.P1P1)), false));
|
||||
|
||||
// {1}, {t}: Put a +1/+1 counter on Hangarback Walker.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
|
@ -88,33 +88,33 @@ public class HangarbackWalker extends CardImpl {
|
|||
|
||||
class HangarbackWalkerEffect extends OneShotEffect {
|
||||
|
||||
public HangarbackWalkerEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "{this} enters the battlefield with X +1/+1 counters on it";
|
||||
}
|
||||
public HangarbackWalkerEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
staticText = "{this} enters the battlefield with X +1/+1 counters on it";
|
||||
}
|
||||
|
||||
public HangarbackWalkerEffect(final HangarbackWalkerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public HangarbackWalkerEffect(final HangarbackWalkerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
|
||||
if (obj != null && obj instanceof SpellAbility) {
|
||||
int amount = ((SpellAbility)obj).getManaCostsToPay().getX();
|
||||
if (amount > 0) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
|
||||
}
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
|
||||
if (obj != null && obj instanceof SpellAbility) {
|
||||
int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
|
||||
if (amount > 0) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HangarbackWalkerEffect copy() {
|
||||
return new HangarbackWalkerEffect(this);
|
||||
}
|
||||
@Override
|
||||
public HangarbackWalkerEffect copy() {
|
||||
return new HangarbackWalkerEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class LilianaHereticalHealer extends CardImpl {
|
|||
|
||||
// Whenever another nontoken creature you control dies, exile Liliana Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new ExileAndReturnTransformedSourceEffect(ExileAndReturnTransformedSourceEffect.Gender.FEMAL,
|
||||
new CreateTokenEffect(new ZombieToken(expansionSetCode))), false, filter));
|
||||
new CreateTokenEffect(new ZombieToken())), false, filter));
|
||||
}
|
||||
|
||||
public LilianaHereticalHealer(final LilianaHereticalHealer card) {
|
||||
|
|
|
@ -65,10 +65,10 @@ public class NissaSageAnimist extends CardImpl {
|
|||
this.expansionSetCode = "ORI";
|
||||
this.subtype.add("Nissa");
|
||||
this.color.setGreen(true);
|
||||
|
||||
|
||||
this.nightCard = true;
|
||||
this.canTransform = true;
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
|
||||
// +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.
|
||||
|
@ -95,21 +95,21 @@ public class NissaSageAnimist extends CardImpl {
|
|||
}
|
||||
|
||||
class NissaSageAnimistPlusOneEffect extends OneShotEffect {
|
||||
|
||||
|
||||
NissaSageAnimistPlusOneEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.";
|
||||
}
|
||||
|
||||
|
||||
NissaSageAnimistPlusOneEffect(final NissaSageAnimistPlusOneEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public NissaSageAnimistPlusOneEffect copy() {
|
||||
return new NissaSageAnimistPlusOneEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
@ -195,4 +195,4 @@ class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl {
|
|||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,11 +61,11 @@ public class PiaAndKiranNalaar extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken("ORI"), 2)));
|
||||
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), 2)));
|
||||
|
||||
// {2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{2}{R}"));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledArtifactPermanent("an artifact"),true)));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, new FilterControlledArtifactPermanent("an artifact"), true)));
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -78,4 +78,4 @@ public class PiaAndKiranNalaar extends CardImpl {
|
|||
public PiaAndKiranNalaar copy() {
|
||||
return new PiaAndKiranNalaar(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ThopterSpyNetwork extends CardImpl {
|
|||
|
||||
// At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield.
|
||||
this.addAbility(new ThopterSpyNetworkUpkeepTriggeredAbility());
|
||||
|
||||
|
||||
// Whenever one or more artifact creatures you control deals combat damage to a player, draw a card.
|
||||
this.addAbility(new ThopterSpyNetworkDamageTriggeredAbility());
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class ThopterSpyNetwork extends CardImpl {
|
|||
class ThopterSpyNetworkUpkeepTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public ThopterSpyNetworkUpkeepTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken("ORI"), 1), false);
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken(), 1), false);
|
||||
}
|
||||
|
||||
public ThopterSpyNetworkUpkeepTriggeredAbility(final ThopterSpyNetworkUpkeepTriggeredAbility ability) {
|
||||
|
@ -98,7 +98,7 @@ class ThopterSpyNetworkUpkeepTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return game.getBattlefield().countAll(new FilterArtifactPermanent(), this.controllerId, game) >= 1;
|
||||
return game.getBattlefield().countAll(new FilterArtifactPermanent(), this.controllerId, game) >= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -108,7 +108,7 @@ class ThopterSpyNetworkUpkeepTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
|
||||
List<UUID> damagedPlayerIds = new ArrayList<>();
|
||||
|
||||
public ThopterSpyNetworkDamageTriggeredAbility() {
|
||||
|
@ -127,7 +127,7 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|
||||
|| event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST;
|
||||
|| event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,14 +135,14 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
||||
if (((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if (creature != null && creature.getControllerId().equals(controllerId)
|
||||
&& creature.getCardType().contains(CardType.ARTIFACT) && !damagedPlayerIds.contains(event.getTargetId())) {
|
||||
damagedPlayerIds.add(event.getTargetId());
|
||||
return true;
|
||||
if (creature != null && creature.getControllerId().equals(controllerId)
|
||||
&& creature.getCardType().contains(CardType.ARTIFACT) && !damagedPlayerIds.contains(event.getTargetId())) {
|
||||
damagedPlayerIds.add(event.getTargetId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.getType().equals(GameEvent.EventType.END_COMBAT_STEP_POST)){
|
||||
if (event.getType().equals(GameEvent.EventType.END_COMBAT_STEP_POST)) {
|
||||
damagedPlayerIds.clear();
|
||||
}
|
||||
return false;
|
||||
|
@ -152,4 +152,4 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public String getRule() {
|
||||
return "Whenever one or more artifact creatures you control deals combat damage to a player, draw a card";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class UndeadServant extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Undead Servant enters the battlefield, put a 2/2 black Zombie creature token onto the battlefield for each card named Undead Servant in your graveyard.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken(expansionSetCode), new CardsInControllerGraveyardCount(filter))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken(), new CardsInControllerGraveyardCount(filter))));
|
||||
}
|
||||
|
||||
public UndeadServant(final UndeadServant card) {
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.mirrodinbesieged;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -47,7 +46,7 @@ import mage.game.permanent.token.ZombieToken;
|
|||
*/
|
||||
public class NestedGhoul extends CardImpl {
|
||||
|
||||
public NestedGhoul (UUID ownerId) {
|
||||
public NestedGhoul(UUID ownerId) {
|
||||
super(ownerId, 48, "Nested Ghoul", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
this.expansionSetCode = "MBS";
|
||||
this.subtype.add("Zombie");
|
||||
|
@ -58,7 +57,7 @@ public class NestedGhoul extends CardImpl {
|
|||
this.addAbility(new NestedGhoulTriggeredAbility());
|
||||
}
|
||||
|
||||
public NestedGhoul (final NestedGhoul card) {
|
||||
public NestedGhoul(final NestedGhoul card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -70,8 +69,9 @@ public class NestedGhoul extends CardImpl {
|
|||
}
|
||||
|
||||
class NestedGhoulTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
NestedGhoulTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken("MBS")));
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken()));
|
||||
}
|
||||
|
||||
NestedGhoulTriggeredAbility(final NestedGhoulTriggeredAbility ability) {
|
||||
|
@ -97,4 +97,4 @@ class NestedGhoulTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public String getRule() {
|
||||
return "Whenever a source deals damage to {this}, put a 2/2 black Zombie creature token onto the battlefield.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
package mage.sets.planechase2012;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.GoblinToken;
|
||||
|
||||
/**
|
||||
|
@ -52,7 +52,7 @@ public class BeetlebackChief extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Beetleback Chief enters the battlefield, put two 1/1 red Goblin creature tokens onto the battlefield.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(expansionSetCode), 2)));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(), 2)));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -25,33 +25,32 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.scarsofmirrodin;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.permanent.token.GoblinToken;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public class KuldothaRebirth extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
}
|
||||
|
||||
public KuldothaRebirth (UUID ownerId) {
|
||||
public KuldothaRebirth(UUID ownerId) {
|
||||
super(ownerId, 96, "Kuldotha Rebirth", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}");
|
||||
this.expansionSetCode = "SOM";
|
||||
|
||||
|
@ -59,7 +58,7 @@ public class KuldothaRebirth extends CardImpl {
|
|||
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
||||
}
|
||||
|
||||
public KuldothaRebirth (final KuldothaRebirth card) {
|
||||
public KuldothaRebirth(final KuldothaRebirth card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -68,4 +67,4 @@ public class KuldothaRebirth extends CardImpl {
|
|||
return new KuldothaRebirth(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,10 +51,11 @@ import mage.game.permanent.token.ZombieToken;
|
|||
public class ArchdemonOfUnx extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Zombie creature");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new SubtypePredicate("Zombie")));
|
||||
}
|
||||
|
||||
|
||||
public ArchdemonOfUnx(UUID ownerId) {
|
||||
super(ownerId, 64, "Archdemon of Unx", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
|
||||
this.expansionSetCode = "ALA";
|
||||
|
@ -69,7 +70,7 @@ public class ArchdemonOfUnx extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
// At the beginning of your upkeep, sacrifice a non-Zombie creature, then put a 2/2 black Zombie creature token onto the battlefield.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(filter, 1, ""), TargetController.YOU, false);
|
||||
ability.addEffect(new CreateTokenEffect(new ZombieToken("ALA")));
|
||||
ability.addEffect(new CreateTokenEffect(new ZombieToken()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
package mage.sets.shardsofalara;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.GoblinToken;
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,6 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.CreateTokenTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -83,14 +82,14 @@ class MoggInfestationEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public MoggInfestationEffect copy() {
|
||||
return new MoggInfestationEffect(this);
|
||||
return new MoggInfestationEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && getTargetPointer().getFirst(game, source) != null) {
|
||||
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) {
|
||||
if (permanent.destroy(source.getSourceId(), game, false)) {
|
||||
Effect effect = new CreateTokenTargetEffect(new GoblinToken(), 2);
|
||||
effect.setTargetPointer(getTargetPointer());
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
package mage.sets.timespiral;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.StormAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.GoblinToken;
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,6 @@ public class EmptyTheWarrens extends CardImpl {
|
|||
super(ownerId, 152, "Empty the Warrens", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
||||
this.expansionSetCode = "TSP";
|
||||
|
||||
|
||||
// Put two 1/1 red Goblin creature tokens onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(), 2));
|
||||
// Storm
|
||||
|
|
|
@ -1,39 +1,40 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
@ -51,6 +52,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
private boolean attacking;
|
||||
private UUID lastAddedTokenId;
|
||||
private ArrayList<UUID> lastAddedTokenIds = new ArrayList<>();
|
||||
private boolean expansionSetCodeChecked;
|
||||
|
||||
public CreateTokenEffect(Token token) {
|
||||
this(token, new StaticValue(1));
|
||||
|
@ -63,7 +65,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
public CreateTokenEffect(Token token, DynamicValue amount) {
|
||||
this(token, amount, false, false);
|
||||
}
|
||||
|
||||
|
||||
public CreateTokenEffect(Token token, int amount, boolean tapped, boolean attacking) {
|
||||
this(token, new StaticValue(amount), tapped, attacking);
|
||||
}
|
||||
|
@ -74,6 +76,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
this.amount = amount.copy();
|
||||
this.tapped = tapped;
|
||||
this.attacking = attacking;
|
||||
this.expansionSetCodeChecked = false;
|
||||
setText();
|
||||
}
|
||||
|
||||
|
@ -85,6 +88,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
this.attacking = effect.attacking;
|
||||
this.lastAddedTokenId = effect.lastAddedTokenId;
|
||||
this.lastAddedTokenIds.addAll(effect.lastAddedTokenIds);
|
||||
this.expansionSetCodeChecked = effect.expansionSetCodeChecked;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,6 +98,9 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (!expansionSetCodeChecked) {
|
||||
updateExpansionSetCode(game, source);
|
||||
}
|
||||
int value = amount.calculate(game, source, this);
|
||||
token.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId(), tapped, attacking);
|
||||
this.lastAddedTokenId = token.getLastAddedToken();
|
||||
|
@ -101,10 +108,18 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void updateExpansionSetCode(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject instanceof Card) {
|
||||
token.setExpansionSetCodeForImage(((Card) sourceObject).getExpansionSetCode());
|
||||
}
|
||||
expansionSetCodeChecked = true;
|
||||
}
|
||||
|
||||
public UUID getLastAddedTokenId() {
|
||||
return lastAddedTokenId;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<UUID> getLastAddedTokenIds() {
|
||||
return lastAddedTokenIds;
|
||||
}
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
@ -74,13 +73,14 @@ import mage.watchers.Watcher;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
public abstract class CardImpl extends MageObjectImpl implements Card {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CardImpl.class);
|
||||
|
||||
protected UUID ownerId;
|
||||
protected int cardNumber;
|
||||
protected String expansionSetCode;
|
||||
public String expansionSetCode;
|
||||
protected String tokenSetCode;
|
||||
protected Rarity rarity;
|
||||
protected boolean canTransform;
|
||||
|
@ -108,16 +108,15 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
Ability ability = new PlayLandAbility(name);
|
||||
ability.setSourceId(this.getId());
|
||||
abilities.add(ability);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
SpellAbility ability = new SpellAbility(manaCost, name, Zone.HAND, spellAbilityType);
|
||||
if (!cardType.contains(CardType.INSTANT)) {
|
||||
ability.setTiming(TimingRule.SORCERY);
|
||||
}
|
||||
ability.setSourceId(this.getId());
|
||||
abilities.add(ability);
|
||||
abilities.add(ability);
|
||||
}
|
||||
this.usesVariousArt = Character.isDigit(this.getClass().getName().charAt(this.getClass().getName().length()-1));
|
||||
this.usesVariousArt = Character.isDigit(this.getClass().getName().charAt(this.getClass().getName().length() - 1));
|
||||
this.morphCard = false;
|
||||
}
|
||||
|
||||
|
@ -206,8 +205,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
game.getState().getCardState(objectId).addInfo(key, value);
|
||||
}
|
||||
|
||||
protected static final ArrayList<String> rulesError = new ArrayList<String>() {{add("Exception occured in rules generation");}};
|
||||
|
||||
protected static final ArrayList<String> rulesError = new ArrayList<String>() {
|
||||
{
|
||||
add("Exception occured in rules generation");
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public List<String> getRules() {
|
||||
try {
|
||||
|
@ -217,7 +220,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
}
|
||||
return rulesError;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> getRules(Game game) {
|
||||
try {
|
||||
|
@ -228,7 +231,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
for (String data : cardState.getInfo().values()) {
|
||||
rules.add(data);
|
||||
}
|
||||
for (Ability ability: cardState.getAbilities()) {
|
||||
for (Ability ability : cardState.getAbilities()) {
|
||||
rules.add(ability.getRule());
|
||||
}
|
||||
}
|
||||
|
@ -243,6 +246,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
/**
|
||||
* Gets all base abilities - does not include additional abilities added by
|
||||
* other cards or effects
|
||||
*
|
||||
* @return A list of {@link Ability} - this collection is modifiable
|
||||
*/
|
||||
@Override
|
||||
|
@ -251,9 +255,10 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets all current abilities - includes additional abilities added by
|
||||
* other cards or effects
|
||||
* @param game
|
||||
* Gets all current abilities - includes additional abilities added by other
|
||||
* cards or effects
|
||||
*
|
||||
* @param game
|
||||
* @return A list of {@link Ability} - this collection is not modifiable
|
||||
*/
|
||||
@Override
|
||||
|
@ -265,28 +270,28 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
Abilities<Ability> all = new AbilitiesImpl<>();
|
||||
all.addAll(abilities);
|
||||
all.addAll(otherAbilities);
|
||||
return all;
|
||||
return all;
|
||||
}
|
||||
|
||||
protected void addAbility(Ability ability) {
|
||||
ability.setSourceId(this.getId());
|
||||
abilities.add(ability);
|
||||
for (Ability subAbility: ability.getSubAbilities()) {
|
||||
for (Ability subAbility : ability.getSubAbilities()) {
|
||||
abilities.add(subAbility);
|
||||
}
|
||||
}
|
||||
|
||||
protected void addAbilities(List<Ability> abilities) {
|
||||
for (Ability ability: abilities) {
|
||||
for (Ability ability : abilities) {
|
||||
addAbility(ability);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void addAbility(Ability ability, Watcher watcher) {
|
||||
addAbility(ability);
|
||||
ability.addWatcher(watcher);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SpellAbility getSpellAbility() {
|
||||
if (spellAbility == null) {
|
||||
|
@ -322,9 +327,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
public List<Mana> getMana() {
|
||||
List<Mana> mana = new ArrayList<>();
|
||||
for (ManaAbility ability : this.abilities.getManaAbilities(Zone.BATTLEFIELD)) {
|
||||
for (Mana netMana: ability.getNetMana(null)) {
|
||||
for (Mana netMana : ability.getNetMana(null)) {
|
||||
mana.add(netMana);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mana;
|
||||
}
|
||||
|
@ -357,14 +362,14 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
game.getPlayer(ownerId).getSideboard().remove(this);
|
||||
break;
|
||||
case COMMAND:
|
||||
game.getState().getCommand().remove((Commander)game.getObject(objectId));
|
||||
game.getState().getCommand().remove((Commander) game.getObject(objectId));
|
||||
break;
|
||||
case STACK:
|
||||
StackObject stackObject = game.getStack().getSpell(getId());
|
||||
if (stackObject == null && (this instanceof SplitCard)) { // handle if half od Split cast is on the stack
|
||||
stackObject = game.getStack().getSpell(((SplitCard)this).getLeftHalfCard().getId());
|
||||
stackObject = game.getStack().getSpell(((SplitCard) this).getLeftHalfCard().getId());
|
||||
if (stackObject == null) {
|
||||
stackObject = game.getStack().getSpell(((SplitCard)this).getRightHalfCard().getId());
|
||||
stackObject = game.getStack().getSpell(((SplitCard) this).getRightHalfCard().getId());
|
||||
}
|
||||
}
|
||||
if (stackObject != null) {
|
||||
|
@ -379,12 +384,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
logger.fatal(new StringBuilder("Invalid from zone [").append(fromZone)
|
||||
.append("] for card [").append(this.getName())
|
||||
.append("] to zone [").append(toZone)
|
||||
.append("] source [").append(sourceCard != null ? sourceCard.getName():"null").append("]").toString());
|
||||
.append("] source [").append(sourceCard != null ? sourceCard.getName() : "null").append("]").toString());
|
||||
break;
|
||||
}
|
||||
game.rememberLKI(objectId, event.getFromZone(), this);
|
||||
}
|
||||
|
||||
|
||||
setFaceDown(false, game);
|
||||
updateZoneChangeCounter(game);
|
||||
switch (event.getToZone()) {
|
||||
|
@ -406,8 +411,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
case LIBRARY:
|
||||
if (flag) {
|
||||
game.getPlayer(ownerId).getLibrary().putOnTop(this, game);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
game.getPlayer(ownerId).getLibrary().putOnBottom(this, game);
|
||||
}
|
||||
break;
|
||||
|
@ -428,9 +432,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
default:
|
||||
Card sourceCard = game.getCard(sourceId);
|
||||
logger.fatal(new StringBuilder("Invalid to zone [").append(toZone)
|
||||
.append("] for card [").append(this.getName())
|
||||
.append("] to zone [").append(toZone)
|
||||
.append("] source [").append(sourceCard != null ? sourceCard.getName():"null").append("]").toString());
|
||||
.append("] for card [").append(this.getName())
|
||||
.append("] to zone [").append(toZone)
|
||||
.append("] source [").append(sourceCard != null ? sourceCard.getName() : "null").append("]").toString());
|
||||
return false;
|
||||
}
|
||||
game.setZone(objectId, event.getToZone());
|
||||
|
@ -462,12 +466,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
case OUTSIDE:
|
||||
game.getPlayer(ownerId).getSideboard().remove(mainCard);
|
||||
break;
|
||||
|
||||
|
||||
case COMMAND:
|
||||
game.getState().getCommand().remove((Commander)game.getObject(mainCard.getId()));
|
||||
game.getState().getCommand().remove((Commander) game.getObject(mainCard.getId()));
|
||||
break;
|
||||
default:
|
||||
//logger.warning("moveToZone, not fully implemented: from="+event.getFromZone() + ", to="+event.getToZone());
|
||||
//logger.warning("moveToZone, not fully implemented: from="+event.getFromZone() + ", to="+event.getToZone());
|
||||
}
|
||||
game.rememberLKI(mainCard.getId(), event.getFromZone(), this);
|
||||
}
|
||||
|
@ -479,6 +483,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game) {
|
||||
return moveToExile(exileId, name, sourceId, game, null);
|
||||
|
@ -514,7 +519,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
break;
|
||||
default:
|
||||
MageObject object = game.getObject(sourceId);
|
||||
logger.warn(new StringBuilder("moveToExile, not fully implemented: from = ").append(fromZone).append(" - ").append(object != null ? object.getName():"null"));
|
||||
logger.warn(new StringBuilder("moveToExile, not fully implemented: from = ").append(fromZone).append(" - ").append(object != null ? object.getName() : "null"));
|
||||
}
|
||||
game.rememberLKI(objectId, event.getFromZone(), this);
|
||||
}
|
||||
|
@ -537,19 +542,19 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId) {
|
||||
return this.putOntoBattlefield(game, fromZone, sourceId, controllerId, false, false, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped){
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped) {
|
||||
return this.putOntoBattlefield(game, fromZone, sourceId, controllerId, tapped, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, boolean facedown){
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, boolean facedown) {
|
||||
return this.putOntoBattlefield(game, fromZone, sourceId, controllerId, tapped, facedown, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, boolean facedown, ArrayList<UUID> appliedEffects){
|
||||
|
||||
@Override
|
||||
public boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped, boolean facedown, ArrayList<UUID> appliedEffects) {
|
||||
ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, controllerId, fromZone, Zone.BATTLEFIELD, appliedEffects, tapped);
|
||||
if (facedown) {
|
||||
this.setFaceDown(true, game);
|
||||
|
@ -582,7 +587,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
removed = true;
|
||||
break;
|
||||
default:
|
||||
logger.warn("putOntoBattlefield, not fully implemented: fromZone="+fromZone);
|
||||
logger.warn("putOntoBattlefield, not fully implemented: fromZone=" + fromZone);
|
||||
}
|
||||
game.rememberLKI(objectId, event.getFromZone(), this);
|
||||
if (!removed) {
|
||||
|
@ -601,7 +606,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
permanent.entersBattlefield(sourceId, game, event.getFromZone(), true);
|
||||
game.setScopeRelevant(false);
|
||||
game.applyEffects();
|
||||
game.addSimultaneousEvent(new ZoneChangeEvent(permanent, event.getPlayerId(), fromZone, Zone.BATTLEFIELD));
|
||||
game.addSimultaneousEvent(new ZoneChangeEvent(permanent, event.getPlayerId(), fromZone, Zone.BATTLEFIELD));
|
||||
return true;
|
||||
}
|
||||
if (facedown) {
|
||||
|
@ -625,7 +630,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.TURNFACEUP, getId(), playerId);
|
||||
if (!game.replaceEvent(event)) {
|
||||
setFaceDown(false, game);
|
||||
for (Ability ability :abilities) { // abilities that were set to not visible face down must be set to visible again
|
||||
for (Ability ability : abilities) { // abilities that were set to not visible face down must be set to visible again
|
||||
if (ability.getWorksFaceDown() && !ability.getRuleVisible()) {
|
||||
ability.setRuleVisible(true);
|
||||
}
|
||||
|
@ -678,7 +683,8 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void build() {}
|
||||
public void build() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getUsesVariousArt() {
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
|
||||
|
@ -39,22 +37,10 @@ import mage.constants.CardType;
|
|||
*/
|
||||
public class GoblinToken extends Token {
|
||||
|
||||
static List<String> imageSetCodes = Arrays.asList(
|
||||
"M10", "C14", "KTK", "EVG", "DTK"
|
||||
);
|
||||
|
||||
public GoblinToken() {
|
||||
this(imageSetCodes.get(new Random().nextInt(imageSetCodes.size())));
|
||||
}
|
||||
|
||||
public GoblinToken(String originalExpansionSetCode) {
|
||||
super("Goblin", "1/1 red Goblin creature token");
|
||||
if (!imageSetCodes.contains(originalExpansionSetCode)) {
|
||||
this.setOriginalExpansionSetCode(imageSetCodes.get(new Random().nextInt(imageSetCodes.size())));
|
||||
} else {
|
||||
this.setOriginalExpansionSetCode(originalExpansionSetCode);
|
||||
}
|
||||
|
||||
availableImageSetCodes.addAll(Arrays.asList("SOM", "M10", "C14", "KTK", "EVG", "DTK", "ORI"));
|
||||
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add("Goblin");
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.CardType;
|
||||
|
@ -38,12 +40,8 @@ import mage.constants.CardType;
|
|||
public class ThopterColorlessToken extends Token {
|
||||
|
||||
public ThopterColorlessToken() {
|
||||
this("EXO");
|
||||
}
|
||||
|
||||
public ThopterColorlessToken(String expansionSetCode) {
|
||||
super("Thopter", "1/1 colorless Thopter artifact creature token with flying");
|
||||
this.setOriginalExpansionSetCode(expansionSetCode);
|
||||
availableImageSetCodes.addAll(Arrays.asList("EXO", "ORI"));
|
||||
cardType.add(CardType.ARTIFACT);
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add("Thopter");
|
||||
|
@ -53,4 +51,11 @@ public class ThopterColorlessToken extends Token {
|
|||
addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpansionSetCodeForImage(String code) {
|
||||
super.setExpansionSetCodeForImage(code);
|
||||
if (getOriginalExpansionSetCode().equals("ORI")) {
|
||||
this.setTokenType(new Random().nextInt(2) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectImpl;
|
||||
import mage.ObjectColor;
|
||||
|
@ -44,8 +44,6 @@ import mage.game.events.GameEvent.EventType;
|
|||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
||||
public class Token extends MageObjectImpl {
|
||||
|
||||
|
@ -56,22 +54,26 @@ public class Token extends MageObjectImpl {
|
|||
private int originalCardNumber;
|
||||
private String originalExpansionSetCode;
|
||||
private Card copySourceCard; // the card the Token is a copy from
|
||||
|
||||
|
||||
// list of set codes tokene images are available for
|
||||
protected List<String> availableImageSetCodes = new ArrayList<>();
|
||||
|
||||
public enum Type {
|
||||
|
||||
FIRST(1),
|
||||
SECOND(2);
|
||||
|
||||
|
||||
int code;
|
||||
|
||||
|
||||
Type(int code) {
|
||||
this.code = code;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Token(String name, String description) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
|
@ -95,7 +97,7 @@ public class Token extends MageObjectImpl {
|
|||
this.tokenType = token.tokenType;
|
||||
this.lastAddedTokenId = token.lastAddedTokenId;
|
||||
this.lastAddedTokenIds.addAll(token.lastAddedTokenIds);
|
||||
this.originalCardNumber = token.originalCardNumber;
|
||||
this.originalCardNumber = token.originalCardNumber;
|
||||
this.originalExpansionSetCode = token.originalExpansionSetCode;
|
||||
this.copySourceCard = token.copySourceCard; // will never be changed
|
||||
}
|
||||
|
@ -165,7 +167,7 @@ public class Token extends MageObjectImpl {
|
|||
}
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(controller.getLogName() + " puts a " + newToken.getLogName() + " token onto the battlefield");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -207,5 +209,13 @@ public class Token extends MageObjectImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void setExpansionSetCodeForImage(String code) {
|
||||
if (availableImageSetCodes.size() > 0) {
|
||||
if (availableImageSetCodes.contains(code)) {
|
||||
setOriginalExpansionSetCode(code);
|
||||
} else {
|
||||
setOriginalExpansionSetCode(availableImageSetCodes.get(new Random().nextInt(availableImageSetCodes.size())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
@ -20,14 +20,14 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
|
@ -39,15 +39,8 @@ import mage.constants.CardType;
|
|||
public class ZombieToken extends Token {
|
||||
|
||||
public ZombieToken() {
|
||||
this("10E");
|
||||
}
|
||||
|
||||
public ZombieToken(String expansionSetCode) {
|
||||
super("Zombie", "2/2 black Zombie creature token");
|
||||
this.setOriginalExpansionSetCode(expansionSetCode);
|
||||
if (expansionSetCode.equals("ISD")) {
|
||||
this.setTokenType(new Random().nextInt(3) + 1);
|
||||
}
|
||||
availableImageSetCodes.addAll(Arrays.asList("10E", "M10", "M11", "M12", "M13", "M14", "M15", "MBS", "ALA", "ISD", "C14", "CNS", "MMA", "BNG", "KTK", "DTK", "ORI"));
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlack(true);
|
||||
subtype.add("Zombie");
|
||||
|
@ -55,4 +48,12 @@ public class ZombieToken extends Token {
|
|||
toughness = new MageInt(2);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setExpansionSetCodeForImage(String code) {
|
||||
super.setExpansionSetCodeForImage(code);
|
||||
if (getOriginalExpansionSetCode().equals("ISD")) {
|
||||
this.setTokenType(new Random().nextInt(3) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue