This commit is contained in:
Aria 2025-03-21 22:23:30 +11:00
commit 9c94d113d3
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
10260 changed files with 1237388 additions and 0 deletions

View file

@ -0,0 +1,22 @@
require "/scripts/util.lua"
function die(smash)
local pos = entity.position()
local spreadRange = config.getParameter("spreadRange", 2)
local candidateSpaces = {}
for x = pos[1] - spreadRange, pos[1] + spreadRange do
for y = pos[2] - spreadRange, pos[2] + spreadRange do
table.insert(candidateSpaces, {x, y})
end
end
shuffle(candidateSpaces)
local toPlace = config.getParameter("spreadFactor", 2)
while #candidateSpaces > 0 and toPlace > 0 do
if world.placeObject("greycapsule", candidateSpaces[1], 1, {}) then
toPlace = toPlace - 1
end
table.remove(candidateSpaces, 1)
end
end