第284页:生物传送机
展开二三四.生物传送机(探矿杖左键点生物,右键传送到任意地点)
用记事本打开游戏目录\data\scripts\prefabs\diviningrod.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function onattack(inst, owner, target)
SpawnPrefab("lightning_rod_fx").Transform:SetPosition(target.Transform:GetWorldPosition())
target:AddTag("send")
end
local function canteleport(inst)
return true
end
local function teleport(inst)
local player = GetPlayer()
local range = 3000
local pos = Vector3(player.Transform:GetWorldPosition())
local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range)
for k,v in pairs(ents) do
if v:HasTag("send") then
v.Transform:SetPosition(TheInput:GetWorldPosition():Get())
v:RemoveTag("send")
end
end
end
inst:AddComponent("spellcaster")
inst.components.spellcaster:SetSpellFn(teleport)
inst.components.spellcaster:SetSpellTestFn(canteleport)
inst.components.spellcaster.canusefrominventory = false
inst.components.spellcaster.canuseonpoint = true
inst:AddComponent("weapon")
inst.components.weapon:SetDamage(0)
inst.components.weapon:SetRange(30, 35)
inst.components.weapon:SetOnAttack(onattack)
inst.components.weapon:SetProjectile("bishop_charge")
即可在装备探矿杖时,用鼠标左键点生物(几个都可以),无论走到地图何处,装备探矿杖用鼠标右键点地面,都可将选中的生物传送过来。生物传送机可让群体性动物落单,让不会相遇的动物碰面,调离守护某处的敌人等。探矿杖在科学选项(画着原子)下,用1个树枝、4个噩梦燃料、1个齿轮制造
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