Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RADN = elements.allocate("RADN", "RADN")
- elements.element(RADN, elements.element(elements.DEFAULT_PT_WATR))
- elements.property(RADN, "Name", "RADN")
- elements.property(RADN, "Description", "Radioactive Liquid. Can be activated by sparks and flames. Use sparingly.")
- elements.property(RADN, "Colour", 0x512368)
- elements.property(RADN, "MenuSection", elem.SC_EXPLOSIVE)
- elements.property(RADN, "Temperature", 295.15)
- elements.property(RADN, "Flammable", 10)
- elements.property(RADN, "Explosive", 16)
- local function Explode (particle_index, x_location, y_location, s, neighbours)
- local x_offset = math.random(-1, 1)
- local y_offset = math.random(-1, 1)
- local neighbour_index = simulation.partID(x_location + x_offset, y_location + y_offset)
- if simulation.partProperty(neighbour_index, "type") == elements.DEFAULT_PT_SPRK or simulation.partProperty(neighbour_index, "type") == elements.DEFAULT_PT_PLSM or simulation.partProperty(neighbour_index, "type") == elements.DEFAULT_PT_FIRE then
- simulation.partProperty(particle_index, "type", elements.DEFAULT_PT_DEUT)
- simulation.partProperty(particle_index, "life", 999999999)
- simulation.partProperty(simulation.partID(x_location - 1), "type", elements.DEFAULT_PT_NEUT)
- simulation.partProperty(simulation.partID(x_location + 1), "type", elements.DEFAULT_PT_NEUT)
- simulation.partProperty(simulation.partID(y_location - 1), "type", elements.DEFAULT_PT_NEUT)
- simulation.partProperty(simulation.partID(y_location + 1), "type", elements.DEFAULT_PT_NEUT)
- end
- end
- elements.property(RADN, "Update", Explode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement