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

YN176-霸王盔(用猪皮种霸王盔,吸收99%伤害,挨打时弹开并反伤敌人,可照明、防雨、防冻、防暑、补脑、奔跑加速)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一七六.霸王盔(用猪皮种霸王盔,吸收99%伤害,挨打时弹开并反伤敌人,可照明、防雨、防冻、防暑、补脑、奔跑加速) 用MT管理器打开游戏目录/assets/scripts/prefabs/pigskin.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) local helmet = SpawnPrefab("pigskin") helmet.Transform:SetPosition(pt.x, pt.y, pt.z) helmet.AnimState:SetBank("wathgrithrhat") helmet.AnimState:SetBuild("hat_wathgrithr") helmet.AnimState:PlayAnimation("anim") helmet.components.inventoryitem:ChangeImageName("wathgrithrhat") helmet:RemoveComponent("stackable") helmet:RemoveComponent("tradable") helmet:RemoveComponent("edible") helmet:RemoveComponent("burnable") helmet:RemoveComponent("propagator") helmet:RemoveComponent("deployable") helmet:AddComponent("equippable") helmet.components.equippable.equipslot = EQUIPSLOTS.HEAD helmet.components.equippable.walkspeedmult = 2.5 helmet.components.equippable.dapperness = TUNING.DAPPERNESS_HUGE*32 helmet.components.equippable:SetOnEquip(function(helmet, owner) owner.AnimState:OverrideSymbol("swap_hat", "hat_wathgrithr", "swap_hat") owner.AnimState:Show("HAT") owner.AnimState:Show("HAT_HAIR") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") if owner == GetPlayer() then owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAIR") owner.components.temperature:SetTemp(20) owner:PushEvent("stopfreezing") owner:PushEvent("stopoverheating") owner.components.moisture:SetMoistureLevel(0) helmet.fire = SpawnPrefab( "campfirefire" ) local follower = helmet.fire.entity:AddFollower() follower:FollowSymbol( owner.GUID, "swap_hat", -6, -196, 0 ) helmet.fire.AnimState:SetMultColour(255/255,0/255,0/255,1) helmet.fire.Transform:SetScale(1.3, 1.3, 1.3) helmet.fire:RemoveComponent("heater") helmet.fire.persists = false helmet.helmetfn = function(attacked, data) if data and data.attacker and data.attacker.components.health then SpawnPrefab("groundpoundring_fx").Transform:SetPosition(owner.Transform:GetWorldPosition()) data.attacker.components.health:DoDelta(-300) local pt01 = owner:GetPosition() local pt02 = data.attacker:GetPosition() data.attacker.Transform:SetPosition((pt02.x-pt01.x)*1.5+pt02.x, 0, (pt02.z-pt01.z)*1.5+pt02.z) if data.attacker.components.locomotor then data.attacker.components.locomotor:Stop() end if data.attacker.components.health:GetPercent() < 0.3 then data.attacker.AnimState:SetMultColour(255/255,0/255,0/255,1) end end end helmet:ListenForEvent("attacked", helmet.helmetfn, owner) owner:AddTag("goodsavages") end end ) helmet.components.equippable:SetOnUnequip(function(helmet, owner) owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAT_HAIR") owner.AnimState:Show("HAIR_NOHAT") owner.AnimState:Show("HAIR") if owner == GetPlayer() then owner.AnimState:Show("HEAD") owner.AnimState:Hide("HEAD_HAIR") owner.components.temperature:SetTemp(nil) helmet.fire:Remove() helmet.fire = nil helmet:RemoveEventCallback("attacked", helmet.helmetfn, owner) owner:RemoveTag("goodsavages") end end ) helmet:AddComponent("armor") helmet.components.armor:InitCondition(20000, 0.99) helmet:AddComponent("waterproofer") helmet.components.waterproofer:SetEffectiveness(1) helmet:AddTag("helmets") inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy local function onsave(inst, data) if inst:HasTag("helmets") then data.helmets = true end end local function onload(inst, data) if data and data.helmets then inst.AnimState:SetBank("wathgrithrhat") inst.AnimState:SetBuild("hat_wathgrithr") inst.AnimState:PlayAnimation("anim") inst.components.inventoryitem:ChangeImageName("wathgrithrhat") inst:RemoveComponent("stackable") inst:RemoveComponent("tradable") inst:RemoveComponent("edible") inst:RemoveComponent("burnable") inst:RemoveComponent("propagator") inst:RemoveComponent("deployable") inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.HEAD inst.components.equippable.walkspeedmult = 2.5 inst.components.equippable.dapperness = TUNING.DAPPERNESS_HUGE*32 inst.components.equippable:SetOnEquip(function(inst, owner) owner.AnimState:OverrideSymbol("swap_hat", "hat_wathgrithr", "swap_hat") owner.AnimState:Show("HAT") owner.AnimState:Show("HAT_HAIR") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") if owner == GetPlayer() then owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAIR") owner.components.temperature:SetTemp(20) owner:PushEvent("stopfreezing") owner:PushEvent("stopoverheating") owner.components.moisture:SetMoistureLevel(0) inst.fire = SpawnPrefab( "campfirefire" ) local follower = inst.fire.entity:AddFollower() follower:FollowSymbol( owner.GUID, "swap_hat", -6, -196, 0 ) inst.fire.AnimState:SetMultColour(255/255,0/255,0/255,1) inst.fire.Transform:SetScale(1.3, 1.3, 1.3) inst.fire:RemoveComponent("heater") inst.fire.persists = false inst.helmetfn = function(attacked, data) if data and data.attacker and data.attacker.components.health then SpawnPrefab("groundpoundring_fx").Transform:SetPosition(owner.Transform:GetWorldPosition()) data.attacker.components.health:DoDelta(-300) local pt01 = owner:GetPosition() local pt02 = data.attacker:GetPosition() data.attacker.Transform:SetPosition((pt02.x-pt01.x)*1.5+pt02.x, 0, (pt02.z-pt01.z)*1.5+pt02.z) if data.attacker.components.locomotor then data.attacker.components.locomotor:Stop() end if data.attacker.components.health:GetPercent() < 0.3 then data.attacker.AnimState:SetMultColour(255/255,0/255,0/255,1) end end end inst:ListenForEvent("attacked", inst.helmetfn, owner) owner:AddTag("goodsavages") end end ) inst.components.equippable:SetOnUnequip(function(inst, owner) owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAT_HAIR") owner.AnimState:Show("HAIR_NOHAT") owner.AnimState:Show("HAIR") if owner == GetPlayer() then owner.AnimState:Show("HEAD") owner.AnimState:Hide("HEAD_HAIR") owner.components.temperature:SetTemp(nil) inst.fire:Remove() inst.fire = nil inst:RemoveEventCallback("attacked", inst.helmetfn, owner) owner:RemoveTag("goodsavages") end end ) inst:AddComponent("armor") inst.components.armor:InitCondition(20000, 0.99) inst:AddComponent("waterproofer") inst.components.waterproofer:SetEffectiveness(1) inst:AddTag("helmets") end end inst.OnSave = onsave inst.OnLoad = onload 即可用猪皮种霸王盔,吸收99%伤害,敌人攻击你时会被弹开,并遭到反伤,让你流的每一滴血,都收到百倍利息。霸王盔可照明、防雨、防冻、防暑、补脑,并使奔跑加速,与“霸王枪”并称饥荒世界两大神器,助你在乱世中百战百胜。佩戴霸王盔时,“铁血蛮族”不敢主动攻击你。不要与“用猪皮种猪火炬”一同修改

