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

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

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

第324页:电动斧子

展开

二七四.电动斧子(拿黄金斧子自动放倒身边的树)

  用记事本打开游戏目录\data\scripts\prefabs\axe.lua文件,

  1.将下列内容:

  local function onequipgold(inst, owner)

  owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe")

  owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold")

  owner.AnimState:Show("ARM_carry")

  owner.AnimState:Hide("ARM_normal")

  end

  替换为:

  local function pickup(inst, owner)

  local range = 3

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

  local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range)

  for k,v in pairs(ents) do

  if v:HasTag("tree") and v.components.workable and v.components.workable.workleft > 0 then

  v.components.workable:Destroy(GetPlayer())

  end

  end

  inst.SoundEmitter:PlaySound("dontstarve/forest/treeCrumble")

  end

  local function onequipgold(inst, owner)

  if owner.components.inventory:Has("lightbulb", 1) then

  inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end)

  owner.components.inventory:ConsumeByName("lightbulb", 1)

  end

  owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe")

  owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold")

  owner.AnimState:Show("ARM_carry")

  owner.AnimState:Hide("ARM_normal")

  end

  local function onunequipgold(inst, owner)

  owner.AnimState:Hide("ARM_carry")

  owner.AnimState:Show("ARM_normal")

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

  end

  2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold )

  即可拿黄金斧子自动放倒身边的树(类似电锯),效率极高,且不留树根,方便种新树。电动斧子需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动砍树了

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

责任编辑:Shy夏夏

上一页 321 322 323 324 325 326 327 328 329 330 331 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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