Advertisement
PastebinLuaMaker

Powder Power Mod(For Powder Toy)

Jul 12th, 2021 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.27 KB | None | 0 0
  1. PowdPowe = {
  2.     setname="NONE",
  3. }
  4. function PowdPowe.loadset(setname)
  5.     if setname=="nitrousSet" then
  6.         print("Loading set...")
  7.         local ntoo = elements.allocate("POWDERPOWER", "N2O")
  8.         local ntol = elements.allocate("POWDERPOWER", "N2OL")
  9.         local ntwo = elements.allocate("POWDERPOWER", "N2")
  10.         local ntod = elements.allocate("POWDERPOWER", "N2OD")
  11.    
  12.         elements.element(ntoo, elements.element(elements.DEFAULT_PT_HYGN))
  13.         elements.property(ntoo, "Name", "N2O")
  14.         elements.property(ntoo, "Description", "Nitrous Oxide. Explodes under pressure or by fire. Liquifies into N2OL at -123C.")
  15.         elements.property(ntoo, "Colour", 0x448D9C)
  16.         elements.property(ntoo, "MenuSection", elem.SC_GAS)
  17.         elements.property(ntoo, "Diffusion", 0.5)
  18.         elements.property(ntoo, "Weight", 1)
  19.         elements.property(ntoo, "Temperature", 300)
  20.         elements.property(ntoo, "HighPressure", 20)
  21.         elements.property(ntoo, "HighPressureTransition", elements.DEFAULT_PT_FIRE)
  22.         elements.property(ntoo, "Explosive", 1)
  23.         elements.property(ntoo, "Flammable", 1)
  24.         elements.property(ntoo, "LowTemperature", 150)
  25.         elements.property(ntoo, "LowTemperatureTransition", elements.POWDERPOWER_PT_N2OL)
  26.         elements.property(ntoo, "MenuVisible", 1)
  27.         elements.property(ntoo, "Properties", TYPE_GAS)
  28.  
  29.         elements.element(ntol, elements.element(elements.DEFAULT_PT_LOXY))
  30.         elements.property(ntol, "Name", "N2OL")
  31.         elements.property(ntol, "Description", "Nitrous Oxide as a liquid. Same thing as N2O. Evaporates at -123C. There is a bug where N2OL just sucks up DESL.")
  32.         elements.property(ntol, "Colour", 0x448D9C)
  33.         elements.property(ntol, "MenuSection", elem.SC_LIQUID)
  34.         elements.property(ntol, "Falldown", 2)
  35.         elements.property(ntol, "Diffusion", 0)
  36.         elements.property(ntol, "Weight", 49)
  37.         elements.property(ntol, "Temperature", 140)
  38.         elements.property(ntol, "HighPressure", 20)
  39.         elements.property(ntol, "HighPressureTransition", elements.DEFAULT_PT_FIRE)
  40.         elements.property(ntol, "Explosive", 1)
  41.         elements.property(ntol, "Flammable", 1)
  42.         elements.property(ntol, "LowTemperature", ITL)
  43.         elements.property(ntol, "HighTemperature", 150)
  44.         elements.property(ntol, "HighTemperatureTransition", elements.POWDERPOWER_PT_N2O)
  45.         elements.property(ntol, "MenuVisible", 1)
  46.         elements.property(ntol, "Gravity", 0.04)
  47.         elements.property(ntol, "Properties", TYPE_LIQUID)
  48.         local function funcUpdate(i,x,y,s,nt)
  49.             for r in sim.neighbors(x,y,1,1) do
  50.                if sim.partProperty(r, "type") == elem.DEFAULT_PT_DESL then
  51.                    sim.partChangeType(r, elem.DEFAULT_PT_N2OD)
  52.                end
  53.            end
  54.         end
  55.         elements.property(ntoo, "Update", funcUpdate)
  56.         elements.property(ntol, "Update", funcUpdate)
  57.  
  58.         elements.element(ntwo, elements.element(elements.DEFAULT_PT_HYGN))
  59.         elements.property(ntwo, "Name", "N2")
  60.         elements.property(ntwo, "Description", "Nitrogen. Mixes with OXYG to make N2O on contact. This can only be spawned by itself, as N2 from LN2 dissipates fast.")
  61.         elements.property(ntwo, "Colour", 0x448D9C)
  62.         elements.property(ntwo, "MenuSection", elem.SC_GAS)
  63.         elements.property(ntwo, "Diffusion", 0.5)
  64.         elements.property(ntwo, "Weight", 1)
  65.         elements.property(ntwo, "Temperature", 300)
  66.         elements.property(ntwo, "Explosive", 1)
  67.         elements.property(ntwo, "Flammable", 1)
  68.         elements.property(ntwo, "LowTemperature", 45)
  69.         elements.property(ntwo, "LowTemperatureTransition", elements.DEFAULT_PT_LN2)
  70.         elements.property(ntwo, "MenuVisible", 1)
  71.  
  72.         elements.element(ntod, elements.element(elements.DEFAULT_PT_DESL))
  73.         elements.property(ntod, "Name", "N2OD")
  74.         elements.property(ntod, "Description", "Nitrous Oxide mixed with diesel. HIGHLY explosive. Handle with care.")
  75.         elements.property(ntod, "Colour", 0x930DDB)
  76.         elements.property(ntod, "MenuSection", elem.SC_LIQUID)
  77.         elements.property(ntod, "Falldown", 2)
  78.         elements.property(ntod, "Diffusion", 0)
  79.         elements.property(ntod, "Weight", 49)
  80.         elements.property(ntod, "Temperature", 300)
  81.         elements.property(ntod, "HighPressure", 20)
  82.         elements.property(ntod, "HighPressureTransition", elements.DEFAULT_PT_FIRE)
  83.         elements.property(ntod, "Explosive", 1)
  84.         elements.property(ntod, "Flammable", 1)
  85.         elements.property(ntod, "MenuVisible", 1)
  86.         elements.property(ntod, "Gravity", 0.04)
  87.         elements.property(ntod, "Properties", TYPE_LIQUID)
  88.         print("Loaded.")
  89.         print("N2 can only be spawned by its own.")
  90.     end
  91.     if setname=="copperSet" then
  92.         print("Loading Copper Set... Please wait")
  93.         local copr = elements.allocate("POWDERPOWER", "COPR")
  94.         local mocp = elements.allocate("POWDERPOWER", "MOCP")
  95.  
  96.         elements.element(mocp, elements.element(elements.DEFAULT_PT_LAVA))
  97.         elements.property(mocp, "Name", "Molten Copper")
  98.         elements.property(mocp, "Description", "Molten Copper.")
  99.         elements.property(mocp, "Properties", TYPE_LIQUID)
  100.         elements.property(mocp, "LowTemperature", "1360.15")
  101.         elements.property(mocp, "LowTemperatureTransition", POWDERPOWER_PT_COPR)
  102.         elements.property(mocp, "MenuVisible", 0)
  103.        
  104.         elements.element(copr, elements.element(elements.DEFAULT_PT_METL))
  105.         elements.property(copr, "Properties", PROP_CONDUCTS, PROP_LIFE_DEC, PROP_HOT_GLOW)
  106.         elements.property(copr, "Name", "COPR")
  107.         elements.property(copr, "Description", "Copper. Melts at 1,085 C. Conducts.")
  108.         elements.property(copr, "Color", "0X6B6830")
  109.         elements.property(copr, "HighTemperature", "1360.15")
  110.         elements.property(copr, "HighTemperatureTransition", POWDERPOWER_PT_MOCP)
  111.         print("Loaded")
  112.     end
  113. end
  114. function PowdPowe.clearAll()
  115.     elements.loadDefault()
  116.     print("Cleared added elements")
  117. end
  118. function PowdPowe.loadextra(extra)
  119.     print("Command not avaliable yet")
  120. end
  121. print("POWDER POWER. Use PowdPowe.loadset(SETNAMEHERE) (Surrounded by quotation marks, I do not want to confuse tpt)")
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement