mirror of
https://github.com/correl/mage.git
synced 2025-03-26 17:00:08 -09:00
Implemented Dawn Evangel
This commit is contained in:
parent
18ca3bcff9
commit
eacccf6f06
2 changed files with 96 additions and 0 deletions
Mage.Sets/src/mage
95
Mage.Sets/src/mage/cards/d/DawnEvangel.java
Normal file
95
Mage.Sets/src/mage/cards/d/DawnEvangel.java
Normal file
|
@ -0,0 +1,95 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DawnEvangel extends CardImpl {
|
||||
|
||||
public DawnEvangel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{W}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever a creature dies, if an Aura you control was attached to it, return target creature card with converted mana cost 2 or less from your graveyard to your hand.
|
||||
this.addAbility(new DawnEvangelAbility());
|
||||
}
|
||||
|
||||
private DawnEvangel(final DawnEvangel card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DawnEvangel copy() {
|
||||
return new DawnEvangel(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DawnEvangelAbility extends DiesCreatureTriggeredAbility {
|
||||
|
||||
private static final FilterCard cardFilter
|
||||
= new FilterCreatureCard("creature card with converted mana cost 2 or less from your graveyard");
|
||||
|
||||
static {
|
||||
cardFilter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 3));
|
||||
}
|
||||
|
||||
DawnEvangelAbility() {
|
||||
super(new ReturnFromGraveyardToHandTargetEffect(), false);
|
||||
this.addTarget(new TargetCardInYourGraveyard(cardFilter));
|
||||
}
|
||||
|
||||
private DawnEvangelAbility(DawnEvangelAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!super.checkTrigger(event, game)) {
|
||||
return false;
|
||||
}
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
return zEvent
|
||||
.getTarget()
|
||||
.getAttachments()
|
||||
.stream()
|
||||
.map(game::getPermanentOrLKIBattlefield)
|
||||
.filter(Objects::nonNull)
|
||||
.filter(permanent -> permanent.hasSubtype(SubType.AURA, game))
|
||||
.map(Permanent::getId)
|
||||
.anyMatch(getControllerId()::equals);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature dies, if an Aura you control was attached to it, " +
|
||||
"return target creature card with converted mana cost 2 or less from your graveyard to your hand.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DawnEvangelAbility copy() {
|
||||
return new DawnEvangelAbility(this);
|
||||
}
|
||||
}
|
|
@ -42,6 +42,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Cling to Dust", 87, Rarity.UNCOMMON, mage.cards.c.ClingToDust.class));
|
||||
cards.add(new SetCardInfo("Commanding Presence", 7, Rarity.UNCOMMON, mage.cards.c.CommandingPresence.class));
|
||||
cards.add(new SetCardInfo("Dalakos, Crafter of Wonders", 212, Rarity.RARE, mage.cards.d.DalakosCrafterOfWonders.class));
|
||||
cards.add(new SetCardInfo("Dawn Evangel", 8, Rarity.UNCOMMON, mage.cards.d.DawnEvangel.class));
|
||||
cards.add(new SetCardInfo("Daxos, Blessed by the Sun", 9, Rarity.UNCOMMON, mage.cards.d.DaxosBlessedByTheSun.class));
|
||||
cards.add(new SetCardInfo("Deathbellow War Cry", 294, Rarity.RARE, mage.cards.d.DeathbellowWarCry.class));
|
||||
cards.add(new SetCardInfo("Demon of Loathing", 292, Rarity.RARE, mage.cards.d.DemonOfLoathing.class));
|
||||
|
|
Loading…
Add table
Reference in a new issue