Reading the code, I believe I stumbled on a bug related to melee + resistances. Consider this code path: roll_bash_damage(), add_damage(), get_effective_resist(). I've pasted the relevant code below, explanation follows.
The resistance code expects res_mult to be 1.0 if there is no resistance penetration. The bash roll code assumes the reverse -- it sets res_mult to 0 unless there is a critical hit, in which case res_mult becomes 0.5. The same bug is present for all three roll functions (bash, cut, stab). I've traced with printf() and the rest of the code seems to be sane, as I'm getting 1.0 res_mult values presumably coming from monster attacks.
When attacking with melee (my printf):
Roll Bash with amount 4 rm 0.000000.
Adding damage type 3 amount 4.000000 rp 0 rm 0.000000.
Applying resistance rp 0 rm 0.000000 result 0.000000.
Other damage getting processed (my printf):
Adding damage type 3 amount 3.000000 rp 0 rm 1.000000.
Applying resistance rp 0 rm 1.000000 result 14.000000.
Suggested patch: fix the roll functions by setting effective_resist 1.0f and subtracting instead of adding for the critical hits.
Reading the code, I believe I stumbled on a bug related to melee + resistances. Consider this code path: roll_bash_damage(), add_damage(), get_effective_resist(). I've pasted the relevant code below, explanation follows.
The resistance code expects res_mult to be 1.0 if there is no resistance penetration. The bash roll code assumes the reverse -- it sets res_mult to 0 unless there is a critical hit, in which case res_mult becomes 0.5. The same bug is present for all three roll functions (bash, cut, stab). I've traced with printf() and the rest of the code seems to be sane, as I'm getting 1.0 res_mult values presumably coming from monster attacks.
When attacking with melee (my printf): Roll Bash with amount 4 rm 0.000000. Adding damage type 3 amount 4.000000 rp 0 rm 0.000000. Applying resistance rp 0 rm 0.000000 result 0.000000.
Other damage getting processed (my printf): Adding damage type 3 amount 3.000000 rp 0 rm 1.000000. Applying resistance rp 0 rm 1.000000 result 14.000000.
Suggested patch: fix the roll functions by setting effective_resist 1.0f and subtracting instead of adding for the critical hits.
Thanks for the game.