饥荒 全人物解锁及主角自动回血等实用修改教程

《饥荒》这款生存游戏,很多玩家都想觉得游戏有些难,就想修改一些内容,比如解锁全人物,主角自动回血,主角不会饿之类的,下面小编为大家奉上最全的修改教程,内容简单易懂,希望各位玩家喜欢。目录

饥荒 全人物解锁及主角自动回血等实用修改教程

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

  用记事本打开游戏目录\data\DLC0001\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个蓝宝石制造

相关内容请关注:饥荒专区

作者:易宁     责任编辑:Shy夏夏

本文是否解决了您的问题

APP精彩推荐打开游民APP查看更多

  • 《生化9》玩家发现里昂手机号 打过去结果不出意外
    《生化9》玩家发现里昂手机号 打过去结果不出意外

  • "抖音第一蒂法"被质疑靠化妆!素颜再亮相后网友闭嘴

  • 亲母女嫁给亲父子引关注 网友:有孩子了怎么喊?
    亲母女嫁给亲父子引关注 网友:有孩子了怎么喊?

攻略合集
人物图鉴

相关内容

在线玩推荐更多

游民星空

打开App阅读体验更佳,攻略、资讯实时更新

下载APP