Implemented Retrofitter Foundry

This commit is contained in:
Evan Kranzler 2018-07-23 15:59:47 -04:00
parent dca3237d6d
commit fdf8c99d8a
3 changed files with 116 additions and 0 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.UntapSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.RetrofitterFoundryToken;
import mage.game.permanent.token.ServoToken;
import mage.game.permanent.token.ThopterColorlessToken;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author TheElk801
*/
public final class RetrofitterFoundry extends CardImpl {
private static final FilterControlledPermanent filter1 = new FilterControlledPermanent("a Servo");
private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("a Thopter");
static {
filter1.add(new SubtypePredicate(SubType.SERVO));
filter2.add(new SubtypePredicate(SubType.THOPTER));
}
public RetrofitterFoundry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
// {3}: Untap Retrofitter Foundry.
this.addAbility(new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new UntapSourceEffect(),
new GenericManaCost(3))
);
// {2}, {T}: Create a 1/1 colorless Servo artifact creature token.
Ability ability = new SimpleActivatedAbility(
new CreateTokenEffect(new ServoToken()),
new GenericManaCost(2)
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
// {1}, {T}, Sacrifice a Servo: Create a 1/1 colorless Thopter artifact creature token with flying.
ability = new SimpleActivatedAbility(
new CreateTokenEffect(new ThopterColorlessToken()),
new GenericManaCost(1)
);
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter1)));
this.addAbility(ability);
// {T}, Sacrifice a Thopter: Create a 4/4 colorless Construct artifact creature token.
ability = new SimpleActivatedAbility(
new CreateTokenEffect(new RetrofitterFoundryToken()),
new TapSourceCost()
);
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2)));
this.addAbility(ability);
}
public RetrofitterFoundry(final RetrofitterFoundry card) {
super(card);
}
@Override
public RetrofitterFoundry copy() {
return new RetrofitterFoundry(this);
}
}

View file

@ -21,6 +21,7 @@ public final class Commander2018 extends ExpansionSet {
this.blockName = "Command Zone";
cards.add(new SetCardInfo("Chaos Warp", 122, Rarity.RARE, mage.cards.c.ChaosWarp.class));
cards.add(new SetCardInfo("Retrofitter Foundry", 57, Rarity.RARE, mage.cards.r.RetrofitterFoundry.class));
cards.add(new SetCardInfo("Saheeli's Directive", 26, Rarity.RARE, mage.cards.s.SaheelisDirective.class));
cards.add(new SetCardInfo("Tawnos, Urza's Apprentice", 45, Rarity.MYTHIC, mage.cards.t.TawnosUrzasApprentice.class));
cards.add(new SetCardInfo("Thopter Spy Network", 107, Rarity.RARE, mage.cards.t.ThopterSpyNetwork.class));

View file

@ -0,0 +1,34 @@
package mage.game.permanent.token;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
/**
*
* @author TheElk801
*/
public final class RetrofitterFoundryToken extends TokenImpl {
public RetrofitterFoundryToken() {
this("C18");
}
public RetrofitterFoundryToken(String setCode) {
super("Construct", "4/4 colorless Construct artifact creature token");
this.setOriginalExpansionSetCode(setCode);
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.CONSTRUCT);
power = new MageInt(4);
toughness = new MageInt(4);
}
public RetrofitterFoundryToken(final RetrofitterFoundryToken token) {
super(token);
}
public RetrofitterFoundryToken copy() {
return new RetrofitterFoundryToken(this);
}
}