[Y22] Implemented Key to the Archive

This commit is contained in:
Evan Kranzler 2022-03-01 17:48:23 -05:00
parent fcb918f811
commit 173b708650
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,69 @@
package mage.cards.k;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DraftFromSpellbookEffect;
import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.abilities.effects.mana.AddManaInAnyCombinationEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class KeyToTheArchive extends CardImpl {
private static final List<String> spellbook = Collections.unmodifiableList(Arrays.asList(
"Approach of the Second Sun",
"Claim the Firstborn",
"Counterspell",
"Day of Judgment",
"Demonic Tutor",
"Despark",
"Doom Blade",
"Electrolyze",
"Growth Spiral",
"Krosan Grip",
"Lightning Bolt",
"Lightning Helix",
"Putrefy",
"Regrowth",
"Time Warp"
));
public KeyToTheArchive(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// Key to the Archive enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// When Key to the Archive enters the battlefield, draft a card from Key to the Archive's spellbook, then discard a card.
Ability ability = new EntersBattlefieldTriggeredAbility(new DraftFromSpellbookEffect(spellbook));
ability.addEffect(new DiscardControllerEffect(1).concatBy(", then"));
this.addAbility(ability);
// {T}: Add two mana in any combination of colors.
this.addAbility(new SimpleManaAbility(
Zone.BATTLEFIELD, new AddManaInAnyCombinationEffect(2), new TapSourceCost()
));
}
private KeyToTheArchive(final KeyToTheArchive card) {
super(card);
}
@Override
public KeyToTheArchive copy() {
return new KeyToTheArchive(this);
}
}

View file

@ -22,5 +22,6 @@ public final class AlchemyInnistrad extends ExpansionSet {
cards.add(new SetCardInfo("Cursebound Witch", 24, Rarity.UNCOMMON, mage.cards.c.CurseboundWitch.class));
cards.add(new SetCardInfo("Faithful Disciple", 7, Rarity.UNCOMMON, mage.cards.f.FaithfulDisciple.class));
cards.add(new SetCardInfo("Key to the Archive", 59, Rarity.RARE, mage.cards.k.KeyToTheArchive.class));
}
}