# \[Magiclysm\] What effect does RIng of Protection do?

**URL:** https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331
**Category:** The Bunker
**Created:** [November 21, 2020, 11:50am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331 "2020-11-21T11:50:30Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Reinweiss](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/reinweiss/32/10487_2.png) [@Reinweiss](https://discourse.cataclysmdda.org/u/Reinweiss)
#### Post date: [November 21, 2020, 11:50am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/1 "2020-11-21T11:50:30Z")

</div>

“passive\_effects”: [  
{  
“has”: “WORN”,  
“condition”: “ALWAYS”,  
“values”: [  
{ “value”: “ARMOR\_CUT”, “add”: -8 },  
{ “value”: “ARMOR\_BASH”, “add”: -8 },  
{ “value”: “ARMOR\_STAB”, “add”: -8 },  
{ “value”: “ARMOR\_BULLET”, “add”: -4 }

Does it mean decrease damage?

---

<div class="post-metadata">

### Author: ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)
#### Post date: [November 22, 2020, 7:15am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/2 "2020-11-22T07:15:37Z")

</div>

I was curious about this myself, as it didn’t seem all that self explanatory. Seems kinda vague other than ‘protection’

---

<div class="post-metadata">

### Author: ![Len\_B](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/len_b/32/10457_2.png) [@Len\_B](https://discourse.cataclysmdda.org/u/Len_B)
#### Post date: [November 22, 2020, 7:53pm UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/3 "2020-11-22T19:53:06Z")

</div>

From looking at that code, I would expect that it adds a negative value to incoming damage. Need a code diver to confirm if this is the case.

---

<div class="post-metadata">

### Author: ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)
#### Post date: [November 23, 2020, 4:27am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/4 "2020-11-23T04:27:43Z")

</div>

> [@Reinweiss](#):
>
> Does it mean decrease damage?

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.”)…

---

<div class="post-metadata">

### Author: ![KorGgenT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/korggent/32/12330_2.png) [@KorGgenT](https://discourse.cataclysmdda.org/u/KorGgenT)
#### Post date: [November 23, 2020, 4:45am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/5 "2020-11-23T04:45:36Z")

</div>

because the values act upon the incoming damage

---

<div class="post-metadata">

### Author: ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)
#### Post date: [November 23, 2020, 4:54am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/6 "2020-11-23T04:54:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![zantanzuken](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zantanzuken/32/10325_2.png) [@zantanzuken](https://discourse.cataclysmdda.org/u/zantanzuken)
#### Post date: [November 23, 2020, 7:38am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/7 "2020-11-23T07:38:13Z")

</div>

well the idea is, if a monster does + damage to you, (say, bites you for 8 damage) then the ring does - damage to you, (removes 4)

oldschool RPG’s used to do that too, in that they’d show you ‘taking’ negative damage in order to heal yourself.

---

<div class="post-metadata">

### Author: ![KorGgenT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/korggent/32/12330_2.png) [@KorGgenT](https://discourse.cataclysmdda.org/u/KorGgenT)
#### Post date: [November 23, 2020, 7:41am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/8 "2020-11-23T07:41:22Z")

</div>

no not exactly -  
the monster tries to do 8 damage to you. the ring subtracts 4 from that.  
that’s the only reason it’s like that.

---

<div class="post-metadata">

### Author: ![zantanzuken](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zantanzuken/32/10325_2.png) [@zantanzuken](https://discourse.cataclysmdda.org/u/zantanzuken)
#### Post date: [November 23, 2020, 7:44am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/9 "2020-11-23T07:44:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)
#### Post date: [November 23, 2020, 2:34pm UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/10 "2020-11-23T14:34:16Z")

</div>

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](https://github.com/CleverRaven/Cataclysm-DDA/blob/716e147850a9013bb73de0d472f6de9dcabd79f7/data/mods/Magiclysm/items/enchanted_rings.json#L365-L368) to [this](https://github.com/CleverRaven/Cataclysm-DDA/blob/716e147850a9013bb73de0d472f6de9dcabd79f7/data/json/monsters/zed_soldiers.json#L25-L27).  
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”.

---

<div class="post-metadata">

### Author: ![zantanzuken](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zantanzuken/32/10325_2.png) [@zantanzuken](https://discourse.cataclysmdda.org/u/zantanzuken)
#### Post date: [November 23, 2020, 3:14pm UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/11 "2020-11-23T15:14:39Z")

</div>

i mean, realistically you’d have to take it up with the magiclysm mod author for his reasoning behind it

---

<div class="post-metadata">

### Author: ![KorGgenT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/korggent/32/12330_2.png) [@KorGgenT](https://discourse.cataclysmdda.org/u/KorGgenT)
#### Post date: [November 24, 2020, 1:39am UTC](https://discourse.cataclysmdda.org/t/magiclysm-what-effect-does-ring-of-protection-do/25331/12 "2020-11-24T01:39:05Z")

</div>

> [@Valase](#):
>
> I have no explanation why it’s one way for monsters and the other way for the player character.

that’s just what i was replying to. an explanation. monsters don’t get enchantments, it’s different code.
