[DSK] Implement Glimmer Seeker

This commit is contained in:
theelk801 2024-09-02 12:06:04 -04:00
parent fd8b0d1f99
commit 7f58582f8d
5 changed files with 142 additions and 0 deletions

View file

@ -0,0 +1,54 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.abilityword.SurvivalAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.hint.ConditionHint;
import mage.abilities.hint.Hint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.permanent.token.GlimmerToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GlimmerSeeker extends CardImpl {
private static final Condition condition
= new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent(SubType.GLIMMER));
private static final Hint hint = new ConditionHint(condition, "You control a Glimmer creature");
public GlimmerSeeker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SURVIVOR);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Survival -- At the beginning of your second main phase, if Glimmer Seeker is tapped, draw a card if you control a Glimmer creature. If you don't control a Glimmer creature, create a 1/1 white Glimmer enchantment creature token.
this.addAbility(new SurvivalAbility(new ConditionalOneShotEffect(
new CreateTokenEffect(new GlimmerToken()), new DrawCardSourceControllerEffect(1),
condition, "draw a card if you control a Glimmer creature. " +
"If you don't control a Glimmer creature, create a 1/1 white Glimmer enchantment creature token"
)).addHint(hint));
}
private GlimmerSeeker(final GlimmerSeeker card) {
super(card);
}
@Override
public GlimmerSeeker copy() {
return new GlimmerSeeker(this);
}
}

View file

@ -35,6 +35,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet {
cards.add(new SetCardInfo("Fear of Lost Teeth", 97, Rarity.COMMON, mage.cards.f.FearOfLostTeeth.class)); cards.add(new SetCardInfo("Fear of Lost Teeth", 97, Rarity.COMMON, mage.cards.f.FearOfLostTeeth.class));
cards.add(new SetCardInfo("Fear of Missing Out", 136, Rarity.RARE, mage.cards.f.FearOfMissingOut.class)); cards.add(new SetCardInfo("Fear of Missing Out", 136, Rarity.RARE, mage.cards.f.FearOfMissingOut.class));
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Glimmer Seeker", 14, Rarity.UNCOMMON, mage.cards.g.GlimmerSeeker.class));
cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Leyline of Hope", 18, Rarity.RARE, mage.cards.l.LeylineOfHope.class)); cards.add(new SetCardInfo("Leyline of Hope", 18, Rarity.RARE, mage.cards.l.LeylineOfHope.class));
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS));

View file

@ -0,0 +1,56 @@
package mage.abilities.abilityword;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.AbilityWord;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.Optional;
/**
* TODO: This should only trigger on the second main phase, this is part of a larger refactor that has to be done
*
* @author TheElk801
*/
public class SurvivalAbility extends TriggeredAbilityImpl {
public SurvivalAbility(Effect effect) {
this(effect, false);
}
public SurvivalAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
setTriggerPhrase("At the beginning of your second main phase, if {this} is tapped, ");
setAbilityWord(AbilityWord.SURVIVOR);
}
private SurvivalAbility(final SurvivalAbility ability) {
super(ability);
}
@Override
public SurvivalAbility copy() {
return new SurvivalAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.POSTCOMBAT_MAIN_PHASE_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game.isActivePlayer(getControllerId());
}
@Override
public boolean checkInterveningIfClause(Game game) {
return Optional
.ofNullable(getSourcePermanentIfItStillExists(game))
.map(Permanent::isTapped)
.orElse(false);
}
}

View file

@ -55,6 +55,7 @@ public enum AbilityWord {
SECRET_COUNCIL("Secret council"), SECRET_COUNCIL("Secret council"),
SPELL_MASTERY("Spell mastery"), SPELL_MASTERY("Spell mastery"),
STRIVE("Strive"), STRIVE("Strive"),
SURVIVOR("Survivor"),
SWEEP("Sweep"), SWEEP("Sweep"),
TEMPTING_OFFER("Tempting offer"), TEMPTING_OFFER("Tempting offer"),
THRESHOLD("Threshold"), THRESHOLD("Threshold"),

View file

@ -0,0 +1,30 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author TheElk801
*/
public final class GlimmerToken extends TokenImpl {
public GlimmerToken() {
super("Glimmer Token", "1/1 white Glimmer enchantment creature token");
cardType.add(CardType.ENCHANTMENT);
cardType.add(CardType.CREATURE);
color.setWhite(true);
subtype.add(SubType.GLIMMER);
power = new MageInt(1);
toughness = new MageInt(1);
}
private GlimmerToken(final GlimmerToken token) {
super(token);
}
@Override
public GlimmerToken copy() {
return new GlimmerToken(this);
}
}