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

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

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

第211页:无限进化

展开

二一一.无限进化(给远古祭坛500个黄金,升级主角血量、饥饿、脑最大值各100点)

  1.用记事本打开游戏目录\data\DLC0001\scripts\prefabs\player_common.lua文件,将下列内容:

  inst:AddComponent("health")

  inst.components.health:SetMaxHealth(TUNING.WILSON_HEALTH)

  inst.components.health.nofadeout = true

  -------

  inst:AddComponent("hunger")

  inst.components.hunger:SetMax(TUNING.WILSON_HUNGER)

  inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE)

  inst.components.hunger:SetKillRate(TUNING.WILSON_HEALTH/TUNING.STARVE_KILL_TIME)

  inst:AddComponent("sanity")

  inst.components.sanity:SetMax(TUNING.WILSON_SANITY)

  inst.components.sanity.onSane = OnSane

  inst.components.sanity.onInsane = OnInsane

  替换为:

  local function newupgrades(inst)

  inst.components.health.maxhealth = TUNING.WILSON_HEALTH + inst.level_num*100

  inst.components.hunger.max = TUNING.WILSON_HUNGER + inst.level_num*100

  inst.components.sanity.max = TUNING.WILSON_SANITY + inst.level_num*100

  end

  inst.level_num = 0

  inst:AddComponent("health")

  inst.components.health:SetMaxHealth(TUNING.WILSON_HEALTH + inst.level_num*100)

  inst.components.health.nofadeout = true

  inst:AddComponent("hunger")

  inst.components.hunger:SetMax(TUNING.WILSON_HUNGER + inst.level_num*100)

  inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE)

  inst.components.hunger:SetKillRate(TUNING.WILSON_HEALTH/TUNING.STARVE_KILL_TIME)

  inst:AddComponent("sanity")

  inst.components.sanity:SetMax(TUNING.WILSON_SANITY + inst.level_num*100)

  inst.components.sanity.onSane = OnSane

  inst.components.sanity.onInsane = OnInsane

  newupgrades(inst)

  local function onsave(inst, data)

  data.level_num = inst.level_num

  end

  local function onload(inst, data)

  inst.level_num = data.level_num or 0

  inst.components.health.maxhealth = TUNING.WILSON_HEALTH + inst.level_num*100

  inst.components.hunger.max = TUNING.WILSON_HUNGER + inst.level_num*100

  inst.components.sanity.max = TUNING.WILSON_SANITY + inst.level_num*100

  if data.health and data.health.health then inst.components.health.currenthealth = data.health.health end

  if data.hunger and data.hunger.hunger then inst.components.hunger.current = data.hunger.hunger end

  if data.sanity and data.sanity.current then inst.components.sanity.current = data.sanity.current end

  end

  inst.OnSave = onsave

  inst.OnLoad = onload

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

  local function ShouldAcceptItem(inst, item)

  local player = GetPlayer()

  if player.components.inventory:Has("goldnugget", 500) then

  if item.prefab == "goldnugget" then

  return true

  end

  end

  return false

  end

  local function OnGetItemFromPlayer(inst, giver, item)

  if item.prefab == "goldnugget" then

  giver.components.inventory:ConsumeByName("goldnugget", 499)

  giver.level_num = giver.level_num + 1

  inst.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup")

  giver.HUD.controls.status.heart:PulseGreen()

  giver.HUD.controls.status.stomach:PulseGreen()

  giver.HUD.controls.status.brain:PulseGreen()

  giver.HUD.controls.status.brain:ScaleTo(1.3,1,.7)

  giver.HUD.controls.status.heart:ScaleTo(1.3,1,.7)

  giver.HUD.controls.status.stomach:ScaleTo(1.3,1,.7)

  giver.components.health.maxhealth = TUNING.WILSON_HEALTH + giver.level_num*100

  giver.components.hunger.max = TUNING.WILSON_HUNGER + giver.level_num*100

  giver.components.sanity.max = TUNING.WILSON_SANITY + giver.level_num*100

  giver.components.health:DoDelta(giver.components.health.maxhealth)

  giver.components.hunger:DoDelta(giver.components.hunger.max)

  giver.components.sanity:DoDelta(giver.components.sanity.max)

  end

  end

  inst:AddComponent("trader")

  inst.components.trader.onaccept = OnGetItemFromPlayer

  inst.components.trader:SetAcceptTest(ShouldAcceptItem)

  即可给远古祭坛500个黄金(拿着黄金对远古祭坛按鼠标左键),升级主角血量、饥饿、脑最大值各100点,升级无上限,身上黄金不足500时不会升级。如果缺少黄金,可以修改“菜市场”、“肉食店”、“流动商贩”、“杂货收购行”、“收藏品黑市”、“收藏品期货市场”等交易系统赚取黄金(见本修改技巧)。用机器人(wx78)、大力士(沃尔夫冈)作主角时,不要修改此项

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

责任编辑:Shy夏夏

上一页 211 212 213 214 215 216 217 218 219 220 221 下一页
友情提示:支持键盘左右键“← →”翻页

本文是否解决了您的问题

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