模组文件免费下载和使用,谨防上当受骗。

YN256-小冰山(用铥矿碎片种小冰山,靠近可解暑,无限开采冰和永冻冰,吃了能降温)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五六.小冰山(用铥矿碎片种小冰山,靠近可解暑,无限开采冰和永冻冰,吃了能降温) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/thulecite_pieces.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function makeiceberg(inst) local pt = inst:GetPosition() local iceberg = SpawnPrefab("thulecite_pieces") iceberg.Transform:SetPosition(pt.x, pt.y, pt.z) iceberg.AnimState:SetBank("ice_boulder") iceberg.AnimState:SetBuild("ice_boulder") iceberg.AnimState:PlayAnimation("full") iceberg.Transform:SetScale(2, 2, 2) iceberg:AddComponent("named") iceberg.components.named:SetName("Ice") local minimap = iceberg.entity:AddMiniMapEntity() minimap:SetIcon( "iceboulder.png" ) MakeObstaclePhysics(iceberg, 1) MakeLargeBurnable(iceberg) iceberg.AnimState:SetBloomEffectHandle("shaders/anim.ksh") iceberg.entity:AddLight() iceberg.Light:SetFalloff(1) iceberg.Light:SetIntensity(.8) iceberg.Light:SetRadius(7) iceberg.Light:SetColour(255/255,255/255,255/255) iceberg.Light:Enable(true) iceberg:RemoveComponent("edible") iceberg:RemoveComponent("tradable") iceberg:RemoveComponent("inventoryitem") iceberg:RemoveComponent("stackable") iceberg:RemoveComponent("bait") iceberg:RemoveComponent("repairer") iceberg:RemoveComponent("deployable") iceberg:RemoveTag("molebait") iceberg:AddComponent("heater") iceberg.components.heater.iscooler = true iceberg.components.heater.heatfn = function(iceberg) return -40 end iceberg:AddComponent("workable") iceberg.components.workable:SetWorkAction(ACTIONS.MINE) iceberg.components.workable:SetWorkLeft(30) iceberg.components.workable:SetOnWorkCallback(function(iceberg) iceberg.components.workable:SetWorkLeft(30) local pt1 = iceberg:GetPosition() if math.random()<.2 then local icecream = SpawnPrefab("thulecite_pieces") icecream.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 3, pt1.z+(math.random(3)-math.random(3))) icecream.AnimState:SetBank("ice") icecream.AnimState:SetBuild("ice") icecream.AnimState:PlayAnimation("f1") icecream:RemoveComponent("edible") icecream:RemoveComponent("tradable") icecream:RemoveComponent("stackable") icecream:RemoveComponent("bait") icecream:RemoveComponent("repairer") icecream:RemoveComponent("deployable") icecream:RemoveTag("molebait") icecream:AddComponent("named") icecream.components.named:SetName("Ice") icecream.components.inventoryitem.imagename = "ice" icecream:AddComponent("edible") icecream.components.edible.foodtype = "SEEDS" icecream.components.edible.healthvalue = TUNING.HEALING_TINY/2 icecream.components.edible.hungervalue = TUNING.CALORIES_TINY/4 icecream.components.edible:SetOnEatenFn(function(icecream, eater) if eater and eater.components.temperature then local temp = eater.components.temperature:GetCurrent() eater.components.temperature:SetTemperature(temp - 70) end end ) icecream.components.edible.degrades_with_spoilage = false icecream:AddTag("icecream") elseif math.random()<.4 then local ice = SpawnPrefab("ice") ice.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 3, pt1.z+(math.random(3)-math.random(3))) end end ) iceberg.components.workable:SetOnFinishCallback(function(iceberg) SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(iceberg.Transform:GetWorldPosition()) iceberg:Remove() end ) iceberg:AddTag("iceberg") end local function OnDeploy (inst, pt) makeiceberg(inst) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("iceberg") then data.iceberg = true end if inst:HasTag("icecream") then data.icecream = true end end local function onload(inst, data) if data and data.iceberg then makeiceberg(inst) inst:Remove() end if data and data.icecream then inst.AnimState:SetBank("ice") inst.AnimState:SetBuild("ice") inst.AnimState:PlayAnimation("f1") inst:RemoveComponent("edible") inst:RemoveComponent("tradable") inst:RemoveComponent("stackable") inst:RemoveComponent("bait") inst:RemoveComponent("repairer") inst:RemoveComponent("deployable") inst:RemoveTag("molebait") inst:AddComponent("named") inst.components.named:SetName("Ice") inst.components.inventoryitem.imagename = "ice" inst:AddComponent("edible") inst.components.edible.foodtype = "SEEDS" inst.components.edible.healthvalue = TUNING.HEALING_TINY/2 inst.components.edible.hungervalue = TUNING.CALORIES_TINY/4 inst.components.edible:SetOnEatenFn(function(inst, eater) if eater and eater.components.temperature then local temp = eater.components.temperature:GetCurrent() eater.components.temperature:SetTemperature(temp - 70) end end ) inst.components.edible.degrades_with_spoilage = false inst:AddTag("icecream") end end inst.OnSave = onsave inst.OnLoad = onload 即可用铥矿碎片种小冰山(拿着1个铥矿碎片对地面点鼠标右键,如果拿着多个,则不会种出来),靠近可解暑。用锄头凿冰山,有一定概率获得冰和永冻冰(不会腐烂且不可堆叠的是永冻冰),永冻冰可食用,吃了能降温,如果没有中暑就不要吃,否则会冻伤。不想要小冰山了,烧掉即可。不要与“用铥矿碎片种猴子桶”一同修改

