Skip to content

Commit

Permalink
[WOE] Implement Tallion's Messenger (#10866)
Browse files Browse the repository at this point in the history
* [WOE] Implement Tallion's Messenger

* not set a trigger phrase for the reflexive trigger

---------

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
  • Loading branch information
Susucre and theelk801 committed Aug 18, 2023
1 parent a575968 commit f582685
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
96 changes: 96 additions & 0 deletions Mage.Sets/src/mage/cards/t/TalionsMessenger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package mage.cards.t;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPermanent;

import java.util.UUID;

/**
* @author Susucr
*/
public final class TalionsMessenger extends CardImpl {

private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.FAERIE, "Faeries");

public TalionsMessenger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");

this.subtype.add(SubType.FAERIE);
this.subtype.add(SubType.NOBLE);
this.power = new MageInt(1);
this.toughness = new MageInt(3);

// Flying
this.addAbility(FlyingAbility.getInstance());

// Whenever you attack with one or more Faeries, draw a card, then discard a card. When you discard a card this way, put a +1/+1 counter on target Faerie you control.
this.addAbility(new AttacksWithCreaturesTriggeredAbility(
new TalionsMessengerEffect(), 1, filter
));
}

private TalionsMessenger(final TalionsMessenger card) {
super(card);
}

@Override
public TalionsMessenger copy() {
return new TalionsMessenger(this);
}
}

class TalionsMessengerEffect extends OneShotEffect {

private static final FilterPermanent filter = new FilterPermanent(SubType.FAERIE, "Faerie you control");

TalionsMessengerEffect() {
super(Outcome.Benefit);
staticText = "draw a card, then discard a card. When you discard a card this way, put a +1/+1 counter on target Faerie you control";
}

private TalionsMessengerEffect(final TalionsMessengerEffect effect) {
super(effect);
}

@Override
public TalionsMessengerEffect copy() {
return new TalionsMessengerEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
controller.drawCards(1, source, game);
Cards discard = controller.discard(1, false, false, source, game);
if (!discard.isEmpty()) {
ReflexiveTriggeredAbility reflexive = new ReflexiveTriggeredAbility(
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
false
);
reflexive.addTarget(new TargetPermanent(filter));
game.fireReflexiveTriggeredAbility(reflexive, source);
}
return true;
}

}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/WildsOfEldraine.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ private WildsOfEldraine() {
cards.add(new SetCardInfo("Sweettooth Witch", 111, Rarity.COMMON, mage.cards.s.SweettoothWitch.class));
cards.add(new SetCardInfo("Syr Armont, the Redeemer", 214, Rarity.UNCOMMON, mage.cards.s.SyrArmontTheRedeemer.class));
cards.add(new SetCardInfo("Syr Ginger, the Meal Ender", 252, Rarity.RARE, mage.cards.s.SyrGingerTheMealEnder.class));
cards.add(new SetCardInfo("Talion's Messenger", 73, Rarity.RARE, mage.cards.t.TalionsMessenger.class));
cards.add(new SetCardInfo("Taken by Nightmares", 112, Rarity.UNCOMMON, mage.cards.t.TakenByNightmares.class));
cards.add(new SetCardInfo("Talion, the Kindly Lord", 215, Rarity.MYTHIC, mage.cards.t.TalionTheKindlyLord.class));
cards.add(new SetCardInfo("Tanglespan Lookout", 188, Rarity.UNCOMMON, mage.cards.t.TanglespanLookout.class));
Expand Down

0 comments on commit f582685

Please sign in to comment.