[SPM] Implement Friendly Neighborhood

This commit is contained in:
jmlundeen 2025-09-03 10:58:09 -05:00
parent ace21c67c1
commit 5bb8ff2c7f
3 changed files with 97 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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));

View file

@ -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);
}
}