mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 13:39:16 +01:00
TG Signal Port (#18741)
* click code start * snake_span * Update click.dm * Update click.dm * Update click.dm * WIP signal organization * Moooore signals * cuffs * decon * whoops * revert this * Proper name * movable moved * These * Theeese * Sort these * Update cyborg.dm
This commit is contained in:
@@ -36,17 +36,17 @@
|
||||
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
to_chat(user, span_warning("Uh ... how do those things work?!"))
|
||||
place_handcuffs(user, user)
|
||||
attempt_to_cuff(user, user)
|
||||
return
|
||||
|
||||
if(!C.handcuffed)
|
||||
if (C == user)
|
||||
place_handcuffs(user, user)
|
||||
attempt_to_cuff(user, user)
|
||||
return
|
||||
|
||||
//check for an aggressive grab (or robutts)
|
||||
if(can_place(C, user))
|
||||
place_handcuffs(C, user)
|
||||
attempt_to_cuff(C, user)
|
||||
else
|
||||
to_chat(user, span_danger("You need to have a firm grip on [C] before you can put \the [src] on!"))
|
||||
|
||||
@@ -62,36 +62,39 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/item/handcuffs/proc/place_handcuffs(var/mob/living/carbon/target, var/mob/user)
|
||||
/obj/item/handcuffs/proc/attempt_to_cuff(var/mob/living/carbon/victim, var/mob/user)
|
||||
if(SEND_SIGNAL(victim, COMSIG_CARBON_CUFF_ATTEMPTED, user) & COMSIG_CARBON_CUFF_PREVENT)
|
||||
victim.balloon_alert(user, "can't be handcuffed!")
|
||||
return
|
||||
playsound(src, cuff_sound, 30, 1, -2)
|
||||
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(!istype(H))
|
||||
var/mob/living/carbon/human/human_victim = victim
|
||||
if(!istype(human_victim))
|
||||
return 0
|
||||
|
||||
if (!H.has_organ_for_slot(slot_handcuffed))
|
||||
to_chat(user, span_danger("\The [H] needs at least two wrists before you can cuff them together!"))
|
||||
if (!human_victim.has_organ_for_slot(slot_handcuffed))
|
||||
to_chat(user, span_danger("\The [victim] needs at least two wrists before you can cuff them together!"))
|
||||
return 0
|
||||
|
||||
if(istype(H.gloves,/obj/item/clothing/gloves/gauntlets/rig) && !elastic) // Can't cuff someone who's in a deployed hardsuit.
|
||||
to_chat(user, span_danger("\The [src] won't fit around \the [H.gloves]!"))
|
||||
if(istype(human_victim.gloves,/obj/item/clothing/gloves/gauntlets/rig) && !elastic) // Can't cuff someone who's in a deployed hardsuit.
|
||||
to_chat(user, span_danger("\The [src] won't fit around \the [human_victim.gloves]!"))
|
||||
return 0
|
||||
|
||||
user.visible_message(span_danger("\The [user] is attempting to put [cuff_type] on \the [H]!"))
|
||||
user.visible_message(span_danger("\The [user] is attempting to put [cuff_type] on \the [victim]!"))
|
||||
|
||||
if(!do_after(user, use_time, target = src))
|
||||
return 0
|
||||
|
||||
if(!can_place(target, user)) //victim may have resisted out of the grab in the meantime
|
||||
if(!can_place(victim, user)) //victim may have resisted out of the grab in the meantime
|
||||
return 0
|
||||
|
||||
add_attack_logs(user,H,"Handcuffed (attempt)")
|
||||
feedback_add_details("handcuffs","H")
|
||||
add_attack_logs(user,victim,"Handcuffed (attempt)")
|
||||
feedback_add_details("handcuffs","victim")
|
||||
|
||||
user.setClickCooldown(user.get_attack_speed(src))
|
||||
user.do_attack_animation(H)
|
||||
user.do_attack_animation(victim)
|
||||
|
||||
user.visible_message(span_danger("\The [user] has put [cuff_type] on \the [H]!"))
|
||||
user.visible_message(span_danger("\The [user] has put [cuff_type] on \the [victim]!"))
|
||||
|
||||
// Apply cuffs.
|
||||
var/obj/item/handcuffs/cuffs = src
|
||||
@@ -99,12 +102,12 @@
|
||||
cuffs = new(get_turf(user))
|
||||
else
|
||||
user.drop_from_inventory(cuffs)
|
||||
cuffs.loc = target
|
||||
target.handcuffed = cuffs
|
||||
target.update_handcuffed()
|
||||
target.drop_r_hand()
|
||||
target.drop_l_hand()
|
||||
target.stop_pulling()
|
||||
cuffs.loc = victim
|
||||
victim.handcuffed = cuffs
|
||||
victim.update_handcuffed()
|
||||
victim.drop_r_hand()
|
||||
victim.drop_l_hand()
|
||||
victim.stop_pulling()
|
||||
return 1
|
||||
|
||||
/obj/item/handcuffs/equipped(var/mob/living/user,var/slot)
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
if(isrobot(loc?.loc))
|
||||
R = loc.loc
|
||||
registered_name = R.braintype
|
||||
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(check_loc))
|
||||
RegisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(check_loc))
|
||||
|
||||
/obj/item/card/id/cargo/miner/borg/proc/check_loc(atom/movable/mover, atom/old_loc, atom/new_loc)
|
||||
SIGNAL_HANDLER
|
||||
@@ -297,7 +297,7 @@
|
||||
|
||||
/obj/item/card/id/cargo/miner/borg/Destroy()
|
||||
if(R)
|
||||
UnregisterSignal(src, COMSIG_OBSERVER_MOVED)
|
||||
UnregisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE)
|
||||
R = null
|
||||
last_robot_loc = null
|
||||
. = ..()
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
if(isrobot(loc?.loc))
|
||||
R = loc.loc
|
||||
registered_name = R.braintype
|
||||
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(check_loc))
|
||||
RegisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(check_loc))
|
||||
|
||||
/obj/item/card/id/exploration/borg/proc/check_loc(atom/movable/mover, atom/old_loc, atom/new_loc)
|
||||
SIGNAL_HANDLER
|
||||
@@ -323,7 +323,7 @@
|
||||
|
||||
/obj/item/card/id/exploration/borg/Destroy()
|
||||
if(R)
|
||||
UnregisterSignal(src, COMSIG_OBSERVER_MOVED)
|
||||
UnregisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE)
|
||||
R = null
|
||||
last_robot_loc = null
|
||||
. = ..()
|
||||
|
||||
@@ -209,11 +209,11 @@
|
||||
/obj/item/storage/bag/ore/equipped(mob/user)
|
||||
..()
|
||||
user.AddComponent(/datum/component/recursive_move)
|
||||
RegisterSignal(user, COMSIG_OBSERVER_MOVED, /obj/item/storage/bag/ore/proc/autoload, user)
|
||||
RegisterSignal(user, COMSIG_MOVABLE_MOVED, /obj/item/storage/bag/ore/proc/autoload, user)
|
||||
|
||||
/obj/item/storage/bag/ore/dropped(mob/user)
|
||||
..()
|
||||
UnregisterSignal(user, COMSIG_OBSERVER_MOVED)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
|
||||
|
||||
/obj/item/storage/bag/ore/proc/autoload(mob/user)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
var/obj/item/handcuffs/cable/tape/T = new(user)
|
||||
playsound(src, 'sound/effects/tape.ogg',25)
|
||||
|
||||
if(!T.place_handcuffs(H, user))
|
||||
if(!T.attempt_to_cuff(H, user))
|
||||
user.unEquip(T)
|
||||
qdel(T)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user