Advertisement
CatMcChicken

Uranium 235 lua script TPT

Jan 28th, 2017
598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. local a = elements.allocate("U235" , "U235")
  2. elements.element(a, elements.element(elements.DEFAULT_PT_PLUT))
  3. elements.property(a, "Name" , "U235")
  4. elements.property(a, "Description" , "Uranium 235")
  5. function plutonium(i,x,y,s,n)
  6. if tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1)) == tpt.el.neut.id then
  7. if math.random(1,3) == 1 then
  8. tpt.parts[i].type = tpt.el.neut.id
  9. sim.pressure(x/4,y/4,75)
  10. tpt.set_property("temp", math.huge, x, y)
  11. elseif math.random(1,3) == 2 then
  12. tpt.parts[i].type = tpt.el.exot.id
  13. sim.pressure(x/4,y/4,75)
  14. tpt.set_property("temp", math.huge, x, y)
  15. elseif math.random(1,3) == 3 then
  16. tpt.parts[i].type = tpt.el.plut.id
  17. sim.pressure(x/4,y/4,75)
  18. tpt.set_property("temp", math.huge, x ,y)
  19. end
  20. end
  21. if sim.pressure(x/4,y/4) > 1 then
  22. if math.random(1,250) == 10 then
  23. tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'neut')
  24. end
  25. end
  26. end
  27. tpt.element_func(plutonium,a)
  28. function neutron(i,x,y,s,n)
  29. if tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1)) == a then
  30. if math.random(1,30) == 10 then
  31. tpt.create(x + math.random(-1,1), y + math.random(-1,1), 'neut')
  32. end
  33. end
  34. end
  35. tpt.element_func(neutron,tpt.el.neut.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement