From fa98e82de18489ae1c399e8fe44834fac1e37d88 Mon Sep 17 00:00:00 2001
From: moo <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>
Date: Thu, 5 Mar 2020 22:11:52 -0500
Subject: [PATCH 01/15] Religion sect
---
code/__DEFINES/misc.dm | 9 +
code/_globalvars/misc.dm | 9 -
code/_globalvars/religion.dm | 14 ++
code/datums/mind.dm | 4 +-
code/game/gamemodes/cult/cult.dm | 2 +-
code/game/objects/items/holy_weapons.dm | 8 +-
code/game/objects/items/storage/book.dm | 19 +-
code/modules/antagonists/ert/ert.dm | 12 +-
code/modules/jobs/job_types/chaplain.dm | 8 +-
.../mob/living/carbon/human/examine.dm | 4 +-
.../chemistry/reagents/alcohol_reagents.dm | 2 +-
code/modules/religion/religion_sects.dm | 195 ++++++++++++++++++
code/modules/religion/religion_structures.dm | 114 ++++++++++
code/modules/religion/rites.dm | 77 +++++++
14 files changed, 448 insertions(+), 29 deletions(-)
create mode 100644 code/_globalvars/religion.dm
create mode 100644 code/modules/religion/religion_sects.dm
create mode 100644 code/modules/religion/religion_structures.dm
create mode 100644 code/modules/religion/rites.dm
diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index ed7bbe2e4996..c48b869eca89 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -458,3 +458,12 @@ GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE))
//Misc text define. Does 4 spaces. Used as a makeshift tabulator.
#define FOURSPACES " "
+
+//Religion
+
+#define HOLY_ROLE_PRIEST 1 //default priestly role
+#define HOLY_ROLE_HIGHPRIEST 2 //the one who designates the religion
+
+#define ALIGNMENT_GOOD "good"
+#define ALIGNMENT_NEUT "neutral"
+#define ALIGNMENT_EVIL "evil"
\ No newline at end of file
diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm
index edd22ec242fe..7931d91acb50 100644
--- a/code/_globalvars/misc.dm
+++ b/code/_globalvars/misc.dm
@@ -18,12 +18,3 @@ GLOBAL_LIST_EMPTY(powernets)
GLOBAL_VAR_INIT(bsa_unlock, FALSE) //BSA unlocked by head ID swipes
GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details
-
-// All religion stuff
-GLOBAL_VAR(religion)
-GLOBAL_VAR(deity)
-GLOBAL_VAR(bible_name)
-GLOBAL_VAR(bible_icon_state)
-GLOBAL_VAR(bible_item_state)
-GLOBAL_VAR(holy_weapon_type)
-GLOBAL_VAR(holy_armor_type)
diff --git a/code/_globalvars/religion.dm b/code/_globalvars/religion.dm
new file mode 100644
index 000000000000..4eb08d438494
--- /dev/null
+++ b/code/_globalvars/religion.dm
@@ -0,0 +1,14 @@
+// All religion stuff
+GLOBAL_VAR(religion)
+GLOBAL_VAR(deity)
+GLOBAL_DATUM(religious_sect, /datum/religion_sect)
+GLOBAL_VAR(favor)
+
+//bible
+GLOBAL_VAR(bible_name)
+GLOBAL_VAR(bible_icon_state)
+GLOBAL_VAR(bible_item_state)
+
+//gear
+GLOBAL_VAR(holy_weapon_type)
+GLOBAL_VAR(holy_armor_type)
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index ce4c70319cf3..83333467ac2d 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -53,7 +53,7 @@
var/damnation_type = 0
var/datum/mind/soulOwner //who owns the soul. Under normal circumstances, this will point to src
var/hasSoul = TRUE // If false, renders the character unable to sell their soul.
- var/isholy = FALSE //is this person a chaplain or admin role allowed to use bibles
+ var/holy_role = NONE //is this person a chaplain or admin role allowed to use bibles, Any rank besides 'NONE' allows for this.
var/mob/living/enslaved_to //If this mind's master is another mob (i.e. adamantine golems)
var/datum/language_holder/language_holder
@@ -774,4 +774,4 @@
/mob/living/silicon/pai/mind_initialize()
..()
mind.assigned_role = ROLE_PAI
- mind.special_role = ""
+ mind.special_role = ""
\ No newline at end of file
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index 91fdd90439f3..3cf5c67b061b 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -16,7 +16,7 @@
if(!istype(M))
return FALSE
if(M.mind)
- if(ishuman(M) && (M.mind.isholy))
+ if(ishuman(M) && (M.mind.holy_role))
return FALSE
if(specific_cult && specific_cult.is_sacrifice_target(M.mind))
return FALSE
diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm
index 2b1eca503b22..063fe4e06e32 100644
--- a/code/game/objects/items/holy_weapons.dm
+++ b/code/game/objects/items/holy_weapons.dm
@@ -79,7 +79,7 @@
desc = "Contains a set of armaments for the chaplain."
/obj/item/choice_beacon/holy/canUseBeacon(mob/living/user)
- if(user.mind && user.mind.isholy)
+ if(user.mind && user.mind.holy_role)
return ..()
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 40, 1)
@@ -252,7 +252,7 @@
return (BRUTELOSS|FIRELOSS)
/obj/item/nullrod/attack_self(mob/user)
- if(user.mind && (user.mind.isholy) && !reskinned)
+ if(user.mind && (user.mind.holy_role) && !reskinned)
reskin_holy_weapon(user)
/*
@@ -675,11 +675,13 @@
/obj/item/nullrod/carp/attack_self(mob/living/user)
if(used_blessing)
- else if(user.mind && (user.mind.isholy))
+ else if(user.mind && (user.mind.holy_role))
to_chat(user, "You are blessed by Carp-Sie. Wild space carp will no longer attack you.")
user.faction |= "carp"
used_blessing = TRUE
+
+
/obj/item/nullrod/claymore/bostaff //May as well make it a "claymore" and inherit the blocking
name = "monk's staff"
desc = "A long, tall staff made of polished wood. Traditionally used in ancient old-Earth martial arts, it is now used to harass the clown."
diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm
index c2508b9ab57a..9e3b7f51ea68 100644
--- a/code/game/objects/items/storage/book.dm
+++ b/code/game/objects/items/storage/book.dm
@@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
if(!H.can_read(src))
return FALSE
// If H is the Chaplain, we can set the icon_state of the bible (but only once!)
- if(!GLOB.bible_icon_state && H.job == "Chaplain")
+ if(!GLOB.bible_icon_state && H.mind.holy_role == HOLY_ROLE_HIGHPRIEST)
var/dat = "
Pick Bible StylePick a bible style
"
for(var/i in 1 to GLOB.biblestates.len)
var/icon/bibleicon = icon('icons/obj/storage.dmi', GLOB.biblestates[i])
@@ -91,7 +91,12 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
SSblackbox.record_feedback("text", "religion_book", 1, "[biblename]")
usr << browse(null, "window=editicon")
-/obj/item/storage/book/bible/proc/bless(mob/living/carbon/human/H, mob/living/user)
+/obj/item/storage/book/bible/proc/bless(mob/living/L, mob/living/user)
+ if(GLOB.religious_sect)
+ return GLOB.religious_sect.sect_bless(L,user)
+ if(!ishuman(L))
+ return
+ var/mob/living/carbon/human/H = L
for(var/X in H.bodyparts)
var/obj/item/bodypart/BP = X
if(BP.status == BODYPART_ROBOTIC)
@@ -125,7 +130,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
return
var/chaplain = 0
- if(user.mind && (user.mind.isholy))
+ if(user.mind && (user.mind.holy_role))
chaplain = 1
if(!chaplain)
@@ -143,7 +148,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
to_chat(user, "You can't heal yourself!")
return
- if(ishuman(M) && prob(60) && bless(M, user))
+ if(prob(60) && bless(M, user))
smack = 0
else if(iscarbon(M))
var/mob/living/carbon/C = M
@@ -167,10 +172,10 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
return
if(isfloorturf(A))
to_chat(user, "You hit the floor with the bible.")
- if(user.mind && (user.mind.isholy))
+ if(user.mind && (user.mind.holy_role))
for(var/obj/effect/rune/R in orange(2,user))
R.invisibility = 0
- if(user.mind && (user.mind.isholy))
+ if(user?.mind?.holy_role)
if(A.reagents && A.reagents.has_reagent(/datum/reagent/water)) // blesses all the water in the holder
to_chat(user, "You bless [A].")
var/water2holy = A.reagents.get_reagent_amount(/datum/reagent/water)
@@ -245,7 +250,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
/obj/item/storage/book/bible/syndicate/attack_self(mob/living/carbon/human/H)
if (uses)
- H.mind.isholy = TRUE
+ H.mind.holy_role = HOLY_ROLE_PRIEST
uses -= 1
to_chat(H, "You try to open the book AND IT BITES YOU!")
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
diff --git a/code/modules/antagonists/ert/ert.dm b/code/modules/antagonists/ert/ert.dm
index f1378a87bd05..b636f6479e20 100644
--- a/code/modules/antagonists/ert/ert.dm
+++ b/code/modules/antagonists/ert/ert.dm
@@ -74,9 +74,17 @@
/datum/antagonist/ert/medic/inquisitor
outfit = /datum/outfit/ert/medic/inquisitor
+/datum/antagonist/ert/medic/inquisitor/on_gain()
+ . = ..()
+ owner.holy_role = HOLY_ROLE_PRIEST
+
/datum/antagonist/ert/security/inquisitor
outfit = /datum/outfit/ert/security/inquisitor
+/datum/antagonist/ert/security/inquisitor/on_gain()
+ . = ..()
+ owner.holy_role = HOLY_ROLE_PRIEST
+
/datum/antagonist/ert/chaplain
role = "Chaplain"
outfit = /datum/outfit/ert/chaplain
@@ -86,14 +94,14 @@
/datum/antagonist/ert/chaplain/on_gain()
. = ..()
- owner.isholy = TRUE
+ owner.holy_role = HOLY_ROLE_PRIEST
/datum/antagonist/ert/commander/inquisitor
outfit = /datum/outfit/ert/commander/inquisitor
/datum/antagonist/ert/commander/inquisitor/on_gain()
. = ..()
- owner.isholy = TRUE
+ owner.holy_role = HOLY_ROLE_PRIEST
/datum/antagonist/ert/janitor
role = "Janitor"
diff --git a/code/modules/jobs/job_types/chaplain.dm b/code/modules/jobs/job_types/chaplain.dm
index c98cdce089d4..611e1ba2360d 100644
--- a/code/modules/jobs/job_types/chaplain.dm
+++ b/code/modules/jobs/job_types/chaplain.dm
@@ -21,12 +21,12 @@
/datum/job/chaplain/after_spawn(mob/living/H, mob/M)
. = ..()
- if(H.mind)
- H.mind.isholy = TRUE
var/obj/item/storage/book/bible/booze/B = new
if(GLOB.religion)
+ if(H.mind)
+ H.mind.holy_role = HOLY_ROLE_PRIEST
B.deity_name = GLOB.deity
B.name = GLOB.bible_name
B.icon_state = GLOB.bible_icon_state
@@ -36,7 +36,11 @@
var/nrt = GLOB.holy_weapon_type || /obj/item/nullrod
var/obj/item/nullrod/N = new nrt(H)
H.put_in_hands(N)
+ if(GLOB.religious_sect)
+ GLOB.religious_sect.on_conversion(H)
return
+ if(H.mind)
+ H.mind.holy_role = HOLY_ROLE_HIGHPRIEST
var/new_religion = DEFAULT_RELIGION
if(M.client && M.client.prefs.custom_names["religion"])
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 6bdc73c82dc4..59d9945422d3 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -277,7 +277,7 @@
msg += ""
- if(HAS_TRAIT(user, TRAIT_SPIRITUAL) && mind?.isholy)
+ if(HAS_TRAIT(user, TRAIT_SPIRITUAL) && mind?.holy_role)
msg += "[t_He] [t_has] a holy aura about [t_him].\n"
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "religious_comfort", /datum/mood_event/religiously_comforted)
@@ -362,4 +362,4 @@
new_text = replacetext(new_text, "[pronoun_replacement] is", "[pronoun_replacement] [p_are()]") //To make sure something become "They are" or "She is", not "They are" and "She are"
dat += "[new_text]\n" //dat.Join("\n") doesn't work here, for some reason
if(dat.len)
- return dat.Join()
+ return dat.Join()
\ No newline at end of file
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index 669e9dd86c92..bc4b41742ba3 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -2053,7 +2053,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_desc = "boozy Catholicism in a glass."
/datum/reagent/consumable/ethanol/trappist/on_mob_life(mob/living/carbon/M)
- if(M.mind.isholy)
+ if(M.mind.holy_role)
M.adjustFireLoss(-2.5, 0)
M.jitteriness = max(0, M.jitteriness-1)
M.stuttering = max(0, M.stuttering-1)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
new file mode 100644
index 000000000000..12aba6dbc5bb
--- /dev/null
+++ b/code/modules/religion/religion_sects.dm
@@ -0,0 +1,195 @@
+/**
+ * # Religious Sects
+ *
+ * Religious Sects are a way to convert the fun of having an active 'god' (admin) to code-mechanics so you aren't having to press adminwho.
+ *
+ * Sects are not meant to overwrite the fun of choosing a custom god/religion, but meant to enhance it.
+ * The idea is that Space Jesus (or whoever you worship) can be an evil bloodgod who takes the lifeforce out of people, a nature lover, or all things righteous and good. You decide!
+ *
+ */
+/datum/religion_sect
+/// Name of the religious sect
+ var/name = "Religious Sect Base Type"
+/// Description of the religious sect, Presents itself in the selection menu (AKA be brief)
+ var/desc = "Oh My! What Do We Have Here?!!?!?!?"
+/// Opening message when someone gets converted
+ var/convert_opener
+/// holder for alignments.
+ var/alignment = ALIGNMENT_GOOD
+/// Does this require something before being available as an option?
+ var/starter = TRUE
+/// The Sect's 'Mana'
+ var/favor = 0 //MANA!
+/// The max amount of favor the sect can have
+ var/max_favor = 1000
+/// The default value for an item that can be sacrificed
+ var/default_item_favor = 5
+/// Turns into 'desired_items_typecache', lists the types that can be sacrificed barring optional features in can_sacrifice()
+ var/list/desired_items
+/// Autopopulated by `desired_items`
+ var/list/desired_items_typecache
+/// Lists of rites by type. Converts itself into a list of rites with "name - desc (favor_cost)" = type
+ var/list/rites_list
+/// Changes the Altar of Gods icon
+ var/altar_icon
+/// Changes the Altar of Gods icon_state
+ var/altar_icon_state
+
+/datum/religion_sect/New()
+ if(desired_items)
+ desired_items_typecache = typecacheof(desired_items)
+ if(rites_list)
+ var/listylist = generate_rites_list()
+ rites_list = listylist
+ on_select()
+
+///Generates a list of rites with 'name' = 'type'
+/datum/religion_sect/proc/generate_rites_list()
+ . = list()
+ for(var/i in rites_list)
+ if(!ispath(i))
+ continue
+ var/datum/religion_rites/RI = i
+ var/name_entry = "[initial(RI.name)]"
+ if(initial(RI.desc))
+ name_entry += " - [initial(RI.desc)]"
+ if(initial(RI.favor_cost))
+ name_entry += " ([initial(RI.favor_cost)] favor)"
+
+ . += list(name_entry = i)
+
+/// Activates once selected
+/datum/religion_sect/proc/on_select()
+
+/// Activates once selected and on newjoins, oriented around people who become holy.
+/datum/religion_sect/proc/on_conversion(mob/living/L)
+ to_chat(L, "[convert_opener] max_favor))
+ . = (max_favor-favor) //if favor = 5 and we want to add 10 with a max of 10, we'll only be able to add 5
+ favor = clamp(0,max_favor, favor+amount)
+
+/// Sets favor to a specific amount. Can provide optional features based on a user.
+/datum/religion_sect/proc/set_favor(amount = 0, mob/living/L)
+ favor = clamp(0,max_favor,amount)
+ return favor
+
+/// Activates when an individual uses a rite. Can provide different/additional benefits depending on the user.
+/datum/religion_sect/proc/on_riteuse(mob/living/user, obj/structure/altar_of_gods/AOG)
+
+/// Replaces the bible's bless mechanic. Return TRUE if you want to not do the brain hit.
+/datum/religion_sect/proc/sect_bless(mob/living/L, mob/living/user)
+ if(!ishuman(L))
+ return FALSE
+ var/mob/living/carbon/human/H = L
+ for(var/X in H.bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(BP.status == BODYPART_ROBOTIC)
+ to_chat(user, "[GLOB.deity] refuses to heal this metallic taint!")
+ return TRUE
+
+ var/heal_amt = 10
+ var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1, null, BODYPART_ORGANIC)
+
+ if(hurt_limbs.len)
+ for(var/X in hurt_limbs)
+ var/obj/item/bodypart/affecting = X
+ if(affecting.heal_damage(heal_amt, heal_amt, null, BODYPART_ORGANIC))
+ H.update_damage_overlays()
+ H.visible_message("[user] heals [H] with the power of [GLOB.deity]!")
+ to_chat(H, "May the power of [GLOB.deity] compel you to be healed!")
+ playsound(user, "punch", 25, TRUE, -1)
+ SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
+ return TRUE
+
+/datum/religion_sect/puritanism
+ name = "Puritanism (Default)"
+ desc = "Nothing special."
+ convert_opener = "Your run-of-the-mill sect, there are no benefits or boons associated. Praise normalcy!"
+
+/datum/religion_sect/technophile
+ name = "Technophile"
+ desc = "A sect oriented around technology."
+ convert_opener = "May you find peace in a metal shell, acolyte.
Bibles now recharge cyborgs and heal robotic limbs if targeted, but they do not heal organic limbs. You can now sacrifice cells, with favor depending on their charge."
+ alignment = ALIGNMENT_NEUT
+ desired_items = list(/obj/item/stock_parts/cell)
+ rites_list = list(/datum/religion_rites/synthconversion)
+ altar_icon_state = "convertaltar-blue"
+
+/datum/religion_sect/technophile/sect_bless(mob/living/L, mob/living/user)
+ if(iscyborg(L))
+ var/mob/living/silicon/robot/R = L
+ var/charge_amt = 50
+ if(L.mind?.holy_role == HOLY_ROLE_HIGHPRIEST)
+ charge_amt *= 2
+ R.cell?.charge += charge_amt
+ R.visible_message("[user] charges [R] with the power of [GLOB.deity]!")
+ to_chat(R, "You are charged by the power of [GLOB.deity]!")
+ SEND_SIGNAL(R, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
+ playsound(user, 'sound/effects/bang.ogg', 25, TRUE, -1)
+ return TRUE
+ if(!ishuman(L))
+ return
+ var/mob/living/carbon/human/H = L
+
+ //first we determine if we can charge them
+ var/did_we_charge = FALSE
+ var/obj/item/organ/stomach/ethereal/eth_stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
+ if(istype(eth_stomach))
+ eth_stomach.adjust_charge(3)
+ did_we_charge = TRUE
+
+ //if we're not targetting a robot part we stop early
+ var/obj/item/bodypart/BP = H.get_bodypart(user.zone_selected)
+ if(BP.status != BODYPART_ROBOTIC)
+ if(!did_we_charge)
+ to_chat(user, "[GLOB.deity] scoffs at the idea of healing such fleshy matter!")
+ else
+ H.visible_message("[user] charges [H] with the power of [GLOB.deity]!")
+ to_chat(H, "You feel charged by the power of [GLOB.deity]!")
+ SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
+ playsound(user, 'sound/machines/synth_yes.ogg', 25, TRUE, -1)
+ return TRUE
+
+ //charge(?) and go
+ if(BP.heal_damage(5,5,null,BODYPART_ROBOTIC))
+ H.update_damage_overlays()
+
+ H.visible_message("[user] [did_we_charge ? "repairs" : "repairs and charges"] [H] with the power of [GLOB.deity]!")
+ to_chat(H, "The inner machinations of [GLOB.deity] [did_we_charge ? "repairs" : "repairs and charges"] you!")
+ playsound(user, 'sound/effects/bang.ogg', 25, TRUE, -1)
+ SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
+ return TRUE
+
+/datum/religion_sect/technophile/can_sacrifice(obj/item/I, mob/living/L)
+ if(!..())
+ return FALSE
+ var/obj/item/stock_parts/cell/the_cell = I
+ if(the_cell.charge < 3000)
+ to_chat("[GLOB.deity] does not accept pity amounts of power.")
+ return FALSE
+ return TRUE
+
+
+/datum/religion_sect/technophile/on_sacrifice(obj/item/I, mob/living/L)
+ if(!is_type_in_typecache(I, desired_items_typecache))
+ return
+ var/obj/item/stock_parts/cell/the_cell = I
+ adjust_favor(round(the_cell.charge/3000), L)
+ to_chat(L, "You offer [the_cell]'s power to [GLOB.deity], pleasing them.")
+ qdel(I)
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
new file mode 100644
index 000000000000..b86fa0198d8a
--- /dev/null
+++ b/code/modules/religion/religion_structures.dm
@@ -0,0 +1,114 @@
+/obj/structure/altar_of_gods
+ name = "\improper Altar of the Gods"
+ desc = "An altar which allows the head of the church to choose a sect of religious teachings as well as provide sacrifices to earn favor."
+ icon = 'icons/obj/hand_of_god_structures.dmi'
+ icon_state = "convertaltar"
+ density = TRUE
+ anchored = TRUE
+ layer = TABLE_LAYER
+ climbable = TRUE
+ pass_flags = LETPASSTHROW
+ can_buckle = TRUE
+ buckle_lying = 90 //we turn to you!
+ var/datum/religion_sect/sect_to_altar // easy access!
+ var/datum/religion_rites/performing_rite
+
+/obj/structure/altar_of_gods/examine(mob/user)
+ . = ..()
+ if(!isliving(user))
+ return
+ var/mob/living/L = user
+ if(L.mind?.holy_role && sect_to_altar)
+ . += "The sect currently has [round(sect_to_altar.favor)] with [GLOB.deity]."
+ if(!sect_to_altar.rites_list)
+ return
+ . += "List of available Rites:"
+ . += sect_to_altar.rites_list
+
+
+/obj/structure/altar_of_gods/Initialize(mapload)
+ . = ..()
+ if(GLOB.religious_sect)
+ sect_to_altar = GLOB.religious_sect
+ if(sect_to_altar.altar_icon)
+ icon = sect_to_altar.altar_icon
+ if(sect_to_altar.altar_icon_state)
+ icon_state = sect_to_altar.altar_icon_state
+
+/obj/structure/altar_of_gods/attack_hand(mob/living/user)
+ if(!Adjacent(user) || !user.pulling)
+ return ..()
+ if(!isliving(user.pulling))
+ return ..()
+ var/mob/living/pushed_mob = user.pulling
+ if(pushed_mob.buckled)
+ to_chat(user, "[pushed_mob] is buckled to [pushed_mob.buckled]!")
+ return ..()
+ to_chat(user,"Your sect doesn't have any rites to perform!")
+ return
+ var/rite_select = input(user,"Select a rite to perform!","Select a rite",null) in sect_to_altar.rites_list
+ if(!rite_select || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
+ to_chat(user,"You cannot perform the rite at this time.")
+ return
+ var/selection2type = sect_to_altar.rites_list[rite_select]
+ performing_rite = new selection2type(src, src)
+ if(!performing_rite.perform_rite(user, src))
+ QDEL_NULL(performing_rite)
+ else
+ performing_rite.invoke_effect(user, src)
+ sect_to_altar.adjust_favor(performing_rite.favor_cost*-1)
+ QDEL_NULL(performing_rite)
+ return
+
+ if(user.mind.holy_role != HOLY_ROLE_HIGHPRIEST)
+ to_chat(user, "You are not the high priest, and therefore cannot select a religious sect.")
+ return
+
+ var/list/available_options = generate_available_sects(user)
+ if(!available_options)
+ return
+
+ var/sect_select = input(user,"Select a sect (You CANNOT revert this decision!)","Select a Sect",null) in available_options
+ if(!sect_select || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
+ to_chat(user,"You cannot select a sect at this time.")
+ return
+ var/type_selected = available_options[sect_select]
+ GLOB.religious_sect = new type_selected()
+ for(var/i in GLOB.player_list)
+ if(!isliving(i))
+ continue
+ var/mob/living/am_i_holy_living = i
+ if(!am_i_holy_living.mind?.holy_role)
+ continue
+ GLOB.religious_sect.on_conversion(am_i_holy_living)
+ sect_to_altar = GLOB.religious_sect
+ if(sect_to_altar.altar_icon)
+ icon = sect_to_altar.altar_icon
+ if(sect_to_altar.altar_icon_state)
+ icon_state = sect_to_altar.altar_icon_state
+
+
+
+/obj/structure/altar_of_gods/proc/generate_available_sects(mob/user) //eventually want to add sects you get from unlocking certain achievements
+ . = list()
+ for(var/i in subtypesof(/datum/religion_sect))
+ var/datum/religion_sect/not_a_real_instance_rs = i
+ if(initial(not_a_real_instance_rs.starter))
+ . += list(initial(not_a_real_instance_rs.name) = i)
diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm
new file mode 100644
index 000000000000..acac35baea0b
--- /dev/null
+++ b/code/modules/religion/rites.dm
@@ -0,0 +1,77 @@
+/datum/religion_rites
+/// name of the religious rite
+ var/name = "religious rite"
+/// Description of the religious rite
+ var/desc = "immm gonna rooon"
+/// length it takes to complete the ritual
+ var/ritual_length = (10 SECONDS) //total length it'll take
+/// list of invocations said (strings) throughout the rite
+ var/list/ritual_invocations //strings that are by default said evenly throughout the rite
+/// message when you invoke
+ var/invoke_msg
+ var/favor_cost = 0
+
+///Called to perform the invocation of the rite, with args being the performer and the altar where it's being performed. Maybe you want it to check for something else?
+/datum/religion_rites/proc/perform_rite(mob/living/user, obj/structure/altar_of_gods/AOG)
+ if(GLOB.religious_sect?.favor < favor_cost)
+ to_chat(user, "This rite requires more favor!")
+ return FALSE
+ to_chat(user, "You begin to perform the rite of [name]...")
+ if(!ritual_invocations)
+ if(do_after(user, target = user, delay = ritual_length))
+ return TRUE
+ return FALSE
+ var/first_invoke = TRUE
+ for(var/i in ritual_invocations)
+ if(first_invoke) //instant invoke
+ user.say(i)
+ first_invoke = FALSE
+ continue
+ if(!ritual_invocations.len) //we divide so we gotta protect
+ return FALSE
+ if(!do_after(user, target = user, delay = ritual_length/ritual_invocations.len))
+ return FALSE
+ user.say(i)
+ if(!do_after(user, target = user, delay = ritual_length/ritual_invocations.len)) //because we start at 0 and not the first fraction in invocations, we still have another fraction of ritual_length to complete
+ return FALSE
+ if(invoke_msg)
+ user.say(invoke_msg)
+ return TRUE
+
+
+///Does the thing if the rite was successfully performed. return value denotes that the effect successfully (IE a harm rite does harm)
+/datum/religion_rites/proc/invoke_effect(mob/living/user, obj/structure/altar_of_gods/AOG)
+ GLOB.religious_sect.on_riteuse(user,AOG)
+ return TRUE
+
+
+/*********Technophiles**********/
+
+/datum/religion_rites/synthconversion
+ name = "Synthetic Conversion"
+ desc = "Convert a human-esque individual into a (superior) Android."
+ ritual_length = 1 MINUTES
+ ritual_invocations = list("By the inner workings of our god...",
+ "... We call upon you, in the face of adversity...",
+ "... to complete us, removing that which is undesirable...")
+ invoke_msg = "... Arise, our champion! Become that which your soul craves, live in the world as your true form!!"
+ favor_cost = 500
+
+/datum/religion_rites/synthconversion/perform_rite(mob/living/user, obj/structure/altar_of_gods/AOG)
+ if(!AOG?.buckled_mobs?.len)
+ return FALSE
+ return ..()
+
+/datum/religion_rites/synthconversion/invoke_effect(mob/living/user, obj/structure/altar_of_gods/AOG)
+ if(!AOG?.buckled_mobs?.len)
+ return FALSE
+ var/mob/living/carbon/human/human2borg
+ for(var/i in AOG.buckled_mobs)
+ if(istype(i,/mob/living/carbon/human))
+ human2borg = i
+ break
+ if(!human2borg)
+ return FALSE
+ human2borg.set_species(/datum/species/android)
+ human2borg.visible_message("[human2borg] has been converted by the rite of [name]!")
+ return TRUE
From 444c9da779f7b326d87c5b30576c2c99f9d8bf0a Mon Sep 17 00:00:00 2001
From: moo <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>
Date: Fri, 13 Mar 2020 20:54:41 -0400
Subject: [PATCH 02/15] im sectsy (#49874)
---
code/modules/religion/religion_sects.dm | 2 +-
code/modules/religion/religion_structures.dm | 27 ++++++++++++--------
code/modules/religion/rites.dm | 1 +
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index 12aba6dbc5bb..9cd6ded504db 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -56,7 +56,7 @@
if(initial(RI.favor_cost))
name_entry += " ([initial(RI.favor_cost)] favor)"
- . += list(name_entry = i)
+ . += list("[name_entry]" = i)
/// Activates once selected
/datum/religion_sect/proc/on_select()
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
index b86fa0198d8a..638dfd6de907 100644
--- a/code/modules/religion/religion_structures.dm
+++ b/code/modules/religion/religion_structures.dm
@@ -15,15 +15,22 @@
/obj/structure/altar_of_gods/examine(mob/user)
. = ..()
- if(!isliving(user))
+ var/can_i_see = FALSE
+ if(isobserver(user))
+ can_i_see = TRUE
+ else if(isliving(user))
+ var/mob/living/L = user
+ if(L.mind?.holy_role)
+ can_i_see = TRUE
+
+ if(!can_i_see || !sect_to_altar)
return
- var/mob/living/L = user
- if(L.mind?.holy_role && sect_to_altar)
- . += "The sect currently has [round(sect_to_altar.favor)] with [GLOB.deity]."
- if(!sect_to_altar.rites_list)
- return
- . += "List of available Rites:"
- . += sect_to_altar.rites_list
+
+ . += "The sect currently has [round(sect_to_altar.favor)] favor with [GLOB.deity]."
+ if(!sect_to_altar.rites_list)
+ return
+ . += "List of available Rites:"
+ . += sect_to_altar.rites_list
/obj/structure/altar_of_gods/Initialize(mapload)
@@ -68,12 +75,12 @@
to_chat(user,"You cannot perform the rite at this time.")
return
var/selection2type = sect_to_altar.rites_list[rite_select]
- performing_rite = new selection2type(src, src)
+ performing_rite = new selection2type(src)
if(!performing_rite.perform_rite(user, src))
QDEL_NULL(performing_rite)
else
performing_rite.invoke_effect(user, src)
- sect_to_altar.adjust_favor(performing_rite.favor_cost*-1)
+ sect_to_altar.adjust_favor(-performing_rite.favor_cost)
QDEL_NULL(performing_rite)
return
diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm
index acac35baea0b..9cb9153a0142 100644
--- a/code/modules/religion/rites.dm
+++ b/code/modules/religion/rites.dm
@@ -59,6 +59,7 @@
/datum/religion_rites/synthconversion/perform_rite(mob/living/user, obj/structure/altar_of_gods/AOG)
if(!AOG?.buckled_mobs?.len)
+ to_chat(user, "This rite requires an individual to be buckled to [AOG].")
return FALSE
return ..()
From ad04acee52270be58d83952cdc6053c47fe51d76 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Mon, 27 Apr 2020 13:11:05 +0200
Subject: [PATCH 03/15] isholy
---
.../antagonists/clockcult/clock_items/clock_components.dm | 4 ++--
yogstation.dme | 4 ++++
yogstation/code/game/gamemodes/vampire/vampire_other.dm | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/code/modules/antagonists/clockcult/clock_items/clock_components.dm b/code/modules/antagonists/clockcult/clock_items/clock_components.dm
index caf8a97de58d..ed66f7fc4e11 100644
--- a/code/modules/antagonists/clockcult/clock_items/clock_components.dm
+++ b/code/modules/antagonists/clockcult/clock_items/clock_components.dm
@@ -24,9 +24,9 @@
/obj/item/clockwork/component/pickup(mob/living/user)
..()
- if(iscultist(user) || (user.mind && user.mind.isholy))
+ if(iscultist(user) || (user.mind && user.mind.holy_role))
to_chat(user, "[cultist_message]")
- if(user.mind && user.mind.isholy)
+ if(user.mind && user.mind.holy_role)
to_chat(user, "The power of your faith melts away [src]!")
var/obj/item/stack/ore/slag/wrath = new /obj/item/stack/ore/slag
qdel(src)
diff --git a/yogstation.dme b/yogstation.dme
index 63e12dc50e06..57e38fcddb19 100644
--- a/yogstation.dme
+++ b/yogstation.dme
@@ -178,6 +178,7 @@
#include "code\_globalvars\logging.dm"
#include "code\_globalvars\misc.dm"
#include "code\_globalvars\regexes.dm"
+#include "code\_globalvars\religion.dm"
#include "code\_globalvars\lists\flavor_misc.dm"
#include "code\_globalvars\lists\maintenance_loot.dm"
#include "code\_globalvars\lists\mapping.dm"
@@ -2586,6 +2587,9 @@
#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\religion_sects.dm"
+#include "code\modules\religion\religion_structures.dm"
+#include "code\modules\religion\rites.dm"
#include "code\modules\research\designs.dm"
#include "code\modules\research\destructive_analyzer.dm"
#include "code\modules\research\experimentor.dm"
diff --git a/yogstation/code/game/gamemodes/vampire/vampire_other.dm b/yogstation/code/game/gamemodes/vampire/vampire_other.dm
index 342ae88caa30..84fa4bc64b21 100644
--- a/yogstation/code/game/gamemodes/vampire/vampire_other.dm
+++ b/yogstation/code/game/gamemodes/vampire/vampire_other.dm
@@ -46,7 +46,7 @@
/obj/item/storage/book/bible/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE)
. = ..()
- if(!(user.mind && user.mind.isholy) && is_vampire(user))
+ if(!(user.mind && user.mind.holy_role) && is_vampire(user))
to_chat(user, "[deity_name] channels through \the [src] and sets you ablaze for your blasphemy!")
user.fire_stacks += 5
user.IgniteMob()
From a7c84e3dd0fc7ed8d3f30a55e513dc68b6bbf1d6 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Mon, 27 Apr 2020 13:23:13 +0200
Subject: [PATCH 04/15] 512
---
code/modules/religion/religion_sects.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index 9cd6ded504db..ac035263d345 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -82,11 +82,11 @@
. = favor //if favor = 5 and we want to subtract 10, we'll only be able to subtract 5
if((favor + amount > max_favor))
. = (max_favor-favor) //if favor = 5 and we want to add 10 with a max of 10, we'll only be able to add 5
- favor = clamp(0,max_favor, favor+amount)
+ favor = CLAMP(0,max_favor, favor+amount)
/// Sets favor to a specific amount. Can provide optional features based on a user.
/datum/religion_sect/proc/set_favor(amount = 0, mob/living/L)
- favor = clamp(0,max_favor,amount)
+ favor = CLAMP(0,max_favor,amount)
return favor
/// Activates when an individual uses a rite. Can provide different/additional benefits depending on the user.
From 4dcf7a030f2cb9316b08e6dc7740b07cc2215a75 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Wed, 29 Apr 2020 23:26:24 +0200
Subject: [PATCH 05/15] Apply suggestions from code review
Co-Authored-By: Hopekz
---
code/modules/religion/religion_sects.dm | 52 +++++++-------------
code/modules/religion/religion_structures.dm | 1 +
code/modules/religion/rites.dm | 15 ++----
3 files changed, 24 insertions(+), 44 deletions(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index ac035263d345..3f97d1294f3c 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -1,39 +1,23 @@
-/**
- * # Religious Sects
- *
- * Religious Sects are a way to convert the fun of having an active 'god' (admin) to code-mechanics so you aren't having to press adminwho.
- *
- * Sects are not meant to overwrite the fun of choosing a custom god/religion, but meant to enhance it.
- * The idea is that Space Jesus (or whoever you worship) can be an evil bloodgod who takes the lifeforce out of people, a nature lover, or all things righteous and good. You decide!
- *
+ /*
+ Religious Sects are a way to convert the fun of having an active 'god' (admin) to code-mechanics so you aren't having to press adminwho.
+
+ Sects are not meant to overwrite the fun of choosing a custom god/religion, but meant to enhance it.
+ The idea is that Space Jesus (or whoever you worship) can be an evil bloodgod who takes the lifeforce out of people, a nature lover, or all things righteous and good. You decide!
*/
/datum/religion_sect
-/// Name of the religious sect
- var/name = "Religious Sect Base Type"
-/// Description of the religious sect, Presents itself in the selection menu (AKA be brief)
- var/desc = "Oh My! What Do We Have Here?!!?!?!?"
-/// Opening message when someone gets converted
- var/convert_opener
-/// holder for alignments.
- var/alignment = ALIGNMENT_GOOD
-/// Does this require something before being available as an option?
- var/starter = TRUE
-/// The Sect's 'Mana'
- var/favor = 0 //MANA!
-/// The max amount of favor the sect can have
- var/max_favor = 1000
-/// The default value for an item that can be sacrificed
- var/default_item_favor = 5
-/// Turns into 'desired_items_typecache', lists the types that can be sacrificed barring optional features in can_sacrifice()
- var/list/desired_items
-/// Autopopulated by `desired_items`
- var/list/desired_items_typecache
-/// Lists of rites by type. Converts itself into a list of rites with "name - desc (favor_cost)" = type
- var/list/rites_list
-/// Changes the Altar of Gods icon
- var/altar_icon
-/// Changes the Altar of Gods icon_state
- var/altar_icon_state
+ var/name = "Religious Sect Base Type" // Name of the religious sect
+ var/desc = "Oh My! What Do We Have Here?!!?!?!?" // Description of the religious sect, Presents itself in the selection menu (AKA be brief)
+ var/convert_opener // Opening message when someone gets converted
+ var/alignment = ALIGNMENT_GOOD // holder for alignments.
+ var/starter = TRUE // Does this require something before being available as an option?
+ var/favor = 0 // The Sect's 'Mana'
+ var/max_favor = 1000 // The max amount of favor the sect can have
+ var/default_item_favor = 5 // The default value for an item that can be sacrificed
+ var/list/desired_items // Turns into 'desired_items_typecache', lists the types that can be sacrificed barring optional features in can_sacrifice()
+ var/list/desired_items_typecache // Autopopulated by `desired_items`
+ var/list/rites_list // Lists of rites by type. Converts itself into a list of rites with "name - desc (favor_cost)" = type
+ var/altar_icon // Changes the Altar of Gods icon
+ var/altar_icon_state // Changes the Altar of Gods icon_state
/datum/religion_sect/New()
if(desired_items)
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
index 638dfd6de907..d407c488562f 100644
--- a/code/modules/religion/religion_structures.dm
+++ b/code/modules/religion/religion_structures.dm
@@ -63,6 +63,7 @@
sect_to_altar.on_sacrifice(C,user)
return TRUE
. = ..()
+
//everything below is assumed you're bibling it up
if(!istype(C, /obj/item/storage/book/bible))
return
diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm
index 9cb9153a0142..dc7528c0758a 100644
--- a/code/modules/religion/rites.dm
+++ b/code/modules/religion/rites.dm
@@ -1,14 +1,9 @@
/datum/religion_rites
-/// name of the religious rite
- var/name = "religious rite"
-/// Description of the religious rite
- var/desc = "immm gonna rooon"
-/// length it takes to complete the ritual
- var/ritual_length = (10 SECONDS) //total length it'll take
-/// list of invocations said (strings) throughout the rite
- var/list/ritual_invocations //strings that are by default said evenly throughout the rite
-/// message when you invoke
- var/invoke_msg
+ var/name = "religious rite" // name of the religious rite
+ var/desc = "immm gonna rooon" // Description of the religious rite
+ var/ritual_length = (10 SECONDS) // length it takes to complete the ritual
+ var/list/ritual_invocations // list of invocations said (strings) throughout the rite
+ var/invoke_msg // message when you invoke
var/favor_cost = 0
///Called to perform the invocation of the rite, with args being the performer and the altar where it's being performed. Maybe you want it to check for something else?
From cf45872c7f14a3101edfb8bc53553de9052bdc2b Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:47:17 +0200
Subject: [PATCH 06/15] Update code/modules/religion/rites.dm
Co-authored-by: Hopekz
---
code/modules/religion/rites.dm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm
index dc7528c0758a..b590bbe47a52 100644
--- a/code/modules/religion/rites.dm
+++ b/code/modules/religion/rites.dm
@@ -46,9 +46,11 @@
name = "Synthetic Conversion"
desc = "Convert a human-esque individual into a (superior) Android."
ritual_length = 1 MINUTES
- ritual_invocations = list("By the inner workings of our god...",
- "... We call upon you, in the face of adversity...",
- "... to complete us, removing that which is undesirable...")
+ ritual_invocations = list(
+ "By the inner workings of our god...",
+ "... We call upon you, in the face of adversity...",
+ "... to complete us, removing that which is undesirable..."
+ )
invoke_msg = "... Arise, our champion! Become that which your soul craves, live in the world as your true form!!"
favor_cost = 500
From 0b3bb3568983b41a5a18249f6f44237de77b149d Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:47:37 +0200
Subject: [PATCH 07/15] Update code/modules/religion/religion_sects.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_sects.dm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index 3f97d1294f3c..5e838b28355d 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -47,7 +47,8 @@
/// Activates once selected and on newjoins, oriented around people who become holy.
/datum/religion_sect/proc/on_conversion(mob/living/L)
- to_chat(L, "[convert_opener][convert_opener]
Date: Fri, 8 May 2020 00:47:50 +0200
Subject: [PATCH 08/15] Update code/modules/religion/religion_sects.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_sects.dm | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index 5e838b28355d..8f9837271bc9 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -62,12 +62,9 @@
/// Adjust Favor by a certain amount. Can provide optional features based on a user. Returns actual amount added/removed
/datum/religion_sect/proc/adjust_favor(amount = 0, mob/living/L)
- . = amount
- if(favor + amount < 0)
- . = favor //if favor = 5 and we want to subtract 10, we'll only be able to subtract 5
- if((favor + amount > max_favor))
- . = (max_favor-favor) //if favor = 5 and we want to add 10 with a max of 10, we'll only be able to add 5
- favor = CLAMP(0,max_favor, favor+amount)
+ var/old_favor = favor //store the current favor
+ favor = clamp(favor+amount, 0, max_favor) //ensure we arent going overboard
+ return favor - old_favor //return the difference
/// Sets favor to a specific amount. Can provide optional features based on a user.
/datum/religion_sect/proc/set_favor(amount = 0, mob/living/L)
From 73923760aa9f767340def5607ece970e96c08e05 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:48:01 +0200
Subject: [PATCH 09/15] Update code/modules/religion/religion_sects.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_sects.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index 8f9837271bc9..b3d4610c044f 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -68,7 +68,7 @@
/// Sets favor to a specific amount. Can provide optional features based on a user.
/datum/religion_sect/proc/set_favor(amount = 0, mob/living/L)
- favor = CLAMP(0,max_favor,amount)
+ favor = clamp(amount, 0, max_favor)
return favor
/// Activates when an individual uses a rite. Can provide different/additional benefits depending on the user.
From 6b055abe621201f1fa9f10db631e4210bfebc37b Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:48:07 +0200
Subject: [PATCH 10/15] Update code/modules/religion/religion_sects.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_sects.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index b3d4610c044f..2e15eb76c305 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -97,7 +97,7 @@
to_chat(H, "May the power of [GLOB.deity] compel you to be healed!")
playsound(user, "punch", 25, TRUE, -1)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
- return TRUE
+ return FALSE
/datum/religion_sect/puritanism
name = "Puritanism (Default)"
From 22a66e53ea9988d7c794cc91f9d50e63718fbd37 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:48:21 +0200
Subject: [PATCH 11/15] Update code/modules/religion/religion_structures.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_structures.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
index d407c488562f..ff0d2de38582 100644
--- a/code/modules/religion/religion_structures.dm
+++ b/code/modules/religion/religion_structures.dm
@@ -85,7 +85,7 @@
QDEL_NULL(performing_rite)
return
- if(user.mind.holy_role != HOLY_ROLE_HIGHPRIEST)
+ if(user.mind?.holy_role != HOLY_ROLE_HIGHPRIEST)
to_chat(user, "You are not the high priest, and therefore cannot select a religious sect.")
return
From c3f97f0f588eb317fc5c7f9664ff1e898c1f4dc5 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:48:37 +0200
Subject: [PATCH 12/15] Update code/modules/religion/religion_structures.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_structures.dm | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
index ff0d2de38582..2544ff3a297e 100644
--- a/code/modules/religion/religion_structures.dm
+++ b/code/modules/religion/religion_structures.dm
@@ -91,6 +91,7 @@
var/list/available_options = generate_available_sects(user)
if(!available_options)
+ to_chat(user, "There are currently no religious sects to chose from. ")
return
var/sect_select = input(user,"Select a sect (You CANNOT revert this decision!)","Select a Sect",null) in available_options
From 832f72b134141b5b2dd8cdeb43c2deb322985789 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:50:07 +0200
Subject: [PATCH 13/15] Apply suggestions from code review
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_structures.dm | 4 ++--
code/modules/religion/rites.dm | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm
index 2544ff3a297e..6da222e88db1 100644
--- a/code/modules/religion/religion_structures.dm
+++ b/code/modules/religion/religion_structures.dm
@@ -69,7 +69,7 @@
return
if(sect_to_altar)
if(!sect_to_altar.rites_list)
- to_chat(user, "Your sect doesn't have any rites to perform!")
+ to_chat(user, "Your sect doesn't have any rites to perform!")
return
var/rite_select = input(user,"Select a rite to perform!","Select a rite",null) in sect_to_altar.rites_list
if(!rite_select || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
@@ -86,7 +86,7 @@
return
if(user.mind?.holy_role != HOLY_ROLE_HIGHPRIEST)
- to_chat(user, "You are not the high priest, and therefore cannot select a religious sect.")
+ to_chat(user, "You are not the high priest, and therefore cannot select a religious sect. ")
return
var/list/available_options = generate_available_sects(user)
diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm
index b590bbe47a52..d5447941bc20 100644
--- a/code/modules/religion/rites.dm
+++ b/code/modules/religion/rites.dm
@@ -14,6 +14,8 @@
to_chat(user, "You begin to perform the rite of [name]...")
if(!ritual_invocations)
if(do_after(user, target = user, delay = ritual_length))
+ if(invoke_msg)
+ user.say(invoke_msg, forced = "ritual")
return TRUE
return FALSE
var/first_invoke = TRUE
@@ -26,11 +28,11 @@
return FALSE
if(!do_after(user, target = user, delay = ritual_length/ritual_invocations.len))
return FALSE
- user.say(i)
+ user.say(i, forced = "ritual")
if(!do_after(user, target = user, delay = ritual_length/ritual_invocations.len)) //because we start at 0 and not the first fraction in invocations, we still have another fraction of ritual_length to complete
return FALSE
if(invoke_msg)
- user.say(invoke_msg)
+ user.say(invoke_msg, forced = "ritual")
return TRUE
From c21fd08a0dd77438ff09a3ccf0f7ad6120bc921e Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Fri, 8 May 2020 00:57:50 +0200
Subject: [PATCH 14/15] Update religion_sects.dm
---
code/modules/religion/religion_sects.dm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index 2e15eb76c305..b7f372364cc5 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -135,7 +135,13 @@
if(istype(eth_stomach))
eth_stomach.adjust_charge(3)
did_we_charge = TRUE
-
+ if(ispreternis(H))
+ var/datum/species/preternis/preternis = H.dna.species
+ preternis.charge += 3
+ if(preternis.charge > PRETERNIS_LEVEL_FULL)
+ preternis.charge = PRETERNIS_LEVEL_FULL
+ did_we_charge = TRUE
+
//if we're not targetting a robot part we stop early
var/obj/item/bodypart/BP = H.get_bodypart(user.zone_selected)
if(BP.status != BODYPART_ROBOTIC)
From d921e7b592c71232660e0082e045728e4011efd9 Mon Sep 17 00:00:00 2001
From: TheGamerdk
Date: Mon, 11 May 2020 19:26:30 +0200
Subject: [PATCH 15/15] Update code/modules/religion/religion_sects.dm
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
---
code/modules/religion/religion_sects.dm | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm
index b7f372364cc5..58fc0c35dea3 100644
--- a/code/modules/religion/religion_sects.dm
+++ b/code/modules/religion/religion_sects.dm
@@ -137,9 +137,7 @@
did_we_charge = TRUE
if(ispreternis(H))
var/datum/species/preternis/preternis = H.dna.species
- preternis.charge += 3
- if(preternis.charge > PRETERNIS_LEVEL_FULL)
- preternis.charge = PRETERNIS_LEVEL_FULL
+ preternis.charge = clamp(preternis.charge + 3, PRETERNIS_LEVEL_NONE, PRETERNIS_LEVEL_FULL)
did_we_charge = TRUE
//if we're not targetting a robot part we stop early