代码如下
-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
-- choose which sounds this character will play
inst.soundsname = "tecolin"
-- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
--inst.talker_path_override = "dontstarve_DLC001/characters/"
-- Stats
inst.components.health:SetMaxHealth(150)
inst.components.hunger:SetMax(150)
inst.components.sanity:SetMax(200)
inst.components.temperature.mintemp = 5
inst.components.freezable:SetResistance(300)
inst.components.eater:SetDiet({FOODGROUP.OMNI}, {FOODTYPE.VEGGIE, FOODTYPE.SEEDS, FOODTYPE.GENERIC})
inst:AddComponent("heater")
inst.components.heater.heatfn = function() return -15 end
inst.components.heater:SetThermics(false, true)
inst.components.health.fire_damage_scale = 1.5
inst.components.temperature.overheattemp = 50
inst.components.combat.damagemultiplier = TUNING.WENDY_DAMAGE_MULT
inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
inst.OnLoad = onload
inst.OnNewSpawn = onload
inst.components.sanity.custom_rate_fn = sanityfn
local refreshTime = 1/5
inst:DoPeriodicTask(refreshTime, function() runner(inst, refreshTime) end)
inst:WatchWorldState("season", WatchSeason )
WatchSeason( inst, TheWorld.state.season )
inst:WatchWorldState("isfullmoon", OnIsFullmoon)
OnIsFullmoon(inst, TheWorld.state.isfullmoon)
inst:ListenForEvent("killed", onkilled)
inst.components.eater:SetOnEatFn(oneat)
-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
-- choose which sounds this character will play
inst.soundsname = "tecolin"
-- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
--inst.talker_path_override = "dontstarve_DLC001/characters/"
-- Stats
inst.components.health:SetMaxHealth(150)
inst.components.hunger:SetMax(150)
inst.components.sanity:SetMax(200)
inst.components.temperature.mintemp = 5
inst.components.freezable:SetResistance(300)
inst.components.eater:SetDiet({FOODGROUP.OMNI}, {FOODTYPE.VEGGIE, FOODTYPE.SEEDS, FOODTYPE.GENERIC})
inst:AddComponent("heater")
inst.components.heater.heatfn = function() return -15 end
inst.components.heater:SetThermics(false, true)
inst.components.health.fire_damage_scale = 1.5
inst.components.temperature.overheattemp = 50
inst.components.combat.damagemultiplier = TUNING.WENDY_DAMAGE_MULT
inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
inst.OnLoad = onload
inst.OnNewSpawn = onload
inst.components.sanity.custom_rate_fn = sanityfn
local refreshTime = 1/5
inst:DoPeriodicTask(refreshTime, function() runner(inst, refreshTime) end)
inst:WatchWorldState("season", WatchSeason )
WatchSeason( inst, TheWorld.state.season )
inst:WatchWorldState("isfullmoon", OnIsFullmoon)
OnIsFullmoon(inst, TheWorld.state.isfullmoon)
inst:ListenForEvent("killed", onkilled)
inst.components.eater:SetOnEatFn(oneat)