Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nucleartab = elem.allocate("EXOTIC", "BBACK") -- The BACK button, defined before all for a good effect :P
- -- Element defines - exotic
- local ciso = elem.allocate("EXOTIC", "CISO")
- local diso = elem.allocate("EXOTIC", "DISO")
- local eiso = elem.allocate("EXOTIC", "EISO")
- local emv = elem.allocate("EXOTIC", "EMV")
- local pemv = elem.allocate("EXOTIC", "PEMV")
- local redspot = elem.allocate("EXOTIC", "JRSR")
- local hemp = elem.allocate("EXOTIC", "HEMP")
- -- Element defines - crystals
- local red = elem.allocate("EXOTIC", "R97A")
- local yellow = elem.allocate("EXOTIC", "Y119")
- local green = elem.allocate("EXOTIC", "G73C")
- local cyan = elem.allocate("EXOTIC", "CN15")
- local blue = elem.allocate("EXOTIC", "BL63")
- local magenta = elem.allocate("EXOTIC", "M201")
- local solution = elem.allocate("EXOTIC", "RWTR")
- -- Exotic elements' properties:
- -- HEMP
- elem.element(hemp, elem.element(elem.DEFAULT_PT_MERC))
- elem.property(hemp, "Name", "HEMP")
- elem.property(hemp, "Description", "Highly Exotic Metallic Plasmoid, highly conductive, isotopic decay of destabilized CISO upon red spot radiation.")
- elem.property(hemp, "MenuSection", elem.SC_NUCLEAR)
- elem.property(hemp, "Color", 0xBFFBFB)
- elem.property(hemp, "Weight", 99)
- elem.property(hemp, "Falldown", 2)
- elem.property(hemp, "Gravity", 5)
- elem.property(hemp, "Diffusion", 2)
- elem.property(hemp, "Temperature", 0)
- elem.property(hemp, "Advection", 2)
- elem.property(hemp, "Explosive", 1)
- elem.property(hemp, "HighTemperature", 1600)
- elem.property(hemp, "HighTemperatureTransition", elem.DEFAULT_PT_EXOT)
- elem.property(hemp, "LowPressure", -20)
- elem.property(hemp, "LowPressureTransition", emv)
- elem.property(hemp, "MenuVisible", 0)
- elem.property(elem.DEFAULT_PT_EXOT, "Description", "Exotic, non-conductive isotopic decay of HEMP, sensitive to energy particles.")
- elem.property(elem.DEFAULT_PT_EXOT, "Hardness", -1)
- elem.property(elem.DEFAULT_PT_EXOT, "Color", 0xBFFBFB)
- elem.property(elem.DEFAULT_PT_EXOT, "Advection", 0.3)
- elem.property(elem.DEFAULT_PT_EXOT, "MenuVisible", 0)
- elem.property(elem.DEFAULT_PT_EXOT, "HighPressure", 55)
- elem.property(elem.DEFAULT_PT_EXOT, "HighPressureTransition", elem.DEFAULT_PT_HYGN)
- -- CISO
- elem.element(ciso, elem.element(elem.DEFAULT_PT_WAX))
- elem.property(ciso, "Name", "CISO")
- elem.property(ciso, "Description", "Crystaline Isotope, unstable, forms within Isotope Z upon Jupiter's red spot radiation.")
- elem.property(ciso, "Flammable", 0)
- elem.property(ciso, "MenuSection", elem.SC_NUCLEAR)
- elem.property(ciso, "Temperature", 313.15)
- elem.property(ciso, "Color", 0xFFAA55)
- elem.property(ciso, "Hardness", 2)
- elem.property(ciso, "Weight", 101.0)
- elem.property(ciso, "HighPressure", 25)
- elem.property(ciso, "HighPressureTransition", elem.DEFAULT_PT_ELEC)
- elem.property(ciso, "HighTemperatureTransition", diso)
- elem.property(ciso, "MenuVisible", 0)
- -- DISO
- elem.element(diso, elem.element(elem.DEFAULT_PT_MWAX))
- elem.property(diso, "Name", "DISO")
- elem.property(diso, "Description", "Destabilized C Isotope, slightly radioactive and vaporous. Fusionates to NBLE/EXOT at high temperature and pressure.")
- elem.property(diso, "Hardness", 2)
- elem.property(diso, "Flammable", 0)
- elem.property(diso, "Temperature", 273.15-255.00)
- elem.property(diso, "MenuSection", elem.SC_NUCLEAR)
- elem.property(diso, "Color", 0x1111AA11)
- elem.property(diso, "Weight", 85.5)
- elem.property(diso, "Gravity", -0.7)
- elem.property(diso, "Diffusion", 4.5)
- elem.property(diso, "LowTemperatureTransition", ciso)
- elem.property(diso, "MenuVisible", 0)
- -- EISO
- elem.element(eiso, elem.element(elem.DEFAULT_PT_GLOW))
- elem.property(eiso, "Name", "EISO")
- elem.property(eiso, "Description", "E Isotope, radioactive decay of destabilized C Isotope (DISO).")
- elem.property(eiso, "Hardness", -1)
- elem.property(eiso, "MenuSection", elem.SC_NUCLEAR)
- elem.property(eiso, "MenuVisible", 0)
- elem.property(eiso, "Properties", elem.TYPE_LIQUID+elem.PROP_HOT_GLOW)
- elem.property(eiso, "HighTemperature", 1400.00)
- elem.property(eiso, "HighTemperatureTransition", hemp)
- elem.property(eiso, "Meltable", 1)
- -- EMV
- elem.element(emv, elem.element(elem.DEFAULT_PT_PSTE))
- elem.property(emv, "Name", "EMV")
- elem.property(emv, "Description", "Exotic metallic vapour, conductive only once. Formed from HEMP at low pressure (one-way reaction).")
- elem.property(emv, "Color", 0xBFFBFF)
- elem.property(emv, "MenuSection", elem.SC_NUCLEAR)
- elem.property(emv, "Diffusion", 1.5)
- elem.property(emv, "Gravity", 0.5)
- elem.property(emv, "Weight", 1.0)
- elem.property(emv, "Temperature", 10.0)
- elem.property(emv, "Hardness", 4)
- elem.property(emv, "Properties", elem.TYPE_GAS+elem.PROP_CONDUCTS)
- elem.property(emv, "MenuVisible", 0)
- elem.property(emv, "HighPressureTransition", pemv)
- elem.property(emv, "HighTemperature", 1800.0)
- elem.property(emv, "HighTemperatureTransition", eiso)
- -- PEMV
- elem.element(pemv, elem.element(elem.DEFAULT_PT_PSTS))
- elem.property(pemv, "Name", "PEMV")
- elem.property(pemv, "Description", "Pressurized exotic metallic vapour, unstable, turns into VIBR under high temperature.")
- elem.property(pemv, "Color", 0xCCFF66)
- elem.property(pemv, "MenuSection", elem.SC_NUCLEAR)
- elem.property(pemv, "HighTemperature", 8888.0)
- elem.property(pemv, "HighTemperatureTransition", elem.DEFAULT_PT_VIBR)
- elem.property(pemv, "LowPressureTransition", emv)
- elem.property(pemv, "HighPressure", 200)
- elem.property(pemv, "HighPressureTransition", redspot)
- -- JRSR
- elem.element(redspot, elem.element(elem.DEFAULT_PT_ANAR))
- elem.property(redspot, "Name", "JRSR")
- elem.property(redspot, "Description", "Jupiter's red spot radiation, radioactive emissions affected by the cosmic rays.")
- elem.property(redspot, "Flammable", 0)
- elem.property(redspot, "Weight", 101.0)
- elem.property(redspot, "Temperature", 223.15)
- elem.property(redspot, "Hardness", -1)
- elem.property(redspot, "Color", 0xFF11FFFF)
- elem.property(redspot, "Gravity", 0.0)
- elem.property(redspot, "Diffusion", 4.0)
- elem.property(redspot, "Falldown", -1)
- elem.property(redspot, "MenuSection", elem.SC_NUCLEAR)
- elem.property(redspot, "AirLoss", 1)
- elem.property(redspot, "AirDrag", 0)
- elem.property(redspot, "MenuVisible", 0)
- -- Crystals' properties:
- -- Rauth's water (RWTR)
- elem.element(solution, elem.element(elem.DEFAULT_PT_GLOW))
- elem.property(solution, "Name", "RWTR")
- elem.property(solution, "Description", "Rauth's water, universal crystal solution, used to grow synthetic crystals.")
- elem.property(solution, "Color", 0xF2D9E6)
- elem.property(solution, "MenuSection", elem.SC_NUCLEAR)
- elem.property(solution, "MenuVisible", 0)
- -- R97A
- elem.element(red, elem.element(elem.DEFAULT_PT_DMND))
- elem.property(red, "Name", "R97A")
- elem.property(red, "Description", "Red-97a crystal, often suddently decays creating a shockwave.")
- elem.property(red, "Weight", 101.5)
- elem.property(red, "Temperature", 295.15)
- elem.property(red, "Hardness", -1)
- elem.property(red, "Color", 0xFFC80000)
- elem.property(red, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPENETRATE+elem.PROP_RADIOACTIVE)
- elem.property(red, "MenuSection", elem.SC_NUCLEAR)
- elem.property(red, "MenuVisible", 0)
- -- Y119
- elem.element(yellow, elem.element(elem.DEFAULT_PT_DMND))
- elem.property(yellow, "Name", "Y119")
- elem.property(yellow, "Description", "Yellow-119, grows more rapidly than other crystals, decays with NEUT.")
- elem.property(yellow, "Weight", 101.5)
- elem.property(yellow, "Temperature", 295.15)
- elem.property(yellow, "Hardness", -1)
- elem.property(yellow, "Color", 0xFFFFFF00)
- elem.property(yellow, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPENETRATE+elem.PROP_RADIOACTIVE)
- elem.property(yellow, "MenuSection", elem.SC_NUCLEAR)
- elem.property(yellow, "MenuVisible", 0)
- -- G73C
- elem.element(green, elem.element(elem.DEFAULT_PT_DMND))
- elem.property(green, "Name", "G73C")
- elem.property(green, "Description", "Green-73c, contains major amounts of vibranium. Also emits GRVT.")
- elem.property(green, "Weight", 101.5)
- elem.property(green, "Temperature", 295.15)
- elem.property(green, "Hardness", -1)
- elem.property(green, "Color", 0xFF00C800)
- elem.property(green, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPENETRATE+elem.PROP_RADIOACTIVE)
- elem.property(green, "MenuSection", elem.SC_NUCLEAR)
- elem.property(green, "MenuVisible", 0)
- -- CN15
- elem.element(cyan, elem.element(elem.DEFAULT_PT_DMND))
- elem.property(cyan, "Name", "CN15")
- elem.property(cyan, "Description", "Cyan-15, most stable crystal, emits scarce gamma radiation (PHOT).")
- elem.property(cyan, "Weight", 101.5)
- elem.property(cyan, "Temperature", 295.15)
- elem.property(cyan, "Hardness", -1)
- elem.property(cyan, "Color", 0xFF00C8C8)
- elem.property(cyan, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_RADIOACTIVE)
- elem.property(cyan, "MenuSection", elem.SC_NUCLEAR)
- elem.property(cyan, "MenuVisible", 0)
- -- BL63
- elem.element(blue, elem.element(elem.DEFAULT_PT_DMND))
- elem.property(blue, "Name", "BL63")
- elem.property(blue, "Description", "Blue-63, doesn't grow with RWTR, also found in small quantities on Jupiter.")
- elem.property(blue, "Weight", 101.5)
- elem.property(blue, "Temperature", 295.15)
- elem.property(blue, "Hardness", -1)
- elem.property(blue, "Color", 0xFF0000C8)
- elem.property(blue, "Properties", elem.TYPE_SOLID+elem.PROP_NEUTPASS+elem.PROP_RADIOACTIVE)
- elem.property(blue, "MenuSection", elem.SC_NUCLEAR)
- elem.property(blue, "MenuVisible", 0)
- elem.element(magenta, elem.element(elem.DEFAULT_PT_DMND))
- elem.property(magenta, "Name", "M201")
- elem.property(magenta, "Description", "Magenta-201, generates ionized NBLE around while decaying.")
- elem.property(magenta, "Weight", 101.5)
- elem.property(magenta, "Temperature", 295.15)
- elem.property(magenta, "Hardness", -1)
- elem.property(magenta, "Color", 0xFFC800C8)
- elem.property(magenta, "MenuSection", elem.SC_NUCLEAR)
- elem.property(magenta, "MenuVisible", 0)
- -- Minor changes + resistance to JRSR
- elem.property(elem.DEFAULT_PT_DMND, "Weight", 200.5)
- elem.property(elem.DEFAULT_PT_VOID, "Weight", 200.5)
- elem.property(elem.DEFAULT_PT_CLNE, "Weight", 200.5)
- elem.property(elem.DEFAULT_PT_PVOD, "Weight", 200.5)
- elem.property(elem.DEFAULT_PT_PCLN, "Weight", 200.5)
- elem.property(elem.DEFAULT_PT_IRON, "Weight", 101.5)
- elem.property(elem.DEFAULT_PT_TTAN, "Weight", 102.5)
- elem.property(elem.DEFAULT_PT_CO2, "Hardness", 0)
- elem.property(elem.DEFAULT_PT_WTRV, "Hardness", 0)
- elem.property(elem.DEFAULT_PT_WATR, "Hardness", 2)
- elem.property(elem.DEFAULT_PT_DSTW, "Hardness", 2)
- elem.property(elem.DEFAULT_PT_BUBW, "Hardness", 1)
- elem.property(elem.DEFAULT_PT_SLTW, "Hardness", 0)
- elem.property(elem.DEFAULT_PT_ACID, "Flammable", 0)
- -- Graphics and updates
- local function cisotope(i, x, y, s, nt)
- if sim.partProperty(i, "life") == 0 then
- sim.partProperty(i, "life", 8)
- end;
- local ox = math.random(x-1, x+1);
- local oy = math.random(y-1, y+1);
- local r = sim.partID(ox, oy)
- if r ~= nil and sim.partProperty(r, "type") == redspot then
- sim.partProperty(i, "type", hemp)
- sim.partProperty(r, "type", eiso)
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")+100)
- sim.partCreate(-1, math.random(x-1, x+1), math.random(y-1, y+1), elem.DEFAULT_PT_CAUS)
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end
- end
- local function disotope(i, x, y, s, nt)
- if sim.partProperty(i, "life") == 0 then
- sim.partProperty(i, "life", 8)
- end;
- local ox = math.random(x-1, x+1);
- local oy = math.random(y-1, y+1);
- local r = sim.partID(ox, oy)
- if r ~= nil and sim.partProperty(r, "type") == redspot then
- sim.partProperty(i, "type", hemp)
- sim.partProperty(r, "type", eiso)
- sim.partProperty(r, "temp", sim.partProperty(r, "temp")+100)
- sim.partCreate(-1, math.random(x-1, x+1), math.random(y-1, y+1), elem.DEFAULT_PT_CAUS)
- sim.partProperty(i, "life", sim.partProperty(i, "life")-1)
- end
- local pressure = sim.pressure(x/4, y/4)
- if pressure >= 25 and sim.partProperty(i, "temp") >= 7773.15 then
- sim.partChangeType(i, elem.DEFAULT_PT_NBLE)
- sim.partCreate(-3, x, y, elem.DEFAULT_PT_EXOT)
- sim.partCreate(-3, x, y, elem.DEFAULT_PT_NBLE)
- phot = sim.partCreate(-3, x, y, elem.DEFAULT_PT_PHOT)
- sim.partProperty(phot, "ctype", 126976)
- end
- end
- local function radiate(i, x, y, s, nt)
- local ox = math.random(x-1, x+1);
- local oy = math.random(y-1, y+1);
- local r = sim.partID(ox, oy)
- if r ~= nil then
- if sim.partProperty(r, "type") == elem.DEFAULT_PT_ISOZ or sim.partProperty(r, "type") == elem.DEFAULT_PT_ISZS then
- sim.partChangeType(r, ciso)
- end
- end
- end
- local function solute(i, x, y, s, nt)
- local ox = math.random(x-1, x+1);
- local oy = math.random(y-1, y+1);
- local r = sim.partID(ox, oy)
- if r ~= nil and sim.partProperty(r, "type") == elem.DEFAULT_PT_LAVA and sim.partProperty(r, "ctype") == elem.DEFAULT_PT_QRTZ then
- sim.partChangeType(i, solution)
- sim.partChangeType(r, solution)
- end
- end
- -- Crystals |
- -- V
- local function redcrystal(i, x, y, s, nt)
- if math.random(1,100000) == 1 then
- sim.partChangeType(i, yellow)
- sim.pressure(x/4,y/4,(sim.pressure(x/4,y/4)+50))
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PROT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PROT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PROT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PROT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PROT)
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == solution then
- if math.random(1,2000) == 1 then
- sim.partChangeType(r, red)
- end
- end
- end
- if sim.partProperty(i, "temp") < 10 then
- sim.partChangeType(i, ciso)
- end
- end
- function yellowcrystal(i, x, y, s, nt)
- if math.random(1,100000) == 1 then
- sim.partChangeType(i, green)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_NEUT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_NEUT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_NEUT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_NEUT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_NEUT)
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == solution then
- if math.random(1,1000) == 1 then
- sim.partChangeType(r, yellow)
- end
- end
- end
- if sim.partProperty(i, "temp") < 10 then
- sim.partChangeType(i, ciso)
- end
- end
- function greencrystal(i, x, y, s, nt)
- if math.random(1,100000) == 1 then
- if math.random(0, 1) == 0 then
- sim.partChangeType(i, cyan)
- else
- sim.partChangeType(i, elem.DEFAULT_PT_VIBR)
- end;
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_GRVT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_GRVT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_GRVT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_GRVT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_GRVT)
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == solution then
- if math.random(1,2000) == 1 then
- sim.partChangeType(r, green)
- end
- end
- end
- if sim.partProperty(i, "temp") < 10 then
- sim.partChangeType(i, ciso)
- end
- end
- function cyancrystal(i, x, y, s, nt)
- if math.random(1,500000) == 1 then
- sim.partChangeType(i, blue)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PHOT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PHOT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PHOT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PHOT)
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PHOT)
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == solution then
- if math.random(1,2000) == 1 then
- sim.partChangeType(r, cyan)
- end
- end
- end
- if sim.partProperty(i, "temp") < 10 then
- sim.partChangeType(i, ciso)
- end
- end
- function bluecrystal(i, x, y, s, nt)
- if math.random(1,100000) == 1 then
- sim.partChangeType(i, magenta)
- end
- if math.random(1,2000) == 1 then
- sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), redspot)
- end
- if sim.partProperty(i, "temp") < 10 then
- sim.partChangeType(i, ciso)
- end
- end
- local function magentacrystal(i, x, y, s, nt)
- if math.random(1,100000) == 1 then
- sim.partChangeType(i, red)
- end
- if math.random(1,2000) == 1 then
- local ions = sim.partCreate(-3, x+math.random(-1,1), y+math.random(-1,1), elem.DEFAULT_PT_PLSM)
- sim.partProperty(ions, "temp", 295.15)
- sim.partProperty(ions, "ctype", elem.DEFAULT_PT_NBLE)
- end
- if sim.partProperty(i, "temp") < 10 then
- sim.partChangeType(i, ciso)
- end
- end
- -- Graphics below
- local function hempGlow(i, colr, colg, colb)
- local temp = sim.partProperty(i, "temp");
- if temp < 5000 and temp > 273.15 then
- return 0, 0x00FF0030, 255, 0, 255, 0, 75, 183, 0, 255
- elseif temp > 5000 then
- return 0, 0x00ff0020, 255, 255, 255, 0, 75, 255, 0, 0
- elseif temp < 273.15 then
- return 0, 0x00ff0020, 255, 0, 255, 255, 75, 0, 0, 255
- end
- end
- local function cisoGlow(i, r, g, b)
- glow = math.random(1,3)
- if glow == 1 then
- return 1, 0x00000001, 255, 253, 222, 202, 0, 0, 0, 0
- end
- if glow == 2 then
- return 1, 0x00000001, 255, 253, 222, 211, 0, 0, 0, 0
- end
- if glow == 3 then
- return 1, 0x00000001, 255, 253, 222, 168, 0, 0, 0, 0
- end
- end
- local function disoGlow(i, r, g, b)
- dr = math.random(0,255)
- dg = math.random(0,255)
- db = math.random(0,255)
- return 1, 0x00000021, 255, dr, dg, db, 0, 0, 0, 0
- end
- local function redspotGlow(i, r, g, b)
- rsr = math.random(0,1)
- rsg = math.random(110,160)
- rsb = math.random(130,135)
- return 1, 0x00000001, 255, rsr, rsg, rsb, 0, 0, 0, 0
- end
- -- Crystals glow
- local function redGlow(i, r, g, b)
- return 1, 0x00010001, 255, 200, 0, 0, 20, 200, 0, 0
- end
- local function yellowGlow(i, r, g, b)
- return 1, 0x00010001, 255, 255, 255, 0, 20, 255, 255, 0
- end
- local function greenGlow(i, r, g, b)
- return 1, 0x00000021, 255, 0, 200, 0, 20, 0, 200, 0
- end
- local function cyanGlow(i, r, g, b)
- return 1, 0x00020001, 255, 0, 200, 200, 20, 0, 200, 200
- end
- local function blueGlow(i, r, g, b)
- return 1, 0x00040001, 255, 0, 0, 200, 20, 0, 0, 200
- end
- local function magentaGlow(i, r, g, b)
- return 1, 0x00000011, 255, 200, 0, 200, 20, 200, 0, 200
- end
- -- Modified updates down here
- local function modifyH(i, x, y, s, nt)
- local pressure = sim.pressure(x/4, y/4)
- if pressure >= 50 and sim.partProperty(i, "temp") >= 2273.15 then
- sim.partChangeType(i, elem.DEFAULT_PT_NBLE)
- sim.partCreate(-3, x, y, elem.DEFAULT_PT_NEUT)
- local phot = sim.partCreate(-3, x, y, elem.DEFAULT_PT_PHOT)
- sim.partProperty(phot, "ctype", 4177920)
- local chance = math.random(1, 100)
- if chance <= 10 then
- sim.partCreate(-3, x, y, elem.DEFAULT_PT_ELEC)
- end
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == elem.DEFAULT_PT_PHOT then
- sim.partChangeType(i, elem.DEFAULT_PT_OXYG)
- end
- end
- end
- local function modifyO(i, x, y, s, nt)
- local pressure = sim.pressure(x/4, y/4)
- local gravity = sim.gravMap(x/4, y/4)
- if gravity >= 20 and pressure >= 250 and sim.partProperty(i, "temp") >= 9993.15 then
- sim.partChangeType(i, elem.DEFAULT_PT_BRMT)
- sim.partProperty(i, "temp", math.huge)
- sim.pressure(x/4, y/4, 256)
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == elem.DEFAULT_PT_PROT then
- sim.partChangeType(i, elem.DEFAULT_PT_NBLE)
- end
- end
- end
- local function modifyHe(i, x, y, s, nt)
- local pressure = sim.pressure(x/4, y/4)
- if pressure >= 100 and sim.partProperty(i, "temp") >= 5273.15 then
- sim.partChangeType(i, elem.DEFAULT_PT_PLSM)
- sim.partProperty(i, "ctype", elem.DEFAULT_PT_NBLE)
- sim.partCreate(-3, x, y, elem.DEFAULT_PT_NEUT)
- local phot = sim.partCreate(-3, x, y, elem.DEFAULT_PT_PHOT)
- sim.partProperty(phot, "ctype", 1040187392)
- sim.partCreate(-3, x, y, elem.DEFAULT_PT_CO2)
- end
- local r = sim.partID(math.random(x-1, x+1), math.random(y-1, y+1))
- if r ~= nil then
- if sim.partProperty(r, "type") == elem.DEFAULT_PT_NEUT then
- sim.partChangeType(i, elem.DEFAULT_PT_ISOZ)
- end
- end
- end
- elem.property(ciso, "Update", cisotope)
- elem.property(diso, "Update", disotope)
- elem.property(eiso, "Update", solute)
- elem.property(elem.DEFAULT_PT_HYGN, "Update", modifyH)
- elem.property(elem.DEFAULT_PT_OXYG, "Update", modifyO)
- elem.property(elem.DEFAULT_PT_NBLE, "Update", modifyHe)
- elem.property(redspot, "Update", radiate)
- elem.property(hemp, "Graphics", hempGlow)
- elem.property(ciso, "Graphics", cisoGlow)
- elem.property(diso, "Graphics", disoGlow)
- elem.property(redspot, "Graphics", redspotGlow)
- -- And now da dank krustulz!11!!!!!111!
- elem.property(red, "Update", redcrystal)
- elem.property(red, "Graphics", redGlow)
- elem.property(yellow, "Update", yellowcrystal)
- elem.property(yellow, "Graphics", yellowGlow)
- elem.property(green, "Update", greencrystal)
- elem.property(green, "Graphics", greenGlow)
- elem.property(cyan, "Update", cyancrystal)
- elem.property(cyan, "Graphics", cyanGlow)
- elem.property(blue, "Update", bluecrystal)
- elem.property(blue, "Graphics", blueGlow)
- elem.property(magenta, "Update", magentacrystal)
- elem.property(magenta, "Graphics", magentaGlow)
- -- Buttons code
- local exotictab = elem.allocate("EXOTIC", "BEEC")
- elem.element(exotictab, elem.element(elem.DEFAULT_PT_DUST))
- elem.property(exotictab, "Name", "EEC")
- elem.property(exotictab, "Description", "Click to open the 'Exotic Chemistry' tab.")
- elem.property(exotictab, "MenuSection", elem.SC_NUCLEAR)
- elem.property(exotictab, "Properties", elem.PROP_LIFE_DEC+elem.PROP_LIFE_KILL)
- local crysttab = elem.allocate("EXOTIC", "BPROX")
- elem.element(crysttab, elem.element(elem.DEFAULT_PT_DUST))
- elem.property(crysttab, "Name", "PROX")
- elem.property(crysttab, "Description", "Click to open the 'Proximian crystals' tab.")
- elem.property(crysttab, "MenuSection", elem.SC_NUCLEAR)
- elem.property(crysttab, "Properties", elem.PROP_LIFE_DEC+elem.PROP_LIFE_KILL)
- elem.element(nucleartab, elem.element(elem.DEFAULT_PT_DUST))
- elem.property(nucleartab, "Name", "BACK")
- elem.property(nucleartab, "Description", "Click to go back to the normal menu.")
- elem.property(nucleartab, "MenuSection", elem.SC_NUCLEAR)
- elem.property(nucleartab, "MenuVisible", 0)
- elem.property(exotictab, "Properties", elem.PROP_LIFE_DEC+elem.PROP_LIFE_KILL)
- local nuclear = {}
- for i = 1, 255 do
- pcall(function()
- if elem.property(i, "MenuVisible") == 1 and elem.property(i, "MenuSection") == 10 then
- nuclear[i] = true
- end
- end)
- end
- local function switch(n)
- if n == 1 then
- elem.property(ciso, "MenuVisible", 1)
- elem.property(diso, "MenuVisible", 1)
- elem.property(eiso, "MenuVisible", 1)
- elem.property(hemp, "MenuVisible", 1)
- elem.property(emv, "MenuVisible", 1)
- elem.property(pemv, "MenuVisible", 1)
- elem.property(redspot, "MenuVisible", 1)
- elem.property(elem.DEFAULT_PT_EXOT, "MenuVisible", 1)
- elem.property(nucleartab, "MenuVisible", 1)
- elem.property(crysttab, "MenuVisible", 0)
- elem.property(solution, "MenuVisible", 0)
- elem.property(red, "MenuVisible", 0)
- elem.property(yellow, "MenuVisible", 0)
- elem.property(green, "MenuVisible", 0)
- elem.property(cyan, "MenuVisible", 0)
- elem.property(blue, "MenuVisible", 0)
- elem.property(magenta, "MenuVisible", 0)
- for i in pairs(nuclear) do
- elem.property(i, "MenuVisible", 0)
- end
- elseif n == 2 then
- elem.property(ciso, "MenuVisible", 0)
- elem.property(diso, "MenuVisible", 0)
- elem.property(eiso, "MenuVisible", 0)
- elem.property(hemp, "MenuVisible", 0)
- elem.property(emv, "MenuVisible", 0)
- elem.property(pemv, "MenuVisible", 0)
- elem.property(redspot, "MenuVisible", 0)
- elem.property(nucleartab, "MenuVisible", 1)
- elem.property(elem.DEFAULT_PT_EXOT, "MenuVisible", 0)
- elem.property(crysttab, "MenuVisible", 0)
- elem.property(solution, "MenuVisible", 1)
- elem.property(red, "MenuVisible", 1)
- elem.property(yellow, "MenuVisible", 1)
- elem.property(green, "MenuVisible", 1)
- elem.property(cyan, "MenuVisible", 1)
- elem.property(blue, "MenuVisible", 1)
- elem.property(magenta, "MenuVisible", 1)
- for i in pairs(nuclear) do
- elem.property(i, "MenuVisible", 0)
- end
- elseif n == 0 then
- elem.property(ciso, "MenuVisible", 0)
- elem.property(diso, "MenuVisible", 0)
- elem.property(eiso, "MenuVisible", 0)
- elem.property(hemp, "MenuVisible", 0)
- elem.property(emv, "MenuVisible", 0)
- elem.property(pemv, "MenuVisible", 0)
- elem.property(redspot, "MenuVisible", 0)
- elem.property(nucleartab, "MenuVisible", 0)
- elem.property(crysttab, "MenuVisible", 1)
- elem.property(solution, "MenuVisible", 0)
- elem.property(red, "MenuVisible", 0)
- elem.property(yellow, "MenuVisible", 0)
- elem.property(green, "MenuVisible", 0)
- elem.property(cyan, "MenuVisible", 0)
- elem.property(blue, "MenuVisible", 0)
- elem.property(magenta, "MenuVisible", 0)
- elem.property(elem.DEFAULT_PT_EXOT, "MenuVisible", 0)
- for i in pairs(nuclear) do
- elem.property(i, "MenuVisible", 1)
- end
- end
- end
- local function buttons()
- if tpt.selectedl == elem.property(exotictab, "Identifier") then
- switch(1)
- tpt.selectedl = "DEFAULT_PT_EXOT"
- elseif tpt.selectedl == elem.property(crysttab, "Identifier") then
- switch(2)
- tpt.selectedl = "EXOTIC_PT_RWTR"
- elseif tpt.selectedl == elem.property(nucleartab, "Identifier") then
- switch(0)
- tpt.selectedl = "DEFAULT_PT_NEUT"
- end
- end
- tpt.register_step(buttons)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement