[DFT] Implement Full Throttle

This commit is contained in:
Jmlundeen 2025-03-18 22:46:50 -05:00 committed by GitHub
commit d5ed935339
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 121 additions and 1 deletions

View file

@ -0,0 +1,74 @@
package mage.cards.f;
import java.util.UUID;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.condition.OrCondition;
import mage.abilities.condition.common.IsPhaseCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.turn.Turn;
/**
*
* @author Jmlundeen
*/
public final class FullThrottle extends CardImpl {
public FullThrottle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}{R}");
// After this main phase, there are two additional combat phases.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new AdditionalCombatPhaseEffect(2, TargetController.ANY),
new OrCondition(new IsPhaseCondition(TurnPhase.PRECOMBAT_MAIN), new IsPhaseCondition(TurnPhase.POSTCOMBAT_MAIN)),
"After this main phase, there are two additional combat phases."
));
// At the beginning of each combat this turn, untap all creatures that attacked this turn.
DelayedTriggeredAbility ability = new FullThrottleTriggeredAbility();
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(ability).concatBy("<br>"));
}
private FullThrottle(final FullThrottle card) {
super(card);
}
@Override
public FullThrottle copy() {
return new FullThrottle(this);
}
}
class FullThrottleTriggeredAbility extends DelayedTriggeredAbility {
public FullThrottleTriggeredAbility() {
super(new UntapAllThatAttackedEffect(), Duration.EndOfTurn, false);
setTriggerPhrase("At the beginning of each combat this turn, ");
}
private FullThrottleTriggeredAbility(final FullThrottleTriggeredAbility ability) {
super(ability);
}
@Override
public FullThrottleTriggeredAbility copy() {
return new FullThrottleTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COMBAT_PHASE_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Turn turn = game.getState().getTurn();
return turn.getPhase().getType() == TurnPhase.COMBAT;
}
}

View file

@ -125,6 +125,9 @@ public final class Aetherdrift extends ExpansionSet {
cards.add(new SetCardInfo("Forest", 289, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Foul Roads", 255, Rarity.UNCOMMON, mage.cards.f.FoulRoads.class));
cards.add(new SetCardInfo("Fuel the Flames", 126, Rarity.UNCOMMON, mage.cards.f.FuelTheFlames.class));
cards.add(new SetCardInfo("Full Throttle", 127, Rarity.RARE, mage.cards.f.FullThrottle.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Full Throttle", 386, Rarity.RARE, mage.cards.f.FullThrottle.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Full Throttle", 460, Rarity.RARE, mage.cards.f.FullThrottle.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Gallant Strike", 13, Rarity.UNCOMMON, mage.cards.g.GallantStrike.class));
cards.add(new SetCardInfo("Gas Guzzler", 85, Rarity.RARE, mage.cards.g.GasGuzzler.class));
cards.add(new SetCardInfo("Gastal Blockbuster", 128, Rarity.COMMON, mage.cards.g.GastalBlockbuster.class));

View file

@ -3,19 +3,48 @@ package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.turn.TurnMod;
import java.util.UUID;
public class AdditionalCombatPhaseEffect extends OneShotEffect {
private final int additionalPhases;
private final TargetController targetController;
public AdditionalCombatPhaseEffect() {
super(Outcome.Benefit);
this.additionalPhases = 1;
this.targetController = TargetController.YOU;
staticText = "after this phase, there is an additional combat phase";
}
public AdditionalCombatPhaseEffect(int additionalPhases) {
this(additionalPhases, TargetController.YOU);
}
public AdditionalCombatPhaseEffect(int additionalPhases, TargetController targetController) {
super(Outcome.Benefit);
if (additionalPhases < 1) {
throw new IllegalArgumentException("Number of additional phases must be at least 1");
}
if (additionalPhases == 1) {
this.additionalPhases = 1;
staticText = "after this phase, there is an additional combat phase";
} else {
this.additionalPhases = additionalPhases;
staticText = "after this phase, there are " + additionalPhases + " additional combat phases";
}
this.targetController = targetController;
}
protected AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) {
super(effect);
this.additionalPhases = effect.additionalPhases;
this.targetController = effect.targetController;
}
@Override
@ -25,7 +54,21 @@ public class AdditionalCombatPhaseEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
game.getState().getTurnMods().add(new TurnMod(game.getState().getActivePlayerId()).withExtraPhase(TurnPhase.COMBAT));
UUID controllerId;
switch (targetController) {
case YOU:
controllerId = source.getControllerId();
break;
case ANY:
controllerId = game.getActivePlayerId();
break;
default:
throw new UnsupportedOperationException("Unsupported TargetController in AdditionalCombatPhaseEffect: " + targetController);
}
for (int i = 0; i < additionalPhases; i++) {
TurnMod combat = new TurnMod(controllerId).withExtraPhase(TurnPhase.COMBAT);
game.getState().getTurnMods().add(combat);
}
return true;
}
}