From b549fb5fd89b7d6f577486131a78c4681e509306 Mon Sep 17 00:00:00 2001 From: Baptiste Marie Date: Sun, 28 Jul 2024 01:26:01 +0200 Subject: [PATCH] `...AmountCalculator`: Remove integer truncation random compensations Let's just round down instead of involving RNG. --- .../propertycalc/EnduranceRegenerationAmountCalculator.cs | 6 ------ .../propertycalc/HealthRegenerationAmountCalculator.cs | 7 ------- .../propertycalc/PowerRegenerationAmountCalculator.cs | 7 ------- 3 files changed, 20 deletions(-) diff --git a/GameServer/propertycalc/EnduranceRegenerationAmountCalculator.cs b/GameServer/propertycalc/EnduranceRegenerationAmountCalculator.cs index 710b2dc1fe..29f8058935 100644 --- a/GameServer/propertycalc/EnduranceRegenerationAmountCalculator.cs +++ b/GameServer/propertycalc/EnduranceRegenerationAmountCalculator.cs @@ -69,12 +69,6 @@ Players will no longer need to sit to regenerate faster. else regen *= ServerProperties.Properties.ENDURANCE_REGEN_AMOUNT_MODIFIER; - double decimals = regen - (int) regen; - - // Compensate for int rounding. - if (Util.ChanceDouble(decimals)) - regen += 1; - return (int) regen; } } diff --git a/GameServer/propertycalc/HealthRegenerationAmountCalculator.cs b/GameServer/propertycalc/HealthRegenerationAmountCalculator.cs index 4b1f807c87..46b08ecf36 100644 --- a/GameServer/propertycalc/HealthRegenerationAmountCalculator.cs +++ b/GameServer/propertycalc/HealthRegenerationAmountCalculator.cs @@ -41,13 +41,6 @@ public override int CalcValue(GameLiving living, eProperty property) } regen *= ServerProperties.Properties.HEALTH_REGEN_AMOUNT_MODIFIER; - - double decimals = regen - (int) regen; - - // Compensate for int rounding. - if (Util.ChanceDouble(decimals)) - regen += 1; - regen += living.ItemBonus[(int)property]; int debuff = living.SpecBuffBonusCategory[(int) property]; diff --git a/GameServer/propertycalc/PowerRegenerationAmountCalculator.cs b/GameServer/propertycalc/PowerRegenerationAmountCalculator.cs index 16ee9e0a39..ed2ced93e9 100644 --- a/GameServer/propertycalc/PowerRegenerationAmountCalculator.cs +++ b/GameServer/propertycalc/PowerRegenerationAmountCalculator.cs @@ -29,13 +29,6 @@ public override int CalcValue(GameLiving living, eProperty property) regen /= 2.0; regen *= ServerProperties.Properties.MANA_REGEN_AMOUNT_MODIFIER; - - double decimals = regen - (int) regen; - - // Compensate for int rounding. - if (Util.ChanceDouble(decimals)) - regen += 1; - int debuff = living.SpecBuffBonusCategory[(int) property]; if (debuff < 0)