From fe8fae8a13cf7a4d55af2facee5e2fabfcf1123a Mon Sep 17 00:00:00 2001 From: Fikou <23585223+Fikou@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:39:24 +0100 Subject: [PATCH] fixes punished sect instant transformation from changing species (#80174) ## About The Pull Request so for some fucking reason the signal for removing a limb doesnt send whether or not its a special removal (which it does for adding) and for another fucking reason the proc whether or not an organ should matter for burden is NEVER CALLED fixes #76163 also i think i fucked something up with echolocation. i should make it a subsystem. i couldnt reproduce the bugs that i had but i had those bugs when i was on a byond version without breakpoints so rip. a few days ago an admin tried it on live and it made an infinite amount of images. i tried it a few days later and it didnt happen? i have no fuckin clue ## Why It's Good For The Game AHHHHHHHHHH!!!!!!!!! ## Changelog :cl: fix: fixes punished sect giving you burden for stuff like changing species /:cl: --- .github/CODEOWNERS | 3 +- .../signals/signals_mob/signals_mob_carbon.dm | 6 +-- .../quirks/negative_quirks/body_purist.dm | 2 +- .../traitor/objectives/assassination.dm | 2 +- .../religion/burdened/burdened_trauma.dm | 39 +++++++------------ code/modules/religion/religion_sects.dm | 9 ++--- .../surgery/bodyparts/dismemberment.dm | 6 +-- 7 files changed, 29 insertions(+), 38 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2c6d5d072de..915dda724d5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -125,7 +125,8 @@ # tralezab /code/__DEFINES/basic_mobs.dm @tralezab -/code/datums/ai @tralezab +/code/datums/ai/ @tralezab +/code/modules/religion/ @tralezab # Watermelon914 diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm index f3c3d5d71cc..fe7673ee3ca 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm @@ -57,11 +57,11 @@ /// Called from /obj/item/bodypart/check_for_injuries (obj/item/bodypart/examined, list/check_list) #define COMSIG_CARBON_CHECKING_BODYPART "carbon_checking_injury" -/// Called from carbon losing a limb /obj/item/bodypart/proc/drop_limb(obj/item/bodypart/lost_limb, dismembered) +/// Called from carbon losing a limb /obj/item/bodypart/proc/drop_limb(obj/item/bodypart/lost_limb, special, dismembered) #define COMSIG_CARBON_REMOVE_LIMB "carbon_remove_limb" -/// Called from carbon losing a limb /obj/item/bodypart/proc/drop_limb(obj/item/bodypart/lost_limb, dismembered) +/// Called from carbon losing a limb /obj/item/bodypart/proc/drop_limb(obj/item/bodypart/lost_limb, special, dismembered) #define COMSIG_CARBON_POST_REMOVE_LIMB "carbon_post_remove_limb" -/// Called from bodypart being removed /obj/item/bodypart/proc/drop_limb(mob/living/carbon/old_owner, dismembered) +/// Called from bodypart being removed /obj/item/bodypart/proc/drop_limb(mob/living/carbon/old_owner, special, dismembered) #define COMSIG_BODYPART_REMOVED "bodypart_removed" ///from base of mob/living/carbon/soundbang_act(): (list(intensity)) diff --git a/code/datums/quirks/negative_quirks/body_purist.dm b/code/datums/quirks/negative_quirks/body_purist.dm index 6350a710882..76221df7a5c 100644 --- a/code/datums/quirks/negative_quirks/body_purist.dm +++ b/code/datums/quirks/negative_quirks/body_purist.dm @@ -62,7 +62,7 @@ cybernetics_level++ update_mood() -/datum/quirk/body_purist/proc/on_limb_lose(datum/source, obj/item/bodypart/old_limb, special) +/datum/quirk/body_purist/proc/on_limb_lose(datum/source, obj/item/bodypart/old_limb, special, dismembered) SIGNAL_HANDLER if(IS_ROBOTIC_LIMB(old_limb)) cybernetics_level-- diff --git a/code/modules/antagonists/traitor/objectives/assassination.dm b/code/modules/antagonists/traitor/objectives/assassination.dm index ab3211aedd8..f3b76874213 100644 --- a/code/modules/antagonists/traitor/objectives/assassination.dm +++ b/code/modules/antagonists/traitor/objectives/assassination.dm @@ -147,7 +147,7 @@ taker.visible_message(span_notice("[taker] holds [behead_goal] into the air for a moment."), span_boldnotice("You lift [behead_goal] into the air for a moment.")) succeed_objective() -/datum/traitor_objective/target_player/assassinate/behead/proc/on_target_dismembered(datum/source, obj/item/bodypart/head/lost_head, special) +/datum/traitor_objective/target_player/assassinate/behead/proc/on_target_dismembered(datum/source, obj/item/bodypart/head/lost_head, special, dismembered) SIGNAL_HANDLER if(!istype(lost_head)) return diff --git a/code/modules/religion/burdened/burdened_trauma.dm b/code/modules/religion/burdened/burdened_trauma.dm index 20fe35fc751..51e763dbcb5 100644 --- a/code/modules/religion/burdened/burdened_trauma.dm +++ b/code/modules/religion/burdened/burdened_trauma.dm @@ -119,24 +119,7 @@ return INVOKE_ASYNC(knower, TYPE_PROC_REF(/mob/living/carbon/human, slow_psykerize)) -/// Signal to decrease burden_level (see update_burden proc) if an organ is added -/datum/brain_trauma/special/burdened/proc/organ_added_burden(mob/burdened, obj/item/organ/new_organ, special) - SIGNAL_HANDLER - - if(special) //aheals - return - - if(istype(new_organ, /obj/item/organ/internal/eyes)) - var/obj/item/organ/internal/eyes/new_eyes = new_organ - if(new_eyes.tint < TINT_BLIND) //unless you added unworking eyes (flashlight eyes), this is removing burden - update_burden(FALSE) - return - else if(istype(new_organ, /obj/item/organ/internal/appendix)) - return - - update_burden(increase = FALSE)//working organ - -/datum/brain_trauma/special/burdened/proc/is_burdensome_to_lose_organ(mob/burdened, obj/item/organ/old_organ, special) +/datum/brain_trauma/special/burdened/proc/is_burdensome_organ(mob/burdened, obj/item/organ/organ, special) if(special) //aheals return if(!ishuman(burdened)) @@ -168,20 +151,28 @@ if(!burdened_species.mutantliver) critical_slots -= ORGAN_SLOT_LIVER - if(!(old_organ.slot in critical_slots)) + if(!(organ.slot in critical_slots)) return FALSE - else if(istype(old_organ, /obj/item/organ/internal/eyes)) - var/obj/item/organ/internal/eyes/old_eyes = old_organ - if(old_eyes.tint < TINT_BLIND) //unless you were already blinded by them (flashlight eyes), this is adding burden! + else if(istype(organ, /obj/item/organ/internal/eyes)) + var/obj/item/organ/internal/eyes/eyes = organ + if(eyes.tint < TINT_BLIND) //unless you were already blinded by them (flashlight eyes), this is adding burden! return TRUE return FALSE return TRUE +/// Signal to decrease burden_level (see update_burden proc) if an organ is added +/datum/brain_trauma/special/burdened/proc/organ_added_burden(mob/burdened, obj/item/organ/new_organ, special) + SIGNAL_HANDLER + + if(is_burdensome_organ(burdened, new_organ, special)) + update_burden(increase = FALSE)//working organ + /// Signal to increase burden_level (see update_burden proc) if an organ is removed /datum/brain_trauma/special/burdened/proc/organ_removed_burden(mob/burdened, obj/item/organ/old_organ, special) SIGNAL_HANDLER - update_burden(increase = TRUE)//lost organ + if(is_burdensome_organ(burdened, old_organ, special)) + update_burden(increase = TRUE) //lost organ /// Signal to decrease burden_level (see update_burden proc) if a limb is added /datum/brain_trauma/special/burdened/proc/limbs_added_burden(datum/source, obj/item/bodypart/new_limb, special) @@ -192,7 +183,7 @@ update_burden(increase = FALSE) /// Signal to increase burden_level (see update_burden proc) if a limb is removed -/datum/brain_trauma/special/burdened/proc/limbs_removed_burden(datum/source, obj/item/bodypart/old_limb, special) +/datum/brain_trauma/special/burdened/proc/limbs_removed_burden(datum/source, obj/item/bodypart/old_limb, special, dismembered) SIGNAL_HANDLER if(special) //something we don't wanna consider, like instaswapping limbs diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm index 35e508a6fcf..ebb8a69a7e5 100644 --- a/code/modules/religion/religion_sects.dm +++ b/code/modules/religion/religion_sects.dm @@ -313,11 +313,10 @@ return ..() /datum/religion_sect/burden/tool_examine(mob/living/carbon/human/burdened) //display burden level - if(!ishuman(burdened)) - return FALSE - var/datum/brain_trauma/special/burdened/burden = burdened.has_trauma_type(/datum/brain_trauma/special/burdened) - if(burden) - return "You are at burden level [burden.burden_level]/9." + if(ishuman(burdened)) + var/datum/brain_trauma/special/burdened/burden = burdened.has_trauma_type(/datum/brain_trauma/special/burdened) + if(burden) + return "You are at burden level [burden.burden_level]/9." return "You are not burdened." /datum/religion_sect/burden/sect_bless(mob/living/carbon/target, mob/living/carbon/chaplain) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 6e9143ea630..db92a901916 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -94,8 +94,8 @@ return var/atom/drop_loc = owner.drop_location() - SEND_SIGNAL(owner, COMSIG_CARBON_REMOVE_LIMB, src, dismembered) - SEND_SIGNAL(src, COMSIG_BODYPART_REMOVED, owner, dismembered) + SEND_SIGNAL(owner, COMSIG_CARBON_REMOVE_LIMB, src, special, dismembered) + SEND_SIGNAL(src, COMSIG_BODYPART_REMOVED, owner, special, dismembered) update_limb(dropping_limb = TRUE) bodypart_flags &= ~BODYPART_IMPLANTED //limb is out and about, it can't really be considered an implant owner.remove_bodypart(src) @@ -152,7 +152,7 @@ return forceMove(drop_loc) - SEND_SIGNAL(phantom_owner, COMSIG_CARBON_POST_REMOVE_LIMB, src, dismembered) + SEND_SIGNAL(phantom_owner, COMSIG_CARBON_POST_REMOVE_LIMB, src, special, dismembered) /** * get_mangled_state() is relevant for flesh and bone bodyparts, and returns whether this bodypart has mangled skin, mangled bone, or both (or neither i guess)