Guest User

0.2

a guest
Feb 2nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.41 KB | None | 0 0
  1. local function attract(i,x,y,a) --*1
  2. sim.gravMap(x/4,y/4,a)
  3. end --*1
  4.  
  5. local nept = elements.allocate("TPT" , "NEPT")
  6. elements.element(nept, elements.element(elements.DEFAULT_PT_PLUT))
  7. elements.property(nept, "Name" , "NEPT")
  8. elements.property(nept, "Description" , "Neptunium, radioactive. Heats up when bombarded with neutrons.")
  9. elements.property(nept, "Color", 0x557020)
  10. elements.property(nept, "MenuSection", 10)
  11. function neptunium(i,x,y,s,n)
  12. if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == tpt.el.neut.id then --1
  13. if math.random(1,2) == 1 then --2
  14. tpt.parts[i].type = elements.DEFAULT_PT_URAN
  15. end --2
  16. end --1
  17. if sim.pressure(x/4,y/4) > 1 then --3
  18. if math.random(1,250) == 10 then --4
  19. tpt.create(x + math.random(-2,2), y + math.random(-2,2), 'neut')
  20. tpt.set_property("temp", math.huge, x ,y)
  21. end --4
  22. end --3
  23. if math.random(1,10000) == 10 then --5
  24. sim.pressure(x/4,y/4,0.1)
  25. end --5
  26. end --*1
  27. tpt.element_func(neptunium,nept)
  28. function neutron(i,x,y,s,n) --*2
  29. if tpt.get_property("type", x + math.random(-2,2), y + math.random(-2,2)) == nept then --1
  30. if math.random(1,35) == 10 then --2
  31. tpt.create(x, y, 'neut')
  32. tpt.set_property("temp", math.huge, x ,y)
  33. end --2
  34. end --1
  35. end --*2
  36. tpt.element_func(neutron,tpt.el.neut.id)
  37.  
  38. local vsns = elements.allocate("TPT" , "VSNS")
  39. elements.element(vsns, elements.element(elements.DEFAULT_PT_DMND))
  40. elements.property(vsns, "Name" , "VSNS")
  41. elements.property(vsns, "Description" , "Velocity sensor, creates a spark when something's velocity is higher than its temperature.")
  42. elements.property(vsns, "Color", 0x3D3125)
  43. elements.property(vsns, "MenuSection", 3)
  44. elements.property(vsns, "HeatConduct", 0)
  45. elements.property(elem.TPT_PT_VSNS, "Update",
  46. function(i,x,y,s,nt) --1
  47. for r in sim.neighbors(x,y,1,1) do --2
  48. if math.sqrt(math.pow(sim.partProperty(r, "vx"),2)+math.pow(sim.partProperty(r, "vy"),2)) > sim.partProperty(i, "temp")-273.15 then --3
  49. sim.partCreate(-1, x, y+1, elements.DEFAULT_PT_SPRK)
  50. sim.partCreate(-1, x+1, y+1, elements.DEFAULT_PT_SPRK)
  51. sim.partCreate(-1, x-1, y+1, elements.DEFAULT_PT_SPRK)
  52. sim.partCreate(-1, x, y-1, elements.DEFAULT_PT_SPRK)
  53. sim.partCreate(-1, x+1, y-1, elements.DEFAULT_PT_SPRK)
  54. sim.partCreate(-1, x-1, y-1, elements.DEFAULT_PT_SPRK)
  55. sim.partCreate(-1, x+1, y, elements.DEFAULT_PT_SPRK)
  56. sim.partCreate(-1, x-1, y, elements.DEFAULT_PT_SPRK)
  57. end --3
  58. end --2
  59. end --1
  60. ) --*1
  61.  
  62. local mrcv = elements.allocate("TPT", "MRCV")
  63. elements.element(mrcv,elem.element(elem.DEFAULT_PT_WTRV))
  64. elements.property(mrcv, "Name" , "MRCV")
  65. elements.property(mrcv, "Description" , "Mercury Vapor.")
  66. elements.property(mrcv, "Color", 0x6D6567)
  67. elements.property(mrcv, "Temperature", 637.85)
  68. elements.property(mrcv, "LowTemperature", 618.32)
  69. elements.property(mrcv, "LowTemperatureTransition", elements.DEFAULT_PT_MERC)
  70.  
  71. elements.property(elements.DEFAULT_PT_MERC, "Update", --*1
  72. function(i,x,y) --1
  73. if sim.partProperty(i, "temp") > 628.91 then --2
  74. if math.random(1,450) == 1 then --3
  75. sim.partChangeType(i, elements.TPT_PT_MRCV)
  76. end --3
  77. end --2
  78. end --1
  79. ) --*1
  80.  
  81. local anti = elements.allocate("TPT" , "ANTI")
  82. elements.element(anti, elements.element(elements.DEFAULT_PT_SING))
  83. elements.property(anti, "Name" , "ANTI")
  84. elements.property(anti, "Description" , "Anti Singularity, emits antigravity. Slowly increases in size")
  85. elements.property(anti, "Color", 0xDBDBDB)
  86. elements.property(anti, "HotAir", 0.015)
  87. elements.property(anti, "MenuSection", 16)
  88. elements.property(elements.TPT_PT_ANTI, "Update", --*1
  89. function(i,x,y) --1
  90. attract(i,x,y,-0.75)
  91. if math.random(1,10) == 1 then --2
  92. sim.partCreate(-1, x+math.random(-1,1),y+math.random(-1,1),elements.RADM_PT_ANTI)
  93. sim.partProperty(i, "temp", sim.partProperty(i, "temp")-20)
  94. end --2
  95. end --1
  96. ) --*1
  97.  
  98. local ash = elements.allocate("TPT", "ASH")
  99. elements.element(ash, elements.element(elements.DEFAULT_PT_DUST))
  100. elements.property(ash, "Name" , "ASH")
  101. elements.property(ash, "Description" , "Ash, very light powder. Flammable.")
  102. elements.property(ash, "Color", 0x393224)
  103. elements.property(ash, "Gravity", 0.056)
  104. elements.property(ash, "Advection", 0.2)
  105. elements.property(ash, "Weight", 2)
  106. elements.property(ash, "AirDrag", 0.05)
  107. elements.property(ash, "Flammable", 25.56)
  108.  
  109. local lhyg = elements.allocate("TPT", "LHYG")
  110. elements.element(lhyg, elements.element(elements.DEFAULT_PT_LOXY))
  111. elements.property(lhyg, "Name" , "LHYG")
  112. elements.property(lhyg, "Description" , "Liquid Hydrogen, very cold. Incredibly flammable")
  113. elements.property(lhyg, "Flammable", 5000.65)
  114. elements.property(lhyg, "Explosive", 1)
  115. elements.property(lhyg, "Color", 0x87CEFA)
  116. elements.property(lhyg, "Temperature", 14.15)
  117. elements.property(lhyg, "MenuSection", 7)
  118. elements.property(lhyg, "Diffusion", 0.1)
  119. elements.property(lhyg, "HighTemperature", 18.15)
  120. elements.property(lhyg, "HighTemperatureTransition", elements.DEFAULT_PT_HYGN)
  121.  
  122. elements.property(elements.DEFAULT_PT_HYGN, "LowTemperature", 15.24)
  123. elements.property(elements.DEFAULT_PT_HYGN, "LowTemperatureTransition", elements.TPT_PT_LHYG)
  124.  
  125. local pb = elements.allocate("TPT" , "LEAD")
  126. elements.element(pb, elements.element(elements.DEFAULT_PT_IRON))
  127. elements.property(pb, "Name" , "LEAD")
  128. elements.property(pb, "Description" , "Lead, absorbs neutrons. Conducts electricity.")
  129. elements.property(pb, "Color", 0x686868)
  130. elements.property(pb, "HighTemperature", 601.25)
  131. elements.property(pb, "Properties", elements.PROP_NEUTABSORB+elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_DEADLY)
  132.  
  133. local mnpr = elements.allocate("TPT", "MNPR")
  134. elements.element(mnpr, elements.element(elements.DEFAULT_PT_BOYL))
  135. elements.property(mnpr, "Name" , "MONO")
  136. elements.property(mnpr, "Description" , "Monopropellant. Disperses quickly.")
  137. elements.property(mnpr, "Color", 0xB0B0B0)
  138. elements.property(mnpr, "Advection", 0.2)
  139. elements.property(mnpr, "AirDrag", 0.05)
  140. elements.property(mnpr, "HotAir", 0.01)
  141. elements.property(mnpr, "MenuSection", 16)
  142. elements.property(elements.TPT_PT_MNPR, "Update", --*1
  143. function(i,x,y) --1
  144. if math.random(1,30) == 1 then --2
  145. sim.partKill(i)
  146. end --2
  147. end --1
  148. ) --*1
  149.  
  150. local mnpl = elements.allocate("TPT", "MNPL")
  151. elements.element(mnpl, elements.element(elements.DEFAULT_PT_LOXY))
  152. elements.property(mnpl, "Name" , "MNPL")
  153. elements.property(mnpl, "Description" , "Liquid Monopropellant. Releases lots of pressure and heat when boiled")
  154. elements.property(mnpl, "Flammable", 0)
  155. elements.property(mnpl, "Color", 0xA0A0A0)
  156. elements.property(mnpl, "Temperature", 180.15)
  157. elements.property(mnpl, "MenuSection", 5)
  158. elements.property(mnpl, "Diffusion", 0.1)
  159. elements.property(mnpl, "HighTemperature", 200.15)
  160. elements.property(mnpl, "HighTemperatureTransition", elements.TPT_PT_MNPR)
  161. elements.property(elements.TPT_PT_MNPL, "Update", --*1
  162. function(i,x,y,s,nt) --1
  163. for r in sim.neighbors(x,y,1,1) do --2
  164. if sim.partProperty(r, "type") == elements.TPT_PT_MNPR then --3
  165. if math.random(1,45) == 1 then --4
  166. sim.partProperty(i, "temp", sim.partProperty(i, "temp")+50)
  167. sim.pressure(x/4,y/4,8)
  168. end --4
  169. end --3
  170. end --2
  171. end --1
  172. ) --*1
  173.  
  174. elements.property(mnpr, "LowTemperature", 190.15)
  175. elements.property(mnpr, "LowTemperatureTransition", elements.TPT_PT_MNPL)
  176.  
  177. local tchn = elements.allocate("TPT" , "TCHN")
  178. elements.element(tchn, elements.element(elements.DEFAULT_PT_STNE))
  179. elements.property(tchn, "Name" , "TCHN")
  180. elements.property(tchn, "Description" , "Technetium, decays over time and leaves heat.")
  181. elements.property(tchn, "Color", 0x205570)
  182. elements.property(tchn, "MenuSection", 11)
  183. elements.property(elements.TPT_PT_TCHN, "Update", --*1
  184. function(i,x,y) --1
  185. if math.random(1,11520) == 1 then --2
  186. sim.partProperty(i, "temp", sim.partProperty(i, "temp")+400)
  187. sim.pressure(x/4,y/4,8)
  188. sim.partProperty(i, "type", elements.DEFAULT_PT_STNE)
  189. end --2
  190. end --1
  191. ) --*1
  192. elements.property(tchn, "HighTemperatureTransition", elements.TPT_PT_TCHN)
  193.  
  194. local psac = elements.allocate("TPT", "PSAC")
  195. elements.element(psac, elements.element(elements.DEFAULT_PT_SOAP))
  196. elements.property(psac, "Name" , "PSAC")
  197. elements.property(psac, "Description" , "Positronic acid, reacts violently with matter, weak acid.")
  198. elements.property(psac, "Color", 0xFF20BB)
  199. elements.property(elem.TPT_PT_PSAC, "Update", --*1
  200. function(i,x,y,s,nt) --1
  201. if s ~=8 and nt ~=0 and nt - s > 0 then --2
  202. if math.random(1,100) == 10 then --3
  203. for r in sim.neighbors(x,y,1,1) do --4
  204. if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_DMND then --5
  205. if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VACU then --6
  206. if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_VOID then --7
  207. if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_CLNE then --8
  208. if sim.partProperty(r, "type") ~= elements.DEFAULT_PT_PCLN then --9
  209. if math.random(1,6) == 3 then --10
  210. sim.partKill(r)
  211. sim.partProperty(i, "temp", sim.partProperty(i, "temp")+1600)
  212. if math.random(1,25) == 20 then --11
  213. sim.pressure(x/4,y/4,8)
  214. sim.partKill(i)
  215. return
  216. end --11
  217. end --10
  218. end --9
  219. end --8
  220. end --7
  221. end --6
  222. end --5
  223. end --4
  224. end --3
  225. end --2
  226. end --1
  227. ) --*1
  228.  
  229. local si = elements.allocate("TPT" , "SILC")
  230. elements.element(si, elements.element(elements.DEFAULT_PT_IRON))
  231. elements.property(si, "Name" , "SILC")
  232. elements.property(si, "Description" , "Silicon, strong, conducts electricity. Lets air pass through")
  233. elements.property(si, "Color", 0x686E76)
  234. elements.property(si, "AirLoss", 1)
  235. elements.property(si, "HighTemperature", 1687.01)
  236. elements.property(si, "Properties", elements.PROP_CONDUCTS+elements.PROP_LIFE_DEC+elements.TYPE_SOLID+elements.PROP_HOT_GLOW)
  237.  
  238. local torn = elements.allocate("TPT" , "TORN")
  239. elements.element(torn, elements.element(elements.DEFAULT_PT_BOYL))
  240. elements.property(torn, "Name" , "TORN")
  241. elements.property(torn, "Description" , "Tornado, self explanatory")
  242. elements.property(torn, "Color", 0x8A9098)
  243. elements.property(torn, "AirDrag", 0.05)
  244. elements.property(torn, "AirDrag", 0.05)
  245. elements.property(torn, "HotAir", -0.001)
  246. elements.property(torn, "MenuSection", 16)
Add Comment
Please, Sign In to add comment