2025/04/23 · Bny

YN177-活捉手杖(装备龙卷风魔杖,鼠标左键点鸟、鼹鼠等小动物,可远程活捉)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一七七.活捉手杖(装备龙卷风魔杖,鼠标左键点鸟、鼹鼠等小动物,可远程活捉) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/staff_tornado.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function canattack(inst, target) if target.prefab == "bee" or target.prefab == "killerbee" or target.prefab == "crow" or target.prefab == "robin" or target.prefab == "robin_winter" or target.prefab == "butterfly" or target.prefab == "mole" or target.prefab == "mosquito" or target.prefab == "rabbit" then return true end return false end local function onattack(inst, attacker, target) if target.prefab == "bee" then local prey = SpawnPrefab("bee") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "killerbee" then local prey = SpawnPrefab("killerbee") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "crow" then local prey = SpawnPrefab("crow") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "robin" then local prey = SpawnPrefab("robin") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "robin_winter" then local prey = SpawnPrefab("robin_winter") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "butterfly" then local prey = SpawnPrefab("butterfly") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "mole" then local prey = SpawnPrefab("mole") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "mosquito" then local prey = SpawnPrefab("mosquito") GetPlayer().components.inventory:GiveItem(prey) end if target.prefab == "rabbit" then local prey = SpawnPrefab("rabbit") GetPlayer().components.inventory:GiveItem(prey) end target:Remove() end inst:AddComponent("weapon") inst.components.weapon:SetDamage(0) inst.components.weapon:SetRange(25, 30) inst.components.weapon:SetOnAttack(onattack) inst.components.weapon:SetCanAttack(canattack) inst.components.weapon:SetProjectile("bishop_charge") 即可将龙卷风魔杖升级为活捉手杖,装备活捉手杖,鼠标左键点小动物,可远距离活捉它们。可活捉的小动物包括蜜蜂、杀人蜂、鸟、蝴蝶、鼹鼠、蚊子、兔子。龙卷风魔杖右键召唤龙卷风的功能保留。龙卷风魔杖在战斗选项下,用10个鹿鸭羽毛、1个闪电羊角、1个齿轮制造

