Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Inside BB_FoodPickiness_Main.lua:
ISInventoryPaneContextMenu.eatItem = function(item, percentage, playerNumber)
local playerObj = getSpecificPlayer(playerNumber)
local modData = playerObj:getModData()
local playerHunger = playerObj:getStats():getHunger() * SandboxVars.FoodPickiness.HungerMultiplier
local pickiness = modData.BB_FoodPickiness.pickiness
local disgustFactor = pickiness
local repulsivenessLimit = SandboxVars.FoodPickiness.BaseRepulsivenessLimit + playerHunger
-- Determine item encumbrance once (prefer actual weight; fallback to weight; clamp to a small >0 floor).
local encumbrance = 1.0
if item.getActualWeight ~= nil then
encumbrance = item:getActualWeight()
elseif item.getWeight ~= nil then
encumbrance = item:getWeight()
else
encumbrance = 1.0 -- very defensive fallback
end
if encumbrance == nil or encumbrance <= 0 then
encumbrance = 0.01 -- avoid division by zero and extreme amplification
end
-- Incorporate item unhappiness scaled by encumbrance (heavier items dilute the effect).
local unhappyChange = item:getUnhappyChange()
if unhappyChange ~= nil and unhappyChange ~= 0 then
-- CHANGE: encumbrance is now computed outside and reused here.
disgustFactor = disgustFactor + (unhappyChange / encumbrance)
end
if item:isbDangerousUncooked() and not item:isCooked() and not item:isBurnt() then
disgustFactor = disgustFactor + 5
end
if disgustFactor <= repulsivenessLimit then
onEatItem(item, percentage, playerNumber)
-- Rationale: maintain proportionality—heavier (more encumbering) items increased the perceived “consumption impact”.
local pickinessDelta = (disgustFactor / SandboxVars.FoodPickiness.ConsumptionOffset) * encumbrance
modData.BB_FoodPickiness.pickiness = modData.BB_FoodPickiness.pickiness - pickinessDelta
else
local rand = ZombRand(1, 4)
playerObj:Say(getText("IGUI_FoodPickiness_RefuseToEat_" .. rand))
end
end