There are no callers in mainline. The functions are not meant to be called directly at all – for each, there are wrapper functions that are intended to be called instead, which are still exposed.
These functions are not used anywhere, and they have other issues besides the one fixed in this commit – they're implied to return all moves, but they only return one move for each possibly destination hex. However, this will make them at least be minimally usable.
I used level 3 deprecation because this is something that was intended for internal use in the ai_helper module, and the ai_helper module itself is not an officially stable API
Nowdays ability.value and similar attributes can also contain formulas
(That for example make a heal amount dependent on the remaining hitpointsthe unit has
)
With this the lua ai code should no longer crash in these cases.
Ensures that files either use tabs for indentation or spaces for indentation,
but don't switch between the two within the same file.
This doesn't fix the whitespace, it's a simple check to flag it up
on the assumption that it's better to use an editor or code formatter
to clean up the file.
Elsewhere in the CI we use the luacheck tool - while that can detect
mixing tabs and spaces in a single line's indent, it doesn't check for
inconsistent indentation within a file.
The method used in the battle_outcome() function is somewhat simplified compared to the default engine calculation and faster in the vast majority of cases, but it can become extremely slow when the combined number of strikes of the attacker and defender is very large.
The new method avoids a lot of path finding that the previous method did, esp. on large maps with many units and/or enemies, leading to significant speed improvements in some cases.
This fixes#6504
This fixes#4924. Note, however, that the recruit rushers CA is set up for single-leader sides and does not work with multiple leaders, so this is of limited use.
Many of the operations of the recruit rushers CA are expensive and are therefore cached. For the most part, this cache can be kept from turn to turn, but in case there are events that change, for example, the map or the recruit list, this parameter can be used to force a reset of the cache each turn.