local FATVALUE = {
eel = 2, fish = 1, honey = 1, taffy = 2, waffles = 8, butter = 15,
honeyham = 5, meatballs = 2, fishtacos = 3, bonestew = 10, cookedmeat = 2,
eel_cooked = 2, fishsticks = 5, corn_cooked = 1, fish_cooked = 1, honeynuggets = 3,
trunk_winter = 5, trunk_summer = 5, trunk_cooked = 5, turkeydinner = 8,
mandrakesoup = 20, frogglebunwich = 2, cookedsmallmeat = 1, drumstick_cooked = 1,
deerclops_eyeball = 10,
corn = -1, carrot = -1, kabobs = -2, petals = -3, berries = -1, foliage = -3,
powcake = -5, red_cap = -5, wetgoop = -6, durian = -10, eggplant = -1, blue_cap = -5,
wormlight = -3, green_cap = -5, rottenegg = -10, cave_banana = -2, pomegranate = -5,
fruitmedley = -5, flowersalad = -6, cactus_meat = -10, petals_evil = -15,
carrot_cooked = -1, cactus_flower = -5, durian_cooked = -8, spoiled_food = -10,
berries_cooked = -1, red_cap_cooked = -1, jammypreserves = -4, monsterlasagna = -15,
eggplant_cooked = -1, blue_cap_cooked = -1, green_cap_cooked = -1, cave_banana_cooked = -1,
pomegranate_cooked = -2, cactus_meat_cooked = -5,
}
local function GetFat(inst)
if inst.components.fat ~= nil then
return inst.components.fat:GetCurrent()
elseif inst.player_classified ~= nil then
return inst.player_classified.currentfat:value()
else
return 0
end
end
local function GetFatMax(inst)
if inst.components.fat ~= nil then
return inst.components.fat:GetMax()
elseif inst.player_classified ~= nil then
return inst.player_classified.maxfat:value()
else
return 0
end
end
local function GetFatRateScale(inst)
if inst.components.fat ~= nil then
return inst.components.fat:GetRateScale()
elseif inst.player_classified ~= nil then
return inst.player_classified.fatratescale:value()
else
return RATE_SCALE.NEUTRAL
end
end
local function oneat(inst, food)--吃东西的时候的函数
--吃东西的时候的函数
if food and food.components.edible and FATVALUE[food.prefab] ~= nil then
inst.components.fat:DoDelta(FATVALUE[food.prefab], false)
if food.prefab == "honey" then inst.components.sanity:DoDelta(2, false) end --honey give extra 2 sanity
end
end
2019年12月30日 16点12分
4