From 6e089124bb1a7d32414ed54512f70bf0a8ab964b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 4 Nov 2021 18:32:14 -0400 Subject: [PATCH] [VOW] Implemented Bride's Gown --- Mage.Sets/src/mage/cards/b/BridesGown.java | 89 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BridesGown.java diff --git a/Mage.Sets/src/mage/cards/b/BridesGown.java b/Mage.Sets/src/mage/cards/b/BridesGown.java new file mode 100644 index 0000000000..f1ff3a5670 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BridesGown.java @@ -0,0 +1,89 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterEquipmentPermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BridesGown extends CardImpl { + + private static final FilterPermanent filter = new FilterEquipmentPermanent(); + + static { + filter.add(new NamePredicate("Groom's Finery")); + filter.add(BridesGownPredicate.instance); + } + + private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, false); + private static final Hint hint = new ConditionHint( + condition, "An Equipment named Groom's Finery is attached to a creature you control" + ); + + public BridesGown(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{W}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Equipped creature gets +2/+0. It gets an additional +0/+2 and has first strike as long as an equipment named Groom's Finery is attached to a creature you control. + Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(2, 0)); + ability.addEffect(new ConditionalContinuousEffect( + new BoostEquippedEffect(0, 2), + condition, "It gets an additional +0/+2" + )); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilityAttachedEffect( + FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT + ), condition, "and has first strike as long as an Equipment " + + "named Groom's Finery is attached to a creature you control" + )); + this.addAbility(ability.addHint(hint)); + + // Equip {2} + this.addAbility(new EquipAbility(2)); + } + + private BridesGown(final BridesGown card) { + super(card); + } + + @Override + public BridesGown copy() { + return new BridesGown(this); + } +} + +enum BridesGownPredicate implements ObjectSourcePlayerPredicate { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + Permanent permanent = game.getPermanent(input.getObject().getAttachedTo()); + return permanent != null + && permanent.isCreature(game) + && permanent.isControlledBy(input.getPlayerId()); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index f3a16b2cc1..588a0c5bbd 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -47,6 +47,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Bloodvial Purveyor", 98, Rarity.RARE, mage.cards.b.BloodvialPurveyor.class)); cards.add(new SetCardInfo("Blossom-Clad Werewolf", 226, Rarity.COMMON, mage.cards.b.BlossomCladWerewolf.class)); cards.add(new SetCardInfo("Bramble Wurm", 189, Rarity.UNCOMMON, mage.cards.b.BrambleWurm.class)); + cards.add(new SetCardInfo("Bride's Gown", 4, Rarity.UNCOMMON, mage.cards.b.BridesGown.class)); cards.add(new SetCardInfo("By Invitation Only", 5, Rarity.RARE, mage.cards.b.ByInvitationOnly.class)); cards.add(new SetCardInfo("Cartographer's Survey", 190, Rarity.UNCOMMON, mage.cards.c.CartographersSurvey.class)); cards.add(new SetCardInfo("Catapult Captain", 99, Rarity.UNCOMMON, mage.cards.c.CatapultCaptain.class));