diff --git a/Mage.Sets/src/mage/cards/a/AmphinMutineer.java b/Mage.Sets/src/mage/cards/a/AmphinMutineer.java new file mode 100644 index 00000000000..7a6467d532d --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AmphinMutineer.java @@ -0,0 +1,95 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.EncoreAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.SalamnderWarriorToken; +import mage.players.Player; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AmphinMutineer extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("non-Salamander creature"); + + static { + filter.add(Predicates.not(SubType.SALAMANDER.getPredicate())); + } + + public AmphinMutineer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.SALAMANDER); + this.subtype.add(SubType.PIRATE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Amphin Mutineer enters the battlefield, exile up to one target non-Salamander creature. That creature's controller creates a 4/3 blue Salamander Warrior creature token. + Ability ability = new EntersBattlefieldTriggeredAbility(new AmphinMutineerEffect()); + ability.addTarget(new TargetPermanent(0, 1, filter, false)); + this.addAbility(ability); + + // Encore {4}{U}{U} + this.addAbility(new EncoreAbility(new ManaCostsImpl<>("{4}{U}{U}"))); + } + + private AmphinMutineer(final AmphinMutineer card) { + super(card); + } + + @Override + public AmphinMutineer copy() { + return new AmphinMutineer(this); + } +} + +class AmphinMutineerEffect extends OneShotEffect { + + AmphinMutineerEffect() { + super(Outcome.Benefit); + staticText = "exile up to one target non-Salamander creature. " + + "That creature's controller creates a 4/3 blue Salamander Warrior creature token"; + } + + private AmphinMutineerEffect(final AmphinMutineerEffect effect) { + super(effect); + } + + @Override + public AmphinMutineerEffect copy() { + return new AmphinMutineerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + Player player = game.getPlayer(permanent.getControllerId()); + if (player == null) { + return false; + } + player.moveCards(permanent, Zone.EXILED, source, game); + new SalamnderWarriorToken().putOntoBattlefield(1, game, source.getSourceId(), player.getId()); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index a2952a8692b..48b80f23a61 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -30,6 +30,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Acidic Slime", 421, Rarity.UNCOMMON, mage.cards.a.AcidicSlime.class)); cards.add(new SetCardInfo("Alena, Kessig Trapper", 160, Rarity.UNCOMMON, mage.cards.a.AlenaKessigTrapper.class)); cards.add(new SetCardInfo("Amareth, the Lustrous", 266, Rarity.RARE, mage.cards.a.AmarethTheLustrous.class)); + cards.add(new SetCardInfo("Amphin Mutineer", 55, Rarity.RARE, mage.cards.a.AmphinMutineer.class)); cards.add(new SetCardInfo("Averna, the Chaos Bloom", 269, Rarity.RARE, mage.cards.a.AvernaTheChaosBloom.class)); cards.add(new SetCardInfo("Bladegriff Prototype", 300, Rarity.RARE, mage.cards.b.BladegriffPrototype.class)); cards.add(new SetCardInfo("Brazen Freebooter", 164, Rarity.COMMON, mage.cards.b.BrazenFreebooter.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/SalamnderWarriorToken.java b/Mage/src/main/java/mage/game/permanent/token/SalamnderWarriorToken.java new file mode 100644 index 00000000000..c03d2fa9ed5 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/SalamnderWarriorToken.java @@ -0,0 +1,29 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author TheElk801 + */ +public final class SalamnderWarriorToken extends TokenImpl { + + public SalamnderWarriorToken() { + super("Salamander Warrior", "4/3 blue Salamander Warrior creature token"); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add(SubType.SALAMANDER); + subtype.add(SubType.WARRIOR); + power = new MageInt(4); + toughness = new MageInt(3); + } + + public SalamnderWarriorToken(final SalamnderWarriorToken token) { + super(token); + } + + public SalamnderWarriorToken copy() { + return new SalamnderWarriorToken(this); + } +}