Rework calculations and fix alcohol/drug effects

This fixes calculation errors and implements support for jim_bridge built in synchronized alcohol/drug effects

Separates "drug control" `canOD` variable too
This commit is contained in:
Jim Shield
2025-10-06 02:28:03 +01:00
parent 9b189d89f5
commit 0a0f60468a
2 changed files with 59 additions and 37 deletions

View File

@@ -15,8 +15,23 @@ function GenerateRandomValues(data)
transData[k] = v
end
end
return transData["time"],
transData["heal"],
transData["armor"],
{ hunger = transData["hunger"], thirst = transData["thirst"], stress = transData["stress"] }
if transData.hunger > 0 then
transData.hunger = transData.hunger > 100 and 100 or transData.hunger
end
if transData.thirst > 0 then
transData.thirst = transData.thirst > 100 and 100 or transData.thirst
end
if transData.stress > 0 then
transData.stress = transData.stress > 100 and 100 or transData.stress
end
return transData["time"],
transData["heal"],
transData["armor"],
{
hunger = transData["hunger"],
thirst = transData["thirst"],
stress = transData["stress"]
}
end