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:
parent
2e10f27956
commit
bdace61d9b
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user