Fix cybernetic organs replacing upgraded cybernetic organs (Quirk and station trait related only) (#22917)

* Update standard.md

* yes

* Revert "Update standard.md"

This reverts commit c1bafbed80.
This commit is contained in:
Bop
2025-01-13 11:04:20 +07:00
committed by GitHub
parent 3008d9c48a
commit 5c80750aea
7 changed files with 13 additions and 3 deletions

View File

@@ -195,7 +195,7 @@
if(cybernetic_type)
var/obj/item/organ/cybernetic = new cybernetic_type()
// Timer is needed because doing it immediately doesn't REPLACE organs for some unknown reason, so got to do it next tick or whatever.
addtimer(CALLBACK(cybernetic, TYPE_PROC_REF(/obj/item/organ, Insert), living_mob), 1)
addtimer(CALLBACK(cybernetic, TYPE_PROC_REF(/obj/item/organ, Insert), living_mob, 0, TRUE), 1)
return
if(isAI(living_mob))

View File

@@ -331,7 +331,7 @@
var/obj/item/organ/prosthetic = new organ_type(quirk_holder)
var/obj/item/organ/old_part = H.getorganslot(prosthetic.slot)
slot_string = prosthetic.slot
prosthetic.Insert(H)
prosthetic.Insert(H, 0, TRUE)
qdel(old_part)
H.regenerate_icons()

View File

@@ -253,6 +253,7 @@
var/rid = /datum/reagent/medicine/epinephrine
var/ramount = 10
restartTimer = 5 SECONDS //restarts faster
cybernetic_quality = 1
/obj/item/organ/heart/cybernetic/upgraded/on_life()
. = ..()

View File

@@ -106,6 +106,7 @@
healing_factor = 2 * STANDARD_ORGAN_HEALING //Can regenerate from damage quicker
toxTolerance = 20
toxLethality = 0.007
cybernetic_quality = 1
/obj/item/organ/liver/cybernetic/upgraded/on_life()
. = ..()

View File

@@ -555,6 +555,7 @@
heat_level_1_threshold = 500
heat_level_2_threshold = 800
heat_level_3_threshold = 1400
cybernetic_quality = 1
// ELECTROLYZER LUNGS!!!!!
/obj/item/organ/lungs/ethereal

View File

@@ -35,7 +35,10 @@
///Do we effect the appearance of our mob. Used to save time in preference code
var/visual = TRUE
/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE,special_zone = null)
///Quality cybernetic check, see Insert(), the higher the better
var/cybernetic_quality = 0
/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, cybernetic_check = FALSE, drop_if_replaced = TRUE, special_zone = null)
if(!iscarbon(M) || owner == M)
return
@@ -43,6 +46,9 @@
zone = special_zone
var/obj/item/organ/replaced = M.getorganslot(slot)
if(cybernetic_check && replaced.cybernetic_quality > cybernetic_quality) //If true, this won't replace the upgraded cybernetic organs with normal cybernetic one
return
if(replaced && !special_zone)
replaced.Remove(M, special = 1)
if(drop_if_replaced)

View File

@@ -106,6 +106,7 @@
maxHealth = 3 * STANDARD_ORGAN_THRESHOLD
var/nutriment_stashed = 0
disgust_metabolism = 2 //Twice as efficient as stabilizing itself
cybernetic_quality = 1
/obj/item/organ/stomach/cybernetic/upgraded/on_life()
if(owner.nutrition >= NUTRITION_LEVEL_FULL && nutriment_stashed < NUTRI_STASH_MAX)