Skip to content

Commit 4c69f49

Browse files
committed
Add firestarter.lua (DFHack#37)
1 parent cefdd55 commit 4c69f49

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

firestarter.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--Use while viewing an item, unit inventory, or tile to start fires.
2+
--[====[
3+
4+
firestarter
5+
===========
6+
Lights things on fire, items, locations, entire inventories even!
7+
8+
]====]
9+
local tinder
10+
if dfhack.gui.getCurFocus() == 'item' then
11+
tinder=dfhack.gui.getCurViewscreen().item
12+
tinder.flags.on_fire=true
13+
elseif dfhack.gui.getSelectedUnit(true) then
14+
tinder=dfhack.gui.getSelectedUnit(true).inventory
15+
for k,v in ipairs(tinder) do
16+
tinder[k].item.flags.on_fire=true
17+
end
18+
elseif df.global.ui_advmode.menu==1 then
19+
local curpos=df.global.cursor
20+
df.global.world.fires:insert('#',{new=df.fire})
21+
local hot = df.global.world.fires
22+
for _,k in ipairs(hot) do
23+
if k.temperature==0 then
24+
local spot = k
25+
k.pos.x=curpos.x
26+
k.pos.y=curpos.y
27+
k.pos.z=curpos.z
28+
k.timer=1000
29+
k.temperature=60000
30+
end
31+
end
32+
end

0 commit comments

Comments
 (0)