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:
@@ -501,8 +501,8 @@ public class PlayerControllerAi extends PlayerController {
|
||||
* @see forge.game.player.PlayerController#chooseModeForAbility(forge.card.spellability.SpellAbility, java.util.List, int, int)
|
||||
*/
|
||||
@Override
|
||||
public List<AbilitySub> chooseModeForAbility(SpellAbility sa, int min, int num) {
|
||||
return CharmAi.chooseOptionsAi(sa, player, sa.isTrigger(), num, min, !player.equals(sa.getActivatingPlayer()));
|
||||
public List<AbilitySub> chooseModeForAbility(SpellAbility sa, int min, int num, boolean allowRepeat) {
|
||||
return CharmAi.chooseOptionsAi(sa, player, sa.isTrigger(), num, min, allowRepeat, !player.equals(sa.getActivatingPlayer()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CharmAi extends SpellAbilityAi {
|
||||
|
||||
// reset the chosen list. Otherwise it will be locked in forever
|
||||
sa.setChosenList(null);
|
||||
List<AbilitySub> chosenList = min > 1 ? chooseMultipleOptionsAi(sa, ai, min) : chooseOptionsAi(sa, ai, timingRight, num, min, false);
|
||||
List<AbilitySub> chosenList = min > 1 ? chooseMultipleOptionsAi(sa, ai, min) : chooseOptionsAi(sa, ai, timingRight, num, min, sa.hasParam("CanRepeatModes"), false);
|
||||
|
||||
if (chosenList.isEmpty()) {
|
||||
return false;
|
||||
@@ -38,7 +38,7 @@ public class CharmAi extends SpellAbilityAi {
|
||||
return r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());
|
||||
}
|
||||
|
||||
public static List<AbilitySub> chooseOptionsAi(SpellAbility sa, final Player ai, boolean playNow, int num, int min, boolean opponentChoser) {
|
||||
public static List<AbilitySub> chooseOptionsAi(SpellAbility sa, final Player ai, boolean playNow, int num, int min, boolean allowRepeat, boolean opponentChoser) {
|
||||
if (sa.getChosenList() != null) {
|
||||
return sa.getChosenList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user