Trimps / bug-tracker

Trimps Bugs and Suggestions
GNU General Public License v2.0
1 stars 0 forks source link

Dark essence message incorrect #73

Open Molodude opened 2 years ago

Molodude commented 2 years ago

The omnipotrimp had dark essence, and hovering over S stance showed 1 enemy left in the zone with dark essence. Upon killing it however, the message in the log said that 1 enemy in the zone still had dark essence. (Previous messages in that zone also showed 1 more than it should have, but was not able to capture that in my save). Save attached that is paused right before killing the omnipotrimp in S stance. DEBug.txt

keyboard-jockey commented 1 year ago

Duplicated by https://github.com/Trimps/bug-tracker/issues/172 Findings: 1) fight() checks all defeated cells for DE, so nothing actually goes missing, despite the mismatching messages. 2) fight() increments scrySeed directly after detecting a kill, but does not also update the lastClearedCell before calculating essence. This means that the scry formation tooltip is out of sync with the drop. (It doesn't make any difference until we're on the last cell. The tooltip correctly doesn't give away whether the current cell has DE or not, so its calculation happens to be correct when using the same math from countRemainingEssenceDrops().) 3) One way to fix this would be to provide lastClearedCell as a parameter to countRemainingEssenceDrops() and lastClearedCell+1 from tryScry() instead. 4) (There is a small possibility that everything I've said is true except that it's actually the first cell of the next zone rather than the last cell of the current zone.)

keyboard-jockey commented 1 year ago

I was partially wrong. Anyhow, made a minimally invasive 3 line change to accomodate this. Please see PR https://github.com/Trimps/Trimps.github.io/pull/256