2025/04/23 · Bny

YN178-巨人帽(带猪皮帽变巨人,攻击、防御上升,可撞毁建筑、树、石头)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一七八.巨人帽(带猪皮帽变巨人,攻击、防御上升,可撞毁建筑、树、石头) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: local function football() local inst = simple() inst:AddComponent("armor") inst:AddComponent("waterproofer") inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_SMALL) inst.components.armor:InitCondition(TUNING.ARMOR_FOOTBALLHAT, TUNING.ARMOR_FOOTBALLHAT_ABSORPTION) return inst end 替换为: local function football_equip(inst, owner) onequip(inst, owner) if owner == GetPlayer() then owner.Transform:SetScale(3, 3, 3) owner.components.combat:SetDefaultDamage(500) owner.Physics:SetCollisionCallback(function(owner, other) if other and other.components.workable and other.components.workable.workleft > 0 then other.components.workable:Destroy(owner) end end) end end local function football_unequip(inst, owner) onunequip(inst, owner) if owner == GetPlayer() then owner.Transform:SetScale(1, 1, 1) owner.components.combat:SetDefaultDamage(TUNING.UNARMED_DAMAGE) owner.Physics:SetCollisionCallback( nil ) end end local function football() local inst = simple() inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMOR_FOOTBALLHAT, 0.95) inst:AddComponent("waterproofer") inst.components.waterproofer:SetEffectiveness(TUNING.WATERPROOFNESS_SMALL) inst.components.equippable:SetOnEquip( football_equip ) inst.components.equippable:SetOnUnequip( football_unequip ) return inst end 即可戴猪皮帽变巨人,空手攻击力达到500点(空手按Ctrl + 鼠标左键攻击,或按住F反击),防御敌人95%的伤害(只掉5%的血),可撞毁建筑、树、石头。猪皮帽在战斗选项(画着两把剑)下,用1个绳子、1个猪皮制造,制造时须靠近炼金术引擎

2025/04/23 · Bny

YN179-防弹背包(装备背包吸收99%伤害值)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一七九.防弹背包(装备背包吸收99%伤害值) 1.普通背包作盔甲:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/backpack.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMORMARBLE, 0.99) 2.小猪包作盔甲:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/piggyback.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMORMARBLE, 0.99) 3.坎普斯背包作盔甲:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/krampus_sack.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMORMARBLE, 0.99) 4.冰包作盔甲:用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/icepack.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMORMARBLE, 0.99) 5.盔甲永固:用MT管理器打开游戏目录/assets/scripts/components/armor.lua文件,将下列内容: function Armor:SetCondition(amount) self.condition = amount 替换为: function Armor:SetCondition(amount) self.condition = self.maxcondition 即可装备背包就拥有盔甲防护作用,且99%吸收伤害值,还无限使用哦

2025/04/23 · Bny

YN180-芦苇吹出催眠曲(在携带的芦苇上按鼠标右键,可催眠怪物)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一八0.芦苇吹出催眠曲(在携带的芦苇上按鼠标右键,可催眠怪物) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cutreeds.lua文件,在inst:AddComponent("inventoryitem")的下一行插入以下内容: inst:AddTag("flute") local function HearPanFlute(inst, musician, instrument) if inst.components.sleeper then inst.components.sleeper:AddSleepiness(10, TUNING.PANFLUTE_SLEEPTIME*1) end end inst:AddComponent("tool") inst.components.tool:SetAction(ACTIONS.PLAY) inst:AddComponent("instrument") inst.components.instrument.range = TUNING.PANFLUTE_SLEEPRANGE*2 inst.components.instrument:SetOnHeardFn(HearPanFlute) 即可在携带的芦苇上按鼠标右键,可催眠一片怪物。其中*1为催眠时间20秒,想催眠60秒就*3即可。其中*2为催眠范围30格,想扩大至60格就*4即可

2025/04/23 · Bny

