Advertisement
MrSalit0s

GOLD

Apr 25th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. --[[    element: Gold   by MrSalit0s    ]]
  2. local Gold = elements.allocate("MOD", "GOLD")
  3. elements.element(elements.MOD_PT_GOLD, elements.element(elements.DEFAULT_PT_METL))
  4. elements.property(elements.MOD_PT_GOLD, "Name", "GOLD")
  5. elements.property(elements.MOD_PT_GOLD, "Description", "Gold")
  6. elements.property(elements.MOD_PT_GOLD, "Colour", 0xFFDCAD2C)
  7. elements.property(elements.MOD_PT_GOLD, "MenuSection", 9)
  8. elements.property(elements.MOD_PT_GOLD, "Properties", 0x4124)
  9. elements.property(elements.MOD_PT_GOLD, "Temperature", 295)
  10. elements.property(elements.MOD_PT_GOLD, "Meltable", 1)
  11. elements.property(elements.MOD_PT_GOLD, "HighTemperature", 1273.15)
  12. elements.property(elements.MOD_PT_GOLD, "HighTemperatureTransition", tpt.element("LAVA"))
  13.  
  14. local elem = tpt.get_property("type", ox, oy)
  15.  
  16. local function gold(i,x,y,s,n)
  17. local ox = x+math.random(-1,1)
  18. local oy = y+math.random(-1,1)
  19.     if simulation.pressure(x/4, y/4) >= 0 then      --blocks pressure
  20.         simulation.pressure(x/4, y/4, 0)
  21.     end
  22.     if tpt.get_property("type",ox, oy) == elements.DEFAULT_PT_BMTL or tpt.get_property("type",ox, oy) == elements.DEFAULT_PT_BRMT then
  23.         tpt.set_property("type",elements.DEFAULT_PT_IRON,ox,oy)
  24.     end
  25. end
  26.  
  27. local function goldlava(i,x,y,s,n)
  28. local ox = x+math.random(-1,1)
  29. local oy = y+math.random(-1,1)
  30.     if tpt.get_property("ctype",i) == elements.MOD_PT_GOLD and tpt.get_property("type",ox, oy) == elements.DEFAULT_PT_EXOT then
  31.         tpt.set_property("ctype",elements.DEFAULT_PT_VIBR,i)
  32.     end
  33. end
  34.  
  35. local function goldgraphics(i, colr, colg, colb)
  36.     return 1,0x00000124,225,220,173,44,225,220,173,44
  37. end
  38.  
  39. tpt.graphics_func(goldgraphics,elements.MOD_PT_GOLD)
  40. tpt.element_func(gold,elements.MOD_PT_GOLD)
  41. tpt.element_func(goldlava,elements.DEFAULT_PT_LAVA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement