Migrate organs to the new attack chain. (#32156)

* Migrate organs to the new attack chain.

* Migrate additional organs and rod of asclepius.

* Update regenerative core.

* Call parent activate_self of regenerative core.
This commit is contained in:
Alan
2026-07-17 06:13:01 +00:00
committed by GitHub
parent 6807c223b3
commit 225a38b7de
9 changed files with 110 additions and 101 deletions
+13 -12
View File
@@ -15,13 +15,15 @@
else
icon_state = "[base_icon_state]-off"
/obj/item/organ/internal/heart/attack_self__legacy__attackchain(mob/user)
..()
/obj/item/organ/internal/heart/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
if(status & ORGAN_DEAD)
to_chat(user, SPAN_WARNING("You can't restart a dead heart."))
return
return ITEM_INTERACT_COMPLETE
var/datum/organ/heart/heart = organ_datums[ORGAN_DATUM_HEART]
heart.try_restart(8 SECONDS)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/heart/safe_replace(mob/living/carbon/human/target)
var/datum/organ/heart/heart = organ_datums[ORGAN_DATUM_HEART]
@@ -55,16 +57,15 @@
var/heal_burn = 0
var/heal_oxy = 0
/obj/item/organ/internal/heart/cursed/attack__legacy__attackchain(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target)
if(H == user && istype(H))
if(NO_BLOOD in H.dna.species.species_traits)
to_chat(H, SPAN_USERDANGER("[src] is not compatible with your form!"))
return
playsound(user,'sound/effects/singlebeat.ogg', 40, 1)
user.drop_item()
insert(user)
else
/obj/item/organ/internal/heart/cursed/interact_with_atom(atom/target, mob/living/carbon/human/user, list/modifiers)
if(!(target == user && istype(user)))
return ..()
if(NO_BLOOD in user.dna.species.species_traits)
to_chat(user, SPAN_USERDANGER("[src] is not compatible with your form!"))
return ITEM_INTERACT_COMPLETE
playsound(user,'sound/effects/singlebeat.ogg', 40, 1)
user.drop_item()
insert(user)
/obj/item/organ/internal/heart/cursed/on_life()
if(world.time > (last_pump + pump_delay) && !in_grace_period)
+4 -3
View File
@@ -46,6 +46,7 @@
/// A list of all wounds currently on this organ
var/list/wound_list = list()
new_attack_chain = TRUE
/obj/item/organ/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -75,9 +76,9 @@
if(species_override)
dna.species = new species_override
/obj/item/organ/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(is_robotic() && istype(I, /obj/item/stack/nanopaste))
var/obj/item/stack/nanopaste/nano = I
/obj/item/organ/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(is_robotic() && istype(used, /obj/item/stack/nanopaste))
var/obj/item/stack/nanopaste/nano = used
nano.use(1)
rejuvenate()
to_chat(user, SPAN_NOTICE("You repair the damage on [src]."))
+25 -25
View File
@@ -176,20 +176,20 @@
if(!HAS_TRAIT(owner, TRAIT_IB_IMMUNE))
limb_flags &= ~CANNOT_INT_BLEED
/obj/item/organ/external/attack__legacy__attackchain(mob/M, mob/living/user)
if(!ishuman(M))
/obj/item/organ/external/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(!ishuman(target))
return ..()
var/mob/living/carbon/human/C = M
if(is_robotic() && HAS_TRAIT(C, TRAIT_IPC_JOINTS_MAG) && isnull(C.bodyparts_by_name[limb_name]))
var/mob/living/carbon/human/patient = target
if(is_robotic() && HAS_TRAIT(patient, TRAIT_IPC_JOINTS_MAG) && isnull(patient.bodyparts_by_name[limb_name]))
user.drop_item_to_ground(src)
replaced(C)
C.update_body()
C.updatehealth()
C.UpdateDamageIcon()
replaced(patient)
patient.update_body()
patient.updatehealth()
patient.UpdateDamageIcon()
user.visible_message(
SPAN_NOTICE("[user] has attached [C]'s [src] to the [amputation_point]."),
SPAN_NOTICE("You have attached [C]'s [src] to the [amputation_point]."))
return TRUE
SPAN_NOTICE("[user] has attached [patient]'s [src] to the [amputation_point]."),
SPAN_NOTICE("You have attached [patient]'s [src] to the [amputation_point]."))
return ITEM_INTERACT_COMPLETE
return ..()
/obj/item/organ/external/replaced(mob/living/carbon/human/target)
@@ -824,21 +824,21 @@ Note that amputating the affected organ does in fact remove the infection from t
if(disembowel("groin"))
return TRUE
/obj/item/organ/external/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(I.sharp)
add_fingerprint(user)
if(!length(contents))
to_chat(user, SPAN_WARNING("There is nothing left inside [src]!"))
return
playsound(loc, 'sound/weapons/slice.ogg', 50, TRUE, -1)
user.visible_message(SPAN_WARNING("[user] begins to cut open [src]."),\
SPAN_NOTICE("You begin to cut open [src]..."))
if(do_after(user, 5.4 SECONDS, target = src))
drop_organs(user)
drop_embedded_objects()
open = ORGAN_ORGANIC_VIOLENT_OPEN
else
/obj/item/organ/external/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!used.sharp)
return ..()
add_fingerprint(user)
if(!length(contents))
to_chat(user, SPAN_WARNING("There is nothing left inside [src]!"))
return ITEM_INTERACT_COMPLETE
playsound(loc, 'sound/weapons/slice.ogg', 50, TRUE, -1)
user.visible_message(SPAN_WARNING("[user] begins to cut open [src]."),\
SPAN_NOTICE("You begin to cut open [src]..."))
if(do_after(user, 5.4 SECONDS, target = src))
drop_organs(user)
drop_embedded_objects()
open = ORGAN_ORGANIC_VIOLENT_OPEN
return ITEM_INTERACT_COMPLETE
//empties the bodypart from its organs and other things inside it
/obj/item/organ/external/proc/drop_organs(mob/user)
+20 -22
View File
@@ -256,29 +256,27 @@
return TRUE
/obj/item/organ/internal/attack__legacy__attackchain(mob/living/carbon/M, mob/user)
if(M == user && ishuman(user))
var/mob/living/carbon/human/H = user
if(is_xeno_organ)
to_chat(user, SPAN_WARNING("It wouldnt be a very good idea to eat this."))
return ..()
var/obj/item/food/S = prepare_eat()
if(S)
H.drop_item()
H.put_in_active_hand(S)
S.interact_with_atom(H, H)
qdel(src)
else
..()
/obj/item/organ/internal/interact_with_atom(atom/target, mob/living/carbon/human/user, list/modifiers)
if(!(target == user && ishuman(user)))
return ..()
if(is_xeno_organ)
to_chat(user, SPAN_WARNING("It wouldnt be a very good idea to eat this."))
return ITEM_INTERACT_COMPLETE
var/obj/item/food/organ_to_eat = prepare_eat()
if(organ_to_eat)
user.drop_item()
user.put_in_active_hand(organ_to_eat)
organ_to_eat.interact_with_atom(user, user)
qdel(src)
/obj/item/organ/internal/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(is_robotic() && istype(I, /obj/item/stack/synthetic_skin))
var/obj/item/stack/synthetic_skin/skin = I
skin.use(1)
self_augmented_skin_level = skin.skin_level
to_chat(user, SPAN_NOTICE("You apply [skin] to [src]."))
return
return ..()
/obj/item/organ/internal/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!(is_robotic() && istype(used, /obj/item/stack/synthetic_skin)))
return ..()
var/obj/item/stack/synthetic_skin/skin = used
skin.use(1)
self_augmented_skin_level = skin.skin_level
to_chat(user, SPAN_NOTICE("You apply [skin] to [src]."))
return ITEM_INTERACT_COMPLETE
/****************************************************
@@ -43,15 +43,15 @@
else
. += SPAN_NOTICE("You can hijack the latent functions of this organ by using a Hemostat on it.")
/obj/item/organ/internal/alien/attackby__legacy__attackchain(obj/item/hemostat/item, mob/user, params)
if(istype(item))
if(!hijacked)
to_chat(user, SPAN_NOTICE("You slice off the control node of this organ. This organ will now be effective against aliens."))
else
to_chat(user, SPAN_NOTICE("You reattach the control node of this organ. This organ will now be effective against those who attack the hive."))
hijacked = !hijacked
return
return ..()
/obj/item/organ/internal/alien/item_interaction(mob/living/user, obj/item/hemostat/used, list/modifiers)
if(!istype(used))
return ..()
if(!hijacked)
to_chat(user, SPAN_NOTICE("You slice off the control node of this organ. This organ will now be effective against aliens."))
else
to_chat(user, SPAN_NOTICE("You reattach the control node of this organ. This organ will now be effective against those who attack the hive."))
hijacked = !hijacked
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/alien/prepare_eat()
var/obj/S = ..()
+2 -2
View File
@@ -582,9 +582,9 @@ GLOBAL_LIST_INIT(voice_of_god_commands, init_voice_of_god_commands())
desc = "They carry the voice of an ancient god. This one is enchanted to implant it into yourself when used in hand."
var/has_implanted = FALSE
/obj/item/organ/internal/vocal_cords/colossus/wizard/attack_self__legacy__attackchain(mob/living/user)
/obj/item/organ/internal/vocal_cords/colossus/wizard/activate_self(mob/living/user)
if(has_implanted)
return
return ..()
user.drop_item()
insert(user)
has_implanted = TRUE