Skip to content

Commit

Permalink
Правки сигналлеров
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantornRU committed Nov 14, 2023
1 parent a31ec5f commit a81cc2e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 2 additions & 0 deletions modular_ss220/_defines220/code/signals_atom.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/// called by /obj/structure/table/do_climb() : (/datum/component/clumsy_climb)
#define COMSIG_CLIMBED_ON "climb_on"
/// called by /datum/emote/living/dance/run_emote() : (/datum/component/clumsy_climb)
#define COMSIG_DANCED_ON "dance_on"
2 changes: 2 additions & 0 deletions modular_ss220/clumsy_table/code/clumsy_climb_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@
item_to_throw.pixel_y = rand(0, 10)
item_to_throw.force /= force_mod
item_to_throw.throwforce /= force_mod

qdel(src)
15 changes: 4 additions & 11 deletions modular_ss220/clumsy_table/code/clumsy_table.dm
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
/obj/structure/table/Crossed(atom/movable/AM, oldloc)
add_clumsy_climb()
AddComponent(/datum/component/clumsy_climb, 5)
. = ..()
remove_clumsy_climb()

/obj/structure/table/do_climb(mob/living/user)
add_clumsy_climb()
. = ..()
SEND_SIGNAL(src, COMSIG_CLIMBED_ON, user)
remove_clumsy_climb()

/obj/structure/table/proc/add_clumsy_climb()
if(!..())
return FALSE
AddComponent(/datum/component/clumsy_climb, 15)

/obj/structure/table/proc/remove_clumsy_climb()
qdel(GetComponent(/datum/component/clumsy_climb))
SEND_SIGNAL(src, COMSIG_CLIMBED_ON, user)

0 comments on commit a81cc2e

Please sign in to comment.