From 518602bf6100a1da8e771dcebf1fd93c29a2cc70 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 29 Sep 2022 22:49:05 -0400 Subject: [PATCH] [BRO] Implemented The Mightstone and Weakstone --- .../cards/t/TheMightstoneAndWeakstone.java | 58 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + .../src/main/java/mage/constants/SubType.java | 1 + .../game/permanent/token/PowerstoneToken.java | 8 ++- 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/t/TheMightstoneAndWeakstone.java diff --git a/Mage.Sets/src/mage/cards/t/TheMightstoneAndWeakstone.java b/Mage.Sets/src/mage/cards/t/TheMightstoneAndWeakstone.java new file mode 100644 index 0000000000..b373808f61 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheMightstoneAndWeakstone.java @@ -0,0 +1,58 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.mana.ConditionalColorlessManaAbility; +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.game.permanent.token.PowerstoneToken; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheMightstoneAndWeakstone extends CardImpl { + + public TheMightstoneAndWeakstone(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.POWERSTONE); + + // When The Mightstone and Weakstone enters the battlefield, choose one -- + // * Draw two cards. + Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)); + + // * Target creature gets -5/-5 until end of turn. + ability.addMode(new Mode(new BoostTargetEffect(-5, -5)).addTarget(new TargetCreaturePermanent())); + this.addAbility(ability); + + // {T}: Add {C}{C}. This mana can't be spent to cast nonartifact spells. + this.addAbility(new ConditionalColorlessManaAbility(2, PowerstoneToken.makeBuilder())); + + // (Melds with Urza, Lord Protector) + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new InfoEffect("(Melds with Urza, Lord Protector)") + )); + } + + private TheMightstoneAndWeakstone(final TheMightstoneAndWeakstone card) { + super(card); + } + + @Override + public TheMightstoneAndWeakstone copy() { + return new TheMightstoneAndWeakstone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index af2694743c..a6be087e3e 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -27,6 +27,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Plains", 278, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Recruitment Officer", 23, Rarity.UNCOMMON, mage.cards.r.RecruitmentOfficer.class)); cards.add(new SetCardInfo("Swamp", 282, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("The Mightstone and Weakstone", 238, Rarity.RARE, mage.cards.t.TheMightstoneAndWeakstone.class)); } // @Override diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index 634b7564c7..067c6ee4a6 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -47,6 +47,7 @@ public enum SubType { FOOD("Food", SubTypeSet.ArtifactType), FORTIFICATION("Fortification", SubTypeSet.ArtifactType), GOLD("Gold", SubTypeSet.ArtifactType), + POWERSTONE("Powerstone", SubTypeSet.ArtifactType), TREASURE("Treasure", SubTypeSet.ArtifactType), VEHICLE("Vehicle", SubTypeSet.ArtifactType), // 205.3m : Creatures and tribals share their lists of subtypes; these subtypes are called creature types. diff --git a/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java b/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java index 2f1c2f89c2..b03c3e416c 100644 --- a/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java @@ -12,6 +12,7 @@ import mage.abilities.mana.builder.ConditionalManaBuilder; import mage.abilities.mana.conditional.ManaCondition; import mage.cards.Card; import mage.constants.CardType; +import mage.constants.SubType; import mage.game.Game; import mage.game.command.Commander; import mage.game.stack.Spell; @@ -29,9 +30,10 @@ public final class PowerstoneToken extends TokenImpl { public PowerstoneToken() { super("Powerstone Token", "Powerstone token"); cardType.add(CardType.ARTIFACT); + subtype.add(SubType.POWERSTONE); // {T}: Add {C}. This mana can't be spent to cast a nonartifact spell. - this.addAbility(new ConditionalColorlessManaAbility(1, new PowerstoneTokenManaBuilder())); + this.addAbility(new ConditionalColorlessManaAbility(1, makeBuilder())); availableImageSetCodes = Arrays.asList("DMU"); } @@ -43,6 +45,10 @@ public final class PowerstoneToken extends TokenImpl { public PowerstoneToken copy() { return new PowerstoneToken(this); } + + public static PowerstoneTokenManaBuilder makeBuilder() { + return new PowerstoneTokenManaBuilder(); + } } class PowerstoneTokenManaBuilder extends ConditionalManaBuilder {