Skip to content

Commit

Permalink
[ACR] Implement Staff of Eden, Vault's Key (#12869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grath authored Sep 14, 2024
1 parent ccd656c commit ee8ae02
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Mage.Sets/src/mage/cards/s/StaffOfEdenVaultsKey.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package mage.cards.s;

import java.util.UUID;

import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.mageobject.PermanentPredicate;
import mage.target.common.TargetCardInGraveyard;

/**
*
* @author Grath
*/
public final class StaffOfEdenVaultsKey extends CardImpl {

private static final FilterCard filter = new FilterCard("legendary permanent card not named Staff of Eden, Vault's Key from a graveyard");
private static final FilterPermanent filter2 = new FilterControlledPermanent("permanent you control but don't own");
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter2);
private static final Hint hint = new ValueHint("Permanents you control but don't own", xValue);

static {
filter.add(SuperType.LEGENDARY.getPredicate());
filter.add(PermanentPredicate.instance);
filter.add(Predicates.not(new NamePredicate("Staff of Eden, Vault's Key")));
filter2.add(TargetController.NOT_YOU.getOwnerPredicate());
}

public StaffOfEdenVaultsKey(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");

this.supertype.add(SuperType.LEGENDARY);

// When Staff of Eden, Vault's Key enters the battlefield, put target legendary permanent card not named Staff of Eden, Vault's Key from a graveyard onto the battlefield under your control.
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect());
ability.addTarget(new TargetCardInGraveyard(filter));
this.addAbility(ability);

// {T}: Draw a card for each permanent you control but don't own.
ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(xValue), new TapSourceCost());
ability.addHint(hint);
this.addAbility(ability);
}

private StaffOfEdenVaultsKey(final StaffOfEdenVaultsKey card) {
super(card);
}

@Override
public StaffOfEdenVaultsKey copy() {
return new StaffOfEdenVaultsKey(this);
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/AssassinsCreed.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private AssassinsCreed() {
cards.add(new SetCardInfo("Silent Clearing", 115, Rarity.RARE, mage.cards.s.SilentClearing.class));
cards.add(new SetCardInfo("Smoke Bomb", 75, Rarity.UNCOMMON, mage.cards.s.SmokeBomb.class));
cards.add(new SetCardInfo("Spartan Veteran", 292, Rarity.COMMON, mage.cards.s.SpartanVeteran.class));
cards.add(new SetCardInfo("Staff of Eden, Vault's Key", 76, Rarity.MYTHIC, mage.cards.s.StaffOfEdenVaultsKey.class));
cards.add(new SetCardInfo("Stone Quarry", 300, Rarity.UNCOMMON, mage.cards.s.StoneQuarry.class));
cards.add(new SetCardInfo("Submerged Boneyard", 301, Rarity.UNCOMMON, mage.cards.s.SubmergedBoneyard.class));
cards.add(new SetCardInfo("Sunbaked Canyon", 111, Rarity.RARE, mage.cards.s.SunbakedCanyon.class));
Expand Down

0 comments on commit ee8ae02

Please sign in to comment.