rework allowing additional modes conditionally

This commit is contained in:
theelk801 2024-09-14 10:35:30 -04:00
parent 05e738efb5
commit c79ed1ea72
15 changed files with 18 additions and 22 deletions

View file

@ -33,7 +33,7 @@ public final class AkromasWill extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both instead." "Choose one. If you control a commander as you cast this spell, you may choose both instead."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Creatures you control gain flying, vigilance, and double strike until end of turn. // Creatures you control gain flying, vigilance, and double strike until end of turn.
this.getSpellAbility().addEffect(new GainAbilityControlledEffect( this.getSpellAbility().addEffect(new GainAbilityControlledEffect(

View file

@ -36,7 +36,7 @@ public final class DiscipleOfPerdition extends CardImpl {
// * You draw a card and you lose 1 life. // * You draw a card and you lose 1 life.
Ability ability = new DiesSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, true), false); Ability ability = new DiesSourceTriggeredAbility(new DrawCardSourceControllerEffect(1, true), false);
ability.getModes().setChooseText("choose one. If you have exactly 13 life, you may choose both."); ability.getModes().setChooseText("choose one. If you have exactly 13 life, you may choose both.");
ability.getModes().setMoreCondition(new LifeCompareCondition(TargetController.YOU, ComparisonType.EQUAL_TO, 13)); ability.getModes().setMoreCondition(2, new LifeCompareCondition(TargetController.YOU, ComparisonType.EQUAL_TO, 13));
ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and")); ability.addEffect(new LoseLifeSourceControllerEffect(1).concatBy("and"));
// * Exile target opponent's graveyard. That player loses 1 life. // * Exile target opponent's graveyard. That player loses 1 life.

View file

@ -28,7 +28,7 @@ public final class DrownInDreams extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both." "Choose one. If you control a commander as you cast this spell, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Target player draws X cards. // Target player draws X cards.
this.getSpellAbility().addEffect(new DrawCardTargetEffect(GetXValue.instance)); this.getSpellAbility().addEffect(new DrawCardTargetEffect(GetXValue.instance));

View file

@ -32,8 +32,7 @@ public final class FlameOfAnor extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{R}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{R}");
// Choose one. If you control a Wizard as you cast this spell, you may choose two instead. // Choose one. If you control a Wizard as you cast this spell, you may choose two instead.
this.getSpellAbility().getModes().setMoreCondition(condition); this.getSpellAbility().getModes().setMoreCondition(2, condition);
this.getSpellAbility().getModes().setMoreLimit(2);
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a Wizard as you cast this spell, you may choose two instead." "Choose one. If you control a Wizard as you cast this spell, you may choose two instead."
); );

View file

@ -29,7 +29,7 @@ public final class JeskasWill extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both instead." "Choose one. If you control a commander as you cast this spell, you may choose both instead."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Add {R} for each card in target opponent's hand. // Add {R} for each card in target opponent's hand.
this.getSpellAbility().addEffect(new JeskasWillEffect()); this.getSpellAbility().addEffect(new JeskasWillEffect());

View file

@ -34,7 +34,7 @@ public final class KamahlsWill extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both." "Choose one. If you control a commander as you cast this spell, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Until end of turn, any number of target lands you control become 1/1 Elemental creatures with vigilance, indestructible, and haste. They're still lands. // Until end of turn, any number of target lands you control become 1/1 Elemental creatures with vigilance, indestructible, and haste. They're still lands.
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect( this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(

View file

@ -40,7 +40,7 @@ public final class KlauthsWill extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both." "Choose one. If you control a commander as you cast this spell, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Breathe Flame Klauth's Will deals X damage to each creature without flying. // Breathe Flame Klauth's Will deals X damage to each creature without flying.
this.getSpellAbility().addEffect(new DamageAllEffect(GetXValue.instance, filter)); this.getSpellAbility().addEffect(new DamageAllEffect(GetXValue.instance, filter));
@ -76,4 +76,4 @@ enum KlauthsWillAdjuster implements TargetAdjuster {
)); ));
} }
} }
} }

View file

@ -30,7 +30,7 @@ public final class LetsPlayAGame extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"choose one. If there are four or more card types among cards in your graveyard, choose one or more instead." "choose one. If there are four or more card types among cards in your graveyard, choose one or more instead."
); );
this.getSpellAbility().getModes().setMoreCondition(DeliriumCondition.instance); this.getSpellAbility().getModes().setMoreCondition(3, DeliriumCondition.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DELIRIUM); this.getSpellAbility().setAbilityWord(AbilityWord.DELIRIUM);
this.getSpellAbility().addHint(CardTypesInGraveyardHint.YOU); this.getSpellAbility().addHint(CardTypesInGraveyardHint.YOU);

View file