2025/04/23 · Bny

YN257-生物克隆机(用夜魔盔甲种克隆机,随身携带,大量克隆各种生物)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五七.生物克隆机(用夜魔盔甲种克隆机,随身携带,大量克隆各种生物) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/armor_sanity.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "silk" or item.prefab == "houndstooth" or item.prefab == "beefalowool" or item.prefab == "tentaclespots" or item.prefab == "froglegs" or item.prefab == "stinger" or item.prefab == "mosquitosack" or item.prefab == "tallbirdegg" or item.prefab == "walrus_tusk" or item.prefab == "livinglog" or item.prefab == "bird_egg" or item.prefab == "trunk_summer" or item.prefab == "trunk_winter" or item.prefab == "deerclops_eyeball" or item.prefab == "fish" or item.prefab == "plantmeat" or item.prefab == "rocks" or item.prefab == "cave_banana" or item.prefab == "slurper_pelt" or item.prefab == "minotaurhorn" or item.prefab == "wormlight" or item.prefab == "slurtle_shellpieces" or item.prefab == "slurtleslime" or item.prefab == "batwing" or item.prefab == "manrabbit_tail" or item.prefab == "pigskin" or item.prefab == "lightninggoathorn" or item.prefab == "dragon_scales" or item.prefab == "goose_feather" or item.prefab == "bearger_fur" then return true end return false end local slotpos = { Vector3(0,-75,0)} local widgetbuttoninfo = { text = "GO", position = Vector3(0, -135, 0), fn = function(inst) if inst:HasTag("machines") then if not inst.components.container:IsEmpty() then for k,v in pairs(inst.components.container.slots) do if v and v.prefab == "silk" then inst.weirdo = "spiderqueen" end if v and v.prefab == "houndstooth" then inst.weirdo = "firehound" end if v and v.prefab == "beefalowool" then inst.weirdo = "beefalo" end if v and v.prefab == "tentaclespots" then inst.weirdo = "tentacle" end if v and v.prefab == "froglegs" then inst.weirdo = "frog" end if v and v.prefab == "stinger" then inst.weirdo = "killerbee" end if v and v.prefab == "mosquitosack" then inst.weirdo = "mosquito" end if v and v.prefab == "tallbirdegg" then inst.weirdo = "tallbird" end if v and v.prefab == "walrus_tusk" then inst.weirdo = "walrus" end if v and v.prefab == "livinglog" then inst.weirdo = "leif_sparse" end if v and v.prefab == "bird_egg" then inst.weirdo = "perd" end if v and v.prefab == "trunk_summer" then inst.weirdo = "koalefant_summer" end if v and v.prefab == "trunk_winter" then inst.weirdo = "koalefant_winter" end if v and v.prefab == "deerclops_eyeball" then inst.weirdo = "deerclops" end if v and v.prefab == "fish" then inst.weirdo = "merm" end if v and v.prefab == "plantmeat" then inst.weirdo = "lureplant" end if v and v.prefab == "rocks" then inst.weirdo = "rocky" end if v and v.prefab == "cave_banana" then inst.weirdo = "monkey" end if v and v.prefab == "slurper_pelt" then inst.weirdo = "slurper" end if v and v.prefab == "minotaurhorn" then inst.weirdo = "minotaur" end if v and v.prefab == "wormlight" then inst.weirdo = "worm" end if v and v.prefab == "slurtle_shellpieces" then inst.weirdo = "slurtle" end if v and v.prefab == "slurtleslime" then inst.weirdo = "snurtle" end if v and v.prefab == "batwing" then inst.weirdo = "bat" end if v and v.prefab == "manrabbit_tail" then inst.weirdo = "bunnyman" end if v and v.prefab == "pigskin" then inst.weirdo = "pigman" end if v and v.prefab == "lightninggoathorn" then inst.weirdo = "lightninggoat" end if v and v.prefab == "dragon_scales" then inst.weirdo = "dragonfly" end if v and v.prefab == "goose_feather" then inst.weirdo = "moose" end if v and v.prefab == "bearger_fur" then inst.weirdo = "bearger" end v:Remove() end local pt0 = Vector3(GetPlayer().Transform:GetWorldPosition()) for k = 1, 20 do local result_offset = FindValidPositionByFan(1 * 2 * PI, 10, 20, function(offset) local x,y,z = (pt0 + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) if result_offset then local newweirdo = SpawnPrefab(inst.weirdo) newweirdo.Transform:SetPosition((pt0 + result_offset):Get()) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) local fx = SpawnPrefab("collapse_small") local pos = pt0 + result_offset fx.Transform:SetPosition(pos.x, pos.y, pos.z) end end end end end } local function OnDeploy (inst, pt) local machine = SpawnPrefab("armor_sanity") machine.Transform:SetPosition(pt.x, pt.y, pt.z) machine.AnimState:SetBank("rain_meter") machine.AnimState:SetBuild("rain_meter") machine.AnimState:PlayAnimation("meter", 0) machine.Transform:SetScale(0.5, 0.5, 0.5) machine:RemoveTag("sanity") machine:RemoveComponent("inventoryitem") machine:RemoveComponent("armor") machine:RemoveComponent("equippable") machine:RemoveComponent("deployable") machine.components.container.canbeopened = true machine:AddComponent("inventoryitem") machine.components.inventoryitem:ChangeImageName("rainometer") machine:AddComponent("equippable") machine.components.equippable.equipslot = EQUIPSLOTS.BODY machine.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*2 machine.components.equippable:SetOnEquip( function(machine) GetPlayer().components.inventory:SetOverflow(machine) machine.components.container:Open(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") GetPlayer():Hide() local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) end ) machine.components.equippable:SetOnUnequip( function(machine) machine.components.container:Close(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") GetPlayer():Show() local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end ) machine:AddTag("machines") inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("machines") then data.machines = true end end local function onload(inst, data) if data and data.machines then inst.AnimState:SetBank("rain_meter") inst.AnimState:SetBuild("rain_meter") inst.AnimState:PlayAnimation("meter", 0) inst.Transform:SetScale(0.5, 0.5, 0.5) inst:RemoveTag("sanity") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("armor") inst:RemoveComponent("equippable") inst:RemoveComponent("deployable") inst.components.container.canbeopened = true inst:AddComponent("inventoryitem") inst.components.inventoryitem:ChangeImageName("rainometer") inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.BODY inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*2 inst.components.equippable:SetOnEquip( function(inst) GetPlayer().components.inventory:SetOverflow(inst) inst.components.container:Open(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") GetPlayer():Hide() local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) end ) inst.components.equippable:SetOnUnequip( function(inst) inst.components.container:Close(GetPlayer()) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") GetPlayer():Show() local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end ) inst:AddTag("machines") end end inst.OnSave = onsave inst.OnLoad = onload inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(-80,150,0) inst.components.container.side_widget = true inst.components.container.itemtestfn = itemtest inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container.acceptsstacks = false inst.components.container.canbeopened = false 即可用夜魔盔甲种克隆机,装备克隆机后主角隐身(以免遭怪物围攻),屏幕右侧会出现格子和按钮,在格子中放入1个生物掉落的物品,按GO按钮,就可以克隆20个该生物,具体为:蜘蛛丝克隆蜘蛛女王、犬牙克隆火狗、牛毛克隆牛、触手皮克隆触手、蛙腿克隆青蛙、蜂刺克隆杀人蜂、蚊子血囊克隆蚊子、高鸟蛋克隆大高鸟、海象牙克隆海象、活木头克隆树精、鸡蛋克隆火鸡、夏象鼻克隆夏象、冬象鼻克隆冬象、巨鹿眼球克隆巨鹿、鱼克隆鱼人、食人花肉克隆食人花、岩石克隆龙虾、香蕉克隆猴子、缀食者皮克隆缀食者、远古守护者角克隆远古守护者、虫子果克隆虫子、蜗牛龟壳片克隆蜗牛龟、蜗牛龟粘液克隆黏糊虫、蝙蝠翅膀克隆蝙蝠、兔人尾巴克隆兔人、猪皮克隆猪人、闪电羊角克隆闪电羊、蜻蜓鳞片克隆蜻蜓、熊皮克隆熊、鹿鸭羽毛克隆鹿鸭。卸载克隆机后主角现身。拥有克隆机,让你有无限的怪物可刷,也可用于以怪制怪,比如在牛群里制造触手,在蜘蛛群里释放杀人蜂等,创造一个生机勃勃的世界吧。夜魔盔甲在魔法选项(画着红骷髅)下用5个噩梦燃料、3张纸制造

