[ZNR] Implemented Coralhelm Chronicler

This commit is contained in:
Evan Kranzler 2020-09-04 16:26:42 -04:00
parent 98ad269d25
commit 579e341944
3 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,65 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.abilities.keyword.KickerAbility;
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.FilterSpell;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.filter.predicate.mageobject.KickedPredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CoralhelmChronicler extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a kicked spell");
private static final FilterCard filter2 = new FilterCard("card with a kicker ability");
static {
filter.add(KickedPredicate.instance);
filter2.add(new AbilityPredicate(KickerAbility.class));
}
public CoralhelmChronicler(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.subtype.add(SubType.MERFOLK);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever you cast a kicked spell, draw a card, then discard a card.
this.addAbility(new SpellCastControllerTriggeredAbility(
new DrawDiscardControllerEffect(1, 1, false), filter, false
));
// When Coralhelm Chronicler enters the battlefield, look at the top five cards of your library. You may reveal a card with a kicker ability from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
StaticValue.get(5), false, StaticValue.get(1), filter2, Zone.LIBRARY, false,
true, false, Zone.HAND, true, false, false
).setBackInRandomOrder(true).setText("look at the top five cards of your library. " +
"You may reveal a card with a kicker ability from among them and put it into your hand. " +
"Put the rest on the bottom of your library in a random order")));
}
private CoralhelmChronicler(final CoralhelmChronicler card) {
super(card);
}
@Override
public CoralhelmChronicler copy() {
return new CoralhelmChronicler(this);
}
}

View file

@ -90,6 +90,7 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Clearwater Pathway", 260, Rarity.RARE, mage.cards.c.ClearwaterPathway.class));
cards.add(new SetCardInfo("Cleric of Life's Bond", 222, Rarity.UNCOMMON, mage.cards.c.ClericOfLifesBond.class));
cards.add(new SetCardInfo("Cliffhaven Sell-Sword", 8, Rarity.COMMON, mage.cards.c.CliffhavenSellSword.class));
cards.add(new SetCardInfo("Coralhelm Chronicler", 54, Rarity.RARE, mage.cards.c.CoralhelmChronicler.class));
cards.add(new SetCardInfo("Cragcrown Pathway", 261, Rarity.RARE, mage.cards.c.CragcrownPathway.class));
cards.add(new SetCardInfo("Dauntless Survivor", 184, Rarity.COMMON, mage.cards.d.DauntlessSurvivor.class));
cards.add(new SetCardInfo("Deadly Alliance", 96, Rarity.COMMON, mage.cards.d.DeadlyAlliance.class));

View file

@ -0,0 +1,35 @@
package mage.filter.predicate.mageobject;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.keyword.KickerAbility;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.stack.Spell;
/**
* @author TheElk801
*/
public enum KickedPredicate implements Predicate<MageObject> {
instance;
@Override
public boolean apply(MageObject input, Game game) {
Spell spell = game.getSpell(input.getId());
if (spell == null) {
return false;
}
for (Ability ability : spell.getAbilities()) {
if (ability instanceof KickerAbility
&& ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()) > 0) {
return true;
}
}
return false;
}
@Override
public String toString() {
return "Kicked";
}
}