Skip to content

Commit 123c504

Browse files
authored
Prevent bioscrambling from/into unremovable/hidden organs or limbs (#5291)
## About The Pull Request This prevents limbs with `BODYPART_UNREMOVABLE`, or organs with `ORGAN_UNREMOVABLE` or `ORGAN_HIDDEN` from being bioscrambled into something else, and also makes any limbs/organs with those flags ineligible to be picked to bioscramble something _into_. Was originally a part of #5290, but I atomized it into its own PR. Unsure if this QoL, balance, or perhaps a fix. Gonna mark it as QoL for now. ## Why It's Good For The Game prevents weird jank that wouldn't really otherwise be possible, and can cause problems:tm: with weird edge-cases and such ## Changelog :cl: qol: Unremovable or hidden organs/limbs will no longer be bioscrambled, and are also no longer eligible bioscrambler results. /:cl:
1 parent f79742a commit 123c504

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

code/modules/mob/living/carbon/carbon_defense.dm

+4-4
Original file line numberDiff line numberDiff line change
@@ -837,14 +837,14 @@
837837
var/changed_something = FALSE
838838
var/obj/item/organ/new_organ = pick(GLOB.bioscrambler_valid_organs)
839839
var/obj/item/organ/replaced = get_organ_slot(initial(new_organ.slot))
840-
if (!(replaced?.organ_flags & ORGAN_SYNTHETIC))
840+
if (!(replaced?.organ_flags & (ORGAN_SYNTHETIC | ORGAN_UNREMOVABLE | ORGAN_HIDDEN))) // monkestation edit: also check ORGAN_UNREMOVABLE and ORGAN_HIDDEN
841841
changed_something = TRUE
842842
new_organ = new new_organ()
843843
new_organ.replace_into(src)
844844

845845
var/obj/item/bodypart/new_part = pick(GLOB.bioscrambler_valid_parts)
846846
var/obj/item/bodypart/picked_user_part = get_bodypart(initial(new_part.body_zone))
847-
if (!(picked_user_part?.bodytype & BODYTYPE_ROBOTIC))
847+
if (!(picked_user_part?.bodytype & BODYTYPE_ROBOTIC) || (picked_user_part?.bodypart_flags & BODYPART_UNREMOVABLE)) // monkestation edit: check BODYPART_UNREMOVABLE
848848
changed_something = TRUE
849849
new_part = new new_part()
850850
new_part.replace_limb(src, special = TRUE)
@@ -862,14 +862,14 @@
862862
/mob/living/carbon/proc/init_bioscrambler_lists()
863863
var/list/body_parts = typesof(/obj/item/bodypart/chest) + typesof(/obj/item/bodypart/head) + subtypesof(/obj/item/bodypart/arm) + subtypesof(/obj/item/bodypart/leg)
864864
for (var/obj/item/bodypart/part as anything in body_parts)
865-
if(!is_type_in_typecache(part, GLOB.bioscrambler_parts_blacklist) && !(part::bodytype & BODYTYPE_ROBOTIC) && !(part::limb_id in GLOB.bioscrambler_limb_id_blacklist))
865+
if(!is_type_in_typecache(part, GLOB.bioscrambler_parts_blacklist) && !(part::bodytype & BODYTYPE_ROBOTIC) && !(part::bodypart_flags & BODYPART_UNREMOVABLE) && !(part::limb_id in GLOB.bioscrambler_limb_id_blacklist)) // monkestation edit: check BODYPART_UNREMOVABLE
866866
continue
867867
body_parts -= part
868868
GLOB.bioscrambler_valid_parts = body_parts
869869

870870
var/list/organs = subtypesof(/obj/item/organ/internal) + subtypesof(/obj/item/organ/external)
871871
for (var/obj/item/organ/organ_type as anything in organs)
872-
if(!is_type_in_typecache(organ_type, GLOB.bioscrambler_organs_blacklist) && !(organ_type::organ_flags & ORGAN_SYNTHETIC) && organ_type::zone != "abstract")
872+
if(!is_type_in_typecache(organ_type, GLOB.bioscrambler_organs_blacklist) && !(organ_type::organ_flags & (ORGAN_SYNTHETIC | ORGAN_UNREMOVABLE | ORGAN_HIDDEN)) && organ_type::zone != "abstract") // monkestation edit: also check ORGAN_UNREMOVABLE and ORGAN_HIDDEN
873873
continue
874874
organs -= organ_type
875875
GLOB.bioscrambler_valid_organs = organs

0 commit comments

Comments
 (0)