Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. local nmeta = {}
  2. nmeta.property = function(self,...) return elem.property(self,...) end
  3. nmeta.element = function(self,...) return elem.element(self,...) end
  4. nmeta.__call = print
  5. nmeta.__index = nmeta
  6. debug.setmetatable(0,nmeta)
  7.  
  8. local mtwt = elem.allocate("MARKHUSS", "MTWT")
  9. mtwt:element(elem.element(elem.DEFAULT_PT_DMND))
  10. mtwt:property("Name", "MTWT")
  11. mtwt:property("Description", "markHuss test water for ctype shenanigans")
  12. mtwt:property("Colour", 0x2030d0)
  13. mtwt:property("MenuVisible", 0)
  14. mtwt:property("MenuSection", elem.SC_SPECIAL)
  15. mtwt:property("Advection", 0.6)
  16. mtwt:property("AirDrag", 0.01)
  17. mtwt:property("AirLoss", 0.98)
  18. mtwt:property("Loss", 0.95)
  19. mtwt:property("Collision", 0)
  20. mtwt:property("Gravity", 0.1)
  21. mtwt:property("Diffusion", 0)
  22. mtwt:property("HotAir", 0)
  23. mtwt:property("Explosive", 0)
  24. mtwt:property("Flammable", 0)
  25. mtwt:property("Hardness", 20)
  26. mtwt:property("Meltable", 0)
  27. mtwt:property("Weight", 30)
  28. mtwt:property("HeatConduct", 29)
  29. mtwt:property("Temperature", 293.15)
  30. mtwt:property("Falldown", 2)
  31. mtwt:property("State", elem.ST_LIQUID)
  32. mtwt:property("Properties", elem.TYPE_LIQUID)
  33. mtwt:property("LowPressure", 10000)
  34. mtwt:property("LowPressureTransition", 0)
  35. mtwt:property("HighPressure", 10000)
  36. mtwt:property("HighPressureTransition", 0)
  37. mtwt:property("LowTemperature", 10000)
  38. mtwt:property("LowTemperatureTransition", 0)
  39. mtwt:property("HighTemperature", 10000)
  40. mtwt:property("HighTemperatureTransition", 0)
  41. elem.DEFAULT_PT_WATR:property("Update", function(i, x, y, ss, nt)
  42. local close = nt - ss
  43. if close >= 4 then
  44. local neighbour = sim.partID(x, y + 1)
  45. if neighbour then
  46. local neighbour_ctype = sim.partProperty(neighbour, "ctype")
  47. if neighbour_ctype ~= elem.DEFAULT_PT_WATR then
  48. sim.partKill(x, y + 1)
  49. local repl = sim.partCreate(-3, x, y + 1, elem.DEFAULT_PT_WATR)
  50. if repl ~= -1 then
  51. sim.partProperty(repl, "ctype", neighbour_ctype)
  52. sim.partProperty(repl, "dcolour", sim.decoColour(
  53. neighbour_ctype * 2,
  54. close * 45,
  55. neighbour_ctype * 2 + close * 20
  56. ))
  57. end
  58. end
  59. end
  60. end
  61. end, 1)
  62. mtwt:property("Graphics", function(i, colr, colg, colb)
  63. return 1, ren.PMODE_FLAT, 255, colr, colg, colb, 0, 0, 0, 0
  64. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement