Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] fixes punished sect instant transformation from changing species #1040

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/body_purist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 15 additions & 24 deletions code/modules/religion/burdened/burdened_trauma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions code/modules/religion/religion_sects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/surgery/bodyparts/dismemberment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading