forked from External/mage
[WOE] Implement Return Triumphant (#10915)
This commit is contained in:
parent
14c607ba59
commit
5fd4f8f2bd
2 changed files with 86 additions and 0 deletions
85
Mage.Sets/src/mage/cards/r/ReturnTriumphant.java
Normal file
85
Mage.Sets/src/mage/cards/r/ReturnTriumphant.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateRoleAttachedTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class ReturnTriumphant extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCreatureCard("creature card with mana value 3 or less from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new ManaValuePredicate(ComparisonType.OR_LESS, 3));
|
||||
}
|
||||
|
||||
public ReturnTriumphant(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}");
|
||||
|
||||
// Return target creature card with mana value 3 or less from your graveyard to the battlefield. Create a Young Hero Role token attached to it.
|
||||
this.getSpellAbility().addEffect(new ReturnTriumphantAbility());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
|
||||
}
|
||||
|
||||
private ReturnTriumphant(final ReturnTriumphant card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnTriumphant copy() {
|
||||
return new ReturnTriumphant(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ReturnTriumphantAbility extends OneShotEffect {
|
||||
|
||||
ReturnTriumphantAbility() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
staticText = "return target creature card with mana value 3 or less from your graveyard "
|
||||
+ "to the battlefield. Create a Young Hero Role token attached to it";
|
||||
}
|
||||
|
||||
private ReturnTriumphantAbility(final ReturnTriumphantAbility effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnTriumphantAbility copy() {
|
||||
return new ReturnTriumphantAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
if (player == null || card == null) {
|
||||
return false;
|
||||
}
|
||||
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return new CreateRoleAttachedTargetEffect(RoleType.YOUNG_HERO)
|
||||
.setTargetPointer(new FixedTarget(permanent, game))
|
||||
.apply(game, source);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -87,6 +87,7 @@ public final class WildsOfEldraine extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Restless Cottage", 258, Rarity.RARE, mage.cards.r.RestlessCottage.class));
|
||||
cards.add(new SetCardInfo("Restless Fortress", 259, Rarity.RARE, mage.cards.r.RestlessFortress.class));
|
||||
cards.add(new SetCardInfo("Restless Spire", 306, Rarity.RARE, mage.cards.r.RestlessSpire.class));
|
||||
cards.add(new SetCardInfo("Return Triumphant", 26, Rarity.COMMON, mage.cards.r.ReturnTriumphant.class));
|
||||
cards.add(new SetCardInfo("Return from the Wilds", 181, Rarity.COMMON, mage.cards.r.ReturnFromTheWilds.class));
|
||||
cards.add(new SetCardInfo("Rootrider Faun", 182, Rarity.COMMON, mage.cards.r.RootriderFaun.class));
|
||||
cards.add(new SetCardInfo("Rowan's Grim Search", 104, Rarity.COMMON, mage.cards.r.RowansGrimSearch.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue