fully support the CharmNum param in AF_Charm

This commit is contained in:
slapshot5
2011-10-10 05:30:40 +00:00
parent 2ab17e5843
commit 0d38dfbe2b

View File

@@ -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);
} }
} }