/* This is an attempt to make some easily reusable "particle" type effect, to stop the code constantly having to be rewritten. An item like the jetpack that uses the ion_trail_follow system, just has one defined, then set up when it is created with New(). Then this same system can just be reused each time it needs to create more trails.A beaker could have a steam_trail_follow system set up, then the steam would spawn and follow the beaker, even if it is carried or thrown. */ /obj/effect/effect name = "effect" icon = 'icons/effects/effects.dmi' mouse_opacity = 0 unacidable = 1//So effect are not targeted by alien acid. flags = TABLEPASS /obj/effect/effect/water name = "water" icon = 'icons/effects/effects.dmi' icon_state = "extinguish" var/life = 15.0 flags = TABLEPASS mouse_opacity = 0 /obj/effect/effect/smoke name = "smoke" icon = 'icons/effects/water.dmi' icon_state = "smoke" opacity = 1 anchored = 0.0 mouse_opacity = 0 var/amount = 8.0 /obj/effect/effect/water/New() ..() //var/turf/T = src.loc //if (istype(T, /turf)) // T.firelevel = 0 //TODO: FIX spawn( 70 ) del(src) return return /obj/effect/effect/water/Del() //var/turf/T = src.loc //if (istype(T, /turf)) // T.firelevel = 0 //TODO: FIX ..() return /obj/effect/effect/water/Move(turf/newloc) //var/turf/T = src.loc //if (istype(T, /turf)) // T.firelevel = 0 //TODO: FIX if (--src.life < 1) //SN src = null del(src) if(newloc.density) return 0 .=..() /obj/effect/effect/water/Bump(atom/A) if(reagents) reagents.reaction(A) return ..() /datum/effect/effect/system var/number = 3 var/cardinals = 0 var/turf/location var/atom/holder var/setup = 0 proc/set_up(n = 3, c = 0, turf/loc) if(n > 10) n = 10 number = n cardinals = c location = loc setup = 1 proc/attach(atom/atom) holder = atom proc/start() ///////////////////////////////////////////// // GENERIC STEAM SPREAD SYSTEM //Usage: set_up(number of bits of steam, use North/South/East/West only, spawn location) // The attach(atom/atom) proc is optional, and can be called to attach the effect // to something, like a smoking beaker, so then you can just call start() and the steam // will always spawn at the items location, even if it's moved. /* Example: var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system steam.set_up(5, 0, mob.loc) -- sets up variables OPTIONAL: steam.attach(mob) steam.start() -- spawns the effect */ ///////////////////////////////////////////// /obj/effect/effect/steam name = "steam" icon = 'icons/effects/effects.dmi' icon_state = "extinguish" density = 0 /datum/effect/effect/system/steam_spread set_up(n = 3, c = 0, turf/loc) if(n > 10) n = 10 number = n cardinals = c location = loc start() var/i = 0 for(i=0, i 10) n = 10 number = n cardinals = c if(istype(loca, /turf/)) location = loca else location = get_turf(loca) start() var/i = 0 for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location) src.total_sparks++ var/direction if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i 10) n = 10 number = n cardinals = c if(istype(loca, /turf/)) location = loca else location = get_turf(loca) if(direct) direction = direct start() var/i = 0 for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(src.location) src.total_smoke++ var/direction = src.direction if(!direction) if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i 20) n = 20 number = n cardinals = c if(istype(loca, /turf/)) location = loca else location = get_turf(loca) if(direct) direction = direct start() var/i = 0 for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/bad_smoke/smoke = new /obj/effect/effect/bad_smoke(src.location) src.total_smoke++ var/direction = src.direction if(!direction) if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i 20) n = 20 number = n cardinals = c carry.copy_to(chemholder, carry.total_volume) /* if((src.reagents.has_reagent("pacid")) || (src.reagents.has_reagent("lube"))) // Messages admins if someone sprays polyacid or space lube from a Cleaner bottle. message_admins("[key_name_admin(user)] fired Polyacid/Space lube from a Cleaner bottle.") // Polymorph log_game("[key_name(user)] fired Polyacid/Space lube from a Cleaner bottle.") */ if(istype(loca, /turf/)) location = loca else location = get_turf(loca) if(direct) direction = direct if(carry.my_atom.fingerprintslast) message_admins("A chemical smoke reaction has taken place in ([location.x], [location.y]). Last associated key is [carry.my_atom.fingerprintslast].") log_game("A chemical smoke reaction has taken place in ([location.x], [location.y]). Last associated key is [carry.my_atom.fingerprintslast].") else message_admins("A chemical smoke reaction has taken place in ([location.x], [location.y]). No associated key.") log_game("A chemical smoke reaction has taken place in ([location.x], [location.y]). No associated key.") start() var/i = 0 var/color = mix_color_from_reagents(chemholder.reagents.reagent_list) for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/chem_smoke/smoke = new /obj/effect/effect/chem_smoke(src.location) src.total_smoke++ var/direction = src.direction if(!direction) if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) if(chemholder.reagents.total_volume != 1) // can't split 1 very well chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / number) // copy reagents to each smoke, divide evenly if(color) smoke.icon += color // give the smoke color, if it has any to begin with else // if no color, just use the old smoke icon smoke.icon = 'icons/effects/96x96.dmi' smoke.icon_state = "smoke" for(i=0, i 20) n = 20 number = n cardinals = c if(istype(loca, /turf/)) location = loca else location = get_turf(loca) if(direct) direction = direct start() var/i = 0 for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/sleep_smoke/smoke = new /obj/effect/effect/sleep_smoke(src.location) src.total_smoke++ var/direction = src.direction if(!direction) if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i 20) n = 20 number = n cardinals = c if(istype(loca, /turf/)) location = loca else location = get_turf(loca) if(direct) direction = direct start() var/i = 0 for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/mustard_gas/smoke = new /obj/effect/effect/mustard_gas(src.location) src.total_smoke++ var/direction = src.direction if(!direction) if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i 0) devastation = min (MAX_EXPLOSION_RANGE, devastation + round(amount/12)) if (round(amount/6) > 0) heavy = min (MAX_EXPLOSION_RANGE, heavy + round(amount/6)) if (round(amount/3) > 0) light = min (MAX_EXPLOSION_RANGE, light + round(amount/3)) if (flash && flashing_factor) flash += (round(amount/4) * flashing_factor) for(var/mob/M in viewers(8, location)) M << "\red The solution violently explodes." explosion(location, devastation, heavy, light, flash)