Refactored the attack proc (#19908)

Refactored the attack proc signature.
Added signals and components for the attack proc.
Added signals and components for the attackby proc.
Adjusted some leftover attackby procs signatures.
Added grep test to ensure people don't keep adding attack/attackby procs
with the wrong signature.
This commit is contained in:
Fluffy
2024-10-06 21:30:00 +00:00
committed by GitHub
parent b79b7c5177
commit 9636363e60
121 changed files with 878 additions and 663 deletions
+3 -3
View File
@@ -474,9 +474,9 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
target.update_eyes()
..()
/obj/item/organ/attack(var/mob/target, var/mob/user)
/obj/item/organ/attack(mob/living/target_mob, mob/living/user, target_zone)
if(robotic || !istype(target) || !istype(user) || (user != target && user.a_intent == I_HELP))
if(robotic || !istype(target_mob) || !istype(user) || (user != target_mob && user.a_intent == I_HELP))
return ..()
if(alert("Do you really want to use this organ as food? It will be useless for anything else afterwards.",,"No.","Yes.") == "No.")
@@ -496,7 +496,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
O.fingerprintslast = fingerprintslast
user.put_in_active_hand(O)
qdel(src)
target.attackby(O, user)
target_mob.attackby(O, user)
//used by stethoscope
/obj/item/organ/proc/listen()