diff --git a/Mage.Sets/src/mage/cards/a/ArgivianAvenger.java b/Mage.Sets/src/mage/cards/a/ArgivianAvenger.java new file mode 100644 index 0000000000..15763bba10 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArgivianAvenger.java @@ -0,0 +1,100 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ArgivianAvenger extends CardImpl { + + public ArgivianAvenger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + + this.subtype.add(SubType.SHAPESHIFTER); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {1}: Until end of turn, Argivian Avenger gets -1/-1 and gains your choice of flying, vigilance, deathtouch, or haste. + this.addAbility(new SimpleActivatedAbility(new ArgivianAvengerEffect(), new GenericManaCost(1))); + } + + private ArgivianAvenger(final ArgivianAvenger card) { + super(card); + } + + @Override + public ArgivianAvenger copy() { + return new ArgivianAvenger(this); + } +} + +class ArgivianAvengerEffect extends OneShotEffect { + + private static final Map abilityMap = new HashMap<>(); + + static { + abilityMap.put("Flying", FlyingAbility.getInstance()); + abilityMap.put("Vigilance", VigilanceAbility.getInstance()); + abilityMap.put("Deathtouch", DeathtouchAbility.getInstance()); + abilityMap.put("Haste", HasteAbility.getInstance()); + } + + ArgivianAvengerEffect() { + super(Outcome.Benefit); + staticText = "until end of turn, {this} gets -1/-1 " + + "and gains your choice of flying, vigilance, deathtouch, or haste"; + } + + private ArgivianAvengerEffect(final ArgivianAvengerEffect effect) { + super(effect); + } + + @Override + public ArgivianAvengerEffect copy() { + return new ArgivianAvengerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (player == null || permanent == null) { + return false; + } + game.addEffect(new BoostSourceEffect(-1, -1, Duration.EndOfTurn), source); + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose an ability"); + choice.setChoices(abilityMap.keySet()); + player.choose(outcome, choice, game); + Ability ability = abilityMap.getOrDefault(choice.getChoice(), null); + if (ability != null) { + game.addEffect(new GainAbilitySourceEffect(ability, Duration.EndOfTurn), source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 90faec5d78..cbf9c53843 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -28,6 +28,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Ambush Paratrooper", 3, Rarity.COMMON, mage.cards.a.AmbushParatrooper.class)); cards.add(new SetCardInfo("Arbalest Engineers", 206, Rarity.UNCOMMON, mage.cards.a.ArbalestEngineers.class)); cards.add(new SetCardInfo("Arcane Proxy", 75, Rarity.MYTHIC, mage.cards.a.ArcaneProxy.class)); + cards.add(new SetCardInfo("Argivian Avenger", 232, Rarity.UNCOMMON, mage.cards.a.ArgivianAvenger.class)); cards.add(new SetCardInfo("Argoth, Sanctum of Nature", "256a", Rarity.RARE, mage.cards.a.ArgothSanctumOfNature.class)); cards.add(new SetCardInfo("Argothian Opportunist", 167, Rarity.COMMON, mage.cards.a.ArgothianOpportunist.class)); cards.add(new SetCardInfo("Ashnod's Harvester", 117, Rarity.UNCOMMON, mage.cards.a.AshnodsHarvester.class));