Skip to content

Commit

Permalink
[MIRROR] Punished sect blessing rework [MDB IGNORE] (#25368) (#909)
Browse files Browse the repository at this point in the history
* Punished sect blessing rework (#80043)

## About The Pull Request
Instead of punished sect healing people like the normal bibble- you take
their burdens on instead!
All bodypart damage and wounds is transferred onto you, as well as
blood, suffocation, cloning damage and toxins
The amount of damage you take is dependant on your burden level,
decreasing by 7% with every burden level (100% at level 0, 93% at level
1, 37% at level 9 (the point at which you become a psyker))
the punished sect is now an absolute trauma, this makes more sense
because aheals shouldnt really clear it more than they clear stuff like
paraplegics

## Why It's Good For The Game
I think it's an interesting tweak of letting this chaplain sect do
something the others can't in healing, yet at a possibly huge cost.

## Changelog
:cl:
add: Instead of punished sect healing people like the normal bibble- you
take their burdens on instead!
/:cl:

---------



* Punished sect blessing rework

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Fikou <[email protected]>
Co-authored-by: tralezab <40974010+tralezab@ users.noreply.github.com>
  • Loading branch information
4 people authored Dec 3, 2023
1 parent c06892e commit 92cb91e
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 17 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/religion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#define ALIGNMENT_NEUT "neutral"
#define ALIGNMENT_EVIL "evil"

/// the probability, when not overridden by sects, for a bible's bless effect to trigger on a smack
#define DEFAULT_SMACK_CHANCE 60

//## which weapons should we use?

// unused but for clarity
Expand Down
25 changes: 14 additions & 11 deletions code/modules/library/bibles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,27 +251,30 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
return ..()

if(target_mob.stat == DEAD)
target_mob.visible_message(span_danger("[user] smacks [target_mob]'s lifeless corpse with [src]."))
playsound(target_mob, SFX_PUNCH, 25, TRUE, -1)
if(!GLOB.religious_sect?.sect_dead_bless(target_mob, user))
target_mob.visible_message(span_danger("[user] smacks [target_mob]'s lifeless corpse with [src]."))
playsound(target_mob, SFX_PUNCH, 25, TRUE, -1)
return

if(user == target_mob)
balloon_alert(user, "can't heal yourself!")
return

var/smack = TRUE
if(prob(60) && bless(target_mob, user))
smack = FALSE
else if(iscarbon(target_mob))
var/smack_chance = DEFAULT_SMACK_CHANCE
if(GLOB.religious_sect)
smack_chance = GLOB.religious_sect.smack_chance
var/success = !prob(smack_chance) && bless(target_mob, user)
if(success)
return
if(iscarbon(target_mob))
var/mob/living/carbon/carbon_target = target_mob
if(!istype(carbon_target.head, /obj/item/clothing/head/helmet))
carbon_target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 60)
carbon_target.balloon_alert(carbon_target, "you feel dumber!")
if(smack)
target_mob.visible_message(span_danger("[user] beats [target_mob] over the head with [src]!"), \
span_userdanger("[user] beats [target_mob] over the head with [src]!"))
playsound(target_mob, SFX_PUNCH, 25, TRUE, -1)
log_combat(user, target_mob, "attacked", src)
target_mob.visible_message(span_danger("[user] beats [target_mob] over the head with [src]!"), \
span_userdanger("[user] beats [target_mob] over the head with [src]!"))
playsound(target_mob, SFX_PUNCH, 25, TRUE, -1)
log_combat(user, target_mob, "attacked", src)

/obj/item/book/bible/attackby_storage_insert(datum/storage, atom/storage_holder, mob/user)
return !istype(storage_holder, /obj/item/book/bible)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@


///Returns a list of bodyparts with wounds (in case someone has a wound on an otherwise fully healed limb)
/mob/living/carbon/proc/get_wounded_bodyparts(brute = FALSE, burn = FALSE, required_bodytype)
/mob/living/carbon/proc/get_wounded_bodyparts(required_bodytype)
var/list/obj/item/bodypart/parts = list()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
Expand Down
2 changes: 1 addition & 1 deletion code/modules/religion/burdened/burdened_trauma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
COMSIG_CARBON_LOSE_MUTATION,
COMSIG_CARBON_GAIN_TRAUMA,
COMSIG_CARBON_LOSE_TRAUMA,
))
))
return ..()

