forked from External/mage
Added support for casting modal spells or activating modal abilities with more than one mode to choose.
This commit is contained in:
parent
d520d63e2c
commit
853810ce45
8 changed files with 201 additions and 90 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue