[STX] Implemented Retriever Phoenix

This commit is contained in:
Evan Kranzler 2021-04-07 19:24:41 -04:00
parent dd8e076ed8
commit bea736aa54
4 changed files with 115 additions and 4 deletions

View file

@ -7,7 +7,7 @@ import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.game.events.GameEvent;
/**
* @author TheElk801
@ -20,10 +20,12 @@ public class LearnEffect extends OneShotEffect {
filter.add(SubType.LESSON.getPredicate());
}
private static final String defaultText = "learn. <i>(You may reveal a Lesson card you own from outside the game " +
"and put it into your hand, or discard a card to draw a card.)</i>";
public LearnEffect() {
super(Outcome.Neutral);
staticText = "learn. <i>(You may reveal a Lesson card you own from outside the game " +
"and put it into your hand, or discard a card to draw a card.)</i>";
staticText = defaultText;
}
private LearnEffect(final LearnEffect effect) {
@ -32,7 +34,12 @@ public class LearnEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (game.replaceEvent(GameEvent.getEvent(
GameEvent.EventType.LEARN, source.getSourceId(),
source, source.getControllerId()
))) {
return false;
}
return new WishEffect(filter, true).apply(game, source)
|| new DoIfCostPaid(
new DrawCardSourceControllerEffect(1), new DiscardCardCost()
@ -43,4 +50,8 @@ public class LearnEffect extends OneShotEffect {
public LearnEffect copy() {
return new LearnEffect(this);
}
public static String getDefaultText() {
return defaultText;
}
}

View file

@ -301,6 +301,7 @@ public class GameEvent implements Serializable {
DIDNT_PAY_CUMULATIVE_UPKEEP,
LIFE_PAID,
CASCADE_LAND,
LEARN,
//permanent events
ENTERS_THE_BATTLEFIELD_SELF, /* 616.1a If any of the replacement and/or prevention effects are self-replacement effects (see rule 614.15),
one of them must be chosen. If not, proceed to rule 616.1b. */