[MIRROR] Begin clickcode attack_self fix (#12173)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-12-29 15:51:44 -05:00
committed by GitHub
co-authored by Cameron Lennox
parent 063cf6cf48
commit 3cac28f9ad
361 changed files with 2676 additions and 998 deletions
+10 -3
View File
@@ -24,6 +24,9 @@
var/const/WIRE_RADIO_RECEIVE = 8 //Allows Pulsed(1) to call Activate()
var/const/WIRE_RADIO_PULSE = 16 //Allows Pulse(1) to send a radio message
///var used for attack_self chain
var/special_handling = FALSE
/obj/item/assembly/proc/holder_movement()
return
@@ -89,11 +92,15 @@
else
. += "\The [src] can be attached!"
/obj/item/assembly/attack_self(mob/user as mob)
/obj/item/assembly/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(special_handling)
return FALSE
if(!user)
return 0
return FALSE
tgui_interact(user)
return 1
/obj/item/assembly/tgui_state(mob/user)
return GLOB.tgui_deep_inventory_state
+5 -2
View File
@@ -125,8 +125,11 @@
else
..()
/obj/item/assembly_holder/attack_self(var/mob/user)
src.add_fingerprint(user)
/obj/item/assembly_holder/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
add_fingerprint(user)
if(src.secured)
if(!a_left || !a_right)
to_chat(user, span_warning(" BUG:Assembly part missing, please report this!"))
+5 -1
View File
@@ -7,6 +7,7 @@
secured = 1
wires = WIRE_RECEIVE
special_handling = TRUE
/obj/item/assembly/igniter/activate()
if(!..())
@@ -32,7 +33,10 @@
return TRUE
/obj/item/assembly/igniter/attack_self(var/mob/user)
/obj/item/assembly/igniter/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
activate()
add_fingerprint(user)
+5 -1
View File
@@ -5,6 +5,7 @@
origin_tech = list(TECH_COMBAT = 1)
matter = list(MAT_STEEL = 100)
var/armed = 0
special_handling = TRUE
/obj/item/assembly/mousetrap/examine(var/mob/user)
@@ -49,7 +50,10 @@
update_icon()
pulse(0)
/obj/item/assembly/mousetrap/attack_self(var/mob/living/user)
/obj/item/assembly/mousetrap/attack_self(mob/living/user)
. = ..(user)
if(.)
return TRUE
if(!armed)
to_chat(user, span_notice("You arm [src]."))
else
+5 -1
View File
@@ -6,6 +6,7 @@
var/obj/item/radio/electropack/part2 = null
var/status = 0
w_class = ITEMSIZE_HUGE
special_handling = TRUE
/obj/item/assembly/shock_kit/Destroy()
qdel(part1)
@@ -33,7 +34,10 @@
add_fingerprint(user)
return
/obj/item/assembly/shock_kit/attack_self(mob/user as mob)
/obj/item/assembly/shock_kit/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
part1.attack_self(user, status)
part2.attack_self(user, status)
add_fingerprint(user)
+4
View File
@@ -6,6 +6,7 @@
matter = list(MAT_STEEL = 500, MAT_GLASS = 50)
var/listening = 0
var/recorded //the activation message
special_handling = TRUE
/obj/item/assembly/voice/hear_talk(mob/M, list/message_pieces, verb)
var/msg = multilingual_to_message(message_pieces)
@@ -27,6 +28,9 @@
/obj/item/assembly/voice/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(!user)
return FALSE
activate()