mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fixed choosing replacement effects for similar effects (didn't ask to choose);
This commit is contained in:
parent
0d40cc7cf2
commit
3f4ed0a919
2 changed files with 7 additions and 2 deletions
|
@ -164,19 +164,24 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
public int chooseEffect(List<ReplacementEffect> rEffects, Game game) {
|
||||
game.getState().setPriorityPlayerId(getId());
|
||||
replacementEffectChoice.getChoices().clear();
|
||||
int count = 1;
|
||||
for (ReplacementEffect effect: rEffects) {
|
||||
replacementEffectChoice.getChoices().add(effect.getText(null));
|
||||
replacementEffectChoice.getChoices().add(count + ". " + effect.getText(null));
|
||||
count++;
|
||||
}
|
||||
if (replacementEffectChoice.getChoices().size() == 1)
|
||||
return 0;
|
||||
while (!abort) {
|
||||
game.fireChooseEvent(playerId, replacementEffectChoice);
|
||||
waitForResponse();
|
||||
System.out.println(response.getString());
|
||||
if (response.getString() != null) {
|
||||
replacementEffectChoice.setChoice(response.getString());
|
||||
count = 1;
|
||||
for (int i = 0; i < rEffects.size(); i++) {
|
||||
if (replacementEffectChoice.getChoice().equals(rEffects.get(i).getText(null)))
|
||||
if (replacementEffectChoice.getChoice().equals(count + ". " + rEffects.get(i).getText(null)))
|
||||
return i;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue