# ThickSkinned and ThinSkinned is the same, while player in trees

## Recommended Posts

It looks like damage chance is the same for "Thick/Thin Skinned" traits. It is also very different from the base chance.

zombie.characters.IsoGameCharacter:

```private void damageWhileInTrees() {
//...
if (Rand.NextBool(i)) {
i = 5; // basic chance = 1/5 = 0.2 = 20%
if (this.Traits.ThickSkinned.isSet())
i += 10; // chance for ThickSkinned = 1/(5+10) = 0.0(6) = 6%
if (this.Traits.ThinSkinned.isSet())
i += 10; // chance for ThinSkinned = 1/(5+10) = 0.0(6) = 6%
if (Rand.NextBool(i) && (int)getBodyPartClothingDefense(Integer.valueOf(j), false) < 100) {
BodyPart bodyPart = getBodyDamage().getBodyParts().get(j);
if (Rand.NextBool(i + 10)) {
bodyPart.setCut(true, true);
} else {
bodyPart.setScratched(true, true);
}
}
}
}```

##### Share on other sites

Can you explain that abit more, dont realy understand!

##### Share on other sites

1 hour ago, Masmassu said:

Can you explain that abit more, dont realy understand!

If I understood correctly, function `Rand.NextBool(i)` is equivalent to "chance 1 out i". At the beginning i = 5 is determined, that is, chance 1/5 (is 20%). Next, checked presence of traits `ThickSkinned` and `ThinSkinned` and for each of them, i increases by 10. This is equivalent to a chance of 1/(5+10) = 6%.

Thus, an ordinary character, making his way through the forest, has a fairly high chance of being injured. But for a character with the "thin skin" or "thick skin" trait, this chance is equally low.

##### Share on other sites

54 minutes ago, Narrnika said:

If I understood correctly, function `Rand.NextBool(i)` is equivalent to "chance 1 out i". At the beginning i = 5 is determined, that is, chance 1/5 (is 20%). Next, checked presence of traits `ThickSkinned` and `ThinSkinned` and for each of them, i increases by 10. This is equivalent to a chance of 1/(5+10) = 6%.

Thus, an ordinary character, making his way through the forest, has a fairly high chance of being injured. But for a character with the "thin skin" or "thick skin" trait, this chance is equally low.

I don't know much about this language but I can see they have the same random value's when taken, I think this should be fixed.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.