[DFT] Implement Elvish Refueler (#13392)

This commit is contained in:
Jmlundeen 2025-03-13 22:24:26 -05:00 committed by GitHub
parent cd8cb6afe5
commit 9aaad5193f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 232 additions and 1 deletions

View file

@ -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 &mdash; " + super.getRule() + " <i>(Activate each exhaust ability only once.)</i>";