Add Demon token and use it for existing cards.

This commit is contained in:
LoneFox 2015-09-20 18:25:48 +03:00
parent 05648987d2
commit 795bf74f11
5 changed files with 66 additions and 69 deletions

View file

@ -29,7 +29,6 @@ package mage.sets.avacynrestored;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
@ -38,7 +37,7 @@ import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.game.permanent.token.Token; import mage.game.permanent.token.DemonToken;
import java.util.UUID; import java.util.UUID;
@ -53,7 +52,6 @@ public class DemonicRising extends CardImpl {
super(ownerId, 94, "Demonic Rising", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); super(ownerId, 94, "Demonic Rising", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
this.expansionSetCode = "AVR"; this.expansionSetCode = "AVR";
// At the beginning of your end step, if you control exactly one creature, put a 5/5 black Demon creature token with flying onto the battlefield. // At the beginning of your end step, if you control exactly one creature, put a 5/5 black Demon creature token with flying onto the battlefield.
TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken()), false); TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken()), false);
this.addAbility(new ConditionalTriggeredAbility(ability, OneControlledCreatureCondition.getInstance(), ruleText)); this.addAbility(new ConditionalTriggeredAbility(ability, OneControlledCreatureCondition.getInstance(), ruleText));
@ -68,15 +66,3 @@ public class DemonicRising extends CardImpl {
return new DemonicRising(this); return new DemonicRising(this);
} }
} }
class DemonToken extends Token {
public DemonToken() {
super("Demon", "a 5/5 black Demon creature token with flying");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add("Demon");
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
}
}

View file

@ -28,7 +28,6 @@
package mage.sets.commander2014; package mage.sets.commander2014;
import java.util.UUID; import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility; import mage.abilities.common.CanBeYourCommanderAbility;
@ -55,7 +54,7 @@ import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.game.Game; import mage.game.Game;
import mage.game.command.Emblem; import mage.game.command.Emblem;
import mage.game.permanent.token.Token; import mage.game.permanent.token.DemonToken;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
@ -77,13 +76,13 @@ public class ObNixilisOfTheBlackOath extends CardImpl {
this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2)); this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2));
// -2: Put a 5/5 black Demon creature token with flying onto the battlefield. You lose 2 life. // -2: Put a 5/5 black Demon creature token with flying onto the battlefield. You lose 2 life.
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new ObNixilisDemonToken()), -2); LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new DemonToken()), -2);
loyaltyAbility.addEffect(new LoseLifeSourceControllerEffect(2)); loyaltyAbility.addEffect(new LoseLifeSourceControllerEffect(2));
this.addAbility(loyaltyAbility); this.addAbility(loyaltyAbility);
// -8: You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." // -8: You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new ObNixilisOfTheBlackOathEmblem()), -8)); this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new ObNixilisOfTheBlackOathEmblem()), -8));
// Ob Nixilis of the Black Oath can be your commander. // Ob Nixilis of the Black Oath can be your commander.
this.addAbility(CanBeYourCommanderAbility.getInstance()); this.addAbility(CanBeYourCommanderAbility.getInstance());
} }
@ -134,23 +133,6 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect {
} }
class ObNixilisDemonToken extends Token {
ObNixilisDemonToken() {
super("Demon", "5/5 black Demon creature token with flying");
setTokenType(1);
setOriginalExpansionSetCode("C14");
cardType.add(CardType.CREATURE);
subtype.add("Demon");
color.setBlack(true);
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
}
}
class ObNixilisOfTheBlackOathEmblem extends Emblem { class ObNixilisOfTheBlackOathEmblem extends Emblem {
// You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." // You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
public ObNixilisOfTheBlackOathEmblem() { public ObNixilisOfTheBlackOathEmblem() {

View file

@ -44,7 +44,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TappedPredicate; import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.token.Token; import mage.game.permanent.token.DemonToken;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
/** /**
@ -111,18 +111,3 @@ class SkirsdagHighPriestCost extends CostImpl {
return paid; return paid;
} }
} }
class DemonToken extends Token {
DemonToken() {
super("Demon", "5/5 black Demon creature token with flying");
cardType.add(CardType.CREATURE);
subtype.add("Demon");
color.setBlack(true);
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
}
}

View file

@ -38,7 +38,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.game.permanent.token.Token; import mage.game.permanent.token.DemonToken;
/** /**
* *
@ -70,19 +70,3 @@ public class PriestOfTheBloodRite extends CardImpl {
return new PriestOfTheBloodRite(this); return new PriestOfTheBloodRite(this);
} }
} }
class DemonToken extends Token {
DemonToken() {
super("Demon", "5/5 black Demon creature token with flying");
cardType.add(CardType.CREATURE);
subtype.add("Demon");
setOriginalExpansionSetCode("ORI");
color.setBlack(true);
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
}
}

View file

@ -0,0 +1,60 @@
/*
* 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.Arrays;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
/**
*
* @author LoneFox
*/
public class DemonToken extends Token {
public DemonToken() {
super("Demon", "1/1 black Demon creature token with flying");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add("Demon");
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
availableImageSetCodes.addAll(Arrays.asList("INN", "AVR", "C14", "ORI"));
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode().equals("C14")) {
this.setTokenType(2);
}
}
}