游民星空 > 攻略秘籍 > 攻略 > 正文

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

2015-01-21 11:28:46 来源:互联网 作者:易宁 我要投稿

第164页:高爆地雷

展开

一六四.高爆地雷(指南针放在地上作地雷)

  用记事本打开游戏目录\data\scripts\prefabs\compass.lua文件,在inst:AddComponent("inventoryitem")的下一行插入以下内容

  inst.components.inventoryitem:SetOnDroppedFn(function()

  inst:RemoveTag("startkill")

  if inst.task then inst.task:Cancel() inst.task = nil end

  end )

  inst.components.inventoryitem:SetOnPickupFn(function()

  inst:RemoveTag("startkill")

  if inst.task then inst.task:Cancel() inst.task = nil end

  end )

  inst.components.inventoryitem:SetOnPutInInventoryFn(function()

  inst:RemoveTag("startkill")

  if inst.task then inst.task:Cancel() inst.task = nil end

  end )

  local function OnDeploy (inst, pt)

  inst:AddTag("startkill")

  inst.Physics:Teleport(pt:Get())

  inst.task = inst:DoPeriodicTask(0.1, function(inst)

  local target = FindEntity(inst, 2, function(guy)

  return guy.components.combat and guy.components.health and not guy.components.health:IsDead() and not guy:HasTag("player") and not guy:HasTag("smallbird") and not guy:HasTag("chester")

  end )

  if target then

  GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo")

  SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition())

  SpawnPrefab("explode_small").Transform:SetPosition(inst.Transform:GetWorldPosition())

  local pos = Vector3(inst.Transform:GetWorldPosition())

  GetClock():DoLightningLighting()

  GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.7, 0.02, .5, 40)

  target.components.health:DoDelta(-3000)

  inst:Remove()

  end

  end )

  end

  inst:AddComponent("deployable")

  inst.components.deployable.ondeploy = OnDeploy

  inst.components.deployable.min_spacing = 2

  inst:AddComponent("stackable")

  inst.components.stackable.maxsize = 999

  local function onsave(inst, data)

  if inst:HasTag("startkill") then

  data.startkill = true

  end

  end

  local function onload(inst, data)

  if data and data.startkill then

  inst:AddTag("startkill")

  inst.task = inst:DoPeriodicTask(0.1, function(inst)

  local target = FindEntity(inst, 2, function(guy)

  return guy.components.combat and guy.components.health and not guy.components.health:IsDead() and not guy:HasTag("player") and not guy:HasTag("smallbird") and not guy:HasTag("chester")

  end )

  if target then

  GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo")

  SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition())

  SpawnPrefab("explode_small").Transform:SetPosition(inst.Transform:GetWorldPosition())

  local pos = Vector3(inst.Transform:GetWorldPosition())

  GetClock():DoLightningLighting()

  GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.7, 0.02, .5, 40)

  target.components.health:DoDelta(-3000)

  inst:Remove()

  end

  end )

  end

  end

  inst.OnSave = onsave

  inst.OnLoad = onload

  即可拿起指南针用鼠标右键部署在空地上,敌人踩上后会爆炸,主角、自养高鸟、狗箱不会触发。指南针在生存选项(画着绳套)下,用1个黄金、1张纸制造

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

责任编辑:Shy夏夏

上一页 161 162 163 164 165 166 167 168 169 170 171 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

文章内容导航
游民星空APP
随手浏览游戏攻略
code
攻略合集
单机游戏下载
休闲娱乐
综合热点资讯
游民星空联运游戏