2025/04/23 · Bny

YN258-强迫症标尺(按键盘Insert键在地上画坐标,方便建造、种植,再按Insert键消失)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五八.强迫症标尺(按键盘Insert键在地上画坐标,方便建造、种植,再按Insert键消失) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("playeractionpicker")的下一行插入以下内容: TheInput:AddKeyUpHandler(KEY_INSERT, function() if not inst:HasTag("ruler") then inst:AddTag("ruler") local pt = inst:GetPosition() for y = 10, 0, -1 do for x = 0, 10 do local coordinate = SpawnPrefab("gridplacer") coordinate.AnimState:SetOrientation( ANIM_ORIENTATION.OnGround ) coordinate.AnimState:SetLayer( LAYER_BACKGROUND ) coordinate.AnimState:SetSortOrder( 1 ) coordinate.Transform:SetRotation( 45 ) coordinate.Transform:SetPosition(pt.x-14.1+x*2.82, 0, pt.z-14.1+y*2.82) local light = coordinate.entity:AddLight() light:SetIntensity(.6) light:SetRadius(.5) light:SetFalloff(.6) light:Enable(true) light:SetColour(180/255, 195/255, 225/255) coordinate:AddTag("NOCLICK") coordinate:AddTag("coordinate") end end else inst:RemoveTag("ruler") local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 3000) for k,v in pairs(ents) do if v:HasTag("coordinate") then v:Remove() end end end end ) 即可按键盘Insert键,以主角为中心在地上画出白色坐标,可作为建造或种植的参照线,也可测量你现有的建筑、植物是不是歪了,强迫症必备,还有夜光效果哦,再按一次Insert键坐标消失

2025/04/23 · Bny

