From 630617b6d051e51e40d49d910d426471fde3f41a Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 15 Jan 2023 11:54:53 -0500 Subject: [PATCH] [ONE] Implement Ovika, Enigma Goliath --- .../src/main/resources/card-pictures-tok.txt | 2 +- .../mage/cards/c/ChancellorOfTheForge.java | 6 +- .../src/mage/cards/o/OvikaEnigmaGoliath.java | 98 +++++++++++++++++++ .../src/mage/sets/PhyrexiaAllWillBeOne.java | 1 + .../token/PhyrexianGoblinHasteToken.java | 36 +++++++ .../permanent/token/PhyrexianGoblinToken.java | 6 +- 6 files changed, 141 insertions(+), 8 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/o/OvikaEnigmaGoliath.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinHasteToken.java diff --git a/Mage.Client/src/main/resources/card-pictures-tok.txt b/Mage.Client/src/main/resources/card-pictures-tok.txt index 144a61636d..a3d9b615b0 100644 --- a/Mage.Client/src/main/resources/card-pictures-tok.txt +++ b/Mage.Client/src/main/resources/card-pictures-tok.txt @@ -852,7 +852,7 @@ |Generate|TOK:NEM|Saproling|1||SaprolingBurstToken| |Generate|TOK:NEM|Saproling|2||SaprolingToken| |Generate|TOK:NPH|Beast|||BeastToken| -|Generate|TOK:NPH|Phyrexian Goblin|||PhyrexianGoblinToken| +|Generate|TOK:NPH|Phyrexian Goblin|||PhyrexianGoblinHasteToken| |Generate|TOK:NPH|Phyrexian Golem|||PhyrexianGolemToken| |Generate|TOK:NPH|Phyrexian Myr|||PhyrexianMyrToken| |Generate|TOK:ODY|Bear|||BearToken| diff --git a/Mage.Sets/src/mage/cards/c/ChancellorOfTheForge.java b/Mage.Sets/src/mage/cards/c/ChancellorOfTheForge.java index c735aa1cac..aa56303604 100644 --- a/Mage.Sets/src/mage/cards/c/ChancellorOfTheForge.java +++ b/Mage.Sets/src/mage/cards/c/ChancellorOfTheForge.java @@ -16,7 +16,7 @@ import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.token.PhyrexianGoblinToken; +import mage.game.permanent.token.PhyrexianGoblinHasteToken; import java.util.UUID; @@ -45,7 +45,7 @@ public final class ChancellorOfTheForge extends CardImpl { // When Chancellor of the Forge enters the battlefield, create X 1/1 red Goblin creature tokens with haste, where X is the number of creatures you control. DynamicValue value = new PermanentsOnBattlefieldCount(filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PhyrexianGoblinToken(), value), false) + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PhyrexianGoblinHasteToken(), value), false) .addHint(CreaturesYouControlHint.instance)); } @@ -62,7 +62,7 @@ public final class ChancellorOfTheForge extends CardImpl { class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbility { ChancellorOfTheForgeDelayedTriggeredAbility() { - super(new CreateTokenEffect(new PhyrexianGoblinToken())); + super(new CreateTokenEffect(new PhyrexianGoblinHasteToken())); } ChancellorOfTheForgeDelayedTriggeredAbility(ChancellorOfTheForgeDelayedTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/cards/o/OvikaEnigmaGoliath.java b/Mage.Sets/src/mage/cards/o/OvikaEnigmaGoliath.java new file mode 100644 index 0000000000..ba85515d99 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OvikaEnigmaGoliath.java @@ -0,0 +1,98 @@ +package mage.cards.o; + +import java.util.UUID; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.CompositeCost; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.PhyrexianGoblinToken; +import mage.game.permanent.token.Token; +import mage.game.stack.Spell; +import mage.target.targetpointer.FixedTargets; + +/** + * @author TheElk801 + */ +public final class OvikaEnigmaGoliath extends CardImpl { + + public OvikaEnigmaGoliath(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.NIGHTMARE); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Ward--{3}, Pay 3 life. + this.addAbility(new WardAbility(new CompositeCost( + new GenericManaCost(2), new PayLifeCost(3), "{3}, Pay 3 life" + ))); + + // Whenever you cast a noncreature spell, create X 1/1 red Phyrexian Goblin creature tokens, where X is the mana value of that spell. They gain haste until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility( + new OvikaEnigmaGoliathEffect(), StaticFilters.FILTER_SPELL_A_NON_CREATURE, false + )); + } + + private OvikaEnigmaGoliath(final OvikaEnigmaGoliath card) { + super(card); + } + + @Override + public OvikaEnigmaGoliath copy() { + return new OvikaEnigmaGoliath(this); + } +} + +class OvikaEnigmaGoliathEffect extends OneShotEffect { + + OvikaEnigmaGoliathEffect() { + super(Outcome.Benefit); + staticText = "create X 1/1 red Phyrexian Goblin creature tokens, " + + "where X is the mana value of that spell. They gain haste until end of turn"; + } + + private OvikaEnigmaGoliathEffect(final OvikaEnigmaGoliathEffect effect) { + super(effect); + } + + @Override + public OvikaEnigmaGoliathEffect copy() { + return new OvikaEnigmaGoliathEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = (Spell) getValue("spellCast"); + if (spell == null || spell.getManaValue() < 1) { + return false; + } + Token token = new PhyrexianGoblinToken(); + token.putOntoBattlefield(spell.getManaValue(), game, source); + game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance()) + .setTargetPointer(new FixedTargets(token, game)), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java index 2af9d6c5f2..0b764a2897 100644 --- a/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java +++ b/Mage.Sets/src/mage/sets/PhyrexiaAllWillBeOne.java @@ -40,6 +40,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet { cards.add(new SetCardInfo("Mirrex", 254, Rarity.RARE, mage.cards.m.Mirrex.class)); cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Norn's Wellspring", 24, Rarity.RARE, mage.cards.n.NornsWellspring.class)); + cards.add(new SetCardInfo("Ovika, Enigma Goliath", 213, Rarity.RARE, mage.cards.o.OvikaEnigmaGoliath.class)); cards.add(new SetCardInfo("Phyrexian Arena", 104, Rarity.RARE, mage.cards.p.PhyrexianArena.class)); cards.add(new SetCardInfo("Phyrexian Obliterator", 105, Rarity.MYTHIC, mage.cards.p.PhyrexianObliterator.class)); cards.add(new SetCardInfo("Plains", 272, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinHasteToken.java b/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinHasteToken.java new file mode 100644 index 0000000000..fc2c7e6ee5 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinHasteToken.java @@ -0,0 +1,36 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.Arrays; + +/** + * @author TheElk801 + */ +public final class PhyrexianGoblinHasteToken extends TokenImpl { + + public PhyrexianGoblinHasteToken() { + super("Phyrexian Goblin Token", "1/1 red Phyrexian Goblin creature token with haste"); + cardType.add(CardType.CREATURE); + subtype.add(SubType.PHYREXIAN); + subtype.add(SubType.GOBLIN); + color.setRed(true); + power = new MageInt(1); + toughness = new MageInt(1); + + addAbility(HasteAbility.getInstance()); + + availableImageSetCodes = Arrays.asList("NPH"); + } + + public PhyrexianGoblinHasteToken(final PhyrexianGoblinHasteToken token) { + super(token); + } + + public PhyrexianGoblinHasteToken copy() { + return new PhyrexianGoblinHasteToken(this); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinToken.java b/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinToken.java index fce194cf0d..33478670f9 100644 --- a/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/PhyrexianGoblinToken.java @@ -13,7 +13,7 @@ import java.util.Arrays; public final class PhyrexianGoblinToken extends TokenImpl { public PhyrexianGoblinToken() { - super("Phyrexian Goblin Token", "1/1 red Phyrexian Goblin creature token with haste"); + super("Phyrexian Goblin Token", "1/1 red Phyrexian Goblin creature token"); cardType.add(CardType.CREATURE); subtype.add(SubType.PHYREXIAN); subtype.add(SubType.GOBLIN); @@ -21,9 +21,7 @@ public final class PhyrexianGoblinToken extends TokenImpl { power = new MageInt(1); toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - - availableImageSetCodes = Arrays.asList("NPH"); + availableImageSetCodes = Arrays.asList("ONE"); } public PhyrexianGoblinToken(final PhyrexianGoblinToken token) {