From 5bb8ff2c7fd8b95198535d41db89dd84f06753ad Mon Sep 17 00:00:00 2001 From: jmlundeen Date: Wed, 3 Sep 2025 10:58:09 -0500 Subject: [PATCH] [SPM] Implement Friendly Neighborhood --- .../mage/cards/f/FriendlyNeighborhood.java | 65 +++++++++++++++++++ Mage.Sets/src/mage/sets/MarvelsSpiderMan.java | 1 + .../permanent/token/HumanCitizenToken.java | 31 +++++++++ 3 files changed, 97 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FriendlyNeighborhood.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/HumanCitizenToken.java diff --git a/Mage.Sets/src/mage/cards/f/FriendlyNeighborhood.java b/Mage.Sets/src/mage/cards/f/FriendlyNeighborhood.java new file mode 100644 index 00000000000..d6a1c2b4e4f --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FriendlyNeighborhood.java @@ -0,0 +1,65 @@ +package mage.cards.f; + +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.permanent.token.HumanCitizenToken; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +import java.util.UUID; + +/** + * + * @author Jmlundeen + */ +public final class FriendlyNeighborhood extends CardImpl { + + public FriendlyNeighborhood(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + + this.subtype.add(SubType.AURA); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + this.addAbility(new EnchantAbility(auraTarget)); + + // When this Aura enters, create three 1/1 green and white Human Citizen creature tokens. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new HumanCitizenToken(), 3))); + + // Enchanted land has "{1}, {T}: Target creature gets +1/+1 until end of turn for each creature you control. Activate only as a sorcery." + Effect boostEffect = new BoostTargetEffect(CreaturesYouControlCount.SINGULAR, CreaturesYouControlCount.SINGULAR) + .setText("Target creature gets +1/+1 until end of turn for each creature you control"); + Ability ability = new ActivateAsSorceryActivatedAbility(boostEffect, + new ManaCostsImpl<>("{1}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(ability, AttachmentType.AURA, Duration.WhileOnBattlefield, null, "land") + .withQuotes(true))); + } + + private FriendlyNeighborhood(final FriendlyNeighborhood card) { + super(card); + } + + @Override + public FriendlyNeighborhood copy() { + return new FriendlyNeighborhood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java b/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java index 1246b51e1ea..9373c729405 100644 --- a/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java +++ b/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java @@ -63,6 +63,7 @@ public final class MarvelsSpiderMan extends ExpansionSet { cards.add(new SetCardInfo("Flying Octobot", 31, Rarity.UNCOMMON, mage.cards.f.FlyingOctobot.class)); cards.add(new SetCardInfo("Forest", 193, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 198, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Friendly Neighborhood", 246, Rarity.RARE, mage.cards.f.FriendlyNeighborhood.class)); cards.add(new SetCardInfo("Gallant Citizen", 129, Rarity.COMMON, mage.cards.g.GallantCitizen.class)); cards.add(new SetCardInfo("Green Goblin, Revenant", 130, Rarity.UNCOMMON, mage.cards.g.GreenGoblinRevenant.class)); cards.add(new SetCardInfo("Grow Extra Arms", 101, Rarity.COMMON, mage.cards.g.GrowExtraArms.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/HumanCitizenToken.java b/Mage/src/main/java/mage/game/permanent/token/HumanCitizenToken.java new file mode 100644 index 00000000000..dd094f16380 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/HumanCitizenToken.java @@ -0,0 +1,31 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author LoneFox + */ +public final class HumanCitizenToken extends TokenImpl { + + public HumanCitizenToken() { + super("Human Token", "1/1 green and white Human Citizen creature token"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + color.setWhite(true); + subtype.add(SubType.HUMAN); + subtype.add(SubType.CITIZEN); + power = new MageInt(1); + toughness = new MageInt(1); + } + + private HumanCitizenToken(final HumanCitizenToken token) { + super(token); + } + + @Override + public HumanCitizenToken copy() { + return new HumanCitizenToken(this); + } +}