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
🆑
fix: fixes punished sect giving you burden for stuff like changing
species
/🆑
This commit is contained in:
Fikou
2023-12-08 18:39:24 +01:00
committed by GitHub
parent 960564267d
commit fe8fae8a13
7 changed files with 29 additions and 38 deletions
+2 -1
View File
@@ -125,7 +125,8 @@
# tralezab
/code/__DEFINES/basic_mobs.dm @tralezab
/code/datums/ai @tralezab
/code/datums/ai/ @tralezab
/code/modules/religion/ @tralezab
# Watermelon914
@@ -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))
@@ -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--
@@ -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
@@ -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
+4 -5
View File
@@ -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)
@@ -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)