mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge branch 'charmRework' into 'master'
Charm rework Closes #806 See merge request core-developers/forge!1312
This commit is contained in:
@@ -150,14 +150,14 @@ public class CharmEffect extends SpellAbilityEffect {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void makeChoices(SpellAbility sa) {
|
public static boolean makeChoices(SpellAbility sa) {
|
||||||
//this resets all previous choices
|
//this resets all previous choices
|
||||||
sa.setSubAbility(null);
|
sa.setSubAbility(null);
|
||||||
|
|
||||||
// Entwine does use all Choices
|
// Entwine does use all Choices
|
||||||
if (sa.isEntwine()) {
|
if (sa.isEntwine()) {
|
||||||
chainAbilities(sa, makePossibleOptions(sa));
|
chainAbilities(sa, makePossibleOptions(sa));
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int num = sa.hasParam("CharmNumOnResolve") ?
|
final int num = sa.hasParam("CharmNumOnResolve") ?
|
||||||
@@ -181,6 +181,7 @@ public class CharmEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
List<AbilitySub> chosen = chooser.getController().chooseModeForAbility(sa, min, num, sa.hasParam("CanRepeatModes"));
|
List<AbilitySub> chosen = chooser.getController().chooseModeForAbility(sa, min, num, sa.hasParam("CanRepeatModes"));
|
||||||
chainAbilities(sa, chosen);
|
chainAbilities(sa, chosen);
|
||||||
|
return chosen != null && !chosen.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void chainAbilities(SpellAbility sa, List<AbilitySub> chosen) {
|
private static void chainAbilities(SpellAbility sa, List<AbilitySub> chosen) {
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ import forge.card.mana.ManaCost;
|
|||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.ability.AbilityFactory;
|
import forge.game.ability.AbilityFactory;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.ability.ApiType;
|
|
||||||
import forge.game.ability.effects.CharmEffect;
|
|
||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.replacement.ReplacementHandler;
|
import forge.game.replacement.ReplacementHandler;
|
||||||
@@ -680,9 +678,6 @@ public class CardFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trig.setStackDescription(trig.toString());
|
trig.setStackDescription(trig.toString());
|
||||||
if (trig.getApi() == ApiType.Charm && !trig.isWrapper()) {
|
|
||||||
CharmEffect.makeChoices(trig);
|
|
||||||
}
|
|
||||||
|
|
||||||
WrappedAbility wrapperAbility = new WrappedAbility(t, trig, ((WrappedAbility) sa).getDecider());
|
WrappedAbility wrapperAbility = new WrappedAbility(t, trig, ((WrappedAbility) sa).getDecider());
|
||||||
wrapperAbility.setTrigger(true);
|
wrapperAbility.setTrigger(true);
|
||||||
|
|||||||
@@ -636,7 +636,10 @@ public class TriggerHandler {
|
|||||||
|
|
||||||
sa.setStackDescription(sa.toString());
|
sa.setStackDescription(sa.toString());
|
||||||
if (sa.getApi() == ApiType.Charm && !sa.isWrapper()) {
|
if (sa.getApi() == ApiType.Charm && !sa.isWrapper()) {
|
||||||
CharmEffect.makeChoices(sa);
|
if (!CharmEffect.makeChoices(sa)) {
|
||||||
|
// 603.3c If no mode is chosen, the ability is removed from the stack.
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Player decider = null;
|
Player decider = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user