MOM: Added card "Heliod, the Radiant Dawn" and its abilities and effects (#10038)

* MOM: Added card "Heliod, the Radiant Dawn" and its abilities and effects

* added night card

---------

Co-authored-by: Daniel Eberhard <daniel.h.e@gmx.de>
Co-authored-by: Evan Kranzler <theelk801@gmail.com>
This commit is contained in:
Merlingilb 2023-03-31 00:16:54 +02:00 committed by GitHub
parent 537e072024
commit f2be84c93b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 162 additions and 0 deletions

View file

@ -0,0 +1,59 @@
package mage.cards.h;
import mage.MageInt;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.target.TargetCard;
import java.util.UUID;
public class HeliodTheRadiantDawn extends CardImpl {
private static final FilterCard filter = new FilterCard("enchantment card that isn't a God");
static {
filter.add(CardType.ENCHANTMENT.getPredicate());
filter.add(Predicates.not(SubType.GOD.getPredicate()));
}
public HeliodTheRadiantDawn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{W}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.addSubType(SubType.GOD);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.secondSideCardClazz = mage.cards.h.HeliodTheWarpedEclipse.class;
//When Heliod, the Radiant Dawn enters the battlefield, return target enchantment card that isn't a God from
//your graveyard to your hand.
EntersBattlefieldTriggeredAbility entersBattlefieldTriggeredAbility =
new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect());
entersBattlefieldTriggeredAbility.addTarget(new TargetCard(Zone.GRAVEYARD, filter));
this.addAbility(entersBattlefieldTriggeredAbility);
//{3}{U/P}: Transform Heliod, the Radiant Dawn. Activate only as a sorcery.
this.addAbility(new TransformAbility());
this.addAbility(new ActivateAsSorceryActivatedAbility(new TransformSourceEffect(), new ManaCostsImpl<>("{3}{U/P}")));
}
private HeliodTheRadiantDawn(final HeliodTheRadiantDawn card) {
super(card);
}
@Override
public HeliodTheRadiantDawn copy() {
return new HeliodTheRadiantDawn(this);
}
}

View file

@ -0,0 +1,99 @@
package mage.cards.h;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashAllEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
public class HeliodTheWarpedEclipse extends CardImpl {
public HeliodTheWarpedEclipse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "");
this.color.setWhite(true);
this.color.setBlue(true);
this.addSuperType(SuperType.LEGENDARY);
this.addSubType(SubType.PHYREXIAN);
this.addSubType(SubType.GOD);
this.power = new MageInt(4);
this.toughness = new MageInt(6);
this.nightCard = true;
//You may cast spells as though they had flash.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashAllEffect(
Duration.WhileOnBattlefield, StaticFilters.FILTER_CARD_NON_LAND
)));
//Spells you cast cost {1} less to cast for each card your opponents have drawn this turn.
this.addAbility(new SimpleStaticAbility(new HeliodTheWarpedEclipseEffect()));
}
private HeliodTheWarpedEclipse(final HeliodTheWarpedEclipse card) {
super(card);
}
@Override
public HeliodTheWarpedEclipse copy() {
return new HeliodTheWarpedEclipse(this);
}
}
class HeliodTheWarpedEclipseEffect extends CostModificationEffectImpl {
HeliodTheWarpedEclipseEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
staticText = "spells you cast cost {1} less to cast for each card your opponents have drawn this turn";
}
private HeliodTheWarpedEclipseEffect(final HeliodTheWarpedEclipseEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class);
if (watcher == null) {
return false;
}
int amount = 0;
for (UUID playerID : game.getOpponents(source.getControllerId())) {
amount = amount + watcher.getCardsDrawnThisTurn(playerID);
}
if (amount < 1) {
return false;
}
CardUtil.adjustCost((SpellAbility) abilityToModify, amount);
return true;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (!(abilityToModify instanceof SpellAbility)) {
return false;
}
Card sourceCard = game.getCard(abilityToModify.getSourceId());
return sourceCard != null && abilityToModify.isControlledBy(source.getControllerId());
}
@Override
public HeliodTheWarpedEclipseEffect copy() {
return new HeliodTheWarpedEclipseEffect(this);
}
}

View file

@ -24,6 +24,10 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Bloodfell Caves", 267, Rarity.COMMON, mage.cards.b.BloodfellCaves.class));
cards.add(new SetCardInfo("Blossoming Sands", 268, Rarity.COMMON, mage.cards.b.BlossomingSands.class));
cards.add(new SetCardInfo("Dismal Backwater", 269, Rarity.COMMON, mage.cards.d.DismalBackwater.class));
cards.add(new SetCardInfo("Heliod, the Radiant Dawn", 17, Rarity.RARE, mage.cards.h.HeliodTheRadiantDawn.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Heliod, the Radiant Dawn", 293, Rarity.RARE, mage.cards.h.HeliodTheRadiantDawn.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Heliod, the Warped Eclipse", 17, Rarity.RARE, mage.cards.h.HeliodTheWarpedEclipse.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Heliod, the Warped Eclipse", 293, Rarity.RARE, mage.cards.h.HeliodTheWarpedEclipse.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Fairgrounds Trumpeter", 335, Rarity.COMMON, mage.cards.f.FairgroundsTrumpeter.class));
cards.add(new SetCardInfo("Forest", 281, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Island", 278, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));