From f1b9b5aba78f96e0618f462bff0a8a41bd4612b7 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 14 Dec 2019 11:08:14 -0500 Subject: [PATCH] Implemented Daxos, Blessed by the Sun --- .../mage/cards/d/DaxosBlessedByTheSun.java | 89 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + .../src/main/java/mage/constants/SubType.java | 1 + 3 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java diff --git a/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java b/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java new file mode 100644 index 0000000000..9335f9e349 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DaxosBlessedByTheSun.java @@ -0,0 +1,89 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DaxosBlessedByTheSun extends CardImpl { + + private static final DynamicValue xValue = new DevotionCount(ColoredManaSymbol.W); + + public DaxosBlessedByTheSun(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{W}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DEMIGOD); + this.power = new MageInt(2); + this.toughness = new MageInt(0); + + // Daxos's toughness is equal to your devotion to white. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SetToughnessSourceEffect(xValue, Duration.EndOfGame + ).setText("{this}'s toughness is equal to your devotion to white"))); + + // Whenever another creature you control enters the battlefield or dies, you gain 1 life. + this.addAbility(new DaxosBlessedByTheSunAbility()); + } + + private DaxosBlessedByTheSun(final DaxosBlessedByTheSun card) { + super(card); + } + + @Override + public DaxosBlessedByTheSun copy() { + return new DaxosBlessedByTheSun(this); + } +} + +class DaxosBlessedByTheSunAbility extends TriggeredAbilityImpl { + + DaxosBlessedByTheSunAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(1)); + } + + private DaxosBlessedByTheSunAbility(DaxosBlessedByTheSunAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) + || (event.getType() == GameEvent.EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).isDiesEvent()); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(this.getSourceId())) { + return false; + } + Permanent creature = game.getPermanentOrLKIBattlefield(event.getTargetId()); + return creature != null && creature.isControlledBy(this.getControllerId()); + } + + @Override + public String getRule() { + return "Whenever another creature you control enters the battlefield or dies, you gain 1 life."; + } + + @Override + public DaxosBlessedByTheSunAbility copy() { + return new DaxosBlessedByTheSunAbility(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index 010ffbf334..2e7783bceb 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -26,6 +26,7 @@ public final class TherosBeyondDeath extends ExpansionSet { this.ratioBoosterMythic = 8; this.maxCardNumberInBooster = 254; + cards.add(new SetCardInfo("Daxos, Blessed by the Sun", 9, Rarity.UNCOMMON, mage.cards.d.DaxosBlessedByTheSun.class)); cards.add(new SetCardInfo("Eidolon of Philosophy", 48, Rarity.COMMON, mage.cards.e.EidolonOfPhilosophy.class)); cards.add(new SetCardInfo("Elspeth, Sun's Nemesis", 14, Rarity.MYTHIC, mage.cards.e.ElspethSunsNemesis.class)); cards.add(new SetCardInfo("Forest", 254, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index e74f2a8552..c4a92c2d34 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -110,6 +110,7 @@ public enum SubType { // D DATHOMIRIAN("Dathomirian", SubTypeSet.CreatureType, true), // Star Wars DAUTHI("Dauthi", SubTypeSet.CreatureType), + DEMIGOD("Demigod", SubTypeSet.CreatureType), DEMON("Demon", SubTypeSet.CreatureType), DESERTER("Deserter", SubTypeSet.CreatureType), DEVIL("Devil", SubTypeSet.CreatureType),