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

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

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

第171页:收妖镜

展开

一七一.收妖镜(装备铥矿奖章对敌人按右键,将其收入镜中)

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

  local function onequip(inst, owner)

  owner.components.inventory:SetOverflow(inst)

  inst.components.container:Open(owner)

  end

  local function onunequip(inst, owner)

  owner.components.inventory:SetOverflow(nil)

  inst.components.container:Close(owner)

  end

  local function itemtest(inst, item, slot)

  if item:HasTag("catched") then

  return true

  end

  return false

  end

  local slotpos = {}

  for y = 0, 9 do

  table.insert(slotpos, Vector3(-162, -y*75 + 170 ,0))

  end

  local function cancatchmonster(inst, caster, target)

  if target then

  return target.components.locomotor and target.components.health and not target.components.health:IsDead() and not target:HasTag("smallbird") and not target:HasTag("chester")

  end

  return true

  end

  local function catchmonster(staff, target, pos)

  if not inst.components.container:IsFull() then

  if target.components.stackable then target:RemoveComponent("stackable") end

  if target.components.inventoryitem then target:RemoveComponent("inventoryitem") end

  target:AddComponent("inventoryitem")

  target.components.inventoryitem.nobounce = true

  target.components.inventoryitem.canbepickedup = true

  target.components.inventoryitem:ChangeImageName("beard_monster")

  target.components.health.canmurder = true

  target:AddTag("catched")

  target.components.inventoryitem:SetOnDroppedFn(function(target)

  target:RemoveComponent("inventoryitem")

  target:RemoveTag("catched")

  if target.brain then target.brain:Start() end

  if target.sg then target.sg:Start() end

  end )

  target.components.inventoryitem:SetOnPutInInventoryFn(function(target)

  if target.sg then target.sg:GoToState("idle") end

  if target.SoundEmitter then target.SoundEmitter:KillAllSounds() end

  end )

  inst.components.container:GiveItem(target)

  end

  end

  inst:AddComponent("spellcaster")

  inst.components.spellcaster:SetSpellFn(catchmonster)

  inst.components.spellcaster:SetSpellTestFn(cancatchmonster)

  inst.components.spellcaster.canuseontargets = true

  inst.components.spellcaster.canusefrominventory = false

  inst:AddComponent("equippable")

  inst.components.equippable.equipslot = EQUIPSLOTS.HANDS

  inst.components.equippable:SetOnEquip( onequip )

  inst.components.equippable:SetOnUnequip( onunequip )

  inst:AddComponent("container")

  inst.components.container:SetNumSlots(#slotpos)

  inst.components.container.widgetslotpos = slotpos

  inst.components.container.widgetpos = Vector3(18,50,0)

  inst.components.container.side_widget = true

  inst.components.container.itemtestfn = itemtest

  inst.components.container.acceptsstacks = false

  即可在装备铥矿奖章时,对敌人按鼠标右键,将敌人收入镜中(画面右边的格子中,显示为烧焦的兔子),如果想杀死它,就对格子中的敌人按鼠标右键,会获得战利品;如果想释放它,就拿出敌人放在地上。“收妖镜”的格子全满后,无法再收新的敌人,可以将敌人放在物品栏或其他背包后再收妖。在存档退出前,请处置(杀掉或释放)全部收来的敌人,否则读档后,敌人将全部被放出。铥矿奖章在远古选项(画着远古祭坛)下,用2个铥矿石、2个噩梦燃料制造,制造时需要靠近远古祭坛

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

责任编辑:Shy夏夏

上一页 171 172 173 174 175 176 177 178 179 180 181 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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