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 02:13:01 -04:00
committed by GitHub
parent 6807c223b3
commit 225a38b7de
9 changed files with 110 additions and 101 deletions
@@ -94,13 +94,15 @@
user.drop_item()
qdel(src)
/obj/item/organ/internal/regenerative_core/afterattack__legacy__attackchain(atom/target, mob/user, proximity_flag)
. = ..()
if(proximity_flag)
applyto(target, user)
/obj/item/organ/internal/regenerative_core/interact_with_atom(atom/target, mob/living/carbon/human/user, list/modifiers)
applyto(target, user)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/regenerative_core/attack_self__legacy__attackchain(mob/user)
/obj/item/organ/internal/regenerative_core/activate_self(mob/user)
if(!user)
return ..()
applyto(user, user)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/regenerative_core/insert(mob/living/carbon/M, special = 0)
..()
@@ -325,46 +325,45 @@
var/activated = FALSE
var/usedHand
var/mob/living/carbon/owner
new_attack_chain = TRUE
/obj/item/rod_of_asclepius/attack_self__legacy__attackchain(mob/user)
/obj/item/rod_of_asclepius/activate_self(mob/user)
if(activated)
return
return ..()
if(!iscarbon(user))
to_chat(user, SPAN_WARNING("The snake carving seems to come alive, if only for a moment, before returning to its dormant state, almost as if it finds you incapable of holding its oath."))
return
return ITEM_INTERACT_COMPLETE
var/mob/living/carbon/itemUser = user
if(itemUser.l_hand == src)
usedHand = LEFT_HAND
if(itemUser.r_hand == src)
usedHand = RIGHT_HAND
usedHand = itemUser.l_hand == src ? LEFT_HAND : RIGHT_HAND
if(itemUser.has_status_effect(STATUS_EFFECT_HIPPOCRATIC_OATH))
to_chat(user, SPAN_WARNING("You can't possibly handle the responsibility of more than one rod!"))
return
return ITEM_INTERACT_COMPLETE
var/failText = SPAN_WARNING("The snake seems unsatisfied with your incomplete oath and returns to its previous place on the rod, returning to its dormant, wooden state. You must stand still while completing your oath!")
to_chat(itemUser, SPAN_NOTICE("The wooden snake that was carved into the rod seems to suddenly come alive and begins to slither down your arm! The compulsion to help others grows abnormally strong..."))
if(do_after_once(itemUser, 40, target = itemUser))
itemUser.say("I swear to fulfill, to the best of my ability and judgment, this covenant:")
else
to_chat(itemUser, failText)
return
return ITEM_INTERACT_COMPLETE
if(do_after(itemUser, 20, target = itemUser))
itemUser.say("I will apply, for the benefit of the sick, all measures that are required, avoiding those twin traps of overtreatment and therapeutic nihilism.")
else
to_chat(itemUser, failText)
return
return ITEM_INTERACT_COMPLETE
if(do_after(itemUser, 30, target = itemUser))
itemUser.say("I will remember that I remain a member of society, with special obligations to all my fellow human beings, those sound of mind and body as well as the infirm.")
else
to_chat(itemUser, failText)
return
return ITEM_INTERACT_COMPLETE
if(do_after(itemUser, 30, target = itemUser))
itemUser.say("If I do not violate this oath, may I enjoy life and art, respected while I live and remembered with affection thereafter. May I always act so as to preserve the finest traditions of my calling and may I long experience the joy of healing those who seek my help.")
else
to_chat(itemUser, failText)
return
return ITEM_INTERACT_COMPLETE
to_chat(itemUser, SPAN_NOTICE("The snake, satisfied with your oath, attaches itself and the rod to your forearm with an inseparable grip. Your thoughts seem to only revolve around the core idea of helping others, and harm is nothing more than a distant, wicked memory..."))
activated(itemUser)
return ITEM_INTERACT_COMPLETE
/obj/item/rod_of_asclepius/Destroy()
owner = null
@@ -449,14 +448,16 @@
return // It's a shard
/obj/item/organ/internal/cyberimp/arm/katana/attack_self__legacy__attackchain(mob/living/carbon/user, modifiers)
. = ..()
/obj/item/organ/internal/cyberimp/arm/katana/activate_self(mob/living/carbon/user)
if(..())
return ITEM_INTERACT_COMPLETE
to_chat(user,SPAN_USERDANGER("The mass goes up your arm and inside it!"))
playsound(user, 'sound/misc/demon_consume.ogg', 50, TRUE)
RegisterSignal(user, COMSIG_MOB_DEATH, PROC_REF(user_death))
user.drop_item()
insert(user)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/cyberimp/arm/katana/emp_act() //Organic, no emp stuff
return
@@ -12,15 +12,18 @@
/obj/item/organ/internal/heart/demon/prepare_eat()
return // Just so people don't accidentally waste it
/obj/item/organ/internal/heart/demon/attack_self__legacy__attackchain(mob/living/user)
/obj/item/organ/internal/heart/demon/activate_self(mob/living/user)
if(!user)
return ..()
user.visible_message(SPAN_WARNING("[user] raises [src] to [user.p_their()] mouth and tears into it with [user.p_their()] teeth!"), \
SPAN_DANGER("An unnatural hunger consumes you. You raise [src] to your mouth and devour it!"))
playsound(user, 'sound/misc/demon_consume.ogg', 50, 1)
/// SLAUGHTER DEMON HEART
/obj/item/organ/internal/heart/demon/slaughter/attack_self__legacy__attackchain(mob/living/user)
..()
/obj/item/organ/internal/heart/demon/slaughter/activate_self(mob/living/user)
if(..())
return ITEM_INTERACT_COMPLETE
// Eating the heart for the first time. Gives basic bloodcrawling. This is the only time we need to insert the heart.
if(!HAS_TRAIT(user, TRAIT_BLOODCRAWL))
@@ -29,18 +32,19 @@
ADD_TRAIT(user, TRAIT_BLOODCRAWL, "bloodcrawl")
user.drop_item()
insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E.
return TRUE
return ITEM_INTERACT_COMPLETE
// Eating a 2nd heart. Gives the ability to drag people into blood and eat them.
if(HAS_TRAIT(user, TRAIT_BLOODCRAWL))
to_chat(user, "You feel differ-[SPAN_DANGER(" CONSUME THEM!")]")
ADD_TRAIT(user, TRAIT_BLOODCRAWL_EAT, "bloodcrawl_eat")
qdel(src) // Replacing their demon heart with another demon heart is pointless, just delete this one and return.
return TRUE
return ITEM_INTERACT_COMPLETE
// Eating any more than 2 demon hearts does nothing.
to_chat(user, SPAN_WARNING("...and you don't feel any different."))
qdel(src)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/heart/demon/slaughter/insert(mob/living/carbon/M, special = 0)
. = ..()
@@ -60,10 +64,11 @@
desc = "It still beats furiously, emitting an aura of fear."
color = COLOR_BLACK
/obj/item/organ/internal/heart/demon/shadow/attack_self__legacy__attackchain(mob/living/user)
. = ..()
/obj/item/organ/internal/heart/demon/shadow/activate_self(mob/living/user)
..()
user.drop_item()
insert(user)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/heart/demon/shadow/insert(mob/living/carbon/M, special = 0)
. = ..()
@@ -85,10 +90,11 @@
. = ..()
set_light(13, 2, "#bbbb00")
/obj/item/organ/internal/heart/demon/pulse/attack_self__legacy__attackchain(mob/living/user)
. = ..()
/obj/item/organ/internal/heart/demon/pulse/activate_self(mob/living/user)
..()
user.drop_item()
insert(user)
return ITEM_INTERACT_COMPLETE
/obj/item/organ/internal/heart/demon/pulse/insert(mob/living/carbon/M, special, dont_remove_slot)
. = ..()
+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