ONE: Added card "Unctus's Retrofitter" and its abilities and effects (#10044)

Co-authored-by: Daniel Eberhard <daniel.h.e@gmx.de>
This commit is contained in:
Merlingilb 2023-04-24 02:43:39 +02:00 committed by GitHub
parent 577c94b877
commit 5dbbaf8ba0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.u;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.keyword.ToxicAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
public class UnctussRetrofitter extends CardImpl {
public UnctussRetrofitter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.addSubType(SubType.PHYREXIAN);
this.addSubType(SubType.ARTIFICER);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
//Toxic 1
this.addAbility(new ToxicAbility(1));
//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.
EntersBattlefieldTriggeredAbility entersBattlefieldTriggeredAbility =
new EntersBattlefieldTriggeredAbility(new UnctussRetrofitterBecomesCreatureEffect());
entersBattlefieldTriggeredAbility.addTarget(new TargetControlledPermanent(
0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, false
));
this.addAbility(entersBattlefieldTriggeredAbility);
}
private UnctussRetrofitter(final UnctussRetrofitter card) {
super(card);
}
@Override
public UnctussRetrofitter copy() {
return new UnctussRetrofitter(this);
}
}
class UnctussRetrofitterBecomesCreatureEffect extends BecomesCreatureTargetEffect {
public UnctussRetrofitterBecomesCreatureEffect() {
super( new CreatureToken(4, 4, "4/4 artifact creature")
.withType(CardType.ARTIFACT), false, false, Duration.WhileOnBattlefield);
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";
}
public UnctussRetrofitterBecomesCreatureEffect(final UnctussRetrofitterBecomesCreatureEffect effect) {
super(effect);
}
@Override
public UnctussRetrofitterBecomesCreatureEffect copy() {
return new UnctussRetrofitterBecomesCreatureEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent == null) {
this.discard();
return false;
}
return super.apply(layer, sublayer, source, game);
}
}

View file

@ -254,6 +254,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Tyvar's Stand", 190, Rarity.UNCOMMON, mage.cards.t.TyvarsStand.class));
cards.add(new SetCardInfo("Tyvar, Jubilant Brawler", 218, Rarity.RARE, mage.cards.t.TyvarJubilantBrawler.class));
cards.add(new SetCardInfo("Unctus, Grand Metatect", 75, Rarity.RARE, mage.cards.u.UnctusGrandMetatect.class));
cards.add(new SetCardInfo("Unctus's Retrofitter", 76, Rarity.UNCOMMON, mage.cards.u.UnctussRetrofitter.class));
cards.add(new SetCardInfo("Unnatural Restoration", 191, Rarity.UNCOMMON, mage.cards.u.UnnaturalRestoration.class));
cards.add(new SetCardInfo("Urabrask's Anointer", 152, Rarity.UNCOMMON, mage.cards.u.UrabrasksAnointer.class));
cards.add(new SetCardInfo("Urabrask's Forge", 153, Rarity.RARE, mage.cards.u.UrabrasksForge.class));