YN181-隐身背心(穿小巧背心可隐身)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一八一.隐身背心(穿小巧背心可隐身) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/sweatervest.lua文件,将下列内容: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "armor_sweatervest", "swap_body") inst.components.fueled:StartConsuming() end local function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") inst.components.fueled:StopConsuming() end 替换为: local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "armor_sweatervest", "swap_body") inst.components.equippable.walkspeedmult = TUNING.CANE_SPEED_MULT*2 owner:Hide() local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 0, 0 ) end local function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") owner:Show() local shadow = GetPlayer().entity:AddDynamicShadow() shadow:SetSize( 1.3, .6 ) end 即可穿上小巧背心隐身,你可以攻击敌人,敌人找不到你,连鸟、兔子都可以直接攻击哦。小巧背心在穿戴选项(画着礼帽)下,用8个犬牙、6个蛛丝制造

2025/04/23 · Bny

YN182-泡泡糖(吃黄油吹个保护泡泡)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一八二.泡泡糖(吃黄油吹个保护泡泡) 用MT管理器打开游戏目录/assets/scripts/prefabs/butter.lua文件,在inst.components.edible.hungervalue = TUNING.CALORIES_MED的下一行插入以下内容: local function proc(inst, eater) eater.components.health:SetInvincible(true) inst:AddTag("forcefield") local fx = SpawnPrefab("forcefieldfx") fx.entity:SetParent(eater.entity) fx.Transform:SetPosition(0, 0.2, 0) local fx_hitanim = function() fx.AnimState:PlayAnimation("hit") fx.AnimState:PushAnimation("idle_loop") end fx:ListenForEvent("blocked", fx_hitanim, eater) inst.active = true eater:DoTaskInTime(60, function() fx:RemoveEventCallback("blocked", fx_hitanim, eater) fx.kill_fx(fx) if inst:IsValid() then eater.components.health:SetInvincible(false) inst:RemoveTag("forcefield") eater:DoTaskInTime(5, function() inst.active = false end) end end) end local function oneaten(inst, eater) proc(inst, eater) end inst.components.edible:SetOnEatenFn(oneaten) 即可吃黄油后60秒内身边环绕一个保护泡,敌人无法伤到主角。黄油可以靠杀蝴蝶掉落,也可以用本修改技巧的“栽种尖刺灌木产黄油”得到

2025/04/23 · Bny

YN183-迷魂花阵(戴花环周围出现食人花眼睛保护主角)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一八三.迷魂花阵(戴花环周围出现食人花眼睛保护主角) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: inst:AddComponent("perishable") inst.components.perishable:SetPerishTime(TUNING.PERISH_FAST) inst.components.perishable:StartPerishing() inst.components.perishable:SetOnPerishFn(generic_perish) inst.components.equippable:SetOnEquip( opentop_onequip ) 替换为: local function flower_equip(inst, owner) opentop_onequip(inst, owner) inst:AddComponent("minionspawner") inst.components.minionspawner.miniontype = "eyeplant" inst.components.minionspawner.maxminions = 27 inst.components.minionspawner.minionspawntime = {min = 0.01, max = 0.01} inst.components.minionspawner.numminions = 10 inst.components.minionspawner.shouldspawn = true inst.components.minionspawner:StartNextSpawn() end local function flower_unequip(inst, owner) onunequip(inst, owner) inst.components.minionspawner.shouldspawn = false inst.components.minionspawner:KillAllMinions() inst:RemoveComponent("minionspawner") end inst.components.equippable:SetOnEquip( flower_equip ) inst.components.equippable:SetOnUnequip( flower_unequip ) 2.用MT管理器打开游戏目录/assets/scripts/prefabs/eyeplant.lua文件,将下列内容: return (guy:HasTag("character") or guy:HasTag("monster") or guy:HasTag("animal") or guy:HasTag("prey") or guy:HasTag("eyeplant") or guy:HasTag("lureplant")) and not checkmaster(guy, inst) 替换为: return (guy:HasTag("character") or guy:HasTag("monster") or guy:HasTag("animal") or guy:HasTag("prey") or guy:HasTag("eyeplant") or guy:HasTag("lureplant")) and not guy:HasTag("player") and not checkmaster(guy, inst) 即可戴花环周围出现食人花眼睛保护主角,食人花眼睛被敌人打死一个又会再生一个。摘下花环,食人花眼睛立即消失

2025/04/23 · Bny

