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

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

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

第233页:垃圾洞

展开

二三三.垃圾洞(用饥饿腰带种垃圾洞,不想要的物品可扔进去销毁,夜晚自燃,白天熄灭)

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

  local function wastehole(inst)

  local pt = inst:GetPosition()

  local wastehole = SpawnPrefab("armorslurper")

  wastehole.Transform:SetPosition(pt.x, pt.y, pt.z)

  wastehole.AnimState:SetBank("tentaclepillar")

  wastehole.AnimState:SetBuild("tentacle_pillar")

  wastehole.AnimState:PlayAnimation("idle_hole",true)

  wastehole.Transform:SetScale(0.5, 0.5, 0.5)

  wastehole.entity:AddSoundEmitter()

  MakeObstaclePhysics(wastehole, .5)

  wastehole:RemoveComponent("inventoryitem")

  wastehole:RemoveComponent("equippable")

  wastehole:RemoveComponent("fueled")

  wastehole:RemoveComponent("deployable")

  wastehole:RemoveTag("fur")

  wastehole:RemoveTag("ruins")

  local minimap = wastehole.entity:AddMiniMapEntity()

  minimap:SetIcon( "firepit.png" )

  wastehole:AddComponent("burnable")

  wastehole.components.burnable:SetFXLevel(5)

  wastehole.components.burnable:AddBurnFX("character_fire", Vector3(0,1.5,0) )

  wastehole:ListenForEvent("onignite", function()

  wastehole:AddComponent("heater")

  wastehole.components.heater.heat = 50

  end )

  wastehole:ListenForEvent("onextinguish", function()

  wastehole.SoundEmitter:PlaySound("dontstarve/common/fireOut")

  if wastehole.components.heater then wastehole:RemoveComponent("heater") end

  end )

  wastehole:ListenForEvent( "daytime", function() wastehole.components.burnable:Extinguish() end , GetWorld())

  wastehole:ListenForEvent( "dusktime", function() wastehole.components.burnable:Ignite(true) end , GetWorld())

  wastehole:ListenForEvent( "nighttime", function() wastehole.components.burnable:Ignite(true) end , GetWorld())

  if GetClock():IsDay() then

  wastehole.components.burnable:Extinguish()

  else

  wastehole.components.burnable:Ignite(true)

  end

  wastehole:AddComponent("workable")

  wastehole.components.workable:SetWorkAction(ACTIONS.HAMMER)

  wastehole.components.workable:SetWorkLeft(3)

  wastehole.components.workable:SetOnFinishCallback(function(wastehole)

  SpawnPrefab("collapse_big").Transform:SetPosition(wastehole.Transform:GetWorldPosition())

  GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood")

  wastehole:Remove()

  end )

  local slotpos = { Vector3(0,-75,0)}

  wastehole:AddComponent("container")

  wastehole.components.container:SetNumSlots(#slotpos)

  wastehole.components.container.widgetslotpos = slotpos

  wastehole.components.container.widgetpos = Vector3(0,600,0)

  wastehole.components.container.side_align_tip = 160

  wastehole.components.container.itemtestfn = function(wastehole, item, slot)

  if item.prefab == "teleportato_ring" or item.prefab == "teleportato_box" or item.prefab == "teleportato_crank" or item.prefab == "teleportato_potato" or item.prefab == "chester_eyebone" or item.prefab == "abigail_flower" or item.prefab == "lucy" or item.prefab == "balloons_empty" or item.prefab == "lighter" or item.prefab == "waxwelljournal" then

  return false

  end

  return true

  end

  wastehole:DoPeriodicTask(0.25, function(wastehole)

  if not wastehole.components.container:IsEmpty() then

  wastehole.components.container:DestroyContents()

  wastehole.SoundEmitter:PlaySound("dontstarve/common/destroy_stone")

  local pt0 = wastehole:GetPosition()

  SpawnPrefab("collapse_small").Transform:SetPosition(pt0.x, 1, pt0.z)

  end

  end )

  wastehole:AddTag("wastehole")

  end

  local function OnDeploy (inst, pt)

  wastehole(inst)

  inst:Remove()

  end

  inst:AddComponent("deployable")

  inst.components.deployable.ondeploy = OnDeploy

  local function onsave(inst, data)

  if inst:HasTag("wastehole") then

  data.wastehole = true

  end

  end

  local function onload(inst, data)

  if data and data.wastehole then

  wastehole(inst)

  inst:Remove()

  end

  end

  inst.OnSave = onsave

  inst.OnLoad = onload

  即可用饥饿腰带种垃圾洞,除重要物品外(如露西斧子等),任何不想要的物品都可以扔进去销毁(拿着物品对垃圾洞点鼠标左键),再也不用发愁垃圾越来越多了。垃圾洞里有沼气,在夜晚时会自燃,白天熄灭,可用于照明和取暖,但不能用来烤食物。垃圾洞在小地图上显示为石头营火的图标,不想要垃圾洞时,用锤子砸毁即可。饥饿腰带在魔法选项(画着红骷髅)下,用6个啜食者皮、2个绳子、2个噩梦燃料制造

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

责任编辑:Shy夏夏

上一页 231 232 233 234 235 236 237 238 239 240 241 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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