/**
Expand Down
File renamed without changes.
83 changes: 80 additions & 3 deletions code/modules/religion/religion_sects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
var/altar_icon_state
/// Currently Active (non-deleted) rites
var/list/active_rites
/// Chance that we fail a bible blessing.
var/smack_chance = DEFAULT_SMACK_CHANCE
/// Whether the structure has CANDLE OVERLAYS!
var/candle_overlay = TRUE

Expand Down Expand Up @@ -123,6 +125,10 @@
blessed.add_mood_event("blessing", /datum/mood_event/blessing)
return TRUE

/// What happens if we bless a corpse? By default just do the default smack behavior
/datum/religion_sect/proc/sect_dead_bless(mob/living/target, mob/living/chap)
return FALSE

/**** Nanotrasen Approved God ****/

/datum/religion_sect/puritanism
Expand Down Expand Up @@ -286,23 +292,24 @@
name = "Punished God"
quote = "To feel the freedom, you must first understand captivity."
desc = "Incapacitate yourself in any way possible. Bad mutations, lost limbs, traumas, \
even addictions. You will learn the secrets of the universe from your defeated shell."
even addictions. You will learn the secrets of the universe from your defeated shell."
tgui_icon = "user-injured"
altar_icon_state = "convertaltar-burden"
alignment = ALIGNMENT_NEUT
candle_overlay = FALSE
smack_chance = 0
rites_list = list(/datum/religion_rites/nullrod_transformation)

/datum/religion_sect/burden/on_conversion(mob/living/carbon/human/new_convert)
..()
if(!ishuman(new_convert))
to_chat(new_convert, span_warning("[GLOB.deity] needs higher level creatures to fully comprehend the suffering. You are not burdened."))
return
new_convert.gain_trauma(/datum/brain_trauma/special/burdened, TRAUMA_RESILIENCE_MAGIC)
new_convert.gain_trauma(/datum/brain_trauma/special/burdened, TRAUMA_RESILIENCE_ABSOLUTE)

/datum/religion_sect/burden/on_deconversion(mob/living/carbon/human/new_convert)
if (ishuman(new_convert))
new_convert.cure_trauma_type(/datum/brain_trauma/special/burdened, TRAUMA_RESILIENCE_MAGIC)
new_convert.cure_trauma_type(/datum/brain_trauma/special/burdened, TRAUMA_RESILIENCE_ABSOLUTE)
return ..()

/datum/religion_sect/burden/tool_examine(mob/living/carbon/human/burdened) //display burden level
Expand All @@ -313,6 +320,76 @@
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)
if(!istype(target) || !istype(chaplain))
return FALSE
var/datum/brain_trauma/special/burdened/burden = chaplain.has_trauma_type(/datum/brain_trauma/special/burdened)
if(!burden)
return FALSE
var/burden_modifier = max(1 - 0.07 * burden.burden_level, 0.01)
var/transferred = FALSE
var/list/hurt_limbs = target.get_damaged_bodyparts(1, 1, BODYTYPE_ORGANIC) + target.get_wounded_bodyparts(BODYTYPE_ORGANIC)
var/list/chaplains_limbs = list()
for(var/obj/item/bodypart/possible_limb in chaplain.bodyparts)
if(IS_ORGANIC_LIMB(possible_limb))
chaplains_limbs += possible_limb
if(length(chaplains_limbs))
for(var/obj/item/bodypart/affected_limb as anything in hurt_limbs)
var/obj/item/bodypart/chaplains_limb = chaplain.get_bodypart(affected_limb.body_zone)
if(!chaplains_limb || !IS_ORGANIC_LIMB(chaplains_limb))
chaplains_limb = pick(chaplains_limbs)
var/brute_damage = affected_limb.brute_dam
var/burn_damage = affected_limb.burn_dam
if((brute_damage || burn_damage))
transferred = TRUE
affected_limb.heal_damage(brute_damage, burn_damage, required_bodytype = BODYTYPE_ORGANIC)
chaplains_limb.receive_damage(brute_damage * burden_modifier, burn_damage * burden_modifier, forced = TRUE, wound_bonus = CANT_WOUND)
for(var/datum/wound/iter_wound as anything in affected_limb.wounds)
transferred = TRUE
iter_wound.remove_wound()
iter_wound.apply_wound(chaplains_limb)
if(HAS_TRAIT_FROM(target, TRAIT_HUSK, BURN))
transferred = TRUE
target.cure_husk(BURN)
chaplain.become_husk(BURN)
var/toxin_damage = target.getToxLoss()
if(toxin_damage && !HAS_TRAIT(chaplain, TRAIT_TOXIMMUNE))
transferred = TRUE
target.adjustToxLoss(-toxin_damage)
chaplain.adjustToxLoss(toxin_damage * burden_modifier, forced = TRUE)
var/suffocation_damage = target.getOxyLoss()
if(suffocation_damage && !HAS_TRAIT(chaplain, TRAIT_NOBREATH))
transferred = TRUE
target.adjustOxyLoss(-suffocation_damage)
chaplain.adjustOxyLoss(suffocation_damage * burden_modifier, forced = TRUE)
var/clone_damage = target.getCloneLoss()
if(clone_damage && !HAS_TRAIT(chaplain, TRAIT_NOCLONELOSS))
transferred = TRUE
target.adjustCloneLoss(-clone_damage)
chaplain.adjustCloneLoss(clone_damage * burden_modifier, forced = TRUE)
if(!HAS_TRAIT(chaplain, TRAIT_NOBLOOD))
if(target.blood_volume < BLOOD_VOLUME_SAFE)
var/target_blood_data = target.get_blood_data(target.get_blood_id())
var/chaplain_blood_data = chaplain.get_blood_data(chaplain.get_blood_id())
var/transferred_blood_amount = min(chaplain.blood_volume, BLOOD_VOLUME_SAFE - target.blood_volume)
if(transferred_blood_amount && (chaplain_blood_data["blood_type"] in get_safe_blood(target_blood_data["blood_type"])))
transferred = TRUE
chaplain.transfer_blood_to(target, transferred_blood_amount, forced = TRUE)
if(target.blood_volume > BLOOD_VOLUME_EXCESS)
target.transfer_blood_to(chaplain, target.blood_volume - BLOOD_VOLUME_EXCESS, forced = TRUE)
target.update_damage_overlays()
chaplain.update_damage_overlays()
if(transferred)
target.visible_message(span_notice("[chaplain] takes on [target]'s burden!"))
to_chat(target, span_boldnotice("May the power of [GLOB.deity] compel you to be healed!"))
playsound(chaplain, SFX_PUNCH, 25, vary = TRUE, extrarange = -1)
target.add_mood_event("blessing", /datum/mood_event/blessing)
else
to_chat(chaplain, span_warning("They hold no burden!"))
return TRUE

/datum/religion_sect/burden/sect_dead_bless(mob/living/target, mob/living/chaplain)
return sect_bless(target, chaplain)

/datum/religion_sect/honorbound
name = "Honorbound God"
Expand Down
2 changes: 1 addition & 1 deletion tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5462,7 +5462,6 @@
#include "code\modules\recycling\disposal\outlet.dm"
#include "code\modules\recycling\disposal\pipe.dm"
#include "code\modules\recycling\disposal\pipe_sorting.dm"
#include "code\modules\religion\pyre_rites.dm"
#include "code\modules\religion\religion_sects.dm"
#include "code\modules\religion\religion_structures.dm"
#include "code\modules\religion\rites.dm"
Expand All @@ -5471,6 +5470,7 @@
#include "code\modules\religion\festival\instrument_rites.dm"
#include "code\modules\religion\honorbound\honorbound_rites.dm"
#include "code\modules\religion\honorbound\honorbound_trauma.dm"
#include "code\modules\religion\pyre\pyre_rites.dm"
#include "code\modules\religion\sparring\ceremonial_gear.dm"
#include "code\modules\religion\sparring\sparring_contract.dm"
#include "code\modules\religion\sparring\sparring_datum.dm"
Expand Down

0 comments on commit 92cb91e

Please sign in to comment.