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

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

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

第173页:千斤锤

展开

一七三.千斤锤(用火腿短棍攻击时,天降巨石将敌人拍扁)

  用记事本打开游戏目录\data\scripts\prefabs\hambat.lua文件,将inst:AddComponent("weapon")替换为以下内容:

  local function onattack(inst, owner, target)

  local pt = target:GetPosition()

  local boulder = SpawnPrefab("thulecite")

  RemovePhysicsColliders(boulder)

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

  boulder.Transform:SetScale(3,3,3)

  boulder:RemoveComponent("inventoryitem")

  boulder.Transform:SetPosition(pt.x, 10, pt.z)

  boulder.falling = boulder:DoPeriodicTask(.01, function() boulder.Physics:SetMotorVelOverride(0,-55,0) end)

  boulder:DoTaskInTime(0.1, function()

  if boulder.falling then boulder.falling:Cancel() boulder.falling = nil end

  GetPlayer().SoundEmitter:PlaySound("dontstarve/creatures/eyeballturret/shotexplo")

  GetPlayer().components.playercontroller:ShakeCamera(boulder, "FULL", 0.5, 0.05, 2, 40)

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

  target:AddTag("NOCLICK")

  MakeInventoryPhysics(target)

  target.AnimState:SetOrientation( ANIM_ORIENTATION.OnGround )

  target.AnimState:SetLayer( LAYER_BACKGROUND )

  target.AnimState:SetSortOrder( 1 )

  target.AnimState:SetPercent("hit", math.random())

  if target.brain then target:SetBrain(nil) end

  if target.components.locomotor then target.components.locomotor:Stop() end

  if target.components.combat then target.components.combat:SetTarget(nil) end

  if target.components.health then target.components.health:SetInvincible(false) end

  target:DoTaskInTime(5, function() target.components.health:Kill() end )

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

  local ents = TheSim:FindEntities(pos.x,0,pos.z, 5)

  for k,v in pairs(ents) do

  if v.components.workable and v.components.workable.workleft > 0 and not v.components.inventoryitem then

  v.components.workable:Destroy(boulder)

  end

  end

  boulder:DoTaskInTime(0.5, function()

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

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

  boulder:Remove()

  end )

  end )

  end

  inst:AddComponent("weapon")

  inst.components.weapon:SetRange(20, 25)

  inst.components.weapon:SetOnAttack(onattack)

  即可在用火腿短棍攻击时,天降巨石将敌人拍扁,并震毁附近的建筑、石头、植物,敌人将在5秒后死亡。火腿短棍在战斗选项(画着两把剑)下,用1个猪皮、2个树枝、2个大肉制造

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

责任编辑:Shy夏夏

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

本文是否解决了您的问题

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