From 592198d6598d76ff7be6e1b2cc430fe2397b782b Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sat, 2 May 2020 20:01:54 +0200 Subject: [PATCH] Makes privates not spew around upon disembowelment or gibbing. --- code/__DEFINES/obj_flags.dm | 1 + code/modules/mob/living/carbon/carbon.dm | 11 +++++++++-- code/modules/mob/living/carbon/death.dm | 8 ++------ code/modules/surgery/bodyparts/dismemberment.dm | 3 +-- code/modules/surgery/organs/augments_arms.dm | 1 + code/modules/surgery/organs/organ_internal.dm | 2 +- modular_citadel/code/modules/arousal/genitals.dm | 1 + 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index d78de86d25..8284f66f50 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -52,3 +52,4 @@ #define ORGAN_EXTERNAL (1<<3) //Was this organ implanted/inserted/etc, if true will not be removed during species change. #define ORGAN_VITAL (1<<4) //Currently only the brain #define ORGAN_NO_SPOIL (1<<5) //Do not spoil under any circumstances +#define ORGAN_NO_DISMEMBERMENT (1<<6) //Immune to disembowelment. diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index cef445113b..69c81229a7 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -540,10 +540,16 @@ return 1 /mob/living/carbon/proc/spew_organ(power = 5, amt = 1) + var/list/spillable_organs = list() + for(var/A in internal_organs) + var/obj/item/organ/O = A + if(!(O.organ_flags & ORGAN_NO_DISMEMBERMENT)) + spillable_organs += O for(var/i in 1 to amt) - if(!internal_organs.len) + if(!spillable_organs.len) break //Guess we're out of organs! - var/obj/item/organ/guts = pick(internal_organs) + var/obj/item/organ/guts = pick(spillable_organs) + spillable_organs -= guts var/turf/T = get_turf(src) guts.Remove() guts.forceMove(T) @@ -551,6 +557,7 @@ guts.throw_at(throw_target, power, 4, src) + /mob/living/carbon/fully_replace_character_name(oldname,newname) ..() if(dna) diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 28e0f2028d..60fa395319 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -41,18 +41,14 @@ if(no_brain && istype(O, /obj/item/organ/brain)) qdel(O) //so the brain isn't transfered to the head when the head drops. continue - var/org_zone = check_zone(O.zone) //both groin and chest organs. - if(org_zone == BODY_ZONE_CHEST) + if(!(O.organ_flags & ORGAN_NO_DISMEMBERMENT) && check_zone(O.zone) == BODY_ZONE_CHEST) O.Remove() O.forceMove(Tsec) O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) else for(var/X in internal_organs) var/obj/item/organ/I = X - if(no_brain && istype(I, /obj/item/organ/brain)) - qdel(I) - continue - if(no_organs && !istype(I, /obj/item/organ/brain)) + if(I.organ_flags & ORGAN_NO_DISMEMBERMENT || (no_brain && istype(I, /obj/item/organ/brain)) || (no_organs && !istype(I, /obj/item/organ/brain))) qdel(I) continue I.Remove() diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 66bca919c4..f2db06ac2d 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -60,8 +60,7 @@ playsound(get_turf(C), 'sound/misc/splort.ogg', 80, 1) for(var/X in C.internal_organs) var/obj/item/organ/O = X - var/org_zone = check_zone(O.zone) - if(org_zone != BODY_ZONE_CHEST) + if(O.organ_flags & ORGAN_NO_DISMEMBERMENT || check_zone(O.zone) != BODY_ZONE_CHEST) continue O.Remove() O.forceMove(T) diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index e01059204c..b7dfa3eb88 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -2,6 +2,7 @@ name = "arm-mounted implant" desc = "You shouldn't see this! Adminhelp and report this as an issue on github!" zone = BODY_ZONE_R_ARM + organ_flags = ORGAN_SYNTHETIC icon_state = "implant-toolkit" w_class = WEIGHT_CLASS_NORMAL actions_types = list(/datum/action/item_action/organ_action/toggle) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 534261f63d..761ebc17a2 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -8,7 +8,7 @@ var/zone = BODY_ZONE_CHEST var/slot // DO NOT add slots with matching names to different zones - it will break internal_organs_slot list! - var/organ_flags = 0 + var/organ_flags = NONE var/maxHealth = STANDARD_ORGAN_THRESHOLD var/damage = 0 //total damage this organ has sustained ///Healing factor and decay factor function on % of maxhealth, and do not work by applying a static number per tick diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index 69d2c791e7..a7b39f1706 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -1,6 +1,7 @@ /obj/item/organ/genital color = "#fcccb3" w_class = WEIGHT_CLASS_SMALL + organ_flags = ORGAN_NO_DISMEMBERMENT var/shape var/sensitivity = 1 // wow if this were ever used that'd be cool but it's not but i'm keeping it for my unshit code var/genital_flags //see citadel_defines.dm