mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[KHM] Implemented Resplendent Marshal (#7419)
This commit is contained in:
parent
0099887a80
commit
30b3e2e658
3 changed files with 121 additions and 0 deletions
109
Mage.Sets/src/mage/cards/r/ResplendentMarshal.java
Normal file
109
Mage.Sets/src/mage/cards/r/ResplendentMarshal.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldOrDiesSourceTriggeredAbility;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DoWhenCostPaid;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class ResplendentMarshal extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter
|
||||
= new FilterCreatureCard("another creature card from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public ResplendentMarshal(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
|
||||
|
||||
this.subtype.add(SubType.ANGEL);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Resplendent Marshal enters the battlefield or dies, you may exile another creature card from your graveyard.
|
||||
// When you do, put a +1/+1 counter on each creature you control other than Resplendent Marshal that shares a creature type with the exiled card.
|
||||
this.addAbility(new EntersBattlefieldOrDiesSourceTriggeredAbility(
|
||||
new DoWhenCostPaid(
|
||||
new ReflexiveTriggeredAbility(new ResplendentMarshalEffect(), false,
|
||||
"put a +1/+1 counter on each creature you control other than Resplendent Marshal that shares a creature type with the exiled card"),
|
||||
new ExileFromGraveCost(new TargetCardInYourGraveyard(filter), true),
|
||||
"Exile another creature card from your graveyard?"
|
||||
), false
|
||||
));
|
||||
}
|
||||
|
||||
private ResplendentMarshal(final ResplendentMarshal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResplendentMarshal copy() {
|
||||
return new ResplendentMarshal(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ResplendentMarshalEffect extends OneShotEffect {
|
||||
|
||||
public ResplendentMarshalEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
||||
private ResplendentMarshalEffect (final ResplendentMarshalEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResplendentMarshalEffect copy() {
|
||||
return new ResplendentMarshalEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
Card exiledCard = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (controller != null && sourceObject != null && exiledCard != null) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (permanent.shareCreatureTypes(exiledCard, game)) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName()
|
||||
+ " puts a +1/+1 counter on " + permanent.getLogName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -250,6 +250,7 @@ public final class Kaldheim extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Reflections of Littjara", 73, Rarity.RARE, mage.cards.r.ReflectionsOfLittjara.class));
|
||||
cards.add(new SetCardInfo("Renegade Reaper", 386, Rarity.UNCOMMON, mage.cards.r.RenegadeReaper.class));
|
||||
cards.add(new SetCardInfo("Replicating Ring", 244, Rarity.UNCOMMON, mage.cards.r.ReplicatingRing.class));
|
||||
cards.add(new SetCardInfo("Resplendent Marshal", 22, Rarity.MYTHIC, mage.cards.r.ResplendentMarshal.class));
|
||||
cards.add(new SetCardInfo("Return Upon the Tide", 106, Rarity.UNCOMMON, mage.cards.r.ReturnUponTheTide.class));
|
||||
cards.add(new SetCardInfo("Revitalize", 23, Rarity.COMMON, mage.cards.r.Revitalize.class));
|
||||
cards.add(new SetCardInfo("Rimewood Falls", 266, Rarity.COMMON, mage.cards.r.RimewoodFalls.class));
|
||||
|
|
|
@ -16,6 +16,7 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
|
@ -25,6 +26,7 @@ import mage.util.CardUtil;
|
|||
public class ExileFromGraveCost extends CostImpl {
|
||||
|
||||
private final List<Card> exiledCards = new ArrayList<>();
|
||||
private boolean setTargetPointer = false;
|
||||
|
||||
public ExileFromGraveCost(TargetCardInYourGraveyard target) {
|
||||
target.setNotTarget(true);
|
||||
|
@ -57,9 +59,15 @@ public class ExileFromGraveCost extends CostImpl {
|
|||
this.text = "exile " + target.getTargetName();
|
||||
}
|
||||
|
||||
public ExileFromGraveCost(TargetCardInYourGraveyard target, boolean setTargetPointer) {
|
||||
this(target);
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
public ExileFromGraveCost(final ExileFromGraveCost cost) {
|
||||
super(cost);
|
||||
this.exiledCards.addAll(cost.getExiledCards());
|
||||
this.setTargetPointer = cost.setTargetPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,6 +85,9 @@ public class ExileFromGraveCost extends CostImpl {
|
|||
Cards cardsToExile = new CardsImpl();
|
||||
cardsToExile.addAll(exiledCards);
|
||||
controller.moveCards(cardsToExile, Zone.EXILED, ability, game);
|
||||
if (setTargetPointer) {
|
||||
source.getEffects().setTargetPointer(new FixedTarget(targets.getFirstTarget(), game));
|
||||
}
|
||||
paid = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue