SkoobyDoo / tome4-SkooBot

ToME4 Bot Addon which provides a rudimentary autopilot for playing the game
GNU General Public License v3.0
3 stars 4 forks source link

Combat logic doesnt react well to being low on resources #25

Open SkoobyDoo opened 5 years ago

SkoobyDoo commented 5 years ago

Currently, if all abilities are uncastable due to insufficient resources, the bot just bumps enemies trying to path into range. Talents should register as failed if there is insufficient resource to use them.

SkoobyDoo commented 5 years ago

Relevant code is filterFailedTalents(talents) and getAvailableTalents(target,talents), which can be found here https://github.com/SkoobyDoo/tome4-SkooBot/blob/aa2067f5e36b60c5d265aef2456bccfa75eb0862/superload/mod/class/Player.lua#L444-L496

getAvailableTalents should probably be able to get this, but the function specifically references a target and may not be the most appropriate location for this.

filterFailedTalents is supposed to use the mechanism here: https://github.com/SkoobyDoo/tome4-SkooBot/blob/aa2067f5e36b60c5d265aef2456bccfa75eb0862/superload/mod/class/Player.lua#L498-L503

to keep track of abilities which have failed to successfully activate, but this does not appear to be currently working for abilities which failed to activate due to insufficient resources.

SkoobyDoo commented 5 years ago

pushing to 0.0.4 release to get 3 out now