[ToME 1.5.10] Auto-use and resource-draining sustains.

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
BugReporter
Higher
Posts: 62
Joined: Wed Jun 06, 2018 10:53 am

[ToME 1.5.10] Auto-use and resource-draining sustains.

#1 Post by BugReporter »

Auto-use can extend duration of resource-draining sustains.

Short description.

Auto-use feature can be used to prevent resource-draining sustains from turning off when a resource reaches 0.

Actual result.

Resource-draining sustain does not deactivate when a resource reaches 0.

Expected result.

Resource-draining sustain deactivates when a resource reaches 0.

Steps to reproduce.

1. Start a new game in Developer Mode and create a Mindslayer character.
2. Use a console to get levels (game.player:forceLevelup(50)) and select Forcefield talent on Levelup screen.
3. Set life regeneration to 100 (game.player.life_regen = 100).
4. Gather 3 or more enemies. Move to a tile with at least 3 enemies standing on adjacent tiles.
5. Right click on Forcefield talent and select "Request confirmation before using this talent".
6. Right click on Forcefield talent and select "Auto-use when enemies are visible and adjacent". Confirm your selection.
7. Skip a turn.
8. Confirm 3 "Talent Use Confirmation" dialogs. Cancel the rest if there are more then 3 dialogs.

Game version.

1.5.10 for windows from ToME site.

Comment.

The number of "Talent Use Confirmation" dialogs seems to be the same as the number of adjacent enemies.
/mod/class/Player.lua => function _M:automaticTalents() (line 891) => for loop (line 914) => if statement (line 915).
If I understand the code correctly, it executes the code for every adjacent enemy.
I guess that exiting the loop when condition becomes True should prevent many dialogs situation.

Code: Select all

for fid, foe in pairs(spotted) do
	if foe.x >= self.x-1 and foe.x <= self.x+1 and foe.y >= self.y-1 and foe.y <= self.y+1 then
		uses[#uses+1] = {name=t.name, turns_used=turns_used, cd=cd, fct=function() self:useTalent(tid) end}
        break
	end
end

Post Reply