Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local wick = elements.allocate("ELEMENT", "WICK")
- elements.element(wick, elements.element(elements.DEFAULT_PT_DMND))
- elements.property(wick, "Name", "WICK")
- elements.property(wick, "Description", "WICK. A wick for your NITR lamp.")
- elements.property(wick, "Colour", 0xECD5A6)
- elements.property(wick, "AirLoss", 0)
- elements.property(wick, "HeatConduct", 0)
- local function wickUpdate(i,x,y,s,nt)
- local clife = tpt.get_property("life", i)
- local ctmp = tpt.get_property("tmp", i)
- local dx = math.random(-3,3)
- local dy = math.random(-3,3)
- if nt > 0 then
- if tpt.get_property("type", x+dx, y+dy) == elements.ELEMENT_PT_WICK then
- local klife = tpt.get_property("life", x+dx, y+dy)
- tpt.set_property("life", math.ceil((clife+klife)/2), i)
- tpt.set_property("life", math.floor((clife+klife)/2), x+dx, y+dy)
- end
- if clife < 250 and tpt.get_property("type", x+dx, y+dy) == 8 then
- tpt.set_property("life", clife + 250, i)
- tpt.set_property("type", 0, x+dx, y+dy)
- end
- if ctmp == 0 and (tpt.get_property("type", x+dx, y+dy) == 4 or tpt.get_property("type", x+dx, y+dy) == 49) then
- tpt.set_property("tmp", 1, i)
- end
- end
- if ctmp == 1 then
- if clife > 0 then
- tpt.set_property("life", clife - 1, i)
- for kx=-1,1 do
- for ky=-1,1 do
- tpt.create(x+kx, y+ky, "FIRE")
- end
- end
- else
- for kx=-1,1 do
- for ky=-1,1 do
- tpt.create(x+kx, y+ky, "FIRE")
- end
- end
- tpt.delete(i)
- end
- end
- end
- elements.property(wick, "Update", wickUpdate)
Advertisement
Add Comment
Please, Sign In to add comment