From 871479f0756db11c7c18c3cfaa1d8558abac607d Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 18 Jun 2023 14:01:54 -0400 Subject: [PATCH] [LTR] Implement Bilbo's Ring --- Mage.Sets/src/mage/cards/b/BilbosRing.java | 72 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 73 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BilbosRing.java diff --git a/Mage.Sets/src/mage/cards/b/BilbosRing.java b/Mage.Sets/src/mage/cards/b/BilbosRing.java new file mode 100644 index 0000000000..7115b906c7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BilbosRing.java @@ -0,0 +1,72 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksAloneAttachedTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.effects.common.combat.CantBeBlockedAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.hint.common.MyTurnHint; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BilbosRing extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledCreaturePermanent(SubType.HALFLING, "Halfling"); + + public BilbosRing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.EQUIPMENT); + + // As long as it's your turn, equipped creature has hexproof and can't be blocked. + Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect( + new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT), + MyTurnCondition.instance, "as long as it's your turn, equipped creature has hexproof" + )); + ability.addEffect(new ConditionalRestrictionEffect( + new CantBeBlockedAttachedEffect(AttachmentType.EQUIPMENT), + MyTurnCondition.instance, "and can't be blocked" + )); + this.addAbility(ability.addHint(MyTurnHint.instance)); + + // Whenever equipped creature attacks alone, you draw a card and you lose 1 life. + ability = new AttacksAloneAttachedTriggeredAbility( + new DrawCardSourceControllerEffect(1, "you") + ); + ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and")); + this.addAbility(ability); + + // Equip Halfling {1} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1), new TargetPermanent(filter))); + + // Equip {4} + this.addAbility(new EquipAbility(4)); + } + + private BilbosRing(final BilbosRing card) { + super(card); + } + + @Override + public BilbosRing copy() { + return new BilbosRing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 6143295f71..ff2550f91d 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -29,6 +29,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Banish from Edoras", 1, Rarity.COMMON, mage.cards.b.BanishFromEdoras.class)); cards.add(new SetCardInfo("Barad-dur", 253, Rarity.RARE, mage.cards.b.BaradDur.class)); cards.add(new SetCardInfo("Battle-Scarred Goblin", 115, Rarity.COMMON, mage.cards.b.BattleScarredGoblin.class)); + cards.add(new SetCardInfo("Bilbo's Ring", 298, Rarity.RARE, mage.cards.b.BilbosRing.class)); cards.add(new SetCardInfo("Bilbo, Retired Burglar", 196, Rarity.UNCOMMON, mage.cards.b.BilboRetiredBurglar.class)); cards.add(new SetCardInfo("Birthday Escape", 43, Rarity.COMMON, mage.cards.b.BirthdayEscape.class)); cards.add(new SetCardInfo("Bitter Downfall", 77, Rarity.UNCOMMON, mage.cards.b.BitterDownfall.class));