mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
(code bounty) refactors all uses of Crossed() and Uncrossed() into signals sent to loc, tracked by connect_loc (#58340)
Co-authored-by: Jared-Fogle <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
This commit is contained in:
co-authored by
Jared-Fogle
Emmett Gaines
parent
3cabee50b6
commit
08df8798ce
@@ -1322,13 +1322,20 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
/obj/effect/hallucination/danger/lava
|
||||
name = "lava"
|
||||
|
||||
/obj/effect/hallucination/danger/lava/Initialize(mapload, _target)
|
||||
. = ..()
|
||||
var/static/list/loc_connections = list(
|
||||
COMSIG_ATOM_ENTERED = .proc/on_entered,
|
||||
)
|
||||
AddElement(/datum/element/connect_loc, src, loc_connections)
|
||||
|
||||
/obj/effect/hallucination/danger/lava/show_icon()
|
||||
image = image('icons/turf/floors/lava.dmi', src, "lava-0", TURF_LAYER)
|
||||
if(target.client)
|
||||
target.client.images += image
|
||||
|
||||
/obj/effect/hallucination/danger/lava/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
/obj/effect/hallucination/danger/lava/proc/on_entered(datum/source, atom/movable/AM)
|
||||
SIGNAL_HANDLER
|
||||
if(AM == target)
|
||||
target.adjustStaminaLoss(20)
|
||||
new /datum/hallucination/fire(target)
|
||||
@@ -1336,14 +1343,21 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
/obj/effect/hallucination/danger/chasm
|
||||
name = "chasm"
|
||||
|
||||
/obj/effect/hallucination/danger/chasm/Initialize(mapload, _target)
|
||||
. = ..()
|
||||
var/static/list/loc_connections = list(
|
||||
COMSIG_ATOM_ENTERED = .proc/on_entered,
|
||||
)
|
||||
AddElement(/datum/element/connect_loc, src, loc_connections)
|
||||
|
||||
/obj/effect/hallucination/danger/chasm/show_icon()
|
||||
var/turf/target_loc = get_turf(target)
|
||||
image = image('icons/turf/floors/chasms.dmi', src, "chasms-[target_loc.smoothing_junction]", TURF_LAYER)
|
||||
if(target.client)
|
||||
target.client.images += image
|
||||
|
||||
/obj/effect/hallucination/danger/chasm/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
/obj/effect/hallucination/danger/chasm/proc/on_entered(datum/source, atom/movable/AM)
|
||||
SIGNAL_HANDLER
|
||||
if(AM == target)
|
||||
if(istype(target, /obj/effect/dummy/phased_mob))
|
||||
return
|
||||
@@ -1358,6 +1372,10 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
/obj/effect/hallucination/danger/anomaly/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
var/static/list/loc_connections = list(
|
||||
COMSIG_ATOM_ENTERED = .proc/on_entered,
|
||||
)
|
||||
AddElement(/datum/element/connect_loc, src, loc_connections)
|
||||
|
||||
/obj/effect/hallucination/danger/anomaly/process(delta_time)
|
||||
if(DT_PROB(45, delta_time))
|
||||
@@ -1372,8 +1390,8 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
if(target.client)
|
||||
target.client.images += image
|
||||
|
||||
/obj/effect/hallucination/danger/anomaly/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
/obj/effect/hallucination/danger/anomaly/proc/on_entered(datum/source, atom/movable/AM)
|
||||
SIGNAL_HANDLER
|
||||
if(AM == target)
|
||||
new /datum/hallucination/shock(target)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user