[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 -1
View File
@@ -47,6 +47,9 @@ var/list/organ_cache = list()
var/meat_type // What does butchering, if possible, make?
var/list/medical_issues = list()
///Var for attack_self chain
var/special_handling = FALSE
/obj/item/organ/Destroy()
handle_organ_mod_special(TRUE)
@@ -482,7 +485,13 @@ var/list/organ_cache = list()
user.put_in_active_hand(O)
qdel(src)
/obj/item/organ/attack_self(mob/user as mob)
/obj/item/organ/attack_self(mob/user, callback)
. = ..(user)
if(.)
return TRUE
if(special_handling && !callback)
return FALSE
// Convert it to an edible form, yum yum.
if(!(robotic >= ORGAN_ROBOT) && user.a_intent == I_HELP && user.zone_sel.selecting == O_MOUTH)
+8 -3
View File
@@ -87,6 +87,8 @@
// HUD element variable, see organ_icon.dm get_damage_hud_image()
var/image/hud_damage_image
special_handling = TRUE
/obj/item/organ/external/Destroy()
if(parent && parent.children)
@@ -148,9 +150,12 @@
if(burn_damage)
take_damage(0, burn_damage)
/obj/item/organ/external/attack_self(var/mob/living/user)
/obj/item/organ/external/attack_self(mob/living/user)
. = ..(user)
if(.)
return TRUE
if(!contents.len)
return ..()
return ..(user, TRUE)
var/list/removable_objects = list()
for(var/obj/item/organ/external/E in (contents + src))
if(!istype(E))
@@ -166,7 +171,7 @@
user.put_in_hands(I)
user.visible_message(span_danger("\The [user] rips \the [I] out of \the [src]!"))
return //no eating the limb until everything's been removed
return ..()
return ..(user, TRUE)
/obj/item/organ/external/examine(mob/user)
. = ..()