v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
24
assets/devel/stats/effects/devshooter/devshooter.lua
Normal file
24
assets/devel/stats/effects/devshooter/devshooter.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require "/scripts/vec2.lua"
|
||||
|
||||
function init()
|
||||
script.setUpdateDelta(20)
|
||||
end
|
||||
|
||||
function update(dt)
|
||||
local targetIds = world.entityQuery(mcontroller.position(), 30, {
|
||||
withoutEntityId = entity.id(),
|
||||
includedTypes = {"creature"},
|
||||
order = "nearest"
|
||||
})
|
||||
|
||||
for i,id in ipairs(targetIds) do
|
||||
if entity.isValidTarget(id) and not world.lineTileCollision(mcontroller.position(), world.entityPosition(id)) then
|
||||
local directionTo = vec2.norm(world.distance(world.entityPosition(id), mcontroller.position()))
|
||||
world.spawnProjectile("teslabolt", mcontroller.position(), entity.id(), directionTo, false, {speed = 100, power = 999})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function uninit()
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue