Skip to content

Instantly share code, notes, and snippets.

@warmist
Created December 20, 2012 21:46
Show Gist options
  • Save warmist/4348846 to your computer and use it in GitHub Desktop.
Save warmist/4348846 to your computer and use it in GitHub Desktop.
{name="corpse explosion",f=function (unit_list,pos)
local items={}
for _,checked_item in pairs(df.global.world.items.other.ANY_CORPSE) do --actually you could iterate over only corpse pieces... But i'm too lazy
if checked_item.flags.on_ground then --add/remove more checks before then if you want to explode not ALL the corpses
table.insert(items,checked_item) --add to the list of target items
end
end
if #items==0 then
print"no corpses"
else
for k,v in pairs(items) do
upos=copyall(v.pos)
dfhack.timeout(100,"ticks",function() dfhack.maps.spawnFlow(upos,6,6,6,50000) end) --this spawns dragonfire after 100 ticks(you could change "100" to e.g. "math.random(0,1000)" for random timeouts)
end
end
end},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment