Well, yes. As the description says: A [MATERIAL] ring that [INTENSITY] reduces some of the force of damage you take when you wear it.
It does just that: It reduces the damage you take.
I have no idea good explanation why it was coded to take negative values for a positive effect, but it works as intended (tested):
On a naked character a monster with a fixed damage value, the character takes 4 damage each hit.
Wearing a ring of protection+2 (copper) reduces that damage to 1 each hit.
With a ring of protection+8 (platinum, the one you’ve pasted the code here), the character no longer takes any damage (“The [MONSTER] hits your [BODYPART], but your armor protects you.”)…
I mean, yeah, sure, I’ve figured that much.
Hovever, given that monsters have identical (uppercase aside) variable names with positive values assigned to them which prevent them from damage… it just seems a bit weird.
That’s why I’ve stated that I have no good explanation for why it’s coded that way for the player, but the other way around for the monsters.
yeah i didnt mean that as in like, you take 8 damage and then immediately heal 4… just that its removing from that number before it actually affects your character. -4 being you take 4 less damage than you would otherwise have taken.
Again… I got that. I understand that. I understand how the math behind that and the code in itself works (see my tests and explanation above).
Now please try to understand what I am talking about:
Compare this to this.
I have no explanation why it’s one way for monsters and the other way for the player character. That’s all I’m saying. That’s all I’ve ever said.
And before someone says “it’s because the monster’s armor value gets turned negative in the code and then subtracted from the attack” - yes, sure it does, but why can’t it do it that way for the player’s character too?
It’s the inconsistency I have no good explanation for (aside from “an oversight”), not on “how it works”.