Guest User

Untitled

a guest
Sep 11th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. local magic = elem.allocate("LIVINGFOSSIL" , "MAGC")
  2. elem.element(magic, elem.element(elements.DEFAULT_PT_GLOW))
  3. elem.property(magic, "Name" , "MAGC")
  4. elem.property(magic, "Description", "Magic. Very light glowing liquid. Burns with CFLM.")
  5. elem.property(magic, "Colour", 0xCDFFFF)
  6. elem.property(magic, "MenuVisible", 1)
  7. elem.property(magic, "MenuSection", elem.SC_LIQUID)
  8. elem.property(magic, "Gravity", 0.02)
  9. elem.property(magic, "Flammable", 0)
  10. elem.property(magic, "Explosive", 0)
  11. elem.property(magic, "Loss", 0.95)
  12. elem.property(magic, "AirLoss", 1)
  13. elem.property(magic, "AirDrag", 0.002)
  14. elem.property(magic, "Advection", 0.6)
  15. elem.property(magic, "Weight", 2)
  16. elem.property(magic, "Diffusion", 0)
  17. elem.property(magic, "Falldown", 2)
  18. elem.property(magic, "State", 2)
  19. elem.property(magic, "Temperature", 273.15-20)
  20. elem.property(magic, "HeatConduct", 20)
  21. elem.property(magic, "Hardness", 20)
  22.  
  23. elem.property(magic, "Graphics", function (i, colr, colg, colb)                                  
  24.     return 1, 0x00010012, 255, 185, 254, 247, 150, 185, 254, 247
  25. end)
  26.  
  27. elem.property(magic, "Update", function (i, x, y, s, n)
  28.      if sim.partProperty(i, sim.FIELD_TEMP) > 273.15-150 and sim.partProperty(i, sim.FIELD_LIFE) == 0 then
  29.         sim.partProperty(i, sim.FIELD_LIFE, 40)
  30.     end
  31.         if sim.partProperty(i, sim.FIELD_TEMP) <= 273.15-150 then
  32.             local burnlife = tpt.get_property("life", x, y)
  33.             if burnlife > 0 then
  34.                 for cx = 1, 3, 2 do
  35.                     for cy = 1, 3, 2 do
  36.                         tpt.create(x + cx, y + cy, 'cflm')
  37.                     end
  38.                 end
  39.             end
  40.             sim.partProperty(i, sim.FIELD_LIFE, burnlife - 1)
  41.             if tpt.get_property("life", x, y) <= 0 then
  42.                 sim.partProperty(i, sim.FIELD_TYPE, 0)
  43.             end
  44.         end
  45.        
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment