饥荒实用修改技巧更新 下载本文

rock2:PushEvent("growfromash") rock2.Transform:SetPosition(pt.x, pt.y, pt.z) inst.components.stackable:Get():Remove() end end

inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy

即可使石矿循环利用

五十七.采矿时50%概率挖出宝石

用记事本打开游戏目录\\data\\scripts\\prefabs\\rocks.lua文件,依次查找以下内容:

inst.components.lootdropper:AddChanceLoot("nitre", 0.25) inst.components.lootdropper:AddChanceLoot("goldnugget", 0.25) inst.components.lootdropper:AddChanceLoot("rocks", 0.6) 在这三句每句的下一行,均插入以下内容:

inst.components.lootdropper:AddChanceLoot("bluegem", 0.5) inst.components.lootdropper:AddChanceLoot("redgem", 0.5) inst.components.lootdropper:AddChanceLoot("orangegem", 0.5) inst.components.lootdropper:AddChanceLoot("yellowgem", 0.5) inst.components.lootdropper:AddChanceLoot("greengem", 0.5)

即可在采矿时50%概率挖出宝石,也可将bluegem(蓝宝石)、redgem(红宝石)、orangegem(橙宝石)、yellowgem(黄宝石)、greengem(绿宝石)换成其他物品(比如koalefant_summer红象、koalefant_winter冬象),并调整0.5(出现概率)为你想要的数字

五十八.每朵花下都有曼德拉草

用记事本打开游戏目录\\data\\scripts\\prefabs\\flower.lua文件,

1.在inst:Remove()的下一行插入以下内容:

inst.components.lootdropper:SpawnLootPrefab("mandrake")

2.在inst:AddComponent("inspectable")的下一行插入以下内容:

inst:AddComponent("lootdropper")

即可在摘花时发现曼德拉草,因为蝴蝶可种为花,等于有无限多的曼德拉草可以采摘 五十

九.花瓣种花(花可移植) 用记

\\data\\scripts\\prefabs\\petals.lua

inst:AddComponent("tradable")的下一行插入下列内容:

local function OnDeploy (inst, pt)

local flower = SpawnPrefab("flower") if flower then

flower:PushEvent("growfrompetals") flower.Transform:SetPosition(pt.x, pt.y, pt.z) inst.components.stackable:Get():Remove() end end

inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy

即可用花瓣种花

六十.生命号角(吹牛角让农田、树杈根、草根、芦苇根、空果树丛迅速长出)

用记事本打开游戏目录\\data\\scripts\\prefabs\\horn.lua文件,

1.在下列内容:

local function onfinished(inst) inst:Remove() end

的下一行插入以下内容:

function growfn(inst, reader)

reader.components.sanity:DoDelta(TUNING.SANITY_LARGE) local range = 30

local pos = Vector3(reader.Transform:GetWorldPosition()) local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) for k,v in pairs(ents) do if v.components.pickable then v.components.pickable:FinishGrowing() end

if v.components.crop then

v.components.crop:DoGrow(TUNING.TOTAL_DAY_TIME*3) end end return true end

2.将下列内容:

inst.components.instrument.range = TUNING.HORN_RANGE inst.components.instrument:SetOnHeardFn(HearHorn)

替换为以下内容:

inst.components.instrument.onheard = growfn

即可在采集过的植物根附近吹牛角,促使植物快速生长出来,但牛角原有让牛跟随功能失效

六十一.神之矛(矛攻击时召唤闪电)

用记事本打开游戏目录\\data\\scripts\\prefabs\\spear.lua文件,

1.在下列内容:

local function onunequip(inst, owner)

owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end

的下一行插入以下内容:

function firefn(inst, reader)

local num_lightnings = 32

reader.components.sanity:DoDelta(TUNING.SANITY_LARGE) reader:StartThread(function() for k = 0, num_lightnings do

local rad = math.random(3, 15) local angle = k*((4*PI)/num_lightnings)

local pos = Vector3(reader.Transform:GetWorldPosition()) + Vector3(rad*math.cos(angle), 0, rad*math.sin(angle))

GetSeasonManager():DoLightningStrike(pos) Sleep(math.random( .3, .5)) end end) return true end

2.将inst.components.weapon:SetDamage(TUNING.SPEAR_DAMAGE)替换为下列内容:

inst.components.weapon:SetDamage(TUNING.SPEAR_DAMAGE*100) inst.components.weapon:SetRange(8, 10) inst.components.weapon.onattack = firefn

即可让矛在攻击时召唤闪电

六十二.装备回旋镖召唤火鸡(打猎

游戏)

用记事本打开游戏目录\\data\\scripts\\prefabs\\boomerang.luainst:AddComponent("inspectable")的下一行插入以下内容:

local function cancreatelight(staff, caster, target, pos) local ground = GetWorld() if ground and pos then

文件,在