YN259-制冰机(用草伞种制冰机,下雨时自动制冰,可加工成大冰块永久保存,大冰块可砸碎成冰)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二五九.制冰机(用草伞种制冰机,下雨时自动制冰,可加工成大冰块永久保存,大冰块可砸碎成冰) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/umbrella.lua文件,在inst:AddTag("show_spoilage")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "ice" then return true end return false end local slotpos = { Vector3(0,-75,0)} local widgetbuttoninfo = { text = "Make", position = Vector3(0, -135, 0), fn = function(inst) if inst:HasTag("icemaker") then if inst.components.container:Has("ice", 10) then GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") inst.components.container:ConsumeByName("ice", 10) local pt = inst:GetPosition() local bigice = SpawnPrefab("grass_umbrella") bigice.Transform:SetPosition(pt.x+(math.random(3)-math.random(3)), 0, pt.z+(math.random(3)-math.random(3))) bigice.AnimState:SetBank("icehat") bigice.AnimState:SetBuild("hat_ice") bigice.AnimState:PlayAnimation("anim") bigice.Transform:SetScale(1.5, 1.5, 1.5) bigice:RemoveComponent("waterproofer") bigice:RemoveComponent("equippable") bigice:RemoveComponent("insulator") bigice:RemoveComponent("perishable") bigice:RemoveComponent("fuel") bigice:RemoveComponent("burnable") bigice:RemoveComponent("propagator") bigice:RemoveComponent("deployable") bigice:RemoveComponent("container") bigice:RemoveTag("nopunch") bigice:RemoveTag("show_spoilage") bigice:RemoveAllEventCallbacks() bigice:AddComponent("named") bigice.components.named:SetName("Big ice") bigice.components.inventoryitem:ChangeImageName("icehat") bigice:AddComponent("heater") bigice.components.heater.iscooler = true bigice.components.heater.heatfn = function(bigice) return -40 end bigice:AddComponent("workable") bigice.components.workable:SetWorkAction(ACTIONS.HAMMER) bigice.components.workable:SetWorkLeft(1) bigice.components.workable:SetOnFinishCallback(function(bigice) SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(bigice.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") for k = 1, 10 do local pt1 = bigice:GetPosition() local ice = SpawnPrefab("ice") ice.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end bigice:Remove() end ) bigice:AddTag("bigice") end end end } local function OnDeploy (inst, pt) local icemaker = SpawnPrefab("grass_umbrella") icemaker.Transform:SetPosition(pt.x, pt.y, pt.z) icemaker.AnimState:SetBank("eyeball_turret_base") icemaker.AnimState:SetBuild("eyeball_turret_base") icemaker.AnimState:PlayAnimation("idle_loop") icemaker.Transform:SetScale(0.8, 0.8, 0.8) icemaker.AnimState:SetMultColour(0/255,255/255,0/255,1) icemaker:RemoveComponent("waterproofer") icemaker:RemoveComponent("inventoryitem") icemaker:RemoveComponent("equippable") icemaker:RemoveComponent("insulator") icemaker:RemoveComponent("perishable") icemaker:RemoveComponent("fuel") icemaker:RemoveComponent("burnable") icemaker:RemoveComponent("propagator") icemaker:RemoveComponent("deployable") icemaker:RemoveTag("nopunch") icemaker:RemoveTag("show_spoilage") icemaker:RemoveAllEventCallbacks() icemaker:AddComponent("named") icemaker.components.named:SetName("Ice maker") icemaker.components.container.canbeopened = true icemaker:AddComponent("workable") icemaker.components.workable:SetWorkAction(ACTIONS.HAMMER) icemaker.components.workable:SetWorkLeft(3) icemaker.components.workable:SetOnFinishCallback(function(icemaker) SpawnPrefab("collapse_big").Transform:SetPosition(icemaker.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") icemaker:Remove() end ) icemaker:ListenForEvent("rainstart", function() icemaker.task = icemaker:DoPeriodicTask(10, function() local ice = SpawnPrefab("ice") icemaker.components.container:GiveItem(ice) end ) end, GetWorld()) icemaker:ListenForEvent("rainstop", function() if icemaker.task then icemaker.task:Cancel() icemaker.task = nil end end, GetWorld()) icemaker:AddTag("icemaker") inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy inst:AddComponent("container") inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,150,0) inst.components.container.side_align_tip = 160 inst.components.container.itemtestfn = itemtest inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container.canbeopened = false inst.components.container.onopenfn = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.onclosefn = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst:AddTag("fridge") local function onsave(inst, data) if inst:HasTag("icemaker") then data.icemaker = true end if inst:HasTag("bigice") then data.bigice = true end end local function onload(inst, data) if data and data.icemaker then inst.AnimState:SetBank("eyeball_turret_base") inst.AnimState:SetBuild("eyeball_turret_base") inst.AnimState:PlayAnimation("idle_loop") inst.Transform:SetScale(0.8, 0.8, 0.8) inst.AnimState:SetMultColour(0/255,255/255,0/255,1) inst:RemoveComponent("waterproofer") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("equippable") inst:RemoveComponent("insulator") inst:RemoveComponent("perishable") inst:RemoveComponent("fuel") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst:RemoveTag("nopunch") inst:RemoveTag("show_spoilage") inst:RemoveAllEventCallbacks() inst:AddComponent("named") inst.components.named:SetName("Ice maker") inst.components.container.canbeopened = true inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst:ListenForEvent("rainstart", function() inst.task = inst:DoPeriodicTask(10, function() local ice = SpawnPrefab("ice") inst.components.container:GiveItem(ice) end ) end, GetWorld()) inst:ListenForEvent("rainstop", function() if inst.task then inst.task:Cancel() inst.task = nil end end, GetWorld()) inst:AddTag("icemaker") end if data and data.bigice then inst.AnimState:SetBank("icehat") inst.AnimState:SetBuild("hat_ice") inst.AnimState:PlayAnimation("anim") inst.Transform:SetScale(1.5, 1.5, 1.5) inst:RemoveComponent("waterproofer") inst:RemoveComponent("equippable") inst:RemoveComponent("insulator") inst:RemoveComponent("perishable") inst:RemoveComponent("fuel") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst:RemoveComponent("container") inst:RemoveTag("nopunch") inst:RemoveTag("show_spoilage") inst:RemoveAllEventCallbacks() inst:AddComponent("named") inst.components.named:SetName("Big ice") inst.components.inventoryitem:ChangeImageName("icehat") inst:AddComponent("heater") inst.components.heater.iscooler = true inst.components.heater.heatfn = function(inst) return -40 end inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(1) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") for k = 1, 10 do local pt1 = inst:GetPosition() local ice = SpawnPrefab("ice") ice.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 0, pt1.z+(math.random(3)-math.random(3))) end inst:Remove() end ) inst:AddTag("bigice") end end inst.OnSave = onsave inst.OnLoad = onload 即可用草伞种制冰机,下雨时每10秒制成一块冰,鼠标左键点制冰机,可打开格子,在格子中拿取。当格子中至少有10块冰时,点格子下面的“Make”按钮,可将冰加工成大冰块,用以永久保存。靠近大冰块可降温,用锤子砸大冰块,可还原成小冰。不想要制冰机了,用锤子炸毁即可。草伞在生存选项(画着绳套)下,用4个树枝、3个草、6个花瓣制造