@ -34,7 +34,7 @@ public final class MoltenCollapse extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{R}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{R}");
// Choose one. If you descended this turn, you may choose both instead. // Choose one. If you descended this turn, you may choose both instead.
this.getSpellAbility().getModes().setMoreCondition(DescendedThisTurnCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, DescendedThisTurnCondition.instance);
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you descended this turn, you may choose both instead." "Choose one. If you descended this turn, you may choose both instead."
); );

View file

@ -34,7 +34,7 @@ public final class SakashimasWill extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both." "Choose one. If you control a commander as you cast this spell, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Target opponent chooses a creature they control. You gain control of it. // Target opponent chooses a creature they control. You gain control of it.
this.getSpellAbility().addEffect(new SakashimasWillStealEffect()); this.getSpellAbility().addEffect(new SakashimasWillStealEffect());

View file

@ -30,7 +30,7 @@ public final class SeeDouble extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If an opponent has eight or more cards in their graveyard, you may choose both." "Choose one. If an opponent has eight or more cards in their graveyard, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(CardsInOpponentGraveyardCondition.EIGHT); this.getSpellAbility().getModes().setMoreCondition(2, CardsInOpponentGraveyardCondition.EIGHT);
this.getSpellAbility().addHint(CardsInOpponentGraveyardCondition.EIGHT.getHint()); this.getSpellAbility().addHint(CardsInOpponentGraveyardCondition.EIGHT.getHint());
// * Copy target spell. You may choose new targets for the copy. // * Copy target spell. You may choose new targets for the copy.

View file

@ -36,7 +36,7 @@ public final class SoulTransfer extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control an artifact and an enchantment as you cast this spell, you may choose both." "Choose one. If you control an artifact and an enchantment as you cast this spell, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(SoulTransferCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, SoulTransferCondition.instance);
// Exile target creature or planeswalker. // Exile target creature or planeswalker.
this.getSpellAbility().addEffect(new ExileTargetEffect()); this.getSpellAbility().addEffect(new ExileTargetEffect());

View file

@ -45,7 +45,7 @@ public final class SzatsWill extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"Choose one. If you control a commander as you cast this spell, you may choose both." "Choose one. If you control a commander as you cast this spell, you may choose both."
); );
this.getSpellAbility().getModes().setMoreCondition(ControlACommanderCondition.instance); this.getSpellAbility().getModes().setMoreCondition(2, ControlACommanderCondition.instance);
// Each opponent sacrifices a creature they control with the greatest power. // Each opponent sacrifices a creature they control with the greatest power.
this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(filter)); this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(filter));

View file

@ -27,7 +27,7 @@ public final class WailOfTheForgotten extends CardImpl {
this.getSpellAbility().getModes().setChooseText( this.getSpellAbility().getModes().setChooseText(
"choose one. If there are eight or more permanent cards in your graveyard as you cast this spell, choose one or more instead." "choose one. If there are eight or more permanent cards in your graveyard as you cast this spell, choose one or more instead."
); );
this.getSpellAbility().getModes().setMoreCondition(DescendCondition.EIGHT); this.getSpellAbility().getModes().setMoreCondition(3, DescendCondition.EIGHT);
this.getSpellAbility().setAbilityWord(AbilityWord.DESCEND_8); this.getSpellAbility().setAbilityWord(AbilityWord.DESCEND_8);
// * Return target nonland permanent to its owner's hand. // * Return target nonland permanent to its owner's hand.

View file

@ -38,7 +38,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> implements Copyable<Modes>
private int maxPawPrints; private int maxPawPrints;
private Filter maxModesFilter; // calculates the max number of available modes private Filter maxModesFilter; // calculates the max number of available modes
private Condition moreCondition; // allows multiple modes choose (example: choose one... if condition, you may choose both) private Condition moreCondition; // allows multiple modes choose (example: choose one... if condition, you may choose both)
private int moreLimit = Integer.MAX_VALUE; // if multiple modes are allowed, this limits how many additional modes may be chosen (usually doesn't need to change) private int moreLimit; // if multiple modes are allowed, this limits how many additional modes may be chosen
private boolean limitUsageByOnce = false; // limit mode selection to once per game private boolean limitUsageByOnce = false; // limit mode selection to once per game
private boolean limitUsageResetOnNewTurn = false; // reset once per game limit on new turn, example: Galadriel, Light of Valinor private boolean limitUsageResetOnNewTurn = false; // reset once per game limit on new turn, example: Galadriel, Light of Valinor
@ -303,12 +303,9 @@ public class Modes extends LinkedHashMap<UUID, Mode> implements Copyable<Modes>
this.put(mode.getId(), mode); this.put(mode.getId(), mode);
} }
public void setMoreCondition(Condition moreCondition) { public void setMoreCondition(int moreLimit, Condition moreCondition) {
this.moreCondition = moreCondition;
}
public void setMoreLimit(int moreLimit) {
this.moreLimit = moreLimit; this.moreLimit = moreLimit;
this.moreCondition = moreCondition;
} }
private boolean isAlreadySelectedModesOutdated(Game game, Ability source) { private boolean isAlreadySelectedModesOutdated(Game game, Ability source) {