If you couldn't have done it without me, I certainly couldn't have done it without you and the decoding of actual HP values At least the dubious skill of rapidly tapping ctrl-carnage in between single shots (while dodging shots coming at me and cursing the change from ctrl-underscore) has borne some actual fruit.
This is so cool!
: Note to future hackers: Loren's "Unknown4a" field (4 bytes
: following damage taken, offset 190) stores damage inflicted. This number
: is divided by 3, and rounded down, for display on the carnage screen.
: Editing the body count or accuracy stats do not affect the damage
: reported; it's a separate value.
: At first, I was surprised this wasn't documented before now. But, it's much
: harder to spot if you don't know internal damage is divided by 3. Thanks,
: Andrew, I couldn't have done it without you!
: After tweaking these stored numbers, I found that the displayed damage ratio
: handles up to 327.67 and then fails, flipping to -327.-68 and counting
: down from there. The rest is obvious to a programmer -- the code would be
: something like: Sint16 ratio = ((inflicted / 3) / taken) * 100;
: Sint16 ratio_whole = ratio / 100;
: Sint16 ratio_frac = ratio % 100;
: At this point , you'd inflicted 114,308 internal damage points and taken 60
: damage points. The math works out like so:
: 114,308 / 3 = 38102.67
: 38102.67 / 60 = 635.04
: 635.04 * 100 = 63504
: When stored as a signed 16-bit integer, 63504 becomes 65536 - 63504 = -2032
: Splitting -2032 for the whole-number and fractional parts gives -20 and -32
: