mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
[DFT] Implement Elvish Refueler (#13392)
This commit is contained in:
parent
cd8cb6afe5
commit
9aaad5193f
5 changed files with 232 additions and 1 deletions
|
|
@ -3,7 +3,9 @@ package mage.abilities.keyword;
|
|||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
|
@ -24,6 +26,20 @@ public class ExhaustAbility extends ActivatedAbilityImpl {
|
|||
return new ExhaustAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMoreActivationsThisTurn(Game game) {
|
||||
ActivationInfo info = getActivationInfo(game);
|
||||
if (info != null && info.totalActivations >= maxActivationsPerGame) {
|
||||
boolean canActivate = !game.getContinuousEffects()
|
||||
.asThough(sourceId, AsThoughEffectType.ALLOW_EXHAUST_PER_TURN, this, controllerId, game)
|
||||
.isEmpty();
|
||||
if (canActivate) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.hasMoreActivationsThisTurn(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Exhaust — " + super.getRule() + " <i>(Activate each exhaust ability only once.)</i>";
|
||||
|
|
|
|||
|
|
@ -59,7 +59,10 @@ public enum AsThoughEffectType {
|
|||
//
|
||||
// ALLOW_FORETELL_ANYTIME:
|
||||
// For Cosmos Charger effect
|
||||
ALLOW_FORETELL_ANYTIME;
|
||||
ALLOW_FORETELL_ANYTIME,
|
||||
// ALLOW_EXHAUST_ACTIVE_ABILITY:
|
||||
// Elvish Refueler effect allows Exhaust on your turn as though it hasn't been activated
|
||||
ALLOW_EXHAUST_PER_TURN(true, false);
|
||||
|
||||
private final boolean needAffectedAbility; // mark what AsThough check must be called for specific ability, not full object (example: spell check)
|
||||
private final boolean needPlayCardAbility; // mark what AsThough check must be called for play/cast abilities
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue