mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-23 00:22:12 +00:00
Adds a new process-based effects system with the goal of reducing insane lag from sparks. Currently only supports sparks, but should be easily extendable to other types of effects. Also fixes a bug with airlocks where the light from bolts wasn't updating. Refactors bears slightly to reduce duplicated code & pointless spark object creation and destruction. Lighting profiler will now log /turf locations & names correctly. Doors will no longer trigger way more visibility checks than they need to.
39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
/obj/item/device/assembly/igniter
|
|
name = "igniter"
|
|
desc = "A small electronic device able to ignite combustable substances."
|
|
icon_state = "igniter"
|
|
origin_tech = list(TECH_MAGNET = 1)
|
|
matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10)
|
|
|
|
secured = 1
|
|
wires = WIRE_RECEIVE
|
|
var/datum/effect_system/sparks/spark_system
|
|
|
|
/obj/item/device/assembly/igniter/activate()
|
|
if(!..()) return 0//Cooldown check
|
|
|
|
if(holder && istype(holder.loc,/obj/item/weapon/grenade/chem_grenade))
|
|
var/obj/item/weapon/grenade/chem_grenade/grenade = holder.loc
|
|
grenade.prime()
|
|
else
|
|
var/turf/location = get_turf(loc)
|
|
if(location)
|
|
location.hotspot_expose(1000,1000)
|
|
if (istype(src.loc,/obj/item/device/assembly_holder))
|
|
if (istype(src.loc.loc, /obj/structure/reagent_dispensers/fueltank/))
|
|
var/obj/structure/reagent_dispensers/fueltank/tank = src.loc.loc
|
|
if (tank && tank.modded)
|
|
tank.explode()
|
|
|
|
spark_system.queue()
|
|
return 1
|
|
|
|
/obj/item/device/assembly/igniter/attack_self(mob/user as mob)
|
|
activate()
|
|
add_fingerprint(user)
|
|
return
|
|
|
|
/obj/item/device/assembly/igniter/New()
|
|
. = ..()
|
|
spark_system = bind_spark(src, 4, cardinal)
|