[TDM] Implement Call of the Spirit Dragons

This commit is contained in:
theelk801 2025-03-24 15:25:37 -04:00
parent 873b107d4d
commit 3cdc5c578d
4 changed files with 111 additions and 3 deletions

View file

@ -0,0 +1,108 @@
package mage.cards.c;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.*;
/**
* @author TheElk801
*/
public final class CallTheSpiritDragons extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.DRAGON, "Dragons");
public CallTheSpiritDragons(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{U}{B}{R}{G}");
// Dragons you control have indestructible.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter
)));
// At the beginning of your upkeep, for each color, put a +1/+1 counter on a Dragon you control of that color. If you put +1/+1 counters on five Dragons this way, you win the game.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CallTheSpiritDragonsEffect()));
}
private CallTheSpiritDragons(final CallTheSpiritDragons card) {
super(card);
}
@Override
public CallTheSpiritDragons copy() {
return new CallTheSpiritDragons(this);
}
}
class CallTheSpiritDragonsEffect extends OneShotEffect {
private static final List<FilterPermanent> filters = new ArrayList<>();
static {
for (ObjectColor color : ObjectColor.getAllColors()) {
FilterPermanent filter = new FilterControlledPermanent(
SubType.DRAGON, color.getDescription() + " Dragon you control"
);
filter.add(new ColorPredicate(color));
}
}
CallTheSpiritDragonsEffect() {
super(Outcome.Benefit);
staticText = "for each color, put a +1/+1 counter on a Dragon you control of that color. " +
"If you put +1/+1 counters on five Dragons this way, you win the game";
}
private CallTheSpiritDragonsEffect(final CallTheSpiritDragonsEffect effect) {
super(effect);
}
@Override
public CallTheSpiritDragonsEffect copy() {
return new CallTheSpiritDragonsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Set<UUID> dragons = new HashSet<>();
for (FilterPermanent filter : filters) {
if (!game.getBattlefield().contains(filter, source, game, 1)) {
continue;
}
TargetPermanent target = new TargetPermanent(filter);
target.withNotTarget(true);
player.choose(Outcome.BoostCreature, target, source, game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null && permanent.addCounters(CounterType.P1P1.createInstance(), source, game)) {
dragons.add(permanent.getId());
}
}
if (dragons.size() >= 5) {
player.won(game);
}
return !dragons.isEmpty();
}
}

View file

@ -40,6 +40,7 @@ public final class TarkirDragonstorm extends ExpansionSet {
cards.add(new SetCardInfo("Bone-Cairn Butcher", 173, Rarity.UNCOMMON, mage.cards.b.BoneCairnButcher.class));
cards.add(new SetCardInfo("Boulderborn Dragon", 239, Rarity.COMMON, mage.cards.b.BoulderbornDragon.class));
cards.add(new SetCardInfo("Breaching Dragonstorm", 101, Rarity.UNCOMMON, mage.cards.b.BreachingDragonstorm.class));
cards.add(new SetCardInfo("Call the Spirit Dragons", 174, Rarity.MYTHIC, mage.cards.c.CallTheSpiritDragons.class));
cards.add(new SetCardInfo("Caustic Exhale", 74, Rarity.COMMON, mage.cards.c.CausticExhale.class));
cards.add(new SetCardInfo("Channeled Dragonfire", 423, Rarity.UNCOMMON, mage.cards.c.ChanneledDragonfire.class));
cards.add(new SetCardInfo("Coordinated Maneuver", 6, Rarity.COMMON, mage.cards.c.CoordinatedManeuver.class));

View file

@ -20,7 +20,7 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
public static final ObjectColor COLORLESS = new ObjectColor();
public static final ObjectColor GOLD = new ObjectColor("O"); // Not multicolored - Sword of Dungeons & Dragons
public static final ObjectColor GOLD = new ObjectColor("O"); // Not multicolored - Sword of Dungeons & Dragons TODO: remove this, it shouldn't have been added
private boolean white;
private boolean blue;
@ -516,8 +516,6 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
colors.add(ObjectColor.BLACK);
colors.add(ObjectColor.RED);
colors.add(ObjectColor.GREEN);
colors.add(ObjectColor.GOLD);
return colors;
}
}

View file

@ -57298,6 +57298,7 @@ Awaken the Honored Dead|Tarkir: Dragonstorm|170|R|{B}{G}{U}|Enchantment - Saga||
Barrensteppe Siege|Tarkir: Dragonstorm|171|R|{2}{W}{B}|Enchantment|||As this enchantment enters, choose Abzan or Mardu.$* Abzan -- At the beginning of your end step, put a +1/+1 counter on each creature you control.$* Mardu -- At the beginning of your end step, if a creature died under your control this turn, each opponent sacrifices a creature of their choice.|
Betor, Kin to All|Tarkir: Dragonstorm|172|M|{2}{W}{B}{G}|Legendary Creature - Spirit Dragon|5|7|Flying$At the beginning of your end step, if creatures you control have total toughness 10 or greater, draw a card. Then if creatures you control have total toughness 20 or greater, untap each creature you control. Then if creatures you control have total toughness 40 or greater, each opponent loses half their life, rounded up.|
Bone-Cairn Butcher|Tarkir: Dragonstorm|173|U|{1}{R}{W}{B}|Creature - Demon|4|4|Mobilize 2$Attacking tokens you control have deathtouch.|
Call the Spirit Dragons|Tarkir: Dragonstorm|174|M|{W}{U}{B}{R}{G}|Enchantment|||Dragons you control have indestructible.$At the beginning of your upkeep, for each color, put a +1/+1 counter on a Dragon you control of that color. If you put +1/+1 counters on five Dragons this way, you win the game.|
Cori Mountain Stalwart|Tarkir: Dragonstorm|175|U|{1}{R}{W}|Creature - Human Monk|3|3|Flurry -- Whenever you cast your second spell each turn, this creature deals 2 damage to each opponent and you gain 2 life.|
Death Begets Life|Tarkir: Dragonstorm|176|M|{5}{B}{G}{U}|Sorcery|||Destroy all creatures and enchantments. Draw a card for each permanent destroyed this way.|
Disruptive Stormbrood|Tarkir: Dragonstorm|178|U|{4}{G}|Creature - Dragon|3|3|Flying$When this creature enters, destroy up to one target artifact or enchantment.|