第386页:吃触手皮周围生触手
展开三三六.吃触手皮周围生触手
用记事本打开游戏目录\data\DLC0001\scripts\prefabs\tentaclespots.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
function tentaclesfn(inst, reader)
local pt = Vector3(reader.Transform:GetWorldPosition())
local numtentacles = 9
reader:StartThread(function()
for k = 1, numtentacles do
local theta = math.random() * 2 * PI
local radius = math.random(9, 24)
local result_offset = FindValidPositionByFan(theta, radius, 12, function(offset)
local x,y,z = (pt + offset):Get()
local ents = TheSim:FindEntities(x,y,z , 1)
return not next(ents)
end)
if result_offset then
local tentacle = SpawnPrefab("tentacle")
tentacle.Transform:SetPosition((pt + result_offset):Get())
GetPlayer().components.playercontroller:ShakeCamera(reader, "FULL", 0.2, 0.02, .25, 40)
local fx = SpawnPrefab("splash_ocean")
local pos = pt + result_offset
fx.Transform:SetPosition(pos.x, pos.y, pos.z)
tentacle.sg:GoToState("attack_pre")
end
Sleep(.33)
end
end)
return true
end
inst:AddComponent("edible")
inst.components.edible:SetOnEatenFn(tentaclesfn)
即可吃触手皮周围生9个触手,这不是用来保护主角的,而是为了不让触手绝种,所以不要在基地周围吃触手皮
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