2025/04/23 · Bny

YN260-奶报箱(用苔藓种奶报箱,放入黄金,每天清晨送来报纸和5瓶牛奶,读报纸可补脑)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六0.奶报箱(用苔藓种奶报箱,放入黄金,每天清晨送来报纸和5瓶牛奶,读报纸可补脑) 用MT管理器打开游戏目录/assets/scripts/prefabs/cutlichen.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function itemtest(inst, item, slot) if item.prefab == "goldnugget" or item.prefab == "goatmilk" or item.prefab == "cutlichen" then return true end return false end local slotpos = { Vector3(0,32+4,0), Vector3(0,-(32+4),0), Vector3(0,-(64+32+8+4),0)} local widgetbuttoninfo = { text = "Buy", position = Vector3(0, 95, 0), fn = function(inst) if inst:HasTag("milkcartons") and inst.components.container:Has("goldnugget", 1) then inst.components.container:ConsumeByName("goldnugget", 1) GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") local newspaper = SpawnPrefab("cutlichen") newspaper.AnimState:SetBank("blueprint") newspaper.AnimState:SetBuild("blueprint") newspaper.AnimState:PlayAnimation("idle") newspaper.components.inventoryitem:ChangeImageName("blueprint") newspaper.Transform:SetScale(1.2, 1.2, 1.2) newspaper:AddComponent("named") newspaper.components.named:SetName("Newspaper") newspaper:RemoveComponent("stackable") newspaper:RemoveComponent("edible") newspaper:RemoveComponent("perishable") newspaper:RemoveComponent("container") newspaper:RemoveComponent("deployable") newspaper.components.inspectable.getstatus = function(newspaper) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) newspaper:Remove() end newspaper:AddTag("newspapers") GetPlayer().components.inventory:GiveItem(newspaper) end end } local function OnDeploy (inst, pt) local milkcarton = SpawnPrefab("cutlichen") milkcarton.Transform:SetPosition(pt.x, pt.y, pt.z) milkcarton.AnimState:SetBank("icebox") milkcarton.AnimState:SetBuild("ice_box") milkcarton.AnimState:PlayAnimation("closed") milkcarton.Transform:SetScale(0.6, 0.6, 0.6) milkcarton.AnimState:SetMultColour(0/255,185/255,255/255,1) milkcarton:AddComponent("named") milkcarton.components.named:SetName("Milk carton") milkcarton:RemoveComponent("stackable") milkcarton:RemoveComponent("inventoryitem") milkcarton:RemoveComponent("edible") milkcarton:RemoveComponent("perishable") milkcarton:RemoveComponent("deployable") milkcarton.components.container.canbeopened = true milkcarton:AddComponent("workable") milkcarton.components.workable:SetWorkAction(ACTIONS.HAMMER) milkcarton.components.workable:SetWorkLeft(3) milkcarton.components.workable:SetOnFinishCallback(function(milkcarton) SpawnPrefab("collapse_big").Transform:SetPosition(milkcarton.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") milkcarton:Remove() end ) milkcarton:ListenForEvent( "daytime", function() if milkcarton.components.container:Has("goldnugget", 5) then milkcarton.components.container:ConsumeByName("goldnugget", 5) for k = 1, 5 do local goatmilk = SpawnPrefab("goatmilk") milkcarton.components.container:GiveItem(goatmilk) end local newspaper = SpawnPrefab("cutlichen") newspaper.AnimState:SetBank("blueprint") newspaper.AnimState:SetBuild("blueprint") newspaper.AnimState:PlayAnimation("idle") newspaper.components.inventoryitem:ChangeImageName("blueprint") newspaper.Transform:SetScale(1.2, 1.2, 1.2) newspaper:AddComponent("named") newspaper.components.named:SetName("Newspaper") newspaper:RemoveComponent("stackable") newspaper:RemoveComponent("edible") newspaper:RemoveComponent("perishable") newspaper:RemoveComponent("container") newspaper:RemoveComponent("deployable") newspaper.components.inspectable.getstatus = function(newspaper) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) newspaper:Remove() end newspaper:AddTag("newspapers") milkcarton.components.container:GiveItem(newspaper) end end, GetWorld()) milkcarton:AddTag("milkcartons") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy inst.components.deployable.min_spacing = 1 inst:AddComponent("container") inst.components.container.widgetbuttoninfo = widgetbuttoninfo inst.components.container:SetNumSlots(#slotpos) inst.components.container.widgetslotpos = slotpos inst.components.container.widgetpos = Vector3(0,150,0) inst.components.container.side_align_tip = 160 inst.components.container.canbeopened = false inst.components.container.onopenfn = function(inst) inst.AnimState:PlayAnimation("open") GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.onclosefn = function(inst) inst.AnimState:PlayAnimation("close") GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end inst.components.container.itemtestfn = itemtest inst:AddTag("fridge") local function onsave(inst, data) if inst:HasTag("milkcartons") then data.milkcartons = true end if inst:HasTag("newspapers") then data.newspapers = true end end local function onload(inst, data) if data and data.milkcartons then inst.AnimState:SetBank("icebox") inst.AnimState:SetBuild("ice_box") inst.AnimState:PlayAnimation("closed") inst.Transform:SetScale(0.6, 0.6, 0.6) inst.AnimState:SetMultColour(0/255,185/255,255/255,1) inst:AddComponent("named") inst.components.named:SetName("Milk carton") inst:RemoveComponent("stackable") inst:RemoveComponent("inventoryitem") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("deployable") inst.components.container.canbeopened = true inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(3) inst.components.workable:SetOnFinishCallback(function(inst) SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") inst:Remove() end ) inst:ListenForEvent( "daytime", function() if inst.components.container:Has("goldnugget", 5) then inst.components.container:ConsumeByName("goldnugget", 5) for k = 1, 5 do local goatmilk = SpawnPrefab("goatmilk") inst.components.container:GiveItem(goatmilk) end local newspaper = SpawnPrefab("cutlichen") newspaper.AnimState:SetBank("blueprint") newspaper.AnimState:SetBuild("blueprint") newspaper.AnimState:PlayAnimation("idle") newspaper.components.inventoryitem:ChangeImageName("blueprint") newspaper.Transform:SetScale(1.2, 1.2, 1.2) newspaper:AddComponent("named") newspaper.components.named:SetName("Newspaper") newspaper:RemoveComponent("stackable") newspaper:RemoveComponent("edible") newspaper:RemoveComponent("perishable") newspaper:RemoveComponent("container") newspaper:RemoveComponent("deployable") newspaper.components.inspectable.getstatus = function(newspaper) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) newspaper:Remove() end newspaper:AddTag("newspapers") inst.components.container:GiveItem(newspaper) end end, GetWorld()) inst:AddTag("milkcartons") end if data and data.newspapers then inst.AnimState:SetBank("blueprint") inst.AnimState:SetBuild("blueprint") inst.AnimState:PlayAnimation("idle") inst.components.inventoryitem:ChangeImageName("blueprint") inst.Transform:SetScale(1.2, 1.2, 1.2) inst:AddComponent("named") inst.components.named:SetName("Newspaper") inst:RemoveComponent("stackable") inst:RemoveComponent("edible") inst:RemoveComponent("perishable") inst:RemoveComponent("container") inst:RemoveComponent("deployable") inst.components.inspectable.getstatus = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_clothing") GetPlayer().components.sanity:DoDelta(GetPlayer().components.sanity.max) inst:Remove() end inst:AddTag("newspapers") end end inst.OnSave = onsave inst.OnLoad = onload 即可用苔藓种奶报箱,鼠标左键点奶报箱可打开格子,在格子中放入黄金(订奶预付款,最少5个黄金),第二天清晨将送来5瓶牛奶,并免费赠送一份报纸,同时扣除5个黄金。将报纸放入物品栏,对其点鼠标右键可读报,将补满脑值。如果格子中有黄金,点格子上方的“Buy”按钮,可以额外购买报纸,每份1个黄金。如果每天想多订牛奶和报纸,就多种几个奶报箱吧。不想要奶报箱了,用锤子砸毁即可。苔藓可在洞穴中采到。不要与“用苔藓种苔藓(苔藓可移植)”一同修改

2025/04/23 · Bny

YN261-智能路灯(用蓝色护身符种智能路灯,夜晚自动点亮,白天熄灭,可手动开关、防雷击)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六一.智能路灯(用蓝色护身符种智能路灯,夜晚自动点亮,白天熄灭,可手动开关、防雷击) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/amulet.lua文件,在inst.AnimState:PlayAnimation("blueamulet")的下一行插入以下内容: local function makestreetlight(inst) local pt = inst:GetPosition() local streetlight = SpawnPrefab("blueamulet") streetlight.Transform:SetPosition(pt.x, pt.y, pt.z) streetlight.AnimState:SetBank("nightstick") streetlight.AnimState:SetBuild("nightstick") streetlight.AnimState:PlayAnimation("idle") streetlight.Transform:SetScale(1.5, 1.5, 1.5) streetlight.AnimState:SetMultColour(255/255,255/255,0/255,1) MakeObstaclePhysics(streetlight, .5 ) streetlight:RemoveComponent("equippable") streetlight:RemoveComponent("inventoryitem") streetlight:RemoveComponent("heater") streetlight:RemoveComponent("fueled") streetlight:RemoveComponent("deployable") streetlight:AddComponent("named") streetlight.components.named:SetName("Street Light") streetlight:AddComponent("workable") streetlight.components.workable:SetWorkAction(ACTIONS.HAMMER) streetlight.components.workable:SetWorkLeft(3) streetlight.components.workable:SetOnFinishCallback(function(streetlight, worker) SpawnPrefab("collapse_big").Transform:SetPosition(streetlight.Transform:GetWorldPosition()) GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") local pos = Vector3(streetlight.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 2) for k,v in pairs(ents) do if v:HasTag("bulbs") then v:Remove() end end streetlight:Remove() end ) streetlight:AddTag("streetlights") local bulb = SpawnPrefab("blueamulet") bulb.AnimState:SetBank("bulb") bulb.AnimState:SetBuild("bulb") bulb.AnimState:PlayAnimation("idle") bulb.Transform:SetScale(1.6, 1.6, 1.6) bulb.Physics:SetActive(false) bulb:RemoveComponent("equippable") bulb:RemoveComponent("inventoryitem") bulb:RemoveComponent("heater") bulb:RemoveComponent("fueled") bulb:RemoveComponent("deployable") bulb.persists = false bulb:AddComponent("named") bulb.components.named:SetName("Street Light") bulb.entity:AddSoundEmitter() local light = bulb.entity:AddLight() light:SetFalloff(1) light:SetIntensity(.8) light:SetRadius(10) light:SetColour(255/255,255/255,255/255) light:Enable(false) local follower = bulb.entity:AddFollower() follower:FollowSymbol( streetlight.GUID, "swap_object", 15, -160, 0.1 ) bulb:AddComponent("machine") bulb.components.machine.turnonfn = function() bulb.SoundEmitter:PlaySound("dontstarve/wilson/lantern_on") bulb.AnimState:SetBloomEffectHandle("shaders/anim.ksh") bulb.Light:Enable(true) end bulb.components.machine.turnofffn = function() bulb.SoundEmitter:PlaySound("dontstarve/wilson/lantern_off") bulb.AnimState:SetBloomEffectHandle( "" ) bulb.Light:Enable(false) end bulb:ListenForEvent( "daytime", function() bulb.components.machine:TurnOff() end , GetWorld() ) bulb:ListenForEvent( "dusktime", function() bulb.components.machine:TurnOn() end , GetWorld() ) bulb:AddTag("lightningrod") bulb:AddTag("bulbs") if not GetClock():IsDay() then bulb.components.machine:TurnOn() else bulb.components.machine:TurnOff() end end local function OnDeploy (inst, pt) makestreetlight(inst) inst:Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("streetlights") then data.streetlights = true end end local function onload(inst, data) if data and data.streetlights then makestreetlight(inst) inst:Remove() end end inst.OnSave = onsave inst.OnLoad = onload 即可用蓝色护身符种智能路灯,夜晚自动点亮,白天自动熄灭。鼠标右键点灯泡,可手动开关。智能路灯靠太阳能和闪电做能源,无须手动充能,靠近可防雷击。不想要智能路灯了,用锤子砸掉即可。蓝色护身符在魔法选项(画着红骷髅)下,用3个黄金、1个蓝宝石制造

2025/04/23 · Bny

YN262-传送石(右键点装备的保温石,将主角传送到另一块保温石处)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六二.传送石(右键点装备的保温石,将主角传送到另一块保温石处) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/heatrock.lua文件,在inst:AddComponent("inspectable")下一行插入以下内容: local function canteleport(inst, caster) return true end local function teleport(inst) local caster = inst.components.inventoryitem.owner local range = 3000 local pos = Vector3(caster.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do if v.prefab == "heatrock" and not v.components.inventoryitem:IsHeld() then caster.Transform:SetPosition(v.Transform:GetWorldPosition()) end end return true end inst:AddComponent("spellcaster") inst.components.spellcaster:SetSpellFn(teleport) inst.components.spellcaster:SetSpellTestFn(canteleport) inst.components.spellcaster.canusefrominventory = false inst.components.spellcaster.canuseonpoint = true inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.HANDS 即可制造2块保温石,1块扔在要传到的地点(比如家、洞穴出口处等),另1块带在身上,无论走到地图何处,只要装备保温石对空地按鼠标右键,马上传送回扔在地上的保温石处。如果制造3块保温石,将2块扔在不同地点,这2点间将形成虫洞效果,装备保温石对空地按鼠标右键,会在这2点间来回传送

2025/04/23 · Bny

YN263-御风飞翔(装备羽毛飞翔10秒)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六三.御风飞翔(装备羽毛飞翔10秒) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/feathers.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onequip(inst, owner) inst.fire = SpawnPrefab( "feather_"..name ) inst.fire.Physics:SetActive(false) local follower = inst.fire.entity:AddFollower() follower:FollowSymbol( inst.GUID, "swap_object", 0, 60, 0 ) local pt = owner:GetPosition() owner.Transform:SetPosition(pt.x, pt.y+30, pt.z) inst:DoTaskInTime(10, function() local pt = owner:GetPosition() owner.Transform:SetPosition(pt.x, pt.y-30, pt.z) inst:Remove() end) end local function onunequip(inst, owner) local pt = owner:GetPosition() owner.Transform:SetPosition(pt.x, pt.y-30, pt.z) inst.fire:Remove() inst.fire = nil end inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( onequip ) inst.components.equippable:SetOnUnequip( onunequip ) inst.components.equippable.equipslot = EQUIPSLOTS.HEAD inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*5 即可装备羽毛飞翔10秒,体会饥荒世界从未有过的美妙感觉,洞穴也可飞行。10秒后羽毛被耗尽,想飞就要多捕鸟哦。注意飞行时不要佩戴橙色护身符和带宠物

2025/04/23 · Bny

YN264-风力滑板车(饥荒世界陆上交通工具)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六四.风力滑板车(饥荒世界陆上交通工具) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/umbrella.lua文件, 1.将下列内容: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_umbrella", "swap_umbrella") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") UpdateSound(inst) owner.DynamicShadow:SetSize(2.2, 1.4) inst.components.fueled:StartConsuming() end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") UpdateSound(inst) owner.DynamicShadow:SetSize(1.3, 0.6) inst.components.fueled:StopConsuming() end 替换为: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_umbrella", "swap_umbrella") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") UpdateSound(inst) inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,0,0) end) inst.fire = SpawnPrefab( "telebase" ) inst.fire.Physics:SetActive(false) local follower = inst.fire.entity:AddFollower() follower:FollowSymbol( owner.GUID, "swap_object", -90, 130, 0 ) end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") UpdateSound(inst) if inst.task then inst.task:Cancel() inst.task = nil end inst.fire:Remove() inst.fire = nil end 2.在inst.components.fueled:SetDepletedFn(onperish)的下一行插入inst:AddComponent("blinkstaff") 即可在装备雨伞时,脚下踩着滑板自动行驶,伞就是你的风帆,卸载雨伞后停下。鼠标左键点地可以控制方向(也可以用键盘W、S、A、D键控制方向),鼠标右键点地可以瞬移(用以跳过障碍),有空儿去兜兜风吧。雨伞在生存选项(画着绳套)下,用6个树枝、1个猪皮、2个蛛丝制造

