Quote:
|
Originally Posted by Technique
If the classic server implementation used only a byte to store stat/resist values, then it obviously shouldn't work like that.
|
I had to think about this a bit, but I'm fairly sure this is incorrect. Which is why you shouldn't be quite so snippy about being asked to present 'obvious' evidence.
You seem to be mentally implementing this as a running counter: resistMagic = (char)min(255, max(0, (int)resistMagic + buffValue)). Unfortunately this won't work. Imagine we start with a character of max resists and cast GRM which is then dispelled:
- Initial value: 255
- With GRM: 255+55 -> 255
- GRM fades: 255 - 55 -> 200 (!!)
So either the resist magic value was computed from scratch every time a new buff was applied (and this would for sure have been using 32 bit math (not 16 bit kaev you nut) to avoid overflow) and then clamped to an 8 bit range to save memory or the value was stored as a 16 bit integer internally and clamped to 255 for game balance reasons.
TLDR: Daldaen's interpretation seems the most reasonable to me, and it's probably not an accident that P1999's implementation matches this.