Advertisement
RCAProduction

RCA's HUD Version XII

Sep 29th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 39.49 KB | None | 0 0
  1. --RCA's HUD
  2. --Please use cracker64's script manager
  3. --VER 12 UPDATE {Not Available At Current Time}
  4.  
  5. --Version 3
  6.  
  7. print("RCA's HUD")
  8. print("Version XII")
  9. print("Have Fun!")
  10.  
  11. function DrawHUD()
  12.    
  13. function mouseclicky(mousex, mousey, button, event)
  14.         if (event == 1) then
  15.             var5 = 1
  16.             end
  17.         if (event == 2) then
  18.             var5 = 2
  19.             end
  20.         end
  21.    
  22. function keyclicky(key, nkey, modifier, event)
  23.         if (key == "." and event == 1) then
  24.             var6 = 1
  25.             else
  26.             var6 = 2
  27.             end
  28.         if (key == "," and event == 1) then
  29.             var7 = 1
  30.             else
  31.             var7 = 2
  32.             end
  33.         if (key == "z" and event == 1) then
  34.             var8 = 1
  35.             else
  36.             var8 = 2
  37.             end
  38.         if (key == "=" and event == 1) then
  39.             var10 = 1
  40.             end
  41.         if (key == "-" and event == 1) then
  42.             var10 = 2
  43.             end
  44.         end
  45.    
  46.     tpt.register_keypress(keyclicky)
  47.     tpt.register_mouseclick(mouseclicky)
  48.        
  49.     if var7 == 1 then
  50.         var9 =  1
  51.         end
  52.     if var6 == 1 then
  53.         var9 = 2
  54.         end
  55.    
  56.     if var9 == 1 then
  57.         vis1 = 0
  58.         var10 = 2
  59.         var8 = 1
  60.         else
  61.         vis1 = 200
  62.         end
  63.    
  64.     if var10 == 1 then
  65.         vis2 = 200
  66.         else
  67.         vis2 = 0
  68.         end
  69.    
  70.     if var8 ~= 1 then
  71.         vis3 = 150
  72.         else
  73.         vis3 = 0
  74.         end
  75.    
  76.    
  77.     if tpt.mousex >= 611 then
  78.         x2 = 611
  79.         else
  80.         x2 = tpt.mousex
  81.         end
  82.    
  83.     if tpt.mousey >= 383 then
  84.         y2 = 383
  85.         else
  86.         y2 = tpt.mousey
  87.         end
  88.    
  89.     local x, y = sim.adjustCoords(x2, y2)
  90.    
  91.     if tpt.get_property("type", x, y) >= 1 then
  92.         ptype = tpt.element(tpt.get_property("type", x, y))
  93.         else
  94.         ptype = "Empty,"
  95.         end
  96.    
  97.     if tpt.get_property("type", x, y) == 6 and tpt.get_property("ctype", x, y) >= 1 then
  98.         ptype = "Molten"
  99.         end
  100.    
  101.     if tpt.get_property("type", x, y) >= 1 then
  102.         var1 = tpt.get_property("temp", x, y)-273.15
  103.         else
  104.         var1 = 293.15
  105.         end
  106.    
  107.     local var2 = var1*100
  108.     local var3 = math.floor(var2)/100
  109.    
  110.     if tpt.get_property("type", x, y) >= 1 then
  111.         temp = var3
  112.         else
  113.         temp = "()"
  114.         end
  115.    
  116.     if tpt.get_property("type", x, y) >= 1 then
  117.         temp2 = math.floor(tpt.get_property("temp", x, y)*10)/10
  118.         else
  119.         temp2 = "()"
  120.         end
  121.    
  122.     if tpt.get_property("type", x, y) >= 1 then
  123.         var12312389 = tpt.get_property("ctype", x, y)
  124.         end
  125.    
  126.     if tpt.get_property("type", x, y) >= 1 and var12312389 >= 0 and var12312389 < sim.PT_NUM then
  127.         ctype = tpt.element(tpt.get_property("ctype", x, y))
  128.         end
  129.    
  130.     if tpt.get_property("type", x, y) == 0 or tpt.get_property("ctype", x, y) < 1 then
  131.         ctype = "()"
  132.         end
  133.    
  134.     if x >= 609 then
  135.         x1 = 609/4
  136.         else
  137.         x1 = x/4
  138.         end
  139.    
  140.     if y >= 381 then
  141.         y1 = 381/4
  142.         else
  143.         y1 = y/4
  144.         end
  145.    
  146.     local var4 = sim.pressure(x1, y1)*100
  147.     local var14 = math.floor(var4)/100
  148.    
  149.     if var14 == "nan" then
  150.         pressure = "Infinite"
  151.         else
  152.         pressure = var14
  153.         end
  154.  
  155.     local parts = tpt.get_numOfParts()
  156.     if tpt.get_property("type", x, y) >= 1 then
  157.         tmp = tpt.get_property("tmp", x, y)
  158.         else
  159.         tmp = "0"
  160.         end
  161.    
  162.     if tpt.get_property("type", x, y) >= 1 then
  163.         life = tpt.get_property("life", x, y)
  164.         else
  165.         life = "0"
  166.         end
  167.    
  168.     if tpt.get_property("type", x, y) >= 1 then
  169.         tmp2 = tpt.get_property("tmp2", x, y)
  170.         else
  171.         tmp2 = "0"
  172.         end
  173.    
  174.     if tpt.get_property("type", x, y) >= 1 then
  175.         var11 = tpt.get_property("vy", x, y)*1000
  176.         else
  177.         var11 = 0
  178.         end
  179.     if var11 <= 9999 or var11 <= -9999 then
  180.         vy = math.floor(var11)/1000
  181.         else
  182.         vy = "Err(2)"
  183.         end
  184.    
  185.     if tpt.get_property("type", x, y) >= 1 then
  186.         var12 = tpt.get_property("vx", x, y)*1000
  187.         else
  188.         var12 = 0
  189.         end
  190.     if var12 <= 9999 or var12 <= -9999 then
  191.         vx = math.floor(var12)/1000
  192.         else
  193.         vx = "Err(1)"
  194.         end
  195.  
  196.     local rclr = 0
  197.     local draw = graphics.drawText
  198.     local rect = graphics.fillRect
  199.  
  200. rect(398, 13, 187, 12, 55, 55, 55, vis1)
  201. rect(398, 27, 200, 12, 55, 55, 55, vis1)
  202. rect(14, 13, 210, 12, 55, 55, 55, vis1)
  203. rect(398, 41, 180, 12, 55, 55, 55, vis2)
  204.  
  205.     --{MAY BE USEFUL LATER???}graphics.drawText(6, 6, os.date("%a %b %d, %l:%M:%S %p"), 0, 255, 165, 200)
  206.     draw(16, 15, os.date(), rclr, 255, 165, vis1)
  207.  
  208.     draw(250, 6, "</> Turn HUD On/Off", rclr, 255, 165, vis3)
  209.     draw(250, 16, "-/+ Extra On/Off", rclr, 255, 165, vis3)
  210.     draw(550, 30, x, rclr, 255, 165, vis1)
  211.     draw(578, 30, y, rclr, 255, 165, vis1)
  212.     draw(541, 30, "X:", rclr, 255, 165, vis1)
  213.     draw(570, 30, "Y:", rclr, 255, 165, vis1)
  214.     draw(435, 15, ctype, rclr, 255, 165, vis1)
  215.     draw(400, 15, ptype, rclr, 255, 165, vis1)
  216.     draw(558, 15, pressure, rclr, 255, 165, vis1)
  217.     draw(465, 15, "Temp:", rclr, 255, 165, vis1)
  218.     draw(465, 30, "Tmp:", rclr, 255, 165, vis1)
  219.     draw(400, 30, "Life:", rclr, 255, 165, vis1)
  220.     draw(535, 15, "Pres:", rclr, 255, 165, vis1)
  221.     draw(160, 15, "Parts:", rclr, 255, 165, vis1)
  222.     draw(490, 15, temp, rclr, 255, 165, vis1)
  223.     draw(485, 30, tmp, rclr, 255, 165, vis1)
  224.     draw(422, 30, life, rclr, 255, 165, vis1)
  225.     draw(187, 15, parts, rclr, 255, 165, vis1)
  226.    
  227.     draw(400, 44, "Tmp2:", rclr, 255, 165, vis2)
  228.     draw(426, 44, tmp2, rclr, 255, 165, vis2)
  229.     draw(465, 44, "VX:", rclr, 255, 165, vis2)
  230.     draw(535, 44, "VY:", rclr, 255, 165, vis2)
  231.     draw(480, 44, vx, rclr, 255, 165, vis2)
  232.     draw(550, 44, vy, rclr, 255, 165, vis2)
  233.     --Useful for programming, shows an element's number (Not name) at mouse X, Y. By default is commented out.
  234.         --draw(550, 54, tpt.get_property("type", x, y), 0, 255, 165, 200)
  235.    
  236. end
  237.  
  238. tpt.hud(0)
  239.  
  240. tpt.register_step(DrawHUD)
  241.  
  242.  
  243. function keyclicky(key, nkey, modifier, event)
  244.         if (key == "m" and event == 1) then
  245.             rtemp = 1
  246.             end
  247.         end
  248.    
  249.     tpt.register_keypress(keyclicky)
  250.  
  251. local counter = 0
  252.     function resettemp()
  253.         counter = (counter + 1)%5
  254.     if counter == 0 and rtemp == 1 then
  255.         sim.resetTemp()
  256.         tpt.set_property("temp", 293.15, "wtrv")
  257.         warning = 1
  258.     end
  259.    
  260.     if warning == 1 then
  261.         graphics.fillRect(14, 27, 219,12, 55, 55, 55, 200)
  262.         graphics.drawText(16, 29, "Realistic Mode Enabled (M) Restart To Reset", 0, 255, 165, 200)
  263.     end
  264. end
  265. tpt.register_step(resettemp)
  266.  
  267. function moo(i, x, y, surround_space, nt)
  268.    if sim.pressure(x/4, y/4)<-7 and sim.partProperty(i, sim.FIELD_LIFE)~=0 and surround_space~=0 then
  269.        sim.partCreate(-1, x+math.random(-3,3), y+math.random(-3,3), elem.DEFAULT_PT_ELEC) end
  270.    end
  271.    tpt.element_func(moo, tpt.el.tung.id, 0)
  272.  
  273.    tpt.el.tung.description="Tungsten. Brittle metal with a very high melting point. When sparked under a pressure of -7, emits electrons."
  274.  
  275. --X-Laser
  276.  
  277. --[[local TASR = elements.allocate("RCA", "XASR")
  278. elements.element(TASR, elements.element(elements.DEFAULT_PT_ARAY))
  279. elements.property(TASR, "Name", "XASR")
  280. elements.property(TASR, "Description", "X-Laser. Works like ARAY. Passes through everything.")
  281. elements.property(TASR, "Colour", 0xE37100)
  282. elements.property(TASR, "HeatConduct", 1)
  283.  
  284. function TASR_update(i, x, y, surround_space, nt)
  285.     if tpt.get_property("type", x-1, y) == 15 then
  286.         sim.createLine(x+1, y, x+700, y, 0, 0, 127)
  287.     end    
  288.     if tpt.get_property("type", x-1, y-1) == 15 then
  289.         sim.createLine(x+1, y+1, x+700, y+700, 0, 0, 127)
  290.     end  
  291.     if tpt.get_property("type", x, y-1) == 15 then
  292.         sim.createLine(x, y+1, x, y+700, 0, 0, 127)
  293.     end  
  294.     if tpt.get_property("type", x+1, y-1) == 15 then
  295.         sim.createLine(x-1, y+1, x-700, y+700, 0, 0, 127)
  296.     end  
  297.         if tpt.get_property("type", x+1, y) == 15 then
  298.         sim.createLine(x-1, y, x-700, y, 0, 0, 127)
  299.     end  
  300.     if tpt.get_property("type", x+1, y+1) == 15 then
  301.         sim.createLine(x-1, y-1, x-700, y-700, 0, 0, 127)
  302.     end  
  303.     if tpt.get_property("type", x, y+1) == 15 then
  304.         sim.createLine(x, y-1, x, y-700, 0, 0, 127)
  305.     end  
  306.     if tpt.get_property("type", x-1, y+1) == 15 then
  307.         sim.createLine(x+1, y-1, x+700, y-700, 0, 0, 127)
  308.     end  
  309. end
  310. tpt.element_func(TASR_update, TASR)]]--
  311.  
  312. --LASR
  313.  
  314. --[[local LASR = elements.allocate("RCA", "LASR")
  315. elements.element(elements.RCA_PT_LASR, elements.element(elements.DEFAULT_PT_ELEC))
  316. elements.property(elements.RCA_PT_LASR, "Name", "LASR")
  317. elements.property(elements.RCA_PT_LASR, "Description", "Laser.")
  318. elements.property(elements.RCA_PT_LASR, "Colour", 0x940002)
  319. elements.property(elements.RCA_PT_LASR, "MenuSection", elem.SC_NUCLEAR)
  320. elements.property(elements.RCA_PT_LASR, "MenuVisible", 1)
  321. elements.property(elements.RCA_PT_LASR, "Temperature", 2000)
  322. --elements.property(elements.RCA_PT_LASR, "Life", 1)
  323. --elements.property(elements.RCA_PT_LASR, "HighTemperature", 7000)
  324.  
  325. function LASR_update(i, x, y, surround_space, nt)
  326.     function keyclicky(key, nkey, modifier, event)
  327.             if (key == "275" and event == 1) then
  328.             rght = 1
  329.             else
  330.             rght = 2
  331.             end
  332.         end
  333.         tpt.register_keypress(keyclicky)
  334.  
  335.         if rght == 1 then
  336.             tpt.parts[i].vx=5
  337.             else
  338.             tpt.parts[i].vx=0
  339.         end
  340.  
  341.                 xvel=tpt.parts[i].vx
  342.                 yvel=tpt.parts[i].vy
  343.  
  344.                     xpos=x+xvel
  345.                     ypos=y+yvel
  346.    
  347.             if xpos >= 608 then
  348.                 tpt.delete(i)
  349.         end
  350.             if ypos >= 380 then
  351.                 tpt.delete(i)
  352.         end
  353.     end
  354.  
  355. tpt.element_func(LASR_update, LASR)]]
  356.        
  357.    
  358.  
  359. --METR Element
  360.  
  361. local METR = elements.allocate("ELEMENT", "METR")
  362. elements.element(elements.ELEMENT_PT_METR, elements.element(elements.DEFAULT_PT_ELEC))
  363. elements.property(elements.ELEMENT_PT_METR, "Name", "METR")
  364. elements.property(elements.ELEMENT_PT_METR, "Description", "Meteors, Explode on impact. Use sparingly.")
  365. elements.property(elements.ELEMENT_PT_METR, "Colour", 0xFF7A0002)
  366. elements.property(elements.ELEMENT_PT_METR, "MenuSection", elem.SC_EXPLOSIVE)
  367. elements.property(elements.ELEMENT_PT_METR, "MenuVisible", 1)
  368. elements.property(elements.ELEMENT_PT_METR, "Weight", 100)
  369. elements.property(elements.ELEMENT_PT_METR, "Temperature", 9999)
  370. local function graphics1(i, colr, colg, colb)
  371.     return 1,0x00010000,255,225,0,210,255,255,255,255
  372. end
  373. tpt.graphics_func(graphics1,METR)
  374.  
  375. local function get_property(prop, x, y)
  376.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  377.         return tpt.get_property(prop, x, y)
  378.     end
  379.     return 0
  380. end
  381.  
  382. math.randomseed(os.time())
  383. function metr_update(i, x, y, s, n)
  384.     if tpt.get_property("tmp",i)==0 then
  385.         tpt.parts[i].tmp=1
  386.         randvel=math.random(-20,20)/10
  387.         tpt.parts[i].vx=randvel
  388.         tpt.parts[i].vy=math.sqrt(8-(randvel^2))
  389.     end
  390.  
  391.     xvel=tpt.get_property("vx",i)/2
  392.     yvel=tpt.get_property("vy",i)/2
  393.     if yvel <= 0 or math.abs(xvel) > 1 then
  394.         tpt.delete(i)
  395.     end
  396.  
  397.     xpos=x-xvel
  398.     ypos=y-yvel
  399.     elemtype=get_property("type",xpos,ypos)
  400.  
  401.     if elemtype == 0 then
  402.         tpt.create(xpos,ypos,"bray")
  403.         tpt.set_property("temp",5000,xpos,ypos)
  404.     end
  405.     tpt.parts[i].temp=9999
  406.  
  407.     elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  408.     elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  409.     elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  410.     elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  411.     elemtype21=get_property("type",x+xvel,y+yvel)
  412.     if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_METR and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  413.         tpt.set_property("type","bomb",i)
  414.         tpt.set_property("life",0,i)
  415.         tpt.set_property("tmp",0,i)
  416.         elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_METR and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  417.             tpt.set_property("type","bomb",i)
  418.             tpt.set_property("life",0,i)
  419.             tpt.set_property("tmp",0,i)
  420.             elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_METR and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  421.                 tpt.set_property("type","bomb",i)
  422.                 tpt.set_property("life",0,i)
  423.                 tpt.set_property("tmp",0,i)
  424.                 elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_METR and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  425.                     tpt.set_property("type","bomb",i)
  426.                     tpt.set_property("life",0,i)
  427.                     tpt.set_property("tmp",0,i)
  428.                     elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_METR and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  429.                         tpt.set_property("type","bomb",i)
  430.                         tpt.set_property("life",0,i)
  431.                         tpt.set_property("tmp",0,i)
  432.                     end
  433.                 end
  434.  
  435.                 tpt.element_func(metr_update, elements.ELEMENT_PT_METR,1)
  436.  
  437. --BMBR Element {RCA}
  438.  
  439. local BMBR = elements.allocate("ELEMENT", "BMBR")
  440. elements.element(elements.ELEMENT_PT_BMBR, elements.element(elements.DEFAULT_PT_ELEC))
  441. elements.property(elements.ELEMENT_PT_BMBR, "Name", "BMBR")
  442. elements.property(elements.ELEMENT_PT_BMBR, "Description", "Right Shooting Bomb.")
  443. elements.property(elements.ELEMENT_PT_BMBR, "Colour", 0xFF31CBD9)
  444. elements.property(elements.ELEMENT_PT_BMBR, "MenuSection", elem.SC_EXPLOSIVE)
  445. elements.property(elements.ELEMENT_PT_BMBR, "MenuVisible", 1)
  446. elements.property(elements.ELEMENT_PT_BMBR, "Weight", 100)
  447. elements.property(elements.ELEMENT_PT_BMBR, "Temperature", 9999)
  448. local function graphics1(i, colr, colg, colb)
  449.     return 1,0x00010000,255,225,0,210,255,255,255,255
  450. end
  451. tpt.graphics_func(graphics1,BMBR)
  452.  
  453. local function get_property(prop, x, y)
  454.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  455.         return tpt.get_property(prop, x, y)
  456.     end
  457.     return 0
  458. end
  459.  
  460. math.randomseed(os.time())
  461. function BMBR_update(i, x, y, s, n)
  462.     if tpt.get_property("tmp",i)==0 then
  463.         tpt.parts[i].tmp=1
  464.                 --randvel=math.random(-20,20)/10
  465.                 tpt.parts[i].vx=3
  466.                 tpt.parts[i].vy=0
  467.             end
  468.  
  469.             xvel=3
  470.             yvel=0
  471.             if math.abs(xvel) < 1 then
  472.                 tpt.delete(i)
  473.             end
  474.  
  475.             xpos=x-xvel
  476.             ypos=y-yvel
  477.             elemtype=get_property("type",xpos,ypos)
  478.  
  479.             if elemtype == 0 then
  480.                 tpt.create(xpos,ypos,"bray")
  481.                 tpt.set_property("temp",5000,xpos,ypos)
  482.             end
  483.             tpt.parts[i].temp=9999
  484.  
  485.             elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  486.             elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  487.             elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  488.             elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  489.             elemtype21=get_property("type",x+xvel,y+yvel)
  490.             if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_BMBR and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  491.                 tpt.set_property("type","bomb",i)
  492.                 tpt.set_property("life",0,i)
  493.                 tpt.set_property("tmp",0,i)
  494.                 elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_BMBR and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  495.                     tpt.set_property("type","bomb",i)
  496.                     tpt.set_property("life",0,i)
  497.                     tpt.set_property("tmp",0,i)
  498.                     elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_BMBR and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  499.                         tpt.set_property("type","bomb",i)
  500.                         tpt.set_property("life",0,i)
  501.                         tpt.set_property("tmp",0,i)
  502.                         elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_BMBR and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  503.                             tpt.set_property("type","bomb",i)
  504.                             tpt.set_property("life",0,i)
  505.                             tpt.set_property("tmp",0,i)
  506.                             elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_BMBR and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  507.                                 tpt.set_property("type","bomb",i)
  508.                                 tpt.set_property("life",0,i)
  509.                                 tpt.set_property("tmp",0,i)
  510.                             end
  511.                         end
  512.  
  513.                         tpt.element_func(BMBR_update, elements.ELEMENT_PT_BMBR,1)
  514.  
  515. --BMBL Element {RCA}
  516.  
  517. local BMBL = elements.allocate("ELEMENT", "BMBL")
  518. elements.element(elements.ELEMENT_PT_BMBL, elements.element(elements.DEFAULT_PT_ELEC))
  519. elements.property(elements.ELEMENT_PT_BMBL, "Name", "BMBL")
  520. elements.property(elements.ELEMENT_PT_BMBL, "Description", "Left Shooting Bomb.")
  521. elements.property(elements.ELEMENT_PT_BMBL, "Colour", 0xFF20878E)
  522. elements.property(elements.ELEMENT_PT_BMBL, "MenuSection", elem.SC_EXPLOSIVE)
  523. elements.property(elements.ELEMENT_PT_BMBL, "MenuVisible", 1)
  524. elements.property(elements.ELEMENT_PT_BMBL, "Weight", 100)
  525. elements.property(elements.ELEMENT_PT_BMBL, "Temperature", 9999)
  526. local function graphics1(i, colr, colg, colb)
  527.     return 1,0x00010000,255,225,0,210,255,255,255,255
  528. end
  529. tpt.graphics_func(graphics1,BMBL)
  530.  
  531. local function get_property(prop, x, y)
  532.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  533.         return tpt.get_property(prop, x, y)
  534.     end
  535.     return 0
  536. end
  537.  
  538. math.randomseed(os.time())
  539. function BMBL_update(i, x, y, s, n)
  540.     if tpt.get_property("tmp",i)==0 then
  541.         tpt.parts[i].tmp=1
  542.                 --randvel=math.random(-20,20)/10
  543.                 tpt.parts[i].vx=-3
  544.                 tpt.parts[i].vy=0
  545.             end
  546.  
  547.             xvel=-3
  548.             yvel=0
  549.             if math.abs(xvel) < 1 then
  550.                 tpt.delete(i)
  551.             end
  552.  
  553.             xpos=x-xvel
  554.             ypos=y-yvel
  555.             elemtype=get_property("type",xpos,ypos)
  556.  
  557.             if elemtype == 0 then
  558.                 tpt.create(xpos,ypos,"bray")
  559.                 tpt.set_property("temp",5000,xpos,ypos)
  560.             end
  561.             tpt.parts[i].temp=9999
  562.  
  563.             elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  564.             elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  565.             elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  566.             elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  567.             elemtype21=get_property("type",x+xvel,y+yvel)
  568.             if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_BMBL and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  569.                 tpt.set_property("type","bomb",i)
  570.                 tpt.set_property("life",0,i)
  571.                 tpt.set_property("tmp",0,i)
  572.                 elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_BMBL and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  573.                     tpt.set_property("type","bomb",i)
  574.                     tpt.set_property("life",0,i)
  575.                     tpt.set_property("tmp",0,i)
  576.                     elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_BMBL and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  577.                         tpt.set_property("type","bomb",i)
  578.                         tpt.set_property("life",0,i)
  579.                         tpt.set_property("tmp",0,i)
  580.                         elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_BMBL and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  581.                             tpt.set_property("type","bomb",i)
  582.                             tpt.set_property("life",0,i)
  583.                             tpt.set_property("tmp",0,i)
  584.                             elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_BMBL and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  585.                                 tpt.set_property("type","bomb",i)
  586.                                 tpt.set_property("life",0,i)
  587.                                 tpt.set_property("tmp",0,i)
  588.                             end
  589.                         end
  590.  
  591.                         tpt.element_func(BMBL_update, elements.ELEMENT_PT_BMBL,1)
  592.  
  593. --MRTR {RCA}
  594.  
  595. local MRTR = elements.allocate("ELEMENT", "MRTR")
  596. elements.element(elements.ELEMENT_PT_MRTR, elements.element(elements.DEFAULT_PT_ELEC))
  597. elements.property(elements.ELEMENT_PT_MRTR, "Name", "MRTR")
  598. elements.property(elements.ELEMENT_PT_MRTR, "Description", "Mortar Right.")
  599. elements.property(elements.ELEMENT_PT_MRTR, "Colour", 0xFF2E01E3)
  600. elements.property(elements.ELEMENT_PT_MRTR, "MenuSection", elem.SC_EXPLOSIVE)
  601. elements.property(elements.ELEMENT_PT_MRTR, "MenuVisible", 1)
  602. elements.property(elements.ELEMENT_PT_MRTR, "Weight", 100)
  603. elements.property(elements.ELEMENT_PT_MRTR, "Temperature", 9999)
  604. local function graphics1(i, colr, colg, colb)
  605.     return 1,0x00010000,255,225,0,210,255,255,255,255
  606. end
  607. tpt.graphics_func(graphics1,MRTR)
  608.  
  609. local function get_property(prop, x, y)
  610.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  611.         return tpt.get_property(prop, x, y)
  612.     end
  613.     return 0
  614. end
  615.  
  616. math.randomseed(os.time())
  617. function MRTR_update(i, x, y, s, n)
  618.     if tpt.get_property("tmp",i)==0 then
  619.         tpt.parts[i].tmp=1
  620.                 --randvel=math.random(-20,20)/10
  621.                 tpt.parts[i].vx=3
  622.                 tpt.parts[i].vy=3
  623.             end
  624.  
  625.             xvel=3
  626.             yvel=3
  627.             if math.abs(xvel) < 1 then
  628.                 tpt.delete(i)
  629.             end
  630.  
  631.             xpos=x-xvel
  632.             ypos=y-yvel
  633.             elemtype=get_property("type",xpos,ypos)
  634.  
  635.             if elemtype == 0 then
  636.                 tpt.create(xpos,ypos,"bray")
  637.                 tpt.set_property("temp",5000,xpos,ypos)
  638.             end
  639.             tpt.parts[i].temp=9999
  640.  
  641.             elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  642.             elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  643.             elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  644.             elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  645.             elemtype21=get_property("type",x+xvel,y+yvel)
  646.             if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_MRTR and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  647.                 tpt.set_property("type","bomb",i)
  648.                 tpt.set_property("life",0,i)
  649.                 tpt.set_property("tmp",0,i)
  650.                 elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_MRTR and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  651.                     tpt.set_property("type","bomb",i)
  652.                     tpt.set_property("life",0,i)
  653.                     tpt.set_property("tmp",0,i)
  654.                     elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_MRTR and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  655.                         tpt.set_property("type","bomb",i)
  656.                         tpt.set_property("life",0,i)
  657.                         tpt.set_property("tmp",0,i)
  658.                         elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_MRTR and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  659.                             tpt.set_property("type","bomb",i)
  660.                             tpt.set_property("life",0,i)
  661.                             tpt.set_property("tmp",0,i)
  662.                             elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_MRTR and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  663.                                 tpt.set_property("type","bomb",i)
  664.                                 tpt.set_property("life",0,i)
  665.                                 tpt.set_property("tmp",0,i)
  666.                             end
  667.                         end
  668.  
  669.                         tpt.element_func(MRTR_update, elements.ELEMENT_PT_MRTR,1)
  670.  
  671. --MRTL {RCA}
  672.  
  673. local MRTL = elements.allocate("ELEMENT", "MRTL")
  674. elements.element(elements.ELEMENT_PT_MRTL, elements.element(elements.DEFAULT_PT_ELEC))
  675. elements.property(elements.ELEMENT_PT_MRTL, "Name", "MRTL")
  676. elements.property(elements.ELEMENT_PT_MRTL, "Description", "Motar Left.")
  677. elements.property(elements.ELEMENT_PT_MRTL, "Colour", 0xFF5068E4)
  678. elements.property(elements.ELEMENT_PT_MRTL, "MenuSection", elem.SC_EXPLOSIVE)
  679. elements.property(elements.ELEMENT_PT_MRTL, "MenuVisible", 1)
  680. elements.property(elements.ELEMENT_PT_MRTL, "Weight", 100)
  681. elements.property(elements.ELEMENT_PT_MRTL, "Temperature", 9999)
  682. local function graphics1(i, colr, colg, colb)
  683.     return 1,0x00010000,255,225,0,210,255,255,255,255
  684. end
  685. tpt.graphics_func(graphics1,MRTL)
  686.  
  687. local function get_property(prop, x, y)
  688.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  689.         return tpt.get_property(prop, x, y)
  690.     end
  691.     return 0
  692. end
  693.  
  694. math.randomseed(os.time())
  695. function MRTL_update(i, x, y, s, n)
  696.     if tpt.get_property("tmp",i)==0 then
  697.         tpt.parts[i].tmp=1
  698.                 --randvel=math.random(-20,20)/10
  699.                 tpt.parts[i].vx=-3
  700.                 tpt.parts[i].vy=3
  701.             end
  702.  
  703.             xvel=-3
  704.             yvel=3
  705.             if math.abs(xvel) < 1 then
  706.                 tpt.delete(i)
  707.             end
  708.  
  709.             xpos=x-xvel
  710.             ypos=y-yvel
  711.             elemtype=get_property("type",xpos,ypos)
  712.  
  713.             if elemtype == 0 then
  714.                 tpt.create(xpos,ypos,"bray")
  715.                 tpt.set_property("temp",5000,xpos,ypos)
  716.             end
  717.             tpt.parts[i].temp=9999
  718.  
  719.             elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  720.             elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  721.             elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  722.             elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  723.             elemtype21=get_property("type",x+xvel,y+yvel)
  724.             if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_MRTL and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  725.                 tpt.set_property("type","bomb",i)
  726.                 tpt.set_property("life",0,i)
  727.                 tpt.set_property("tmp",0,i)
  728.                 elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_MRTL and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  729.                     tpt.set_property("type","bomb",i)
  730.                     tpt.set_property("life",0,i)
  731.                     tpt.set_property("tmp",0,i)
  732.                     elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_MRTL and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  733.                         tpt.set_property("type","bomb",i)
  734.                         tpt.set_property("life",0,i)
  735.                         tpt.set_property("tmp",0,i)
  736.                         elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_MRTL and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  737.                             tpt.set_property("type","bomb",i)
  738.                             tpt.set_property("life",0,i)
  739.                             tpt.set_property("tmp",0,i)
  740.                             elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_MRTL and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  741.                                 tpt.set_property("type","bomb",i)
  742.                                 tpt.set_property("life",0,i)
  743.                                 tpt.set_property("tmp",0,i)
  744.                             end
  745.                         end
  746.  
  747.                         tpt.element_func(MRTL_update, elements.ELEMENT_PT_MRTL,1)
  748.  
  749. --PLSM Copy For Explosives {RCA}
  750.  
  751. local RCA1 = elements.allocate("RCA", "IGNT")
  752. elements.element(elements.RCA_PT_IGNT, elements.element(elements.DEFAULT_PT_GAS))
  753. elements.property(elements.RCA_PT_IGNT, "Name", "IGNT")
  754. elements.property(elements.RCA_PT_IGNT, "Description", "Igniter. Use to ignite explosives, hotter than fire.")
  755. elements.property(elements.RCA_PT_IGNT, "Colour", 0xFFE52961)
  756. elements.property(elements.RCA_PT_IGNT, "MenuSection", 5)
  757. elements.property(elements.RCA_PT_IGNT, "MenuVisible", 1)
  758. elements.property(elements.RCA_PT_IGNT, "Temperature", 5000)
  759. elements.property(elements.RCA_PT_IGNT, "Weight", 0)
  760. elements.property(elements.RCA_PT_IGNT, "Flammable", 1)
  761. elements.property(elements.RCA_PT_IGNT, "Explosive", 0)
  762.  
  763.  
  764.  
  765.  
  766. local TLRY = elements.allocate("RCA", "TLRY")
  767. elements.element(elements.RCA_PT_TLRY, elements.element(elements.DEFAULT_PT_BOMB))
  768. elements.property(elements.RCA_PT_TLRY, "Name", "TLRY")
  769. elements.property(elements.RCA_PT_TLRY, "MenuSection", elem.SC_EXPLOSIVE)
  770. elements.property(elements.RCA_PT_TLRY, "Description", "Artillery shell.")
  771. elements.property(elements.RCA_PT_TLRY, "Colour", 0x6E6E6E)
  772. elements.property(elements.RCA_PT_TLRY, "HeatConduct", 1)
  773. elements.property(elements.RCA_PT_TLRY, "Temperature", 9999)
  774.  
  775. function TLRY_update(i, x, y, surround_space, nt)
  776.     if tpt.get_property("type", x+1, y-1) > 0 and tpt.get_property("type", x+1, y-1) < 247 or
  777.         tpt.get_property("type", x+1, y) > 0 and tpt.get_property("type", x+1, y) < 247 or
  778.         tpt.get_property("type", x+1, y+1) > 0 and tpt.get_property("type", x+1, y+1) < 247 or
  779.         tpt.get_property("type", x, y+1) > 0 and tpt.get_property("type", x, y+1) < 247 or
  780.         tpt.get_property("type", x, y-1) > 0 and tpt.get_property("type", x, y-1) < 247 or
  781.         tpt.get_property("type", x-1, y-1) > 0 and tpt.get_property("type", x-1, y-1) < 247 or
  782.         tpt.get_property("type", x-1, y) > 0 and tpt.get_property("type", x-1, y) < 247 or
  783.         tpt.get_property("type", x-1, y+1) > 0 and tpt.get_property("type", x-1, y+1) < 247 then
  784.         sim.createParts(x, y, 3, 3, 247, 0, 0)
  785.         sim.createParts(x, y, 5, 5, 4, 0, 1)
  786.         sim.pressure(x/4,y/4,3)
  787.         tpt.set_property("life", 3, "xpls")
  788.     end  
  789. end
  790. tpt.element_func(TLRY_update, TLRY)
  791.  
  792. local XPLS = elements.allocate("RCA", "XPLS")
  793. elements.element(elements.RCA_PT_XPLS, elements.element(elements.DEFAULT_PT_NEUT))
  794. elements.property(elements.RCA_PT_XPLS, "Name", "XPLS")
  795. elements.property(elements.RCA_PT_XPLS, "MenuVisible", 0)
  796. elements.property(elements.RCA_PT_XPLS, "Description", "UHhh.")
  797. elements.property(elements.RCA_PT_XPLS, "Colour", 0xFF9900)
  798. elements.property(elements.RCA_PT_XPLS, "Temperature", 9999)
  799. elements.property(elements.RCA_PT_XPLS, "Diffusion", 2)
  800. elements.property(elements.RCA_PT_XPLS, "HeatConduct", 9999)
  801.  
  802. function XPLS_update(i, x, y, s, surround_space, n, nt)
  803. end
  804. local function graphics1(i, colr, colg, colb)
  805.     return 1,0x00010020,255,255,0,0,255,255,98,9
  806. end
  807. tpt.graphics_func(graphics1,XPLS)
  808.  
  809.  
  810. local TLYL = elements.allocate("ELEMENT", "TLYL")
  811. elements.element(elements.ELEMENT_PT_TLYL, elements.element(elements.DEFAULT_PT_ELEC))
  812. elements.property(elements.ELEMENT_PT_TLYL, "Name", "TLYL")
  813. elements.property(elements.ELEMENT_PT_TLYL, "Description", "Motar Left.")
  814. elements.property(elements.ELEMENT_PT_TLYL, "Colour", 0xFF5068E4)
  815. elements.property(elements.ELEMENT_PT_TLYL, "MenuSection", elem.SC_EXPLOSIVE)
  816. elements.property(elements.ELEMENT_PT_TLYL, "MenuVisible", 1)
  817. elements.property(elements.ELEMENT_PT_TLYL, "Weight", 100)
  818. elements.property(elements.ELEMENT_PT_TLYL, "Temperature", 9999)
  819. local function graphics1(i, colr, colg, colb)
  820.     return 1,0x00010000,255,225,0,210,255,255,255,255
  821. end
  822. tpt.graphics_func(graphics1,TLYL)
  823.  
  824. local function get_property(prop, x, y)
  825.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  826.         return tpt.get_property(prop, x, y)
  827.     end
  828.     return 0
  829. end
  830.  
  831. math.randomseed(os.time())
  832. function TLYL_update(i, x, y, s, n)
  833.     if tpt.get_property("tmp",i)==0 then
  834.         tpt.parts[i].tmp=1
  835.                 --randvel=math.random(-20,20)/10
  836.                 tpt.parts[i].vx=-3
  837.                 tpt.parts[i].vy=3
  838.             end
  839.  
  840.             xvel=-3
  841.             yvel=3
  842.             if math.abs(xvel) < 1 then
  843.                 tpt.delete(i)
  844.             end
  845.  
  846.             xpos=x-xvel
  847.             ypos=y-yvel
  848.             elemtype=get_property("type",xpos,ypos)
  849.  
  850.             if elemtype == 0 then
  851.                 tpt.create(xpos,ypos,"bray")
  852.                 tpt.set_property("temp",5000,xpos,ypos)
  853.             end
  854.             tpt.parts[i].temp=9999
  855.  
  856.             elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  857.             elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  858.             elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  859.             elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  860.             elemtype21=get_property("type",x+xvel,y+yvel)
  861.             if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_TLYL and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  862.                 tpt.set_property("type","tlry",i)
  863.                 tpt.set_property("life",0,i)
  864.                 tpt.set_property("tmp",0,i)
  865.                 elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_TLYL and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  866.                     tpt.set_property("type","tlry",i)
  867.                     tpt.set_property("life",0,i)
  868.                     tpt.set_property("tmp",0,i)
  869.                     elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_TLYL and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  870.                         tpt.set_property("type","tlry",i)
  871.                         tpt.set_property("life",0,i)
  872.                         tpt.set_property("tmp",0,i)
  873.                         elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_TLYL and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  874.                             tpt.set_property("type","tlry",i)
  875.                             tpt.set_property("life",0,i)
  876.                             tpt.set_property("tmp",0,i)
  877.                             elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_TLYL and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  878.                                 tpt.set_property("type","tlry",i)
  879.                                 tpt.set_property("life",0,i)
  880.                                 tpt.set_property("tmp",0,i)
  881.                             end
  882.                         end
  883.  
  884.                         tpt.element_func(TLYL_update, elements.ELEMENT_PT_TLYL,1)
  885.  
  886. local TLYR = elements.allocate("ELEMENT", "TLYR")
  887. elements.element(elements.ELEMENT_PT_TLYR, elements.element(elements.DEFAULT_PT_ELEC))
  888. elements.property(elements.ELEMENT_PT_TLYR, "Name", "TLYR")
  889. elements.property(elements.ELEMENT_PT_TLYR, "Description", "Motar Left.")
  890. elements.property(elements.ELEMENT_PT_TLYR, "Colour", 0xFF5068E4)
  891. elements.property(elements.ELEMENT_PT_TLYR, "MenuSection", elem.SC_EXPLOSIVE)
  892. elements.property(elements.ELEMENT_PT_TLYR, "MenuVisible", 1)
  893. elements.property(elements.ELEMENT_PT_TLYR, "Weight", 100)
  894. elements.property(elements.ELEMENT_PT_TLYR, "Temperature", 9999)
  895. local function graphics1(i, colr, colg, colb)
  896.     return 1,0x00010000,255,225,0,210,255,255,255,255
  897. end
  898. tpt.graphics_func(graphics1,TLYR)
  899.  
  900. local function get_property(prop, x, y)
  901.     if x >= 0 and x < sim.XRES and y >=0 and y < sim.YRES then
  902.         return tpt.get_property(prop, x, y)
  903.     end
  904.     return 0
  905. end
  906.  
  907. math.randomseed(os.time())
  908. function TLYR_update(i, x, y, s, n)
  909.     if tpt.get_property("tmp",i)==0 then
  910.         tpt.parts[i].tmp=1
  911.                 --randvel=math.random(-20,20)/10
  912.                 tpt.parts[i].vx=3
  913.                 tpt.parts[i].vy=3
  914.             end
  915.  
  916.             xvel=3
  917.             yvel=3
  918.             if math.abs(xvel) < 1 then
  919.                 tpt.delete(i)
  920.             end
  921.  
  922.             xpos=x-xvel
  923.             ypos=y-yvel
  924.             elemtype=get_property("type",xpos,ypos)
  925.  
  926.             if elemtype == 0 then
  927.                 tpt.create(xpos,ypos,"bray")
  928.                 tpt.set_property("temp",5000,xpos,ypos)
  929.             end
  930.             tpt.parts[i].temp=9999
  931.  
  932.             elemtype25=get_property("type",x+xvel*5,y+yvel*5)
  933.             elemtype24=get_property("type",x+xvel*4,y+yvel*4)
  934.             elemtype23=get_property("type",x+xvel*3,y+yvel*3)
  935.             elemtype22=get_property("type",x+xvel*2,y+yvel*2)
  936.             elemtype21=get_property("type",x+xvel,y+yvel)
  937.             if elemtype25 ~= 0 and elemtype25 ~= elements.ELEMENT_PT_TLYR and elemtype25 ~= tpt.el.bray.id and elemtype25 ~= tpt.el.dmnd.id and elemtype25 ~= tpt.el.void.id then
  938.                 tpt.set_property("type","tlry",i)
  939.                 tpt.set_property("life",0,i)
  940.                 tpt.set_property("tmp",0,i)
  941.                 elseif elemtype24 ~= 0 and elemtype24 ~= elements.ELEMENT_PT_TLYR and elemtype24 ~= tpt.el.bray.id and elemtype24 ~= tpt.el.dmnd.id and elemtype24 ~= tpt.el.void.id then
  942.                     tpt.set_property("type","tlry",i)
  943.                     tpt.set_property("life",0,i)
  944.                     tpt.set_property("tmp",0,i)
  945.                     elseif elemtype23 ~= 0 and elemtype23 ~= elements.ELEMENT_PT_TLYR and elemtype23 ~= tpt.el.bray.id and elemtype23 ~= tpt.el.dmnd.id and elemtype23 ~= tpt.el.void.id then
  946.                         tpt.set_property("type","tlry",i)
  947.                         tpt.set_property("life",0,i)
  948.                         tpt.set_property("tmp",0,i)
  949.                         elseif elemtype22 ~= 0 and elemtype22 ~= elements.ELEMENT_PT_TLYR and elemtype22 ~= tpt.el.bray.id and elemtype22 ~= tpt.el.dmnd.id and elemtype22 ~= tpt.el.void.id then
  950.                             tpt.set_property("type","tlry",i)
  951.                             tpt.set_property("life",0,i)
  952.                             tpt.set_property("tmp",0,i)
  953.                             elseif elemtype21 ~= 0 and elemtype21 ~= elements.ELEMENT_PT_TLYR and elemtype21 ~= tpt.el.bray.id and elemtype21 ~= tpt.el.dmnd.id and elemtype21 ~= tpt.el.void.id then
  954.                                 tpt.set_property("type","tlry",i)
  955.                                 tpt.set_property("life",0,i)
  956.                                 tpt.set_property("tmp",0,i)
  957.                             end
  958.                         end
  959.  
  960.                         tpt.element_func(TLYR_update, elements.ELEMENT_PT_TLYR,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement