mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Changed ability handling of modal spells to be able to select the same mode multiple times with different targets.
This commit is contained in:
parent
b18cae5100
commit
4711e0cf99
40 changed files with 488 additions and 421 deletions
|
|
@ -1568,9 +1568,14 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
return modes.getMode();
|
||||
}
|
||||
//TODO: improve this;
|
||||
AvailableMode:
|
||||
for (Mode mode : modes.getAvailableModes(source, game)) {
|
||||
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
|
||||
for (Mode selectedMode : modes.getSelectedModes()) {
|
||||
if (selectedMode.getId().equals(mode.getId())) {
|
||||
continue AvailableMode;
|
||||
}
|
||||
}
|
||||
if (mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue