Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 5c80750

Browse files
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 c1bafbe.
1 parent 3008d9c commit 5c80750

File tree

7 files changed

+13
-3
lines changed

7 files changed

+13
-3
lines changed

code/datums/station_traits/positive_traits.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
if(cybernetic_type)
196196
var/obj/item/organ/cybernetic = new cybernetic_type()
197197
// Timer is needed because doing it immediately doesn't REPLACE organs for some unknown reason, so got to do it next tick or whatever.
198-
addtimer(CALLBACK(cybernetic, TYPE_PROC_REF(/obj/item/organ, Insert), living_mob), 1)
198+
addtimer(CALLBACK(cybernetic, TYPE_PROC_REF(/obj/item/organ, Insert), living_mob, 0, TRUE), 1)
199199
return
200200

201201
if(isAI(living_mob))

code/datums/traits/good.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
var/obj/item/organ/prosthetic = new organ_type(quirk_holder)
332332
var/obj/item/organ/old_part = H.getorganslot(prosthetic.slot)
333333
slot_string = prosthetic.slot
334-
prosthetic.Insert(H)
334+
prosthetic.Insert(H, 0, TRUE)
335335
qdel(old_part)
336336
H.regenerate_icons()
337337

code/modules/surgery/organs/heart.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@
253253
var/rid = /datum/reagent/medicine/epinephrine
254254
var/ramount = 10
255255
restartTimer = 5 SECONDS //restarts faster
256+
cybernetic_quality = 1
256257

257258
/obj/item/organ/heart/cybernetic/upgraded/on_life()
258259
. = ..()

code/modules/surgery/organs/liver.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
healing_factor = 2 * STANDARD_ORGAN_HEALING //Can regenerate from damage quicker
107107
toxTolerance = 20
108108
toxLethality = 0.007
109+
cybernetic_quality = 1
109110

110111
/obj/item/organ/liver/cybernetic/upgraded/on_life()
111112
. = ..()

code/modules/surgery/organs/lungs.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@
555555
heat_level_1_threshold = 500
556556
heat_level_2_threshold = 800
557557
heat_level_3_threshold = 1400
558+
cybernetic_quality = 1
558559

559560
// ELECTROLYZER LUNGS!!!!!
560561
/obj/item/organ/lungs/ethereal

code/modules/surgery/organs/organ_internal.dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,20 @@
3535
///Do we effect the appearance of our mob. Used to save time in preference code
3636
var/visual = TRUE
3737

38-
/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE,special_zone = null)
38+
///Quality cybernetic check, see Insert(), the higher the better
39+
var/cybernetic_quality = 0
40+
41+
/obj/item/organ/proc/Insert(mob/living/carbon/M, special = 0, cybernetic_check = FALSE, drop_if_replaced = TRUE, special_zone = null)
3942
if(!iscarbon(M) || owner == M)
4043
return
4144

4245
if(special_zone)
4346
zone = special_zone
4447

4548
var/obj/item/organ/replaced = M.getorganslot(slot)
49+
if(cybernetic_check && replaced.cybernetic_quality > cybernetic_quality) //If true, this won't replace the upgraded cybernetic organs with normal cybernetic one
50+
return
51+
4652
if(replaced && !special_zone)
4753
replaced.Remove(M, special = 1)
4854
if(drop_if_replaced)

code/modules/surgery/organs/stomach.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
maxHealth = 3 * STANDARD_ORGAN_THRESHOLD
107107
var/nutriment_stashed = 0
108108
disgust_metabolism = 2 //Twice as efficient as stabilizing itself
109+
cybernetic_quality = 1
109110

110111
/obj/item/organ/stomach/cybernetic/upgraded/on_life()
111112
if(owner.nutrition >= NUTRITION_LEVEL_FULL && nutriment_stashed < NUTRI_STASH_MAX)

0 commit comments

Comments
 (0)