mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[ZNR] Implemented Thwart the Grave
This commit is contained in:
parent
c231a25d8e
commit
de0b115151
2 changed files with 85 additions and 0 deletions
84
Mage.Sets/src/mage/cards/t/ThwartTheGrave.java
Normal file
84
Mage.Sets/src/mage/cards/t/ThwartTheGrave.java
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
package mage.cards.t;
|
||||||
|
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.dynamicvalue.common.PartyCount;
|
||||||
|
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||||
|
import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect;
|
||||||
|
import mage.abilities.hint.common.PartyCountHint;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.common.FilterCreatureCard;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class ThwartTheGrave extends CardImpl {
|
||||||
|
|
||||||
|
public ThwartTheGrave(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
|
||||||
|
|
||||||
|
// This spell costs {1} less to cast for each creature in your party.
|
||||||
|
this.addAbility(new SimpleStaticAbility(
|
||||||
|
Zone.ALL, new SpellCostReductionForEachSourceEffect(1, PartyCount.instance)
|
||||||
|
).addHint(PartyCountHint.instance));
|
||||||
|
|
||||||
|
// Return target creature card and up to one target Cleric, Rogue, Warrior, or Wizard creature card from your graveyard to the battlefield.
|
||||||
|
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect().setText("Return target creature card and up to one target Cleric, Rogue, Warrior, or Wizard creature card from your graveyard to the battlefield."));
|
||||||
|
this.getSpellAbility().addTarget(new ThwartTheGraveTarget());
|
||||||
|
}
|
||||||
|
|
||||||
|
private ThwartTheGrave(final ThwartTheGrave card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ThwartTheGrave copy() {
|
||||||
|
return new ThwartTheGrave(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ThwartTheGraveTarget extends TargetCardInYourGraveyard {
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterCreatureCard(
|
||||||
|
"creature card and up to one target Cleric, Rogue, Warrior, or Wizard creature card from your graveyard"
|
||||||
|
);
|
||||||
|
|
||||||
|
ThwartTheGraveTarget() {
|
||||||
|
super(1, 2, filter, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ThwartTheGraveTarget(final ThwartTheGraveTarget target) {
|
||||||
|
super(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ThwartTheGraveTarget copy() {
|
||||||
|
return new ThwartTheGraveTarget(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<UUID> possibleTargets(UUID sourceId, UUID playerId, Game game) {
|
||||||
|
Set<UUID> possibleTargets = super.possibleTargets(sourceId, playerId, game);
|
||||||
|
if (!this.getTargets().isEmpty()) {
|
||||||
|
possibleTargets.removeIf(uuid -> {
|
||||||
|
Card card = game.getCard(uuid);
|
||||||
|
return card != null
|
||||||
|
&& !card.hasSubtype(SubType.CLERIC, game)
|
||||||
|
&& !card.hasSubtype(SubType.ROGUE, game)
|
||||||
|
&& !card.hasSubtype(SubType.WARRIOR, game)
|
||||||
|
&& !card.hasSubtype(SubType.WIZARD, game);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return possibleTargets;
|
||||||
|
}
|
||||||
|
}
|
|
@ -155,6 +155,7 @@ public final class ZendikarRising extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Tangled Vale", 211, Rarity.UNCOMMON, mage.cards.t.TangledVale.class));
|
cards.add(new SetCardInfo("Tangled Vale", 211, Rarity.UNCOMMON, mage.cards.t.TangledVale.class));
|
||||||
cards.add(new SetCardInfo("Taunting Arbormage", 212, Rarity.UNCOMMON, mage.cards.t.TauntingArbormage.class));
|
cards.add(new SetCardInfo("Taunting Arbormage", 212, Rarity.UNCOMMON, mage.cards.t.TauntingArbormage.class));
|
||||||
cards.add(new SetCardInfo("Tazri, Beacon of Unity", 44, Rarity.MYTHIC, mage.cards.t.TazriBeaconOfUnity.class));
|
cards.add(new SetCardInfo("Tazri, Beacon of Unity", 44, Rarity.MYTHIC, mage.cards.t.TazriBeaconOfUnity.class));
|
||||||
|
cards.add(new SetCardInfo("Thwart the Grave", 130, Rarity.UNCOMMON, mage.cards.t.ThwartTheGrave.class));
|
||||||
cards.add(new SetCardInfo("Timbercrown Pathway", 261, Rarity.RARE, mage.cards.t.TimbercrownPathway.class));
|
cards.add(new SetCardInfo("Timbercrown Pathway", 261, Rarity.RARE, mage.cards.t.TimbercrownPathway.class));
|
||||||
cards.add(new SetCardInfo("Umara Mystic", 238, Rarity.UNCOMMON, mage.cards.u.UmaraMystic.class));
|
cards.add(new SetCardInfo("Umara Mystic", 238, Rarity.UNCOMMON, mage.cards.u.UmaraMystic.class));
|
||||||
cards.add(new SetCardInfo("Umara Skyfalls", 86, Rarity.UNCOMMON, mage.cards.u.UmaraSkyfalls.class));
|
cards.add(new SetCardInfo("Umara Skyfalls", 86, Rarity.UNCOMMON, mage.cards.u.UmaraSkyfalls.class));
|
||||||
|
|
Loading…
Reference in a new issue