/* 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 light_on = TRUE /obj/effect/effect name = "effect" icon = 'icons/effects/effects.dmi' mouse_opacity = 0 unacidable = TRUE//So effect are not targeted by alien acid. pass_flags = PASSTABLE | PASSGRILLE blocks_emissive = EMISSIVE_BLOCK_GENERIC light_on = TRUE plane = ABOVE_OBJ_PLANE /datum/effect/effect/system var/number = 3 var/cardinals = 0 var/turf/location var/atom/holder var/setup = 0 /datum/effect/effect/system/proc/set_up(n = 3, c = 0, turf/loc) if(n > 10) n = 10 number = n cardinals = c location = loc setup = 1 /datum/effect/effect/system/proc/attach(atom/atom) holder = atom /datum/effect/effect/system/proc/start() /datum/effect/effect/system/Destroy() location = null holder = null return ..() ///////////////////////////////////////////// // 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 = FALSE /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 /datum/effect/effect/system/steam_spread/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) /datum/effect/effect/system/spark_spread/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 /datum/effect/effect/system/smoke_spread/start(var/I) var/i = 0 for(i=0, i 20) return spawn(0) if(holder) src.location = get_turf(holder) var/obj/effect/effect/smoke/smoke = new smoke_type(src.location) src.total_smoke++ if(I) smoke.color = I var/direction = src.direction if(!direction) if(src.cardinals) direction = pick(cardinal) else direction = pick(alldirs) for(i=0, i 0) devst = devst + amount/12 if (round(amount/6) > 0) heavy = heavy + amount/6 if (round(amount/3) > 0) light = light + amount/3 if (flashing && flashing_factor) flash = (amount/4) * flashing_factor for(var/mob/M in viewers(8, location)) to_chat(M, span_warning("The solution violently explodes.")) explosion( location, round(min(devst, BOMBCAP_DVSTN_RADIUS)), round(min(heavy, BOMBCAP_HEAVY_RADIUS)), round(min(light, BOMBCAP_LIGHT_RADIUS)), round(min(flash, BOMBCAP_FLASH_RADIUS)) ) //////////////////////////////////////////// // A fancier teleport, used in hyper pads //////////////////////////////////////////// /obj/effect/effect/teleport_greyscale name = "teleportation" icon = 'icons/effects/effects.dmi' icon_state = "teleport_greyscale" anchored = 1 mouse_opacity = 0 plane = MOB_PLANE layer = ABOVE_MOB_LAYER /obj/effect/effect/teleport_greyscale/Initialize(mapload) . = ..() QDEL_IN(src, 2 SECONDS) /datum/effect/effect/system/teleport_greyscale var/color = "#FFFFFF" /datum/effect/effect/system/teleport_greyscale/set_up(cl, loca) if(istype(loca, /turf/)) location = loca else location = get_turf(loca) color = cl /datum/effect/effect/system/teleport_greyscale/start() var/obj/effect/effect/teleport_greyscale/tele = new /obj/effect/effect/teleport_greyscale(src.location) tele.color = color