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

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

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

第256页:小冰山

展开

二五六.小冰山(用铥矿碎片种小冰山,靠近可解暑,无限开采冰和永冻冰,吃了能降温)

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

  local function makeiceberg(inst)

  local pt = inst:GetPosition()

  local iceberg = SpawnPrefab("thulecite_pieces")

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

  iceberg.AnimState:SetBank("ice_boulder")

  iceberg.AnimState:SetBuild("ice_boulder")

  iceberg.AnimState:PlayAnimation("full")

  iceberg.Transform:SetScale(2, 2, 2)

  iceberg:AddComponent("named")

  iceberg.components.named:SetName("Ice")

  local minimap = iceberg.entity:AddMiniMapEntity()

  minimap:SetIcon( "iceboulder.png" )

  MakeObstaclePhysics(iceberg, 1)

  MakeLargeBurnable(iceberg)

  iceberg.AnimState:SetBloomEffectHandle("shaders/anim.ksh")

  iceberg.entity:AddLight()

  iceberg.Light:SetFalloff(1)

  iceberg.Light:SetIntensity(.8)

  iceberg.Light:SetRadius(7)

  iceberg.Light:SetColour(255/255,255/255,255/255)

  iceberg.Light:Enable(true)

  iceberg:RemoveComponent("edible")

  iceberg:RemoveComponent("tradable")

  iceberg:RemoveComponent("inventoryitem")

  iceberg:RemoveComponent("stackable")

  iceberg:RemoveComponent("bait")

  iceberg:RemoveComponent("repairer")

  iceberg:RemoveComponent("deployable")

  iceberg:RemoveTag("molebait")

  iceberg:AddComponent("heater")

  iceberg.components.heater.iscooler = true

  iceberg.components.heater.heatfn = function(iceberg) return -40 end

  iceberg:AddComponent("workable")

  iceberg.components.workable:SetWorkAction(ACTIONS.MINE)

  iceberg.components.workable:SetWorkLeft(30)

  iceberg.components.workable:SetOnWorkCallback(function(iceberg)

  iceberg.components.workable:SetWorkLeft(30)

  local pt1 = iceberg:GetPosition()

  if math.random()<.2 then

  local icecream = SpawnPrefab("thulecite_pieces")

  icecream.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 3, pt1.z+(math.random(3)-math.random(3)))

  icecream.AnimState:SetBank("ice")

  icecream.AnimState:SetBuild("ice")

  icecream.AnimState:PlayAnimation("f1")

  icecream:RemoveComponent("edible")

  icecream:RemoveComponent("tradable")

  icecream:RemoveComponent("stackable")

  icecream:RemoveComponent("bait")

  icecream:RemoveComponent("repairer")

  icecream:RemoveComponent("deployable")

  icecream:RemoveTag("molebait")

  icecream:AddComponent("named")

  icecream.components.named:SetName("Ice")

  icecream.components.inventoryitem.imagename = "ice"

  icecream:AddComponent("edible")

  icecream.components.edible.foodtype = "SEEDS"

  icecream.components.edible.healthvalue = TUNING.HEALING_TINY/2

  icecream.components.edible.hungervalue = TUNING.CALORIES_TINY/4

  icecream.components.edible:SetOnEatenFn(function(icecream, eater)

  if eater and eater.components.temperature then

  local temp = eater.components.temperature:GetCurrent()

  eater.components.temperature:SetTemperature(temp - 70)

  end

  end )

  icecream.components.edible.degrades_with_spoilage = false

  icecream:AddTag("icecream")

  elseif math.random()<.4 then

  local ice = SpawnPrefab("ice")

  ice.Transform:SetPosition(pt1.x+(math.random(3)-math.random(3)), 3, pt1.z+(math.random(3)-math.random(3)))

  end

  end )

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

  SpawnPrefab("ground_chunks_breaking").Transform:SetPosition(iceberg.Transform:GetWorldPosition())

  iceberg:Remove()

  end )

  iceberg:AddTag("iceberg")

  end

  local function OnDeploy (inst, pt)

  makeiceberg(inst)

  inst.components.stackable:Get():Remove()

  end

  inst:AddComponent("deployable")

  inst.components.deployable.ondeploy = OnDeploy

  local function onsave(inst, data)

  if inst:HasTag("iceberg") then

  data.iceberg = true

  end

  if inst:HasTag("icecream") then

  data.icecream = true

  end

  end

  local function onload(inst, data)

  if data and data.iceberg then

  makeiceberg(inst)

  inst:Remove()

  end

  if data and data.icecream then

  inst.AnimState:SetBank("ice")

  inst.AnimState:SetBuild("ice")

  inst.AnimState:PlayAnimation("f1")

  inst:RemoveComponent("edible")

  inst:RemoveComponent("tradable")

  inst:RemoveComponent("stackable")

  inst:RemoveComponent("bait")

  inst:RemoveComponent("repairer")

  inst:RemoveComponent("deployable")

  inst:RemoveTag("molebait")

  inst:AddComponent("named")

  inst.components.named:SetName("Ice")

  inst.components.inventoryitem.imagename = "ice"

  inst:AddComponent("edible")

  inst.components.edible.foodtype = "SEEDS"

  inst.components.edible.healthvalue = TUNING.HEALING_TINY/2

  inst.components.edible.hungervalue = TUNING.CALORIES_TINY/4

  inst.components.edible:SetOnEatenFn(function(inst, eater)

  if eater and eater.components.temperature then

  local temp = eater.components.temperature:GetCurrent()

  eater.components.temperature:SetTemperature(temp - 70)

  end

  end )

  inst.components.edible.degrades_with_spoilage = false

  inst:AddTag("icecream")

  end

  end

  inst.OnSave = onsave

  inst.OnLoad = onload

  即可用铥矿碎片种小冰山(拿着1个铥矿碎片对地面点鼠标右键,如果拿着多个,则不会种出来),靠近可解暑。用锄头凿冰山,有一定概率获得冰和永冻冰(不会腐烂且不可堆叠的是永冻冰),永冻冰可食用,吃了能降温,如果没有中暑就不要吃,否则会冻伤。不想要小冰山了,烧掉即可。不要与“用铥矿碎片种猴子桶”一同修改

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

责任编辑:Shy夏夏

上一页 251 252 253 254 255 256 257 258 259 260 261 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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