Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ElementSBOMB = elements.allocate("JUH", "SBOMB")
- elements.element(elements.JUH_PT_SBOMB, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_SBOMB, "Name", "BMBL")
- elements.property(elements.JUH_PT_SBOMB, "Description", "Bomb that flies to the left.")
- elements.property(elements.JUH_PT_SBOMB, "Gravity",0)
- local function explodeL(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="BMBL" then
- tpt.set_pressure(x/4, y/4, 1, 1, 50)
- for i=-2,2 do
- for j=-2,2 do
- -- tpt.set_property("temp", 3000, x+i, y+j)
- end
- end
- tpt.set_property("temp", math.huge, x, y)
- tpt.delete(x,y)
- tpt.create(x, y, "BOMB")
- return
- else
- tpt.set_property("vx", -3, x, y)
- end
- end
- end
- end
- tpt.element_func(explodeL,ElementSBOMB)
- local ElementSBOMBR = elements.allocate("JUH", "SBOMBR")
- elements.element(elements.JUH_PT_SBOMBR, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_SBOMBR, "Name", "BMBR")
- elements.property(elements.JUH_PT_SBOMBR, "Description", "Bomb that flies to the right.")
- elements.property(elements.JUH_PT_SBOMBR, "Gravity",0)
- local function explodeR(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="BMBR" then
- tpt.set_pressure(x/4, y/4, 1, 1, 50)
- for i=-2,2 do
- for j=-2,2 do
- -- tpt.set_property("temp", 3000, x+i, y+j)
- end
- end
- -- tpt.set_property("temp", math.huge, x, y)
- tpt.delete(x,y)
- tpt.create(x, y, "BOMB")
- return
- else
- tpt.set_property("vx", 3, x, y)
- end
- end
- end
- end
- tpt.element_func(explodeR,ElementSBOMBR)
- local ElementLBOMB = elements.allocate("JUH", "LBOMB")
- elements.element(elements.JUH_PT_LBOMB, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_LBOMB, "Name", "LBMB")
- elements.property(elements.JUH_PT_LBOMB, "Description", "Light (weak) bomb.")
- local function explodeS(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="LBMB" then
- tpt.set_pressure(x/4, y/4, 1, 1, 50)
- for i=-2,2 do
- for j=-2,2 do
- tpt.set_property("temp", 3000, x+i, y+j)
- end
- end
- tpt.set_property("temp", math.huge, x, y)
- tpt.delete(x,y)
- tpt.create(x, y, "EMBR")
- local id = tpt.get_property("type", x, y)
- tpt.delete(x,y)
- simulation.createParts(x,y,4,4,id,0,1)
- for i,nx,ny in sim.neighbors(x,y,5,5) do
- sim.partProperty(i, sim.FIELD_TEMP, 3000)
- sim.partProperty(i, sim.FIELD_LIFE, 50)
- end
- return
- else
- end
- end
- end
- end
- tpt.element_func(explodeS,ElementLBOMB)
- local ElementBBOMB = elements.allocate("JUH", "BBOMB")
- elements.element(elements.JUH_PT_BBOMB, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_BBOMB, "Name", "BBMB")
- elements.property(elements.JUH_PT_BBOMB, "Description", "Big (cluster) bomb.")
- local function explodeB(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="BBMB" then
- tpt.set_pressure(x/4, y/4, 1, 1, 150)
- for i=-2,2 do
- for j=-2,2 do
- -- tpt.set_property("temp", 3000, x+i, y+j)
- end
- end
- -- tpt.set_property("temp", math.huge, x, y)
- tpt.delete(x,y)
- tpt.create(x, y, "BOMB")
- local id = tpt.get_property("type", x, y)
- tpt.delete(x,y)
- simulation.createParts(x,y,4,4,id)
- sim.partCreate(-3, x, y, 1)
- sim.partCreate(-3, x+2, y, 1)
- sim.partCreate(-3, x-2, y, 1)
- sim.partCreate(-3, x, y+2, 1)
- sim.partCreate(-3, x, y-2, 1)
- return
- else
- end
- end
- end
- end
- tpt.element_func(explodeB,ElementBBOMB)
- local ElementFBOMB = elements.allocate("JUH", "FBOMB")
- elements.element(elements.JUH_PT_FBOMB, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_FBOMB, "Name", "FBMB")
- elements.property(elements.JUH_PT_FBOMB, "Description", "Fire bomb.")
- local function explodeF(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="FBMB" and tpt.element(tpt.get_property("type", x+i, y+j))~="FIRE" and tpt.element(tpt.get_property("type", x+i, y+j))~="SMKE" then
- tpt.set_pressure(x/4, y/4, 1, 1, 150)
- for i=-2,2 do
- for j=-2,2 do
- -- tpt.set_property("temp", 3000, x+i, y+j)
- end
- end
- tpt.delete(x,y)
- tpt.create(x, y, "FIRE")
- local id = tpt.get_property("type", x, y)
- tpt.delete(x,y)
- simulation.createParts(x,y,6,6,id)
- return
- else
- simulation.createParts(x,y,1,1,4)
- end
- end
- end
- end
- tpt.element_func(explodeF,ElementFBOMB)
- local ElementBULLET = elements.allocate("JUH", "BULLET")
- elements.element(elements.JUH_PT_BULLET, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_BULLET, "Name", "BULT")
- elements.property(elements.JUH_PT_BULLET, "Description", "Bullet, destroys pixels on impact.")
- local function explodeBull(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="BULT" then
- --tpt.set_pressure(x/4, y/4, 1, 1, 150)
- for i=-2,2 do
- for j=-2,2 do
- -- tpt.set_property("temp", 3000, x+i, y+j)
- end
- end
- tpt.delete(x,y)
- simulation.createParts(x,y,2,2,0,1,1)
- return
- else
- end
- end
- end
- end
- tpt.element_func(explodeBull,ElementBULLET)
- local ElementFBULLET = elements.allocate("JUH", "FBULLET")
- elements.element(elements.JUH_PT_FBULLET, elements.element(elements.DEFAULT_PT_BOMB))
- elements.property(elements.JUH_PT_FBULLET, "Name", "FWBT")
- elements.property(elements.JUH_PT_FBULLET, "Description", "Firework bullet.")
- local function explodeFRBull(i,x,y,s,n)
- for i=-1,1 do
- for j=-1,1 do
- if tpt.get_property("type", x+i, y+j)~=0 and tpt.element(tpt.get_property("type", x+i, y+j))~="FWBT" and tpt.element(tpt.get_property("type", x+i, y+j))~="EMBR" then
- --tpt.set_pressure(x/4, y/4, 1, 1, 150)
- for i=-2,2 do
- for j=-2,2 do
- -- tpt.set_property("temp", 3000, x+i, y+j)
- tpt.delete(x,y)
- local part = tpt.create(x+i, y+j, "FIRW")
- tpt.set_property("tmp",1,part)
- end
- end
- return
- else
- end
- end
- end
- end
- tpt.element_func(explodeFRBull, ElementFBULLET)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement