mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
AI: improved performance and fixed crashes on use cases with too much target options like "deals 5 damage divided as you choose" (related to #11285):
* added DebugUtil.AI_ENABLE_DEBUG_MODE for better IDE's debugging AI code; * it's a target amount optimizations; * it's use a grouping of possible targets due same static and dynamic stats (name, abilities, rules, damage, etc); * instead of going through all possible combinations, AI uses only meaningful targets from particular groups;
This commit is contained in:
parent
b4fa6ace66
commit
f17cbbe72b
9 changed files with 349 additions and 50 deletions
|
|
@ -346,7 +346,7 @@ public final class SimulatedPlayer2 extends ComputerPlayer {
|
|||
logger.debug("simulating -- node #:" + SimulationNode2.getCount() + " triggered ability option");
|
||||
for (Target target : ability.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
newNode.getTargets().add(targetId);
|
||||
newNode.getTargets().add(targetId); // save for info only (real targets in newNode.ability already)
|
||||
}
|
||||
}
|
||||
parent.children.add(newNode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue