mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Allowing Charms to have subAbilities be chosen more than once (AI support needs improving to actually filter through all the permutations)
This commit is contained in:
@@ -52,9 +52,9 @@ public class CharmEffect extends SpellAbilityEffect {
|
||||
// so nothing to do in this resolve
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
// TODO Build StackDescription based on Chosen SubAbilities
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CharmEffect extends SpellAbilityEffect {
|
||||
source.setChosenPlayer(chooser);
|
||||
}
|
||||
|
||||
List<AbilitySub> chosen = chooser.getController().chooseModeForAbility(sa, min, num);
|
||||
List<AbilitySub> chosen = chooser.getController().chooseModeForAbility(sa, min, num, sa.hasParam(("CanRepeatModes")));
|
||||
chainAbilities(sa, chosen);
|
||||
}
|
||||
|
||||
@@ -98,12 +98,15 @@ public class CharmEffect extends SpellAbilityEffect {
|
||||
});
|
||||
|
||||
for (AbilitySub sub : chosen) {
|
||||
saDeepest.setSubAbility(sub);
|
||||
sub.setActivatingPlayer(saDeepest.getActivatingPlayer());
|
||||
sub.setParent(saDeepest);
|
||||
// Clone the chosen, just in case the some subAb gets chosen multiple times
|
||||
AbilitySub clone = (AbilitySub)sub.getCopy();
|
||||
|
||||
saDeepest.setSubAbility(clone);
|
||||
clone.setActivatingPlayer(saDeepest.getActivatingPlayer());
|
||||
clone.setParent(saDeepest);
|
||||
|
||||
// to chain the next one (but make sure it goes all the way at the end of the SA chain)
|
||||
saDeepest = sub;
|
||||
saDeepest = clone;
|
||||
while (saDeepest.getSubAbility() != null) {
|
||||
saDeepest = saDeepest.getSubAbility();
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public abstract class PlayerController {
|
||||
public abstract boolean chooseFlipResult(SpellAbility sa, Player flipper, boolean[] results, boolean call);
|
||||
public abstract Card chooseProtectionShield(GameEntity entityBeingDamaged, List<String> options, Map<String, Card> choiceMap);
|
||||
|
||||
public abstract List<AbilitySub> chooseModeForAbility(SpellAbility sa, int min, int num);
|
||||
public abstract List<AbilitySub> chooseModeForAbility(SpellAbility sa, int min, int num, boolean allowRepeat);
|
||||
|
||||
public abstract byte chooseColor(String message, SpellAbility sa, ColorSet colors);
|
||||
public abstract byte chooseColorAllowColorless(String message, Card c, ColorSet colors);
|
||||
|
||||
Reference in New Issue
Block a user