From a4d90bae0fc78036733475d51b8daa9f839db489 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 24 Jul 2025 10:47:46 -0400 Subject: [PATCH] [SPM] Implement Spider-Man, Web Slinger --- .../src/mage/cards/s/SpiderManWebSlinger.java | 40 +++++++++++ Mage.Sets/src/mage/sets/MarvelsSpiderMan.java | 1 + .../abilities/keyword/WebSlingingAbility.java | 72 +++++++++++++++++++ Utils/keywords.txt | 1 + 4 files changed, 114 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SpiderManWebSlinger.java create mode 100644 Mage/src/main/java/mage/abilities/keyword/WebSlingingAbility.java diff --git a/Mage.Sets/src/mage/cards/s/SpiderManWebSlinger.java b/Mage.Sets/src/mage/cards/s/SpiderManWebSlinger.java new file mode 100644 index 00000000000..d4af2a9f821 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SpiderManWebSlinger.java @@ -0,0 +1,40 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.keyword.WebSlingingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SpiderManWebSlinger extends CardImpl { + + public SpiderManWebSlinger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.SPIDER); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.HERO); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Web-slinging {W} + this.addAbility(new WebSlingingAbility(this, "{W}")); + } + + private SpiderManWebSlinger(final SpiderManWebSlinger card) { + super(card); + } + + @Override + public SpiderManWebSlinger copy() { + return new SpiderManWebSlinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java b/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java index 7bf740b4f64..e75a51b1f82 100644 --- a/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java +++ b/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java @@ -51,6 +51,7 @@ public final class MarvelsSpiderMan extends ExpansionSet { cards.add(new SetCardInfo("Spider-Byte, Web Warden", 44, Rarity.UNCOMMON, mage.cards.s.SpiderByteWebWarden.class)); cards.add(new SetCardInfo("Spider-Gwen, Free Spirit", 90, Rarity.COMMON, mage.cards.s.SpiderGwenFreeSpirit.class)); cards.add(new SetCardInfo("Spider-Ham, Peter Porker", 114, Rarity.RARE, mage.cards.s.SpiderHamPeterPorker.class)); + cards.add(new SetCardInfo("Spider-Man, Web-Slinger", 16, Rarity.COMMON, mage.cards.s.SpiderManWebSlinger.class)); cards.add(new SetCardInfo("Spider-Rex, Daring Dino", 116, Rarity.COMMON, mage.cards.s.SpiderRexDaringDino.class)); cards.add(new SetCardInfo("Starling, Aerial Ally", 18, Rarity.COMMON, mage.cards.s.StarlingAerialAlly.class)); cards.add(new SetCardInfo("Swamp", 196, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/abilities/keyword/WebSlingingAbility.java b/Mage/src/main/java/mage/abilities/keyword/WebSlingingAbility.java new file mode 100644 index 00000000000..4faa0001a6e --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/WebSlingingAbility.java @@ -0,0 +1,72 @@ +package mage.abilities.keyword; + +import mage.MageIdentifier; +import mage.abilities.SpellAbility; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.cards.Card; +import mage.constants.SpellAbilityType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.target.common.TargetControlledPermanent; + +import java.util.Set; + +/** + * @author LevelX2 + */ +public class WebSlingingAbility extends SpellAbility { + + public static final String WEB_SLINGING_ACTIVATION_VALUE_KEY = "webSlingingActivation"; + private static final FilterControlledPermanent filter = new FilterControlledCreaturePermanent("tapped creature you control"); + + static { + filter.add(TappedPredicate.TAPPED); + } + + public WebSlingingAbility(Card card, String manaString) { + super(card.getSpellAbility()); + this.newId(); + this.setCardName(card.getName() + " with Web-slinging"); + zone = Zone.HAND; + spellAbilityType = SpellAbilityType.BASE_ALTERNATE; + + this.clearManaCosts(); + this.clearManaCostsToPay(); + this.addCost(new ManaCostsImpl<>(manaString)); + this.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); + + this.setRuleAtTheTop(true); + } + + protected WebSlingingAbility(final WebSlingingAbility ability) { + super(ability); + } + + @Override + public boolean activate(Game game, Set allowedIdentifiers, boolean noMana) { + if (!super.activate(game, allowedIdentifiers, noMana)) { + return false; + } + this.setCostsTag(WEB_SLINGING_ACTIVATION_VALUE_KEY, null); + return true; + } + + @Override + public WebSlingingAbility copy() { + return new WebSlingingAbility(this); + } + + @Override + public String getRule() { + StringBuilder sb = new StringBuilder("Web-slinging "); + sb.append(getManaCosts().getText()); + sb.append(" (You may cast this spell for "); + sb.append(getManaCosts().getText()); + sb.append(" if you also return a tapped creature you control to its owner's hand.)"); + return sb.toString(); + } +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 5dd4945cf5d..f23982f5082 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -149,4 +149,5 @@ Vanishing|number| Vigilance|instance| Ward|cost| Warp|card, manaString| +Web-slinging|card, manaString| Wither|instance|