From 8158751813ef69ec6990626db851f8f9986a4f36 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 31 Jul 2025 11:25:04 -0400 Subject: [PATCH] refactor a card with craft --- .../src/mage/cards/b/BladewheelChariot.java | 35 +-------------- .../mage/cards/s/SpringLoadedSawblades.java | 44 ++++++++++++++++--- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BladewheelChariot.java b/Mage.Sets/src/mage/cards/b/BladewheelChariot.java index aa6b22cf8aa..d9f916154ac 100644 --- a/Mage.Sets/src/mage/cards/b/BladewheelChariot.java +++ b/Mage.Sets/src/mage/cards/b/BladewheelChariot.java @@ -1,20 +1,9 @@ package mage.cards.b; -import mage.MageInt; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.TapTargetCost; -import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect; -import mage.abilities.keyword.CrewAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.cards.TransformingDoubleFacedCard; import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.SubType; -import mage.filter.common.FilterControlledArtifactPermanent; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.AnotherPredicate; -import mage.filter.predicate.permanent.TappedPredicate; -import mage.target.common.TargetControlledPermanent; import java.util.UUID; @@ -23,30 +12,10 @@ import java.util.UUID; */ public final class BladewheelChariot extends CardImpl { - private static final FilterControlledPermanent filter - = new FilterControlledArtifactPermanent("other untapped artifacts you control"); - - static { - filter.add(AnotherPredicate.instance); - filter.add(TappedPredicate.UNTAPPED); - } - public BladewheelChariot(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, ""); - - this.subtype.add(SubType.VEHICLE); - this.power = new MageInt(5); - this.toughness = new MageInt(5); this.nightCard = true; - this.color.setWhite(true); - - // Tap two other untapped artifacts you control: Bladewheel Chariot becomes an artifact creature until end of turn. - this.addAbility(new SimpleActivatedAbility(new AddCardTypeSourceEffect( - Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE - ).setText("{this} becomes an artifact creature until end of turn"), new TapTargetCost(new TargetControlledPermanent(2, filter)))); - - // Crew 1 - this.addAbility(new CrewAbility(1)); + TransformingDoubleFacedCard.copyToBackFace(new mage.cards.s.SpringLoadedSawblades(ownerId, setInfo), this); } private BladewheelChariot(final BladewheelChariot card) { diff --git a/Mage.Sets/src/mage/cards/s/SpringLoadedSawblades.java b/Mage.Sets/src/mage/cards/s/SpringLoadedSawblades.java index d9c7374a10f..1bd92619c4f 100644 --- a/Mage.Sets/src/mage/cards/s/SpringLoadedSawblades.java +++ b/Mage.Sets/src/mage/cards/s/SpringLoadedSawblades.java @@ -2,45 +2,77 @@ package mage.cards.s; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect; import mage.abilities.keyword.CraftAbility; +import mage.abilities.keyword.CrewAbility; import mage.abilities.keyword.FlashAbility; -import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.cards.TransformingDoubleFacedCard; import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterOpponentsCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherPredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; import java.util.UUID; /** * @author TheElk801 */ -public final class SpringLoadedSawblades extends CardImpl { +public final class SpringLoadedSawblades extends TransformingDoubleFacedCard { private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent("tapped creature an opponent controls"); + private static final FilterControlledPermanent filter2 + = new FilterControlledArtifactPermanent("other untapped artifacts you control"); static { filter.add(TappedPredicate.TAPPED); + filter2.add(AnotherPredicate.instance); + filter2.add(TappedPredicate.UNTAPPED); } public SpringLoadedSawblades(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{W}"); + super( + ownerId, setInfo, + new CardType[]{CardType.ARTIFACT}, new SubType[]{}, "{1}{W}", + "Bladewheel Chariot", + new CardType[]{CardType.ARTIFACT}, new SubType[]{SubType.VEHICLE}, "W" + ); + this.getRightHalfCard().setPT(5, 5); + this.secondSideCardClazz = mage.cards.b.BladewheelChariot.class; // Flash - this.addAbility(FlashAbility.getInstance()); + this.getLeftHalfCard().addAbility(FlashAbility.getInstance()); // When Spring-Loaded Sawblades enters the battlefield, it deals 5 damage to target tapped creature an opponent controls. Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(5, "it")); ability.addTarget(new TargetPermanent(filter)); - this.addAbility(ability); + this.getLeftHalfCard().addAbility(ability); // Craft with artifact {3}{W} - this.addAbility(new CraftAbility("{3}{W}")); + this.getLeftHalfCard().addAbility(new CraftAbility("{3}{W}")); + + // Bladewheel Chariot + // Tap two other untapped artifacts you control: Bladewheel Chariot becomes an artifact creature until end of turn. + this.getRightHalfCard().addAbility(new SimpleActivatedAbility(new AddCardTypeSourceEffect( + Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE + ).setText("{this} becomes an artifact creature until end of turn"), new TapTargetCost(new TargetControlledPermanent(2, filter2)))); + + // Crew 1 + this.getRightHalfCard().addAbility(new CrewAbility(1)); + + this.finalizeDFC(); } private SpringLoadedSawblades(final SpringLoadedSawblades card) {