2025/04/23 · Bny

YN265-动力飞行帽(戴羽毛帽在天空自由飞翔)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 二六五.动力飞行帽(戴羽毛帽在天空自由飞翔) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: local function feather_equip(inst, owner) onequip(inst, owner) local ground = GetWorld() if ground and ground.components.birdspawner then ground.components.birdspawner:SetSpawnTimes(TUNING.BIRD_SPAWN_DELAY_FEATHERHAT) ground.components.birdspawner:SetMaxBirds(TUNING.BIRD_SPAWN_MAX_FEATHERHAT) end end local function feather_unequip(inst, owner) onunequip(inst, owner) local ground = GetWorld() if ground and ground.components.birdspawner then ground.components.birdspawner:SetSpawnTimes(TUNING.BIRD_SPAWN_DELAY) ground.components.birdspawner:SetMaxBirds(TUNING.BIRD_SPAWN_MAX) end end local function feather() local inst = simple() inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL inst.components.equippable:SetOnEquip( feather_equip ) inst.components.equippable:SetOnUnequip( feather_unequip ) inst:AddComponent("fueled") inst.components.fueled.fueltype = "USAGE" inst.components.fueled:InitializeFuelLevel(TUNING.FEATHERHAT_PERISHTIME) inst.components.fueled:SetDepletedFn(generic_perish) 替换为: local function feather_equip(inst, owner) onequip(inst, owner) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,10,0) end ) inst:DoTaskInTime(3, function() if inst.task then inst.task:Cancel() inst.task = nil end inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,1,0) end) end ) end local function feather_unequip(inst, owner) if inst.task then inst.task:Cancel() inst.task = nil end inst.task = inst:DoPeriodicTask(.01, function() owner.Physics:SetMotorVelOverride(20,-10,0) end) inst:DoTaskInTime(3, function() if inst.task then inst.task:Cancel() inst.task = nil end onunequip(inst, owner) local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end) end local function feather() local inst = simple() inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL inst.components.equippable:SetOnEquip( feather_equip ) inst.components.equippable:SetOnUnequip( feather_unequip ) 即可在戴羽毛帽时开始起飞,爬升3秒后平飞,用键盘W、S、A、D键控制方向。想降落时卸载羽毛帽即可开始着陆,落地后会滑行一段(按W、S、A、D键可以减少滑行距离)。注意不要在爬升阶段卸载羽毛帽(平飞时再卸载即可),否则在惯性作用下将滑出很长一段距离

2025/04/23 · Bny