refactor a card with craft

This commit is contained in:
theelk801 2025-07-31 11:25:04 -04:00
parent 7609c3087c
commit 8158751813
2 changed files with 40 additions and 39 deletions

View file

@ -1,20 +1,9 @@
package mage.cards.b; 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.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.TransformingDoubleFacedCard;
import mage.constants.CardType; 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; import java.util.UUID;
@ -23,30 +12,10 @@ import java.util.UUID;
*/ */
public final class BladewheelChariot extends CardImpl { 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) { public BladewheelChariot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, ""); 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.nightCard = true;
this.color.setWhite(true); TransformingDoubleFacedCard.copyToBackFace(new mage.cards.s.SpringLoadedSawblades(ownerId, setInfo), this);
// 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));
} }
private BladewheelChariot(final BladewheelChariot card) { private BladewheelChariot(final BladewheelChariot card) {

View file

@ -2,45 +2,77 @@ package mage.cards.s;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; 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.DamageTargetEffect;
import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect;
import mage.abilities.keyword.CraftAbility; import mage.abilities.keyword.CraftAbility;
import mage.abilities.keyword.CrewAbility;
import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.TransformingDoubleFacedCard;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent; import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.filter.predicate.permanent.TappedPredicate; import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID; import java.util.UUID;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
public final class SpringLoadedSawblades extends CardImpl { public final class SpringLoadedSawblades extends TransformingDoubleFacedCard {
private static final FilterPermanent filter private static final FilterPermanent filter
= new FilterOpponentsCreaturePermanent("tapped creature an opponent controls"); = new FilterOpponentsCreaturePermanent("tapped creature an opponent controls");
private static final FilterControlledPermanent filter2
= new FilterControlledArtifactPermanent("other untapped artifacts you control");
static { static {
filter.add(TappedPredicate.TAPPED); filter.add(TappedPredicate.TAPPED);
filter2.add(AnotherPredicate.instance);
filter2.add(TappedPredicate.UNTAPPED);
} }
public SpringLoadedSawblades(UUID ownerId, CardSetInfo setInfo) { 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; this.secondSideCardClazz = mage.cards.b.BladewheelChariot.class;
// Flash // 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. // 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 ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(5, "it"));
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability); this.getLeftHalfCard().addAbility(ability);
// Craft with artifact {3}{W} // 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) { private SpringLoadedSawblades(final SpringLoadedSawblades card) {