Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fluor = elem.allocate("BIGDIG", "FLUR")
- local chlor = elem.allocate("BIGDIG", "CHLR")
- local hifi = elem.allocate("BIGDIG", "HF")
- local clo2 = elem.allocate("BIGDIG", "CLO2")
- local clf3 = elem.allocate("BIGDIG", "CLF3")
- local perchloric = elem.allocate("BIGDIG", "HCLO4")
- elem.element(fluor, elem.element(elem.DEFAULT_PT_CAUS))
- elem.property(fluor, "Name", "FLUR")
- elem.property(fluor, "Gravity", 0.5)
- elem.property(fluor, "Description", "Fluorine, heavy, corrosive gas. Reacts with some other gases.")
- elem.property(fluor, "Color", 0xFF6699)
- elem.property(fluor, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
- local function flurUpdate(i, x, y, s, nt)
- local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype == elem.DEFAULT_PT_H2 then
- sim.partChangeType(i, hifi)
- sim.partChangeType(r, hifi)
- elseif rtype ~= chlor and elem.property(rtype, "Hardness") > 0 then
- if math.random(1, 5) == 1 then
- sim.partKill(r)
- if math.random(1, 10) == 1 then
- sim.partKill(i)
- return 1
- end
- end
- end
- end
- end
- elem.property(fluor, "Update", flurUpdate)
- elem.element(hifi, elem.element(elem.DEFAULT_PT_CAUS))
- elem.property(hifi, "Name", "HGFL")
- elem.property(hifi, "Description", "Hydrogen fluoride, can eat through even glass.")
- elem.property(hifi, "Color", 0xCC99FF)
- elem.property(hifi, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
- local function hgflUpdate(i, x, y, s, nt)
- local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype ~= hifi and rtype ~= elem.DEFAULT_PT_DMND then
- local chance
- if elem.property(rtype, "Hardness") <= 10 then
- chance = 50
- else
- chance = 5
- end;
- if math.random(1, chance) == 1 then
- sim.partKill(r)
- if math.random(1, 10) == 1 then
- sim.partKill(i)
- return 1
- end
- end
- end
- end
- end
- elem.property(hifi, "Update", hgflUpdate)
- elem.element(chlor, elem.element(elem.DEFAULT_PT_CAUS))
- elem.property(chlor, "Name", "CHLR")
- elem.property(chlor, "Description", "Chlorine, corrosive but less than FLUR. Toxic, spreads quickly and may rust some metals.")
- elem.property(chlor, "Color", 0xCCFF99)
- elem.property(chlor, "Diffusion", 5)
- elem.property(chlor, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
- local function chlrUpdate(i, x, y, s, nt)
- local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype == elem.DEFAULT_PT_METL or (rtype == elem.DEFAULT_PT_BMTL and sim.partProperty(r, "tmp") ~= 1) or rtype == elem.DEFAULT_PT_IRON or rtype == elem.DEFAULT_PT_PSCN or rtype == elem.DEFAULT_PT_NSCN or rtype == elem.DEFAULT_PT_TTAN then
- if math.random(1, 10) == 1 then
- sim.partChangeType(r, elem.DEFAULT_PT_BMTL)
- sim.partProperty(r, "tmp", 1)
- end
- elseif rtype == fluor and sim.pressure(x/4, y/4) >= 10 then
- sim.partChangeType(r, clf3)
- sim.partKill(i)
- return 1
- elseif rtype == elem.DEFAULT_PT_O2 and sim.pressure(x/4, y/4) >= 5 then
- sim.partChangeType(r, clo2)
- sim.partKill(i)
- return 1
- elseif rtype ~= chlor and elem.property(rtype, "Hardness") > 0 then
- if math.random(1, 10) == 1 then
- sim.partKill(r)
- if math.random(1, 10) == 1 then
- sim.partKill(i)
- return 1
- end
- end
- end
- end
- end
- elem.property(chlor, "Update", chlrUpdate)
- elem.element(clf3, elem.element(elem.DEFAULT_PT_CAUS))
- elem.property(clf3, "Name", "CLF3")
- elem.property(clf3, "Description", "Chlorine trifluoride, almighty gas of death, reacts explosively with almost everything.")
- elem.property(clf3, "Color", 0xFFCC99)
- elem.property(clf3, "Gravity", 0.25)
- elem.property(clf3, "Diffusion", 3)
- elem.property(clf3, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
- local function clf3Update(i, x, y, s, nt)
- local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype ~= clf3 and rtype ~= chlor and rtype ~= fluor and rtype ~= elem.DEFAULT_PT_DMND and rtype ~= elem.DEFAULT_PT_CLNE and rtype ~= elem.DEFAULT_PT_PCLN and rtype ~= elem.DEFAULT_PT_VOID then
- sim.partChangeType(i, elem.DEFAULT_PT_FIRE)
- sim.partChangeType(r, elem.DEFAULT_PT_FIRE)
- sim.partProperty(i, "temp", 5273.15)
- sim.partProperty(r, "temp", 5273.15)
- sim.pressure(x/4, y/4, 5)
- end
- end
- end
- elem.property(clf3, "Update", clf3Update)
- elem.element(clo2, elem.element(elem.DEFAULT_PT_CAUS))
- elem.property(clo2, "Name", "CLO2")
- elem.property(clo2, "Description", "Chlorine dioxide, destroys metals and living things, used to make perchloric acid.")
- elem.property(clo2, "Properties", elem.TYPE_GAS+elem.PROP_DEADLY)
- elem.property(clo2, "Gravity", -0.1)
- elem.property(clo2, "Diffusion", 5)
- elem.property(clo2, "Color", 0xDDFFCC)
- local function clo2update(i, x, y, s, nt)
- local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if rtype == elem.DEFAULT_PT_METL or (rtype == elem.DEFAULT_PT_BMTL and sim.partProperty(r, "tmp") ~= 1) or rtype == elem.DEFAULT_PT_IRON or rtype == elem.DEFAULT_PT_PSCN or rtype == elem.DEFAULT_PT_NSCN or rtype == elem.DEFAULT_PT_TTAN or rtype == elem.DEFAULT_PT_RBDM then
- if math.random(1, 10) == 1 then
- sim.partChangeType(r, elem.DEFAULT_PT_BMTL)
- sim.partProperty(r, "tmp", 1)
- end
- elseif rtype == elem.DEFAULT_PT_PLNT or rtype == elem.DEFAULT_PT_WOOD or rtype == elem.DEFAULT_PT_VINE then
- sim.partKill(r)
- elseif rtype == elem.DEFAULT_PT_WTRV and sim.pressure(x/4, y/4) >= 5 then
- sim.partChangeType(i, perchloric)
- sim.partKill(r)
- return 1
- end
- end
- end
- elem.property(clo2, "Update", clo2Update)
- elem.element(perchloric, elem.element(elem.DEFAULT_PT_ACID))
- elem.property(perchloric, "Name", "PACD")
- elem.property(perchloric, "Description", "Perchloric acid, toxic, explosive liquid. Reacts with flammable materials.")
- elem.property(perchloric, "Color", 0xE6FFE6)
- elem.property(perchloric, "Diffusion", 0.25)
- elem.property(perchloric, "Flammable", 2000)
- elem.property(perchloric, "Explosive", 1)
- local function pacdUpdate(i, x, y, s, nt)
- local r = sim.partID(x+math.random(-1,1),y+math.random(-1,1))
- if r ~= nil then
- local rtype = sim.partProperty(r, "type")
- if elem.property(rtype, "Flammable") > 100 and rtype ~= perchloric then
- sim.partChangeType(r, elem.DEFAULT_PT_FIRE)
- if elem.property(rtype, "Explosive") == 2 then
- sim.pressure(x/4, y/4, 3)
- end
- elseif rtype == elem.DEFAULT_PT_PLNT or rtype == elem.DEFAULT_PT_WOOD or rtype == elem.DEFAULT_PT_VINE then
- sim.partKill(r)
- end
- end
- end
- elem.property(perchloric, "Update", pacdUpdate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement