forked from External/mage
[MID] Implemented Smoldering Egg / Ashmouth Dragon
This commit is contained in:
parent
72cb83e615
commit
07e0a4ef54
4 changed files with 152 additions and 0 deletions
51
Mage.Sets/src/mage/cards/a/AshmouthDragon.java
Normal file
51
Mage.Sets/src/mage/cards/a/AshmouthDragon.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AshmouthDragon extends CardImpl {
|
||||
|
||||
public AshmouthDragon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.color.setRed(true);
|
||||
this.transformable = true;
|
||||
this.nightCard = true;
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever you cast an instant or sorcery spell, Ashmouth Dragon deals 2 damage to any target.
|
||||
Ability ability = new SpellCastControllerTriggeredAbility(
|
||||
new DamageTargetEffect(2), StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false
|
||||
);
|
||||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private AshmouthDragon(final AshmouthDragon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AshmouthDragon copy() {
|
||||
return new AshmouthDragon(this);
|
||||
}
|
||||
}
|
||||
98
Mage.Sets/src/mage/cards/s/SmolderingEgg.java
Normal file
98
Mage.Sets/src/mage/cards/s/SmolderingEgg.java
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.watchers.common.ManaPaidSourceWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SmolderingEgg extends CardImpl {
|
||||
|
||||
public SmolderingEgg(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.subtype.add(SubType.EGG);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(4);
|
||||
this.transformable = true;
|
||||
this.secondSideCardClazz = mage.cards.a.AshmouthDragon.class;
|
||||
|
||||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
|
||||
// Whenever you cast an instant or sorcery spell, put a number of ember counters on Smoldering Egg equal to the amount of mana spent to cast that spell. Then if Smoldering Egg has seven or more ember counters on it, remove them and transform Smoldering Egg.
|
||||
this.addAbility(new TransformAbility());
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||
new SmolderingEggEffect(), StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false
|
||||
));
|
||||
}
|
||||
|
||||
private SmolderingEgg(final SmolderingEgg card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SmolderingEgg copy() {
|
||||
return new SmolderingEgg(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SmolderingEggEffect extends OneShotEffect {
|
||||
|
||||
SmolderingEggEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "put a number of ember counters on {this} equal to the amount of mana spent to cast that spell. " +
|
||||
"Then if {this} has seven or more ember counters on it, remove them and transform {this}";
|
||||
}
|
||||
|
||||
private SmolderingEggEffect(final SmolderingEggEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SmolderingEggEffect copy() {
|
||||
return new SmolderingEggEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
Spell spell = (Spell) getValue("spellCast");
|
||||
if (spell != null) {
|
||||
permanent.addCounters(
|
||||
CounterType.EMBER.createInstance(
|
||||
ManaPaidSourceWatcher.getTotalPaid(spell.getId(), game)
|
||||
), source.getControllerId(), source, game
|
||||
);
|
||||
}
|
||||
int counters = permanent.getCounters(game).getCount(CounterType.EMBER);
|
||||
if (counters < 7) {
|
||||
return true;
|
||||
}
|
||||
permanent.removeCounters(CounterType.EMBER.createInstance(counters), source, game);
|
||||
new TransformSourceEffect(true).apply(game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -41,6 +41,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Arlinn, the Moon's Fury", 211, Rarity.MYTHIC, mage.cards.a.ArlinnTheMoonsFury.class));
|
||||
cards.add(new SetCardInfo("Arlinn, the Pack's Hope", 211, Rarity.MYTHIC, mage.cards.a.ArlinnThePacksHope.class));
|
||||
cards.add(new SetCardInfo("Arrogant Outlaw", 84, Rarity.COMMON, mage.cards.a.ArrogantOutlaw.class));
|
||||
cards.add(new SetCardInfo("Ashmouth Dragon", 159, Rarity.RARE, mage.cards.a.AshmouthDragon.class));
|
||||
cards.add(new SetCardInfo("Augur of Autumn", 168, Rarity.RARE, mage.cards.a.AugurOfAutumn.class));
|
||||
cards.add(new SetCardInfo("Awoken Demon", 100, Rarity.COMMON, mage.cards.a.AwokenDemon.class));
|
||||
cards.add(new SetCardInfo("Baithook Angler", 42, Rarity.COMMON, mage.cards.b.BaithookAngler.class));
|
||||
|
|
@ -251,6 +252,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Skaab Wrangler", 75, Rarity.UNCOMMON, mage.cards.s.SkaabWrangler.class));
|
||||
cards.add(new SetCardInfo("Slaughter Specialist", 122, Rarity.RARE, mage.cards.s.SlaughterSpecialist.class));
|
||||
cards.add(new SetCardInfo("Sludge Monster", 76, Rarity.RARE, mage.cards.s.SludgeMonster.class));
|
||||
cards.add(new SetCardInfo("Smoldering Egg", 159, Rarity.RARE, mage.cards.s.SmolderingEgg.class));
|
||||
cards.add(new SetCardInfo("Snarling Wolf", 199, Rarity.COMMON, mage.cards.s.SnarlingWolf.class));
|
||||
cards.add(new SetCardInfo("Soul-Guide Gryff", 35, Rarity.COMMON, mage.cards.s.SoulGuideGryff.class));
|
||||
cards.add(new SetCardInfo("Spectral Adversary", 77, Rarity.MYTHIC, mage.cards.s.SpectralAdversary.class));
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public enum CounterType {
|
|||
ECHO("echo"),
|
||||
EGG("egg"),
|
||||
ELIXIR("elixir"),
|
||||
EMBER("ember"),
|
||||
ENERGY("energy"),
|
||||
ENLIGHTENED("enlightened"),
|
||||
EON("eon"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue