Advertisement
TPT_PL

Boron (B)

Oct 11th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local B = elem.allocate("YOL0", "BORN")
  2. elem.element(B, elem.element(elem.DEFAULT_PT_PLEX))
  3. elem.property(B, "Name", "BRON")
  4. elem.property(B, "Description", "Boron, halfs the life of NEUT without having them pass through, can be used in nuclear reactors.")
  5. elem.property(B, "Flammable", 0)
  6. elem.property(B, "Color", 0xcccc00)
  7. elem.property(B, "MenuSection", elem.SC_SOLIDS)
  8. elem.property(B, "Properties", elem.PROP_DEADLY)
  9.  
  10. local function boron(i, x, y, s, nt)
  11.     for r in sim.neighbors(x, y, 1, 1) do
  12.         if sim.partProperty(r, "type") == elem.DEFAULT_PT_NEUT then
  13.             sim.partProperty(r, "life", math.ceil(sim.partProperty(r, "life")/2))
  14.         end
  15.     end
  16. end
  17.  
  18. elem.property(B, "Update", boron)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement