Migrate autosurgeon to the new attack chain. (#32302)

* Migrate autosurgeon to the new attack chain.

* Fix skinmonger runtime and augments icon code consistency.

* Apply suggestion from CRUNCH review.

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: Alan <alfalfascout@users.noreply.github.com>

---------

Signed-off-by: Alan <alfalfascout@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
Alan
2026-08-01 06:14:53 +00:00
committed by GitHub
co-authored by CRUNCH
parent 8010b5ff4e
commit 4be7b2edf7
4 changed files with 88 additions and 101 deletions
+33 -41
View File
@@ -69,32 +69,24 @@
..()
/obj/item/organ/internal/cyberimp/arm/proc/get_overlay_state(image_layer)
return "[augment_icon][parent_organ == BODY_ZONE_L_ARM ? "_left" : "_right"]"
return "[augment_state][parent_organ == BODY_ZONE_L_ARM ? "_left" : "_right"]"
/obj/item/organ/internal/cyberimp/arm/render()
. = ..()
if(!.)
return
var/mutable_appearance/custom_appearance = ..()
if(!custom_appearance)
return FALSE
var/mutable_appearance/arm_overlay = mutable_appearance(
icon = augment_state,
icon_state = get_overlay_state(),
layer = -INTORGAN_LAYER,
)
return arm_overlay
custom_appearance.icon_state = get_overlay_state()
return custom_appearance
/obj/item/organ/internal/cyberimp/arm/extra_render()
. = ..()
if(!.)
return
var/mutable_appearance/hand_overlay = mutable_appearance(
icon = augment_state,
icon_state = "[get_overlay_state()]_hand",
layer = -HAND_INTORGAN_LAYER,
)
return hand_overlay
var/mutable_appearance/custom_appearance = ..()
if(!custom_appearance)
return FALSE
custom_appearance.icon_state = "[get_overlay_state()]_hand"
custom_appearance.layer = -HAND_INTORGAN_LAYER
return custom_appearance
/obj/item/organ/internal/cyberimp/arm/proc/retract_to_linked_implant()
SIGNAL_HANDLER
@@ -261,7 +253,7 @@
contents = newlist(/obj/item/screwdriver/cyborg, /obj/item/wrench/cyborg, /obj/item/weldingtool/largetank/cyborg,
/obj/item/crowbar/cyborg, /obj/item/wirecutters/cyborg, /obj/item/multitool/cyborg)
actions_types = list(/datum/action/item_action/organ_action/toggle/utility_belt)
augment_icon = "toolkit_engi"
augment_state = "toolkit_engi"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/toolset/l
@@ -286,7 +278,7 @@
materials = list(MAT_METAL = 20000, MAT_SILVER = 10000, MAT_PLASMA = 9000, MAT_TITANIUM = 8000, MAT_DIAMOND = 8000)
contents = newlist(/obj/item/screwdriver/abductor, /obj/item/wirecutters/abductor, /obj/item/crowbar/abductor, /obj/item/wrench/abductor, /obj/item/weldingtool/abductor, /obj/item/multitool/abductor)
actions_types = list(/datum/action/item_action/organ_action/toggle/abductor_belt)
augment_icon = "toolkit_engi"
augment_state = "toolkit_engi"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/toolset_abductor/l
@@ -304,7 +296,7 @@
materials = list(MAT_METAL = 20000, MAT_SILVER = 10000, MAT_PLASMA = 9000, MAT_TITANIUM = 8000, MAT_DIAMOND = 8000)
contents = newlist(/obj/item/mop/advanced/abductor, /obj/item/soap/syndie/abductor, /obj/item/lightreplacer/bluespace/abductor, /obj/item/holosign_creator/janitor, /obj/item/melee/flyswatter/abductor, /obj/item/reagent_containers/spray/cleaner/safety/abductor)
actions_types = list(/datum/action/item_action/organ_action/toggle/abductor_belt)
augment_icon = "toolkit_jani"
augment_state = "toolkit_jani"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/janitorial_abductor/l
@@ -318,7 +310,7 @@
materials = list(MAT_METAL = 20000, MAT_SILVER = 10000, MAT_PLASMA = 9000, MAT_TITANIUM = 8000, MAT_DIAMOND = 8000)
contents = newlist(/obj/item/retractor/alien, /obj/item/hemostat/alien, /obj/item/bonesetter/alien, /obj/item/scalpel/laser/alien, /obj/item/circular_saw/alien, /obj/item/bonegel/alien, /obj/item/fix_o_vein/alien, /obj/item/surgicaldrill/alien)
actions_types = list(/datum/action/item_action/organ_action/toggle/abductor_belt)
augment_icon = "toolkit_med"
augment_state = "toolkit_med"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/surgical_abductor/l
@@ -341,7 +333,7 @@
icon_state = "toolkit_surgical"
origin_tech = "materials=5;combat=2;biotech=5;powerstorage=4;syndicate=1"
actions_types = list(/datum/action/item_action/organ_action/toggle/medibeam)
augment_icon = "toolkit_med"
augment_state = "toolkit_med"
do_extra_render = TRUE
/datum/action/item_action/organ_action/toggle/flash
@@ -354,7 +346,7 @@
contents = newlist(/obj/item/flash/armimplant)
origin_tech = "materials=4;combat=3;biotech=4;magnets=4;powerstorage=3"
actions_types = list(/datum/action/item_action/organ_action/toggle/flash)
augment_icon = "toolkit"
augment_state = "toolkit"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/flash/Initialize(mapload)
@@ -368,7 +360,7 @@
desc = "An illegal combat implant that allows the user to administer disabling shocks from their arm."
contents = newlist(/obj/item/borg/stun)
origin_tech = "materials=3;combat=5;biotech=4;powerstorage=4;syndicate=3"
augment_icon = "toolkit"
augment_state = "toolkit"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/combat
@@ -403,7 +395,7 @@
contents = newlist(/obj/item/retractor/augment, /obj/item/hemostat/augment, /obj/item/cautery/augment, /obj/item/bonesetter/augment, /obj/item/scalpel/augment, /obj/item/circular_saw/augment, /obj/item/bonegel/augment, /obj/item/fix_o_vein/augment, /obj/item/surgicaldrill/augment)
origin_tech = "materials=3;engineering=3;biotech=3;programming=2;magnets=3"
actions_types = list(/datum/action/item_action/organ_action/toggle/dufflebag_med)
augment_icon = "toolkit_med"
augment_state = "toolkit_med"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/surgery/l
@@ -421,7 +413,7 @@
contents = newlist(/obj/item/mop/advanced, /obj/item/soap, /obj/item/lightreplacer, /obj/item/holosign_creator/janitor, /obj/item/melee/flyswatter, /obj/item/reagent_containers/spray/cleaner/safety)
origin_tech = "materials=3;engineering=4;biotech=3"
actions_types = list(/datum/action/item_action/organ_action/toggle/janibelt)
augment_icon = "toolkit_jani"
augment_state = "toolkit_jani"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/janitorial/l
@@ -453,7 +445,7 @@
contents = newlist(/obj/item/plant_analyzer, /obj/item/cultivator, /obj/item/hatchet, /obj/item/shovel/spade, /obj/item/reagent_containers/spray/weedspray, /obj/item/reagent_containers/spray/pestspray)
origin_tech = "materials=3;engineering=4;biotech=3"
actions_types = list(/datum/action/item_action/organ_action/toggle/botanybelt)
augment_icon = "toolkit_hydro"
augment_state = "toolkit_hydro"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/botanical/l
@@ -564,7 +556,7 @@
contents = newlist(/obj/item/melee/classic_baton)
actions_types = list(/datum/action/item_action/organ_action/toggle/telebaton)
augment_icon = "toolkit"
augment_state = "toolkit"
do_extra_render = TRUE
/datum/action/item_action/organ_action/toggle/advanced_mop
@@ -578,7 +570,7 @@
contents = newlist(/obj/item/mop/advanced)
actions_types = list(/datum/action/item_action/organ_action/toggle/advanced_mop)
augment_icon = "toolkit_jani"
augment_state = "toolkit_jani"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/cargo
@@ -692,7 +684,7 @@
origin_tech = "combat=5;biotech=5;syndicate=2"
materials = list(MAT_METAL = 5000, MAT_SILVER = 2000, MAT_DIAMOND = 2000, MAT_BLUESPACE = 2000)
stealth_level = 1 // Hidden from health analyzers
augment_icon = "razor" // Note: By default the autosurgeons apply the highest level of cover plating.
augment_state = "razor" // Note: By default the autosurgeons apply the highest level of cover plating.
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/razorwire/examine_more(mob/user)
@@ -748,7 +740,7 @@
contents = newlist(/obj/item/gun/projectile/revolver/doublebarrel/shell_launcher)
icon_state = "shell_cannon"
actions_types = list(/datum/action/item_action/organ_action/toggle/shell_cannon)
augment_icon = "razor"
augment_state = "razor"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/shell_launcher/emp_act(severity)
@@ -814,7 +806,7 @@
contents = newlist(/obj/item/shield/v1_arm)
actions_types = list(/datum/action/item_action/organ_action/toggle/v1_arm)
augment_icon = "v1_arm"
augment_state = "v1_arm"
do_extra_render = TRUE
var/disabled = FALSE
@@ -838,11 +830,11 @@
/obj/item/organ/internal/cyberimp/arm/v1_arm/render()
if(isvox(owner))
augment_icon = "v1_arm_vox"
augment_state = "v1_arm_vox"
else if(isdrask(owner))
augment_icon = "v1_arm_drask"
augment_state = "v1_arm_drask"
else
augment_icon = "v1_arm"
augment_state = "v1_arm"
return ..()
/obj/item/shield/v1_arm
@@ -952,7 +944,7 @@
parent_organ = "l_arm" //Left arm by default
slot = "l_arm_device"
actions_types = list()
augment_icon = "strongarm"
augment_state = "strongarm"
materials = list(MAT_GOLD = 5000, MAT_METAL = 10000, MAT_TITANIUM = 3000, MAT_BLUESPACE = 2000)
var/datum/martial_art/muscle_implant/muscle_implant
@@ -1052,7 +1044,7 @@
contents = newlist(/obj/item/melee/mantis_blade/syndicate)
icon_state = "syndie_mantis"
icon = 'icons/obj/weapons/melee.dmi'
augment_icon = "razor"
augment_state = "razor"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/syndie_mantis/l
@@ -1066,7 +1058,7 @@
contents = newlist(/obj/item/melee/mantis_blade/nt)
icon_state = "mantis"
icon = 'icons/obj/weapons/melee.dmi'
augment_icon = "razor"
augment_state = "razor"
do_extra_render = TRUE
/obj/item/organ/internal/cyberimp/arm/nt_mantis/l
@@ -6,7 +6,7 @@
var/implant_overlay
var/crit_fail = FALSE //Used by certain implants to disable them.
tough = TRUE // Immune to damage
augment_state ='icons/mob/human_races/robotic.dmi'
augment_icon ='icons/mob/human_races/robotic.dmi'
/obj/item/organ/internal/cyberimp/Initialize(mapload, mob/M = null)
. = ..()
@@ -340,7 +340,7 @@
actions_types = list(/datum/action/item_action/organ_action/toggle/sensory_enhancer)
origin_tech = "combat=6;biotech=6;syndicate=4"
materials = list(MAT_METAL = 10000, MAT_SILVER = 2000, MAT_PLASMA = 10000, MAT_DIAMOND = 4000, MAT_BLUESPACE = 4000)
augment_icon = "sandy"
augment_state = "sandy"
always_show_augment = TRUE // A bit too big and bright to hide with synthetic skin.
///The icon state used for the on mob sprite. Default is sandy. Drask and vox have their own unique sprites
var/custom_mob_sprite = "sandy"
@@ -375,17 +375,19 @@
REMOVE_TRAIT(M, TRAIT_MEPHEDRONE_ADAPTED, "[UID()]")
/obj/item/organ/internal/cyberimp/brain/sensory_enhancer/render()
. = ..()
if(!.)
return
var/mutable_appearance/custom_appearance = ..()
if(!custom_appearance)
return FALSE
if(isvox(owner))
custom_mob_sprite = "vox_sandy"
else if(isdrask(owner))
custom_mob_sprite = "drask_sandy"
else
custom_mob_sprite = "sandy"
var/mutable_appearance/our_MA = mutable_appearance(augment_state, custom_mob_sprite, layer = -INTORGAN_LAYER)
return our_MA
custom_appearance.icon_state = custom_mob_sprite
return custom_appearance
/obj/item/organ/internal/cyberimp/brain/sensory_enhancer/emp_act(severity)
. = ..()
@@ -597,14 +599,7 @@
w_class = WEIGHT_CLASS_TINY
origin_tech = "materials=2;biotech=3"
materials = list(MAT_METAL = 600, MAT_GLASS = 250)
augment_icon = "breathing_tube"
/obj/item/organ/internal/cyberimp/mouth/breathing_tube/render()
. = ..()
if(!.)
return
var/mutable_appearance/our_MA = mutable_appearance(augment_state, augment_icon, layer = -INTORGAN_LAYER)
return our_MA
augment_state = "breathing_tube"
/obj/item/organ/internal/cyberimp/mouth/breathing_tube/emp_act(severity)
if(emp_proof)
@@ -632,7 +627,7 @@
slot = "stomach"
origin_tech = "materials=2;powerstorage=2;biotech=2"
materials = list(MAT_METAL = 500, MAT_GLASS = 500, MAT_GOLD = 500)
augment_icon = "nutripump"
augment_state = "nutripump"
/obj/item/organ/internal/cyberimp/chest/nutriment/examine(mob/user)
. = ..()
@@ -674,14 +669,6 @@
synthesizing = FALSE
addtimer(CALLBACK(src, PROC_REF(emp_cool)), 60 SECONDS)
/obj/item/organ/internal/cyberimp/chest/nutriment/render()
. = ..()
if(!.)
return
var/mutable_appearance/our_MA = mutable_appearance(augment_state, augment_icon, layer = -INTORGAN_LAYER)
return our_MA
/obj/item/organ/internal/cyberimp/chest/nutriment/plus
name = "Nutriment pump implant PLUS"
desc = "This implant will synthesize a small amount of nutriment and pumps it directly into your bloodstream when you are hungry."
@@ -690,7 +677,7 @@
poison_amount = 10
origin_tech = "materials=4;powerstorage=3;biotech=3"
materials = list(MAT_METAL = 600, MAT_GLASS = 600, MAT_GOLD = 500, MAT_URANIUM = 750)
augment_icon = "nutripump_adv"
augment_state = "nutripump_adv"
/obj/item/organ/internal/cyberimp/chest/nutriment/hardened
name = "hardened nutriment pump implant"
@@ -708,7 +695,7 @@
origin_tech = "materials=5;programming=5;biotech=6"
materials = list(MAT_METAL = 800, MAT_GLASS = 800, MAT_GOLD = 300, MAT_URANIUM = 500)
slot = "heartdrive"
augment_icon = "reviver"
augment_state = "reviver"
/// How long the implant will go on cooldown for once the user has exited crit, in seconds.
var/revive_cost = 0 SECONDS
/// Are we in the progress of healing the user?
@@ -732,13 +719,6 @@
. = ..()
desc += " The implant has been hardened. It is invulnerable to EMPs."
/obj/item/organ/internal/cyberimp/chest/reviver/render()
. = ..()
if(!.)
return
var/mutable_appearance/our_MA = mutable_appearance(augment_state, augment_icon, layer = -INTORGAN_LAYER)
return our_MA
/obj/item/organ/internal/cyberimp/chest/reviver/dead_process()
if(status & ORGAN_DEAD)
return FALSE
@@ -1102,7 +1082,7 @@
slot = "chest_synthetic_skin"
w_class = WEIGHT_CLASS_TINY
origin_tech = "materials=6;biotech=7;syndicate=1"
augment_icon = "nutripump"
augment_state = "nutripump"
/// Whether regeneration is allowed. This is disabled temporarily by an EMP
var/regeneration_active = TRUE
/// How long to wait after finding a target body part to replace skin on
+34 -21
View File
@@ -7,9 +7,10 @@
icon_state = "autoimplanter"
w_class = WEIGHT_CLASS_SMALL
var/uses = INFINITE
new_attack_chain = TRUE
/obj/item/autosurgeon/attack_self_tk(mob/user)
return //stops TK fuckery
return // Stops TK fuckery.
/obj/item/autosurgeon/organ
name = "implant autosurgeon"
@@ -28,15 +29,20 @@
I.forceMove(src)
name = "[initial(name)] ([storedorgan.name])"
/obj/item/autosurgeon/organ/attack_self__legacy__attackchain(mob/user) //when the object it used...
/obj/item/autosurgeon/organ/activate_self(mob/user) // When the object is used...
if(..())
return ITEM_INTERACT_COMPLETE
if(!uses)
to_chat(user, SPAN_ALERT("[src] has already been used. The tools are dull and won't reactivate."))
return
return ITEM_INTERACT_COMPLETE
else if(!storedorgan)
to_chat(user, SPAN_ALERT("[src] currently has no implant stored."))
return
return ITEM_INTERACT_COMPLETE
SSblackbox.record_feedback("tally", "o_implant_auto", 1, "[storedorgan.type]")
storedorgan.insert(user) //insert stored organ into the user
storedorgan.insert(user) // Insert stored organ into the user.
user.visible_message(SPAN_NOTICE("[user] presses a button on [src], and you hear a short mechanical noise."), SPAN_NOTICE("You feel a sharp sting as [src] plunges into your body."))
playsound(get_turf(user), 'sound/weapons/circsawhit.ogg', 50, TRUE)
storedorgan = null
@@ -45,23 +51,30 @@
uses--
if(!uses)
desc = "[initial(desc)] Looks like it's been used up."
return ITEM_INTERACT_COMPLETE
/obj/item/autosurgeon/organ/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, organ_type))
if(storedorgan)
to_chat(user, SPAN_ALERT("[src] already has an implant stored."))
return
else if(!uses)
to_chat(user, SPAN_ALERT("[src] has already been used up."))
return
if(!user.drop_item())
return
I.forceMove(src)
storedorgan = I
to_chat(user, SPAN_NOTICE("You insert [I] into [src]."))
else
/obj/item/autosurgeon/organ/item_interaction(mob/user, obj/item/used, list/modifiers)
if(!istype(used, organ_type))
return ..()
if(storedorgan)
to_chat(user, SPAN_WARNING("[src] already has an implant stored!"))
return ITEM_INTERACT_COMPLETE
if(!uses)
to_chat(user, SPAN_WARNING("[src] has already been used up!"))
return ITEM_INTERACT_COMPLETE
if(!user.drop_item())
to_chat(user, SPAN_WARNING("[used] is stuck to your hand! You can't store it in [src]!"))
return ITEM_INTERACT_COMPLETE
used.forceMove(src)
storedorgan = used
add_fingerprint(user)
to_chat(user, SPAN_NOTICE("You insert [used] into [src]."))
return ITEM_INTERACT_COMPLETE
/obj/item/autosurgeon/organ/screwdriver_act(mob/living/user, obj/item/I)
if(..())
return TRUE
@@ -110,7 +123,7 @@
name = "suspicious implant autosurgeon"
icon_state = "syndicate_autoimplanter"
/obj/item/autosurgeon/organ/syndicate/attack_self__legacy__attackchain(mob/user)
/obj/item/autosurgeon/organ/syndicate/activate_self(mob/user)
if(storedorgan && uses && storedorgan.is_robotic()) // Helps keep the syndicate ones hidden. One can peel them off if they want them to be visable.
storedorgan.self_augmented_skin_level = 3
return ..()
@@ -193,7 +206,7 @@
/obj/item/autosurgeon/organ/syndicate/oneuse/skinmonger
starting_organ = /obj/item/organ/internal/cyberimp/chest/skinmonger
/obj/item/autosurgeon/organ/syndicate/oneuse/skinmonger/attack_self__legacy__attackchain(mob/user)
/obj/item/autosurgeon/organ/syndicate/oneuse/skinmonger/activate_self(mob/user)
if(!storedorgan)
return ..()
@@ -21,10 +21,10 @@
var/is_xeno_organ = FALSE
/// Does this organ give a warning upon being inserted?
var/warning = FALSE
/// Does this organ show outside the mob, and what is the icon state?
var/augment_state = null
/// Does this organ actually have a sprite for it being on the arm? And what is the path of it.
/// The icon file for the augment that shows outside the mob, if any.
var/augment_icon = null
/// The icon state for the augment that shows outside the mob, if any.
var/augment_state = null
/// Does this organ have a extra render mechanic?
var/do_extra_render = FALSE
/// Does this organ ignore skin covers?
@@ -242,7 +242,8 @@
if(our_parent.augmented_skin_cover_level && !always_show_augment)
return FALSE
return TRUE
var/mutable_appearance/default_appearance = mutable_appearance(augment_icon, augment_state, layer = -INTORGAN_LAYER)
return default_appearance
// An extra render used in certain situations.
/obj/item/organ/internal/proc/extra_render()
@@ -254,7 +255,8 @@
if(our_parent.augmented_skin_cover_level && !always_show_augment)
return FALSE
return TRUE
var/mutable_appearance/default_appearance = mutable_appearance(augment_icon, augment_state, layer = -INTORGAN_LAYER)
return default_appearance
/obj/item/organ/internal/interact_with_atom(atom/target, mob/living/carbon/human/user, list/modifiers)
if(!(target == user && ishuman(user)))