mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
fully support the CharmNum param in AF_Charm
This commit is contained in:
@@ -2118,18 +2118,23 @@ public class GameAction {
|
|||||||
if (sa.isCharm()) {
|
if (sa.isCharm()) {
|
||||||
ArrayList<SpellAbility> choices = new ArrayList<SpellAbility>();
|
ArrayList<SpellAbility> choices = new ArrayList<SpellAbility>();
|
||||||
choices.addAll(sa.getCharmChoices());
|
choices.addAll(sa.getCharmChoices());
|
||||||
|
for (int i = 0; i < choices.size(); i++) {
|
||||||
|
if (!sa.canPlay()) {
|
||||||
|
choices.remove(sa);
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int i = 0; i < sa.getCharmNumber(); i++) {
|
for (int i = 0; i < sa.getCharmNumber(); i++) {
|
||||||
Object o = GuiUtils.getChoice("Choose a spell", choices.toArray());
|
Object o = GuiUtils.getChoice("Choose a spell", choices.toArray());
|
||||||
Ability_Sub chosen = (Ability_Sub) o;
|
Ability_Sub chosen = (Ability_Sub) o;
|
||||||
sa.addCharmChoice(chosen);
|
sa.addCharmChoice(chosen);
|
||||||
choices.remove(chosen);
|
choices.remove(chosen);
|
||||||
//TODO - to support the commands, thi
|
|
||||||
/*
|
//walk down the SpellAbility tree and add to the child Ability_Sub
|
||||||
* TODO - to support the commands, this will need to arrange Ability_Sub items
|
SpellAbility child = sa;
|
||||||
* so that the Charm sa doesn't have multiple Ability_Subs, but instead, the
|
while (child.getSubAbility() != null) {
|
||||||
* most recent chosen Ability_Sub will be added to the bottom of the SpellAbility tree
|
child = child.getSubAbility();
|
||||||
*/
|
}
|
||||||
sa.setSubAbility(chosen);
|
child.setSubAbility(chosen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user