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] Honorbound Sect Improvements: Creatures are not Innocent, and Neither is the Blatantly Evil. Declarations are Cheaper, too #919

Merged
merged 1 commit into from
Dec 3, 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
14 changes: 11 additions & 3 deletions code/modules/religion/honorbound/honorbound_rites.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// how much favor is gained when someone joins the crusade and is deaconized
#define DEACONIZE_FAVOR_GAIN 300

///Makes the person holy, but they now also have to follow the honorbound code (CBT). Actually earns favor, convincing others to uphold the code (tm) is not easy
/datum/religion_rites/deaconize
name = "Join Crusade"
Expand Down Expand Up @@ -64,7 +67,7 @@
var/datum/brain_trauma/special/honorbound/honor = user.has_trauma_type(/datum/brain_trauma/special/honorbound)
if(joining_now in honor.guilty)
honor.guilty -= joining_now
GLOB.religious_sect.adjust_favor(200, user)
GLOB.religious_sect.adjust_favor(DEACONIZE_FAVOR_GAIN, user)
to_chat(user, span_notice("[GLOB.deity] has bound [joining_now] to the code! They are now a holy role! (albeit the lowest level of such)"))
joining_now.mind.holy_role = HOLY_ROLE_DEACON
GLOB.religious_sect.on_conversion(joining_now)
Expand Down Expand Up @@ -151,7 +154,8 @@
<br>
1.) Thou shalt not attack the unready!<br>
Those who are not ready for battle should not be wrought low. The evil of this world must lose
in a fair battle if you are to conquer them completely.
in a fair battle if you are to conquer them completely. Lesser creatures are given the benefit of
being unready, keep that in mind.
<br>
<br>
2.) Thou shalt not attack the just!<br>
Expand All @@ -162,7 +166,9 @@
<br>
3.) Thou shalt not attack the innocent!<br>
There is no honor on a pre-emptive strike, unless they are truly evil vermin.
Those who are guilty will either lay a hand on you first, or you may declare their evil.
Those who are guilty will either lay a hand on you first, or you may declare their evil. Mindless, lesser
creatures cannot be considered innocent, nor evil. They are beings of passion and function, and
may be dispatched as such if their passions misalign with the pursuits of a better world.
<br>
<br>
4.) Thou shalt not use profane magicks!<br>
Expand All @@ -172,3 +178,5 @@
been allowed as it is a school focused on the light and mending of this world.
"}
return ..()

#undef DEACONIZE_FAVOR_GAIN
61 changes: 44 additions & 17 deletions code/modules/religion/honorbound/honorbound_trauma.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// one reason for declaring guilty is specifically checked for, keeping it as a define to avoid future mistakes
#define GUILT_REASON_DECLARATION "from your declaration."

///Honorbound prevents you from attacking the unready, the just, or the innocent
/datum/brain_trauma/special/honorbound
name = "Dogmatic Compulsions"
Expand Down Expand Up @@ -45,46 +48,67 @@
if(!isliving(clickingon))
return

var/mob/living/clickedmob = clickingon
var/mob/living/clicked_mob = clickingon
var/obj/item/weapon = honorbound.get_active_held_item()

if(!honorbound.DirectAccess(clickedmob) && !isgun(weapon))
if(!honorbound.DirectAccess(clicked_mob) && !isgun(weapon))
return
if(weapon?.item_flags & NOBLUDGEON)
return
if(!honorbound.combat_mode && (HAS_TRAIT(clickedmob, TRAIT_ALLOWED_HONORBOUND_ATTACK) || ((!weapon || !weapon.force) && !LAZYACCESS(modifiers, RIGHT_CLICK))))
if(!honorbound.combat_mode && (HAS_TRAIT(clicked_mob, TRAIT_ALLOWED_HONORBOUND_ATTACK) || ((!weapon || !weapon.force) && !LAZYACCESS(modifiers, RIGHT_CLICK))))
return
if(!is_honorable(honorbound, clickedmob))
if(!(clicked_mob in guilty))
check_visible_guilt(clicked_mob)
if(!is_honorable(honorbound, clicked_mob))
return (COMSIG_MOB_CANCEL_CLICKON)

/// Checks a mob for any obvious signs of evil, and applies a guilty reason for each.
/datum/brain_trauma/special/honorbound/proc/check_visible_guilt(mob/living/attacked_mob)
//will most likely just hit nuke ops but good catch-all. WON'T hit traitors
if(ROLE_SYNDICATE in attacked_mob.faction)
guilty(attacked_mob, "for their misaligned association with the Syndicate!")
//not an antag datum check so it applies to wizard minions as well
if(ROLE_WIZARD in attacked_mob.faction)
guilty(attacked_mob, "for blasphemous magicks!")
if(HAS_TRAIT(attacked_mob, TRAIT_CULT_HALO))
guilty(attacked_mob, "for blasphemous worship!")
if(attacked_mob.mind)
var/datum/mind/guilty_conscience = attacked_mob.mind
if(guilty_conscience.has_antag_datum(/datum/antagonist/abductor))
guilty(attacked_mob, "for their blatant surgical malice...")
if(guilty_conscience.has_antag_datum(/datum/antagonist/nightmare))
guilty(attacked_mob, "for being a light-consuming nightmare!")
if(guilty_conscience.has_antag_datum(/datum/antagonist/ninja))
guilty(attacked_mob, "for their misaligned association with the Spider Clan!")
var/datum/antagonist/heretic/heretic_datum = guilty_conscience.has_antag_datum(/datum/antagonist/heretic)
if(heretic_datum?.ascended)
guilty(attacked_mob, "for blasphemous, heretical, out of control worship!")

