mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-21 20:27:42 +01:00
[MIRROR] Begin clickcode attack_self fix (#12173)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
063cf6cf48
commit
3cac28f9ad
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user