[ONE] small change to Unctus's Retrofitter

This commit is contained in:
theelk801 2023-04-23 20:58:07 -04:00
parent 37c57424e8
commit cba8cdf092

View file

@ -5,7 +5,6 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.keyword.ToxicAbility; import mage.abilities.keyword.ToxicAbility;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
@ -13,11 +12,12 @@ import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.custom.CreatureToken; import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetControlledPermanent; import mage.target.TargetPermanent;
import java.util.UUID; import java.util.UUID;
public class UnctussRetrofitter extends CardImpl { public class UnctussRetrofitter extends CardImpl {
public UnctussRetrofitter(UUID ownerId, CardSetInfo setInfo) { public UnctussRetrofitter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.addSubType(SubType.PHYREXIAN); this.addSubType(SubType.PHYREXIAN);
@ -25,17 +25,15 @@ public class UnctussRetrofitter extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
//Toxic 1 // Toxic 1
this.addAbility(new ToxicAbility(1)); this.addAbility(new ToxicAbility(1));
//When Unctus's Retrofitter enters the battlefield, up to one target artifact you control becomes an artifact // When Unctus's Retrofitter enters the battlefield, up to one target artifact you control becomes an artifact creature with base power and toughness 4/4 for as long as Unctus's Retrofitter remains on the battlefield.
//creature with base power and toughness 4/4 for as long as Unctus's Retrofitter remains on the battlefield. Ability ability = new EntersBattlefieldTriggeredAbility(new UnctussRetrofitterBecomesCreatureEffect());
EntersBattlefieldTriggeredAbility entersBattlefieldTriggeredAbility = ability.addTarget(new TargetPermanent(
new EntersBattlefieldTriggeredAbility(new UnctussRetrofitterBecomesCreatureEffect()); 0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT
entersBattlefieldTriggeredAbility.addTarget(new TargetControlledPermanent(
0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, false
)); ));
this.addAbility(entersBattlefieldTriggeredAbility); this.addAbility(ability);
} }
private UnctussRetrofitter(final UnctussRetrofitter card) { private UnctussRetrofitter(final UnctussRetrofitter card) {
@ -50,14 +48,14 @@ public class UnctussRetrofitter extends CardImpl {
class UnctussRetrofitterBecomesCreatureEffect extends BecomesCreatureTargetEffect { class UnctussRetrofitterBecomesCreatureEffect extends BecomesCreatureTargetEffect {
public UnctussRetrofitterBecomesCreatureEffect() { UnctussRetrofitterBecomesCreatureEffect() {
super( new CreatureToken(4, 4, "4/4 artifact creature") super(new CreatureToken(4, 4, "4/4 artifact creature")
.withType(CardType.ARTIFACT), false, false, Duration.WhileOnBattlefield); .withType(CardType.ARTIFACT), false, false, Duration.Custom);
this.staticText = "up to one target artifact you control becomes an artifact creature with base power and " + this.staticText = "up to one target artifact you control becomes an artifact creature with base power and " +
"toughness 4/4 for as long as {this} remains on the battlefield"; "toughness 4/4 for as long as {this} remains on the battlefield";
} }
public UnctussRetrofitterBecomesCreatureEffect(final UnctussRetrofitterBecomesCreatureEffect effect) { private UnctussRetrofitterBecomesCreatureEffect(final UnctussRetrofitterBecomesCreatureEffect effect) {
super(effect); super(effect);
} }
@ -68,7 +66,7 @@ class UnctussRetrofitterBecomesCreatureEffect extends BecomesCreatureTargetEffec
@Override @Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
if (sourcePermanent == null) { if (sourcePermanent == null) {
this.discard(); this.discard();
return false; return false;