YN184-家园防御系统(暗夜照明灯自动向靠近的敌人发射炮弹)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一八四.家园防御系统(暗夜照明灯自动向靠近的敌人发射炮弹) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/nightlight.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function onattack(inst) local pos = Vector3(inst.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, 30) for k,v in pairs(ents) do if v.components.health and v.components.combat and not v.components.health:IsDead() then if v.components.combat.target == GetPlayer() or GetPlayer().components.combat.target == v or v:HasTag("monster") then inst.components.weapon:LaunchProjectile(inst, v) v.components.health:DoDelta(-5000) inst.SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo") SpawnPrefab("collapse_small").Transform:SetPosition(v.Transform:GetWorldPosition()) SpawnPrefab("explode_small").Transform:SetPosition(v.Transform:GetWorldPosition()) GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.7, 0.02, .5, 40) inst.components.fueled:InitializeFuelLevel(1000) end end end end local function turnon(inst) inst.components.machine.ison = true inst.task = inst:DoPeriodicTask(.5, function() onattack(inst) end) inst.components.burnable:IsBurning() inst.components.fueled:InitializeFuelLevel(1000) end local function turnoff(inst) inst.components.machine.ison = false if inst.task then inst.task:Cancel() inst.task = nil end inst.components.burnable:Extinguish() inst.components.fueled:InitializeFuelLevel(0) end inst:AddComponent("machine") inst.components.machine.turnonfn = turnon inst.components.machine.turnofffn = turnoff inst:AddComponent("weapon") inst.components.weapon:SetDamage(0) inst.components.weapon:SetProjectile("eye_charge") 即可对暗夜照明灯按鼠标右键开启家园防御系统,自动向靠近的敌人发射炮弹(不会攻击同伴),再按鼠标右键关闭。建在基地附近,无惧任何敌人。暗影照明灯在魔法选项(画着红骷髅)下,用8个黄金、2个噩梦燃料、1个红宝石建造

2025/04/23 · Bny

YN185-音浪太强(戴兔耳罩周围形成音浪,敌人被弹开)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一八五.音浪太强(戴兔耳罩周围形成音浪,敌人被弹开) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/hats.lua文件,将下列内容: local function earmuffs() local inst = simple() inst:AddComponent("insulator") inst.components.insulator.insulation = TUNING.INSULATION_SMALL inst.components.equippable:SetOnEquip( opentop_onequip ) inst:AddComponent("fueled") inst.components.fueled.fueltype = "USAGE" inst.components.fueled:InitializeFuelLevel(TUNING.EARMUFF_PERISHTIME) inst.components.fueled:SetDepletedFn(generic_perish) inst.AnimState:SetRayTestOnBB(true) return inst end 替换为: local colours= { {198/255,43/255,43/255}, {79/255,153/255,68/255}, {35/255,105/255,235/255}, {233/255,208/255,69/255}, {109/255,50/255,163/255}, {222/255,126/255,39/255}, } local function pickup(inst, owner) inst.colour_idx = math.random(#colours) local light = inst.entity:AddLight() light:SetIntensity(.8) light:SetRadius(3) light:SetFalloff(1) light:Enable(true) light:SetColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3]) local pt = Vector3(owner.Transform:GetWorldPosition()) local result_offset = FindValidPositionByFan(math.random()*2*PI, 10, 75, function(offset) local x,y,z = (pt + offset):Get() local ents = TheSim:FindEntities(x,y,z , 1) return not next(ents) end) local ents2 = TheSim:FindEntities(pt.x,pt.y,pt.z, 8) for k,v in pairs(ents2) do if v.components.health and not v.components.health:IsDead() and not v:HasTag("player") and not v:HasTag("smallbird") and not v:HasTag("chester") and not v:HasTag("wall") and not v:HasTag("structure") then v.Transform:SetPosition((pt + result_offset):Get()) end end end local function earmuffs_onequip(inst, owner) inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) GetPlayer().SoundEmitter:PlaySound("dontstarve/music/music_hoedown", "beavermusic") opentop_onequip(inst, owner) end local function earmuffs_onunequip(inst, owner) if inst.task then inst.task:Cancel() inst.task = nil end GetPlayer().SoundEmitter:KillSound("beavermusic") onunequip(inst, owner) inst.Light:Enable(false) end local function earmuffs() local inst = simple() inst:AddComponent("insulator") inst.components.insulator.insulation = TUNING.INSULATION_SMALL inst.components.equippable:SetOnEquip( earmuffs_onequip ) inst.components.equippable:SetOnUnequip( earmuffs_onunequip ) inst.AnimState:SetRayTestOnBB(true) return inst end 即可在戴兔耳罩时,周围形成音浪,敌人靠近会被弹开,拆杀人蜂窝、偷高鸟蛋毫发无伤。兔耳罩在穿戴选项(画着礼帽)下,用2个兔子、1个树枝制造

2025/04/23 · Bny