Added support for casting modal spells or activating modal abilities with more than one mode to choose.

This commit is contained in:
LevelX2 2013-06-22 19:35:22 +02:00
parent d520d63e2c
commit 853810ce45
8 changed files with 201 additions and 90 deletions

View file

@ -1230,7 +1230,13 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
return modes.getMode();
}
//TODO: improve this;
return modes.values().iterator().next();
for (Mode mode: modes.values()) {
if (!modes.getSelectedModes().contains(mode.getId()) // select only modes not already selected
&& mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available
return mode;
}
}
return null;
}
@Override