Advertisement
Guest User

B0.1

a guest
Oct 8th, 2018
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.04 KB | None | 0 0
  1. local algae = elements.allocate("TPT", "ALGAE")
  2. elements.element(algae, elements.element(elements.DEFAULT_PT_SOAP))
  3. elements.property(algae, "Name" , "ALGE")
  4. elements.property(algae, "Description" , "Algae, spreads in water.")
  5. elements.property(algae, "Color", 0x407010)
  6. elements.property(algae, "Diffusion", 0.3)
  7. elements.property(algae, "Weight", 31)
  8. elements.property(algae, "MenuSection", 16)
  9. elements.property(elem.TPT_PT_ALGAE, "Update", --*1
  10. function(i,x,y,s,nt) --1
  11. if nt == 8 then --2
  12. for r in sim.neighbors(x,y,1,1) do --3
  13. if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --4
  14. if math.random(1,1000) > 1 then --4
  15. sim.partProperty(i, "vy", -0.05)
  16. end --5
  17. if math.random(1,1000) > 1 then --5
  18. sim.partProperty(i, "vx", math.random(-0.01,0.01))
  19. end --6
  20. end --4
  21. if math.random(1,250) < 4 then --7
  22. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  23. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  24. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  25. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  26. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  27. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ALGAE)
  28. end --7
  29. if math.random(1,400) < 2 then --8
  30. sim.partKill(i)
  31. end --8
  32. if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --9
  33. if math.random(1,200) == 1 then --10
  34. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_ALGAE)
  35. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
  36. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.DEFAULT_PT_OXYG)
  37. end --10
  38. end --9
  39. end --3
  40. end --2
  41. if math.random(1,400) < 2 then --11
  42. sim.partKill(i)
  43. end --11
  44. end --1
  45. ) --*1
  46.  
  47. local bctr = elements.allocate("TPT", "BACT")
  48. elements.element(bctr, elements.element(elements.DEFAULT_PT_SOAP))
  49. elements.property(bctr, "Name" , "BCTR")
  50. elements.property(bctr, "Description" , "Bacteria, spreads and sticks.")
  51. elements.property(bctr, "Color", 0xE0F0A1)
  52. elements.property(bctr, "Diffusion", 0.3)
  53. elements.property(bctr, "Weight", 30)
  54. elements.property(bctr, "MenuSection", 11)
  55.  
  56. local bctrb = elements.allocate("TPT", "BCTR")
  57. elements.element(bctrb, elements.element(elements.DEFAULT_PT_SOAP))
  58. elements.property(bctrb, "Name" , "BCTD")
  59. elements.property(bctrb, "Description" , "Decomposer bacteria, decomposes plant matter.")
  60. elements.property(bctrb, "Color", 0xFFE990)
  61. elements.property(bctrb, "Diffusion", 0.3)
  62. elements.property(bctrb, "Weight", 30)
  63. elements.property(bctrb, "MenuSection", 16)
  64.  
  65. local bctra = elements.allocate("TPT", "BCTRA")
  66. elements.element(bctra, elements.element(elements.DEFAULT_PT_SOAP))
  67. elements.property(bctra, "Name" , "ABCT")
  68. elements.property(bctra, "Description" , "Airbourne bacteria.")
  69. elements.property(bctra, "Color", 0xC9E9FF)
  70. elements.property(bctra, "Diffusion", 0.2)
  71. elements.property(bctra, "Weight", 29)
  72. elements.property(bctra, "MenuSection", 16)
  73. elements.property(bctra, "Gravity", -0.025)
  74.  
  75. local bctrc = elements.allocate("TPT", "BCTRC")
  76. elements.element(bctrc, elements.element(elements.DEFAULT_PT_SOAP))
  77. elements.property(bctrc, "Name" , "BCTW")
  78. elements.property(bctrc, "Description" , "Bacterial wall, solid but still flows")
  79. elements.property(bctrc, "Color", 0xC9FF90)
  80. elements.property(bctrc, "Diffusion", 0.1)
  81. elements.property(bctrc, "Weight", 31)
  82. elements.property(bctrc, "MenuSection", 16)
  83.  
  84. local bctrp = elements.allocate("TPT", "BCTRP")
  85. elements.element(bctrp, elements.element(elements.DEFAULT_PT_SOAP))
  86. elements.property(bctrp, "Name" , "AQBC")
  87. elements.property(bctrp, "Description" , "Aquatic Bacteria. Floats and spreads through water slowly.")
  88. elements.property(bctrp, "Color", 0xFFF0FF)
  89. elements.property(bctrp, "Diffusion", 0.3)
  90. elements.property(bctrp, "Weight", 31)
  91. elements.property(bctrp, "MenuSection", 16)
  92. elements.property(elem.TPT_PT_BCTRP, "Update", --*1
  93. function(i,x,y,s,nt) --1
  94. if nt == 8 then --2
  95. for r in sim.neighbors(x,y,1,1) do --3
  96. if math.random(1,1000) > 1 then --4
  97. sim.partProperty(i, "vy", -0.05)
  98. end --4
  99. if math.random(1,1000) > 1 then --5
  100. sim.partProperty(i, "vx", math.random(-0.01,0.01))
  101. end --5
  102. if math.random(1,2000) < 4 then --6
  103. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  104. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  105. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  106. end --6
  107. if math.random(1,40000) < 2 then --7
  108. sim.partKill(i)
  109. end --7
  110. if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --8
  111. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  112. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTR)
  113. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  114. end --8
  115. end --3
  116. end --2
  117. end --1
  118. ) --*1
  119.  
  120. elements.property(elem.TPT_PT_BCTRC, "Update", --*1
  121. function(i,x,y,s,nt) --1
  122. if s ~=8 and nt ~=0 and s > 0 then --2
  123. for r in sim.neighbors(x,y,1,1) do --3
  124. if math.random(1,1000) > 1 then --4
  125. sim.partProperty(i, "vy", 0)
  126. end --4
  127. if math.random(1,1000) > 1 then --5
  128. sim.partProperty(i, "vx", 0)
  129. end --5
  130. if math.random(1,200000) < 4 then --6
  131. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  132. end --6
  133. if math.random(1,200000) == 1 then --7
  134. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  135. end --7
  136. if math.random(1,200000) == 1 then --8
  137. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  138. end --8
  139. if math.random(1,4000) < 2 then --9
  140. sim.partKill(i)
  141. end --9
  142. if sim.partProperty(r, "type") == elements.DEFAULT_PT_CO2 then --10
  143. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  144. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  145. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  146. end --10
  147. if sim.partProperty(r, "type") == elements.DEFAULT_PT_WATR then --11
  148. if math.random(1,20) == 1 then --12
  149. if math.random(1,50) == 1 then --13
  150. sim.partProperty(i, "type", elements.TPT_PT_BCTRP)
  151. end --13
  152. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  153. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  154. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-3,y+3),elements.TPT_PT_BCTRP)
  155. sim.partKill(i)
  156. end --12
  157. end --11
  158. if sim.partProperty(r, "type") == elements.TPT_PT_BCTRP then --11
  159. if math.random(1,200) == 1 then --12
  160. sim.partKill(i)
  161. end --12
  162. end --11
  163. end --3
  164. end --2
  165. end --1
  166. ) --*1
  167.  
  168. elements.property(elem.TPT_PT_BCTR, "Update", --*1
  169. function(i,x,y,s,nt) --1
  170. if s ~=8 and nt ~=0 and nt - s > 0 then --2
  171. for r in sim.neighbors(x,y,1,1) do --3
  172. if math.random(1,10) > 1 then --4
  173. sim.partProperty(i, "vy", 0)
  174. end --4
  175. if math.random(1,10) > 1 then --5
  176. sim.partProperty(i, "vx", 0)
  177. end --5
  178. if math.random(1,200) < 4 then --6
  179. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  180. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  181. end --6
  182. if math.random(1,4000) < 2 then --7
  183. sim.partKill(i)
  184. end --7
  185. if sim.partProperty(r, "type") == elements.DEFAULT_PT_WOOD then --8
  186. if math.random(1,20) < 2 then --9
  187. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  188. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  189. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  190. sim.partKill(r)
  191. end --9
  192. end --8
  193. if sim.partProperty(r, "type") == elements.DEFAULT_PT_PLNT then --10
  194. if math.random(1,20) < 2 then --11
  195. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  196. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  197. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  198. sim.partKill(r)
  199. end --11
  200. end --10
  201. if sim.partProperty(r, "type") == elements.TPT_PT_ALGAE then --12
  202. if math.random(1,20) < 2 then --13
  203. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTR)
  204. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  205. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_ASH)
  206. sim.partKill(r)
  207. end --13
  208. end --12
  209. if math.random(1,1000) == 1 then --14
  210. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  211. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  212. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+3),elements.TPT_PT_BCTRC)
  213. sim.partCreate(-1, math.random(x-3,x+3),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  214. end --14
  215. if math.random(1,10000) == 1 then --15
  216. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  217. end --15
  218. if math.random(1,1000) == 1 then --16
  219. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRP)
  220. end --16
  221. end --3
  222. end --2
  223. end --1
  224. ) --*1
  225.  
  226. elements.property(elem.TPT_PT_BCTRA, "Update", --*1
  227. function(i,x,y,s,nt) --1
  228. if s ~=8 and nt ~=0 and nt - s > 0 then --2
  229. for r in sim.neighbors(x,y,1,1) do --3
  230. if math.random(1,20) > 1 then --4
  231. sim.partProperty(i, "vy", -0.01)
  232. end --4
  233. if math.random(1,20) > 1 then --5
  234. sim.partProperty(i, "vx", 0)
  235. end --5
  236. if math.random(1,400) < 4 then --6
  237. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  238. end --6
  239. if math.random(1,1600) < 2 then --7
  240. sim.partKill(i)
  241. end --7
  242. if sim.partProperty(r, "type") == elements.TPT_PT_ASH then --8
  243. if math.random(1,20) < 2 then --9
  244. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  245. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  246. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
  247. sim.partKill(r)
  248. end --9
  249. end --8
  250. if sim.partProperty(r, "type") == elements.DEFAULT_PT_OXYG then --10
  251. if math.random(1,20) < 2 then --11
  252. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  253. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  254. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.DEFAULT_PT_CO2)
  255. sim.partKill(r)
  256. end --11
  257. end --10
  258. if math.random(1,125) == 1 then --12
  259. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-3,y+1),elements.TPT_PT_BCTRC)
  260. end --12
  261. if math.random(1,10000) == 1 then --12
  262. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRA)
  263. end --12
  264. end --3
  265. end --2
  266. end --1
  267. ) --*1
  268.  
  269. elements.property(elem.TPT_PT_BACT, "Update", --*1
  270. function(i,x,y,s,nt) --1
  271. if s ~=8 and nt ~=0 and nt - s > 0 then --2
  272. for r in sim.neighbors(x,y,1,1) do --3
  273. if math.random(1,20) > 1 then --4
  274. sim.partProperty(i, "vy", -0.01)
  275. end --4
  276. if math.random(1,20) > 1 then --5
  277. sim.partProperty(i, "vx", 0)
  278. end --5
  279. if math.random(1,20) < 2 then --6
  280. sim.partCreate(-1, math.random(x-1,x+1),math.random(y-1,y+1),elements.TPT_PT_BCTRC)
  281. sim.partKill(i)
  282. end --6
  283. end --3
  284. end --2
  285. end --1
  286. ) --*1
  287.  
  288. local co2s = elements.allocate("TPT", "CSNW")
  289. elements.element(co2s, elements.element(elements.DEFAULT_PT_SNOW))
  290. elements.property(co2s, "Name" , "CSNW")
  291. elements.property(co2s, "Description" , "CO2 Snow.")
  292. elements.property(co2s, "Color", 0xC2C2C2)
  293. elements.property(co2s, "Diffusion", 0.1)
  294. elements.property(co2s, "HighTemperature", 10001)
  295. elements.property(co2s, "Temperature", 186.65)
  296. elements.property(co2s, "Weight", 31)
  297. elements.property(co2s, "MenuSection", 16)
  298. elements.property(elements.TPT_PT_CSNW, "Update", --*1
  299. function(i,x,y) --1
  300. if sim.partProperty(i, "temp") > 194.65 then --2
  301. if math.random(1,450) == 1 then --3
  302. sim.partChangeType(i, elements.DEFAULT_PT_CO2)
  303. end --3
  304. end --2
  305. end --1
  306. ) --*1
  307.  
  308. elements.property(elements.DEFAULT_PT_DRIC, "HighPressure", 1.2)
  309. elements.property(elements.DEFAULT_PT_DRIC, "HighPressureTransition", elements.TPT_PT_CSNW)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement