demiurgeQuantified / StatsAPI

Project Zomboid mod that reimplements stat calculations in Lua, so that they can be further modded.
4 stars 2 forks source link

Expand functionality to cover Panic #1

Closed Diakon5 closed 1 year ago

Diakon5 commented 1 year ago

I was recommended this while messing with stress, and frankly, I like this. I'd like to contribute. I had made a mod that fixes a bug with panic reduction being calculated off of the savefile life instead of character survived time. It could be used as a basis, but I am not sure yet how it would need to be ported for the API https://github.com/Diakon5/Zomboid-Mods/blob/main/DaikonPanicMod/Contents/mods/PanicFix/media/lua/client/PanicWrapp.lua

demiurgeQuantified commented 1 year ago

yeah, right now the API just replaces everything the CalculateStats hook is responsible for, but i'd like it to cover all stats if possible. i imagine panic is probably handled in BodyDamage (most stats this API doesn't yet govern are) which makes it difficult to override, but this is definitely something i'm going to look into soon

Diakon5 commented 1 year ago

Panic is governed by stats. Unhappiness is in health. My approach to overriding it was... Rather brute-force, by adding back whatever the game would calculate as the reduction, and then subtracting my amount. It wasn't all that sophisticated, it was my second zomboid mod, and the file also has extra functionality to give some extra panic reduction with zombie kills...