ݷʱ : 2024/11/8 22:37:30һ µȫĶ
ʮ.ʱ
ü±ϷĿ¼\\data\\scripts\\tuning.luaļBASE_COOK_TIME = night_time*.3333,ΪBASE_COOK_TIME = seg_time*.01,
ʮ.̵ʱ
ü±ϷĿ¼\\data\\scripts\\tuning.luaļݣ
FISHING_MINWAIT = 2, FISHING_MAXWAIT = 20, Ϊ
FISHING_MINWAIT = 1, FISHING_MAXWAIT = 5,
̵ʱ
ʮ.ջ䲻
ü±ϷĿ¼\\data\\scripts\\prefabs\\beebox.luainst.components.childspawner:ReleaseAllChildren(picker)滻Ϊݣ
--inst.components.childspawner:ReleaseAllChildren(picker)
ջʱɳ۷
ʮ.ץ۷䡢ɱ˷䡢ө棨óɫԿȡ
1.ץ۷䡢ɱ˷䣺ü±ϷĿ¼\\data\\scripts\\prefabs\\bee.luaļinst.components.inventoryitem.canbepickedup inst.components.inventoryitem.canbepickedup = true
2.ץü±ϷĿ¼\\data\\scripts\\prefabs\\butterfly.luaļ
=
false
Ϊ
ļ
inst.components.inventoryitem.canbepickedup inst.components.inventoryitem.canbepickedup = true
= false滻Ϊ
3.ץө棺ü±ϷĿ¼\\data\\scripts\\prefabs\\fireflies.luaļinst.components.inventoryitem.canbepickedup inst.components.inventoryitem.canbepickedup = true
ɿץ۷䡢ɱ˷䡢ө棨СҲ̫˰ɣ
ʮ.װУƹһܣ㻯У
1.ü±ϷĿ¼\\data\\scripts\\prefabs\\birdtrap.luaļ--this should be redone as a periodic test, probably, so that we can control the expected return explicitlyһвݣ
local function SpawnEffect(inst) local pt = inst:GetPosition()
local fx = SpawnPrefab("small_puff") fx.Transform:SetPosition(pt.x, pt.y, pt.z) fx.Transform:SetScale(0.5,0.5,0.5) end
local function getitem(player, amulet, item) SpawnEffect(item)
if item.components.stackable then item = item.components.stackable:Get() end
player.components.invento
ry:GiveItem(item) end
local function pickup(inst, owner) local pt = owner:GetPosition()
local ents = TheSim:FindEntities(pt.x, pt.y, pt.z, TUNING.ORANGEAMULET_RANGE*5)
for k,v in pairs(ents) do if
v.components.inventoryitem
and
v.components.inventoryitem.canbepickedup
and
v.components.inventoryitem.cangoincontainer and v:HasTag("bird") and not v.components.inventoryitem:IsHeld() then
=
false
Ϊ
if not owner.components.inventory:IsFull() then getitem(owner, inst, v) return
elseif v.components.stackable then
local stack = owner.components.inventory:FindItem(function(item) return (item.prefab == v.prefab and not item.components.stackable:IsFull()
and item ~= owner.components.inventory.activeitem) end) if stack then
getitem(owner, inst, v) return end end end end end
local function onequip(inst, owner)
owner.AnimState:OverrideSymbol("swap_body", "swap_birdtrap")
inst.task = inst:DoPeriodicTask(TUNING.ORANGEAMULET_ICD*.1, function() pickup(inst, owner) end) end
local function onunequip(inst, owner)
owner.AnimState:ClearOverrideSymbol("swap_body") if inst.task then inst.task:Cancel() inst.task = nil end end
2.inst:AddComponent("inventoryitem")һвݣ
inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( onequip ) inst.components.equippable:SetOnUnequip( onunequip ) inst.components.equippable.equipslot = EQUIPSLOTS.BODY
3.ü±ϷĿ¼\\data\\scripts\\prefabs\\birds.luainst.components.inventoryitem.canbepickedup inst.components.inventoryitem.canbepickedup = true
4.inst:AddComponent("occupier")һвݣ
=
false
ļ
Ϊ
"swap_birdtrap",
inst:AddComponent("stackable")
inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM
װ
ʮһ.Ҳ˯˯
ü±ϷĿ¼\\data\\scripts\\prefabs\\tent.luaļ
1.ɾݣ
if GetClock():IsDay() then if sleeper.components.talker then
sleeper.components.talker:Say(GetString(inst.prefab, "ANNOUNCE_NODAYSLEEP")) return end end
2.ɾݣ
if GetClock():IsDay() then
if sleeper.components.talker then
sleeper.components.talker:Say(GetString(inst.prefab, "ANNOUNCE_NODAYSLEEP")) sleeper.components.health:SetInvincible(false) sleeper.components.playercontroller:Enable(true) return end end 3.
ɰҲ˯˯
sleeper.components.hunger:DoDelta(-TUNING.CALORIES_HUGE,
false,
true)滻Ϊ
--sleeper.components.hunger:DoDelta(-TUNING.CALORIES_HUGE, false, true)