[MIRROR] Fixing GBJ cases where the disposal holder is forcemoved outside a pipe. (#1602)

* Fixing GBJ cases where the disposal holder is forcemoved outside a pipe. (#54643)

Title. Also turned movable/pipe_eject() into a comsig, since it was used only for gibs.

* Fixing GBJ cases where the disposal holder is forcemoved outside a pipe.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-11-07 05:06:41 +00:00
committed by GitHub
co-authored by Ghom
parent 7813465ef3
commit 94fe50294d
12 changed files with 87 additions and 66 deletions
@@ -26,6 +26,10 @@
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6")
mergeable_decal = FALSE
/obj/effect/decal/cleanable/xenoblood/xgibs/Initialize()
. = ..()
RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, .proc/on_pipe_eject)
/obj/effect/decal/cleanable/xenoblood/xgibs/proc/streak(list/directions, mapload=FALSE)
set waitfor = FALSE
var/direction = pick(directions)
@@ -37,6 +41,17 @@
if(!step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/xenoblood/xgibs/proc/on_pipe_eject(atom/source, direction)
SIGNAL_HANDLER
var/list/dirs
if(direction)
dirs = list(direction, turn(direction, -45), turn(direction, 45))
else
dirs = GLOB.alldirs.Copy()
streak(dirs)
/obj/effect/decal/cleanable/xenoblood/xgibs/ex_act()
return
@@ -59,6 +59,7 @@
/obj/effect/decal/cleanable/blood/gibs/Initialize(mapload, list/datum/disease/diseases)
. = ..()
reagents.add_reagent(/datum/reagent/liquidgibs, 5)
RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, .proc/on_pipe_eject)
if(already_rotting)
start_rotting(rename=FALSE)
else
@@ -78,6 +79,17 @@
playsound(loc, 'sound/effects/gib_step.ogg', HAS_TRAIT(L, TRAIT_LIGHT_STEP) ? 20 : 50, TRUE)
. = ..()
/obj/effect/decal/cleanable/blood/gibs/proc/on_pipe_eject(atom/source, direction)
SIGNAL_HANDLER
var/list/dirs
if(direction)
dirs = list(direction, turn(direction, -45), turn(direction, 45))
else
dirs = GLOB.alldirs.Copy()
streak(dirs)
/obj/effect/decal/cleanable/blood/gibs/proc/streak(list/directions, mapload=FALSE)
set waitfor = FALSE
var/list/diseases = list()
@@ -12,6 +12,10 @@
mergeable_decal = FALSE
beauty = -50
/obj/effect/decal/cleanable/robot_debris/Initialize()
. = ..()
RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, .proc/on_pipe_eject)
/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions, mapload=FALSE)
set waitfor = FALSE
var/direction = pick(directions)
@@ -28,6 +32,17 @@
if (!step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/robot_debris/proc/on_pipe_eject(atom/source, direction)
SIGNAL_HANDLER
var/list/dirs
if(direction)
dirs = list(direction, turn(direction, -45), turn(direction, 45))
else
dirs = GLOB.alldirs.Copy()
streak(dirs)
/obj/effect/decal/cleanable/robot_debris/ex_act()
return