1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

fixed adaptation probability calculation

This commit is contained in:
Aaron Veden 2021-11-25 09:13:43 -08:00
parent 2e10f27956
commit bdace61d9b
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@ Date: 23. 11. 2021
- Fixed active and raid nest processing only processing half the nests (Thank you Dimm2101)
- Fixed new enemy building upgrade could replace an entity with the same entity (Thank you Dimm2101)
- Fixed new enemy regional base recycling would only process half the bases
- Fixed new enemy adaptation due to damage type not correctly calculating probability for adaptation
---------------------------------------------------------------------------------------------------
Version: 1.1.4

View File

@ -365,7 +365,7 @@ local function upgradeBaseBasedOnDamage(map, base)
total = total + amount
end
local mutationAmount = total * 0.176471
base.damagedBy["mutation"] = mutationAmount
base.damagedBy["RandomMutation"] = mutationAmount
total = total + mutationAmount
local pickedDamage
local roll = mRandom()
@ -373,7 +373,7 @@ local function upgradeBaseBasedOnDamage(map, base)
base.damagedBy[damageTypeName] = amount / total
end
for damageType,amount in pairs(base.damagedBy) do
if (roll - (amount / total) <= 0) then
if ((roll - amount) <= 0) then
pickedDamage = damageType
break
end