mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 04:12:14 -08:00
[DSK] Implement Glimmer Seeker
This commit is contained in:
parent
fd8b0d1f99
commit
7f58582f8d
5 changed files with 142 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -55,6 +55,7 @@ public enum AbilityWord {
|
|||
SECRET_COUNCIL("Secret council"),
|
||||
SPELL_MASTERY("Spell mastery"),
|
||||
STRIVE("Strive"),
|
||||
SURVIVOR("Survivor"),
|
||||
SWEEP("Sweep"),
|
||||
TEMPTING_OFFER("Tempting offer"),
|
||||
THRESHOLD("Threshold"),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue