Narrnika Posted January 15, 2021 Share Posted January 15, 2021 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)) { addHole(BloodBodyPartType.FromIndex(j)); 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); } } } } orikamii and Pandorea 1 1 Link to comment Share on other sites More sharing options...
Masmassu Posted January 15, 2021 Share Posted January 15, 2021 Can you explain that abit more, dont realy understand! Link to comment Share on other sites More sharing options...
Narrnika Posted January 15, 2021 Author Share Posted January 15, 2021 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. Masmassu 1 Link to comment Share on other sites More sharing options...
DXPOHIHIHI Posted January 15, 2021 Share Posted January 15, 2021 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now