forked from External/mage
* add new common framework for at step triggered abilities * move postcombat main and second main triggers to it * update draw step triggers * refactor BeginningOfCombatTriggeredAbility * refactor BeginningOfFirstMainTriggeredAbility * move Pronoun to constants package * cleanup some cards to use simpler constructors * package reorganization
42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package mage.abilities.abilityword;
|
|
|
|
import mage.abilities.effects.Effect;
|
|
import mage.abilities.triggers.BeginningOfSecondMainTriggeredAbility;
|
|
import mage.constants.AbilityWord;
|
|
import mage.game.Game;
|
|
import mage.game.permanent.Permanent;
|
|
|
|
import java.util.Optional;
|
|
|
|
/**
|
|
* @author TheElk801
|
|
*/
|
|
public class SurvivalAbility extends BeginningOfSecondMainTriggeredAbility {
|
|
|
|
public SurvivalAbility(Effect effect) {
|
|
this(effect, false);
|
|
}
|
|
|
|
public SurvivalAbility(Effect effect, boolean optional) {
|
|
super(effect, optional);
|
|
setTriggerPhrase("At the beginning of your second main phase, if {this} is tapped, ");
|
|
setAbilityWord(AbilityWord.SURVIVAL);
|
|
}
|
|
|
|
private SurvivalAbility(final SurvivalAbility ability) {
|
|
super(ability);
|
|
}
|
|
|
|
@Override
|
|
public SurvivalAbility copy() {
|
|
return new SurvivalAbility(this);
|
|
}
|
|
|
|
@Override
|
|
public boolean checkInterveningIfClause(Game game) {
|
|
return Optional
|
|
.ofNullable(getSourcePermanentOrLKI(game))
|
|
.map(Permanent::isTapped)
|
|
.orElse(false);
|
|
}
|
|
}
|