/**
* Called by hooked signals whenever someone attacks the person with this trauma
* Checks if the attacker should be considered guilty and adds them to the guilty list if true
*
* Arguments:
* * user: person who attacked the honorbound
* * declaration: if this wasn't an attack, but instead the honorbound spending favor on declaring this person guilty
* * reason: why this person is now guilty (future pr idea: letting honorbound print a receipt for why someone is guilty? lol)
*/
/datum/brain_trauma/special/honorbound/proc/guilty(mob/living/user, declaration = FALSE)
/datum/brain_trauma/special/honorbound/proc/guilty(mob/living/user, reason = "for no particular reason!")
if(user in guilty)
return
var/datum/mind/guilty_conscience = user.mind
if(guilty_conscience && !declaration) //sec and medical are immune to becoming guilty through attack (we don't check holy because holy shouldn't be able to attack eachother anyways)
if(guilty_conscience && reason != GUILT_REASON_DECLARATION) //sec and medical are immune to becoming guilty through attack (we don't check holy because holy shouldn't be able to attack eachother anyways)
var/datum/job/job = guilty_conscience.assigned_role
if(job.departments_bitflags & (DEPARTMENT_BITFLAG_MEDICAL | DEPARTMENT_BITFLAG_SECURITY))
return
if(declaration)
to_chat(owner, span_notice("[user] is now considered guilty by [GLOB.deity] from your declaration."))
else
to_chat(owner, span_notice("[user] is now considered guilty by [GLOB.deity] for attacking you first."))
to_chat(owner, span_notice("[user] is now considered guilty by [GLOB.deity] [reason]"))
to_chat(user, span_danger("[GLOB.deity] no longer considers you innocent!"))
guilty += user

///Signal sent by the relay_attackers element. It makes the attacker guilty unless the damage was stamina or it was a shove.
/datum/brain_trauma/special/honorbound/proc/on_attacked(mob/source, mob/attacker, attack_flags)
SIGNAL_HANDLER
if(!(attack_flags & (ATTACKER_STAMINA_ATTACK|ATTACKER_SHOVING)))
guilty(attacker)
guilty(attacker, "for attacking [source] first.")

/**
* Called by attack_honor signal to check whether an attack should be allowed or not
Expand All @@ -95,14 +119,15 @@
*/
/datum/brain_trauma/special/honorbound/proc/is_honorable(mob/living/carbon/human/honorbound_human, mob/living/target_creature)
var/is_guilty = (target_creature in guilty)
var/is_human = ishuman(target_creature)
//THE UNREADY (Applies over ANYTHING else!)
if(honorbound_human == target_creature)
return TRUE //oh come on now
if(target_creature.IsSleeping() || target_creature.IsUnconscious() || HAS_TRAIT(target_creature, TRAIT_RESTRAINED))
to_chat(honorbound_human, span_warning("There is no honor in attacking the <b>unready</b>."))
return FALSE
//THE JUST (Applies over guilt except for med, so you best be careful!)
if(ishuman(target_creature))
if(is_human)
var/mob/living/carbon/human/target_human = target_creature
var/datum/job/job = target_human.mind?.assigned_role
var/is_holy = target_human.mind?.holy_role
Expand All @@ -112,9 +137,9 @@
if(job?.departments_bitflags & DEPARTMENT_BITFLAG_MEDICAL && !is_guilty)
to_chat(honorbound_human, span_warning("If you truly think this healer is not <b>innocent</b>, declare them guilty."))
return FALSE
//THE INNOCENT
if(!is_guilty)
to_chat(honorbound_human, span_warning("There is nothing righteous in attacking the <b>innocent</b>."))
//THE INNOCENT (human and borg exclusive)
if(!is_guilty && (is_human || issilicon(target_creature)))
to_chat(target_creature, span_warning("There is nothing righteous in attacking the <b>innocent</b>."))
return FALSE
return TRUE

Expand Down Expand Up @@ -262,4 +287,6 @@
/datum/action/cooldown/spell/pointed/declare_evil/cast(mob/living/cast_on)
. = ..()
GLOB.religious_sect.adjust_favor(-required_favor, owner)
honor_trauma.guilty(cast_on, declaration = TRUE)
honor_trauma.guilty(cast_on, GUILT_REASON_DECLARATION)

#undef GUILT_REASON_DECLARATION
Loading