diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 61895fde581..5c0fb379d01 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -45,6 +45,7 @@
var/role_alt_title
var/datum/job/assigned_job
+ var/datum/religion/faith
var/list/kills=list()
var/list/datum/objective/objectives = list()
@@ -118,6 +119,13 @@
output += "Objective #[obj_count]: [objective.explanation_text]"
obj_count++
+ // -- Religions --
+ if (faith) // This way they can get their religion changed
+ output += "Religion: [faith.name]
\
+ Leader: [faith.religiousLeader]
"
+
+ if (faith.religiousLeader == src)
+ output += "You can convert people by [faith.convert_method]
"
recipient << browse(output,"window=memory")
/datum/mind/proc/edit_memory()
diff --git a/code/datums/religions.dm b/code/datums/religions.dm
index 0a5c664e290..d6641d66fd0 100644
--- a/code/datums/religions.dm
+++ b/code/datums/religions.dm
@@ -6,13 +6,18 @@
var/bible_name = "The Holy Bible"
var/male_adept = "Chaplain"
var/female_adept = "Chaplain"
- var/bible_type = /obj/item/weapon/storage/bible
+ var/convert_method = "splashing them with holy water, holding a bible in hand."
+ var/bible_type = /obj/item/weapon/storage/bible
var/obj/item/weapon/storage/bible/holy_book
+ var/datum/mind/religiousLeader
+ var/list/datum/mind/adepts = list()
+
var/list/bible_names = list()
var/list/deity_names = list()
+ var/datum/action/renounce/action_renounce
var/list/keys = list("christianity") // What you need to type to get this particular relgion.
/datum/religion/New() // For religions with several bibles/deities
@@ -20,11 +25,211 @@
bible_name = pick(bible_names)
if (deity_names.len)
deity_name = pick(deity_names)
+ action_renounce = new /datum/action/renounce(src)
+
+/datum/religion/proc/isReligiousLeader(var/mob/living/user)
+ return (user.mind && user.mind == religiousLeader)
// Give the chaplain the basic gear, as well as a few misc effects.
/datum/religion/proc/equip_chaplain(var/mob/living/carbon/human/H)
return TRUE // Nothing to see here, but redefined in some other religions !
+/* ---- RELIGIOUS CONVERSION ----
+ * convertAct() -> convertCeremony() -> convertCheck() -> convert()
+ * Redefine 'convertCeremony' to play out your snowflake ceremony/interactions in your religion datum.
+ * In a saner language, convertCeremony() and convertCheck() would be private methods. Those are UNSAFE procs. Call convertAct() instead.
+ */
+
+/* ConvertAct() : here we check if eveything is in place for the conversion, and provide feedback if needed. Sanity for the preacher or the target belongs to the verb in the bible.
+ * - preacher : the guy doing the converting
+ * - subject : the guy being converted
+ * - B : the bible using for the conversion
+ */
+/datum/religion/proc/convertAct(var/mob/living/preacher, var/mob/living/subject, var/obj/item/weapon/storage/bible/B)
+ if (B.my_rel != src) // BLASPHEMY
+ to_chat(preacher, "You are a heathen to this God. You feel [B.my_rel.deity_name]'s wrath strike you for this blasphemy.")
+ preacher.fire_stacks += 5
+ preacher.IgniteMob()
+ preacher.emote("scream",,, 1)
+ return FALSE
+ if (preacher != religiousLeader.current)
+ to_chat(preacher, "You fail to muster enough mental strength to begin the conversion. Only the Spiritual Guide of [name] can perfom this.")
+ return FALSE
+ if (subject.mind.faith == src)
+ to_chat(preacher, "You and your target follow the same faith.")
+ return FALSE
+ if (istype(subject.mind.faith) && subject.mind.faith.isReligiousLeader(subject))
+ to_chat(preacher, "Your target is already the leader of another religion.")
+ return FALSE
+ else
+ return convertCeremony(preacher, subject)
+
+/* ConvertCeremony() : the RP ceremony to convert the newfound person.
+ Here we check if we have the tools to convert and play out the little interactions. */
+
+ // This is the default ceremony, for Christianity/Space Jesus
+/datum/religion/proc/convertCeremony(var/mob/living/preacher, var/mob/living/subject)
+ var/held_beaker = preacher.find_held_item_by_type(/obj/item/weapon/reagent_containers)
+ if (!held_beaker)
+ to_chat(preacher, "You need to hold Holy Water to begin to conversion.")
+ return FALSE
+ var/obj/item/weapon/reagent_containers/B = preacher.held_items[held_beaker]
+ if (B.reagents.get_master_reagent_name() != "Holy Water")
+ to_chat(preacher, "You need to hold Holy Water to begin to conversion.")
+ return FALSE
+ subject.visible_message("\The [preacher] attemps to convert \the [subject] to [name].")
+ if(!convertCheck(subject))
+ subject.visible_message("\The [subject] refuses conversion.")
+ return FALSE
+
+ // Everything is ok : begin the conversion
+ splash_sub(B.reagents, subject, 5, preacher)
+ subject.visible_message("\The [subject] is blessed by \the [preacher] and embraces [name]. Praise [deity_name]!")
+ convert(subject, preacher)
+ return TRUE
+
+// Here we check if the subject is willing
+/datum/religion/proc/convertCheck(var/mob/living/subject)
+ var/choice = input(subject, "Do you wish to become a follower of [name]?","Religious converting") in list("Yes", "No")
+ return choice == "Yes"
+
+// Here is the proc to welcome a new soul in our religion.
+/datum/religion/proc/convert(var/mob/living/subject, var/mob/living/preacher)
+ // If he already had one
+ if (subject.mind.faith)
+ subject.mind.faith.renounce(subject) // We remove him from that one
+
+ subject.mind.faith = src
+ to_chat(subject, "You feel your mind become clear and focused as you discover your newfound faith. You are now a follower of [name].")
+ adepts += subject.mind
+ action_renounce.Grant(subject)
+ if (!preacher)
+ var/msg = "\The [key_name(subject)] has been converted to [name] without a preacher."
+ message_admins(msg)
+ else
+ var/msg = "[key_name(subject)] has been converted to [name] by \The [key_name(preacher)]."
+ message_admins(msg)
+
+// Activivating a religion with admin interventions.
+/datum/religion/proc/activate(var/mob/living/preacher)
+ equip_chaplain(preacher) // We do the misc things related to the religion
+ to_chat(preacher, "A great, intense revelation go through your spirit. You are now the religious leader of [name]. Convert people by [convert_method]")
+ if (holy_book)
+ preacher.put_in_hands(holy_book)
+ else
+ holy_book = new bible_type
+ holy_book.my_rel = src
+ chooseBible(src, preacher)
+ holy_book.name = bible_name
+ preacher.put_in_hands(holy_book)
+ religiousLeader = preacher.mind
+ convert(preacher, null)
+
+/datum/religion/proc/renounce(var/mob/living/subject)
+ to_chat(subject, "You renounce [name].")
+ adepts -= subject.mind
+ subject.mind.faith = null
+
+// Action : renounce your faith. For players.
+/datum/action/renounce
+ name = "Renounce faith"
+ desc = "Leave the religion you are currently in."
+ icon_icon = 'icons/obj/clothing/hats.dmi'
+ button_icon_state = "fedora" // :^) Needs a better icon
+
+/datum/action/renounce/Trigger()
+ var/datum/religion/R = target
+ var/mob/living/M = owner
+
+ if (!R) // No religion, may as well be a good time to remove the icon if it's there
+ Remove(M)
+ return FALSE
+
+ if (R.isReligiousLeader(M))
+ to_chat(M, "You are the leader of this flock and cannot forsake them. If you have to, pray to the Gods for release.")
+ return FALSE
+ Remove(owner)
+ R.renounce(owner)
+
+/proc/chooseBible(var/datum/religion/R, var/mob/user)
+
+ if (!istype(R) || !user)
+ return FALSE
+
+ if (!R.holy_book)
+ return FALSE
+
+ var/book_style = "Bible"
+
+ book_style = input(user, "Which bible style would you like?") as null|anything in list("Bible", "Koran", "Scrapbook", "Creeper", "White Bible", "Holy Light", "Athiest", "[R.holy_book.name == "clockwork slab" ? "Slab":"Tome"]", "The King in Yellow", "Ithaqua", "Scientology", \
+ "the bible melts", "Unaussprechlichen Kulten", "Necronomicon", "Book of Shadows", "Torah", "Burning", "Honk", "Ianism", "The Guide")
+ switch(book_style)
+ if("Koran")
+ R.holy_book.icon_state = "koran"
+ R.holy_book.item_state = "koran"
+ if("Scrapbook")
+ R.holy_book.icon_state = "scrapbook"
+ R.holy_book.item_state = "scrapbook"
+ if("Creeper")
+ R.holy_book.icon_state = "creeper"
+ R.holy_book.item_state = "syringe_kit"
+ if("White Bible")
+ R.holy_book.icon_state = "white"
+ R.holy_book.item_state = "syringe_kit"
+ if("Holy Light")
+ R.holy_book.icon_state = "holylight"
+ R.holy_book.item_state = "syringe_kit"
+ if("Athiest")
+ R.holy_book.icon_state = "athiest"
+ R.holy_book.item_state = "syringe_kit"
+ if("Tome")
+ R.holy_book.icon_state = "tome"
+ R.holy_book.item_state = "syringe_kit"
+ if("The King in Yellow")
+ R.holy_book.icon_state = "kingyellow"
+ R.holy_book.item_state = "kingyellow"
+ if("Ithaqua")
+ R.holy_book.icon_state = "ithaqua"
+ R.holy_book.item_state = "ithaqua"
+ if("Scientology")
+ R.holy_book.icon_state = "scientology"
+ R.holy_book.item_state = "scientology"
+ if("the bible melts")
+ R.holy_book.icon_state = "melted"
+ R.holy_book.item_state = "melted"
+ if("Unaussprechlichen Kulten")
+ R.holy_book.icon_state = "kulten"
+ R.holy_book.item_state = "kulten"
+ if("Necronomicon")
+ R.holy_book.icon_state = "necronomicon"
+ R.holy_book.item_state = "necronomicon"
+ if("Book of Shadows")
+ R.holy_book.icon_state = "shadows"
+ R.holy_book.item_state = "shadows"
+ if("Torah")
+ R.holy_book.icon_state = "torah"
+ R.holy_book.item_state = "torah"
+ if("Burning")
+ R.holy_book.icon_state = "burning"
+ R.holy_book.item_state = "syringe_kit"
+ if("Honk")
+ R.holy_book.icon_state = "honkbook"
+ R.holy_book.item_state = "honkbook"
+ if("Ianism")
+ R.holy_book.icon_state = "ianism"
+ R.holy_book.item_state = "ianism"
+ if("The Guide")
+ R.holy_book.icon_state = "guide"
+ R.holy_book.item_state = "guide"
+ if("Slab")
+ R.holy_book.icon_state = "slab"
+ R.holy_book.item_state = "slab"
+ R.holy_book.desc = "A bizarre, ticking device... That looks broken."
+ else
+ //If christian bible, revert to default
+ R.holy_book.icon_state = "bible"
+ R.holy_book.item_state = "bible"
+
// The list of all religions spacemen have designed, so far.
/datum/religion/catholic
name = "Catholicism"
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index be6def30c57..3801297311d 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -20,10 +20,11 @@ var/datum/controller/gameticker/ticker
var/list/datum/mind/minds = list()//The people in the game. Used for objective tracking.
- var/Bible_icon_state // icon_state the chaplain has chosen for his bible
- var/Bible_item_state // item_state the chaplain has chosen for his bible
+ var/Bible_icon_state // icon_state the OFFICIAL chaplain has chosen for his bible
+ var/Bible_item_state // item_state the OFFICIAL chaplain has chosen for his bible
var/Bible_name // name of the bible
var/Bible_deity_name = "Space Jesus"
+ var/list/datum/religion/religions = list() // Religion(s) in the game
var/random_players = 0 // if set to nonzero, ALL players who latejoin or declare-ready join will have random appearances/genders
diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm
index 338ff7629e1..9ca46f346c2 100644
--- a/code/game/jobs/job/civilian_chaplain.dm
+++ b/code/game/jobs/job/civilian_chaplain.dm
@@ -50,10 +50,13 @@
rel.equip_chaplain(H) // We do the misc things related to the religion
B = new rel.bible_type
B.name = rel.bible_name
- B.deity_name = rel.deity_name
- H.put_in_hands(B)
+ B.my_rel = rel
rel.holy_book = B
+ H.put_in_hands(B)
+ rel.religiousLeader = H.mind
J = (H.gender == FEMALE ? rel.female_adept : rel.male_adept)
+ rel.convert(H, null)
+ to_chat(H, "A great, intense revelation go through your spirit. You are now the religious leader of [rel.name]. Convert people by [rel.convert_method]")
chap_religion = rel
choice = TRUE
break // We got our religion ! Abort, abort.
@@ -64,11 +67,15 @@
chap_religion.name = "[new_religion]"
chap_religion.deity_name = "[new_religion]"
chap_religion.bible_name = "The Holy Book of [new_religion]"
- B = new chap_religion.bible_type
- B.name = chap_religion.bible_name
- B.deity_name = chap_religion.deity_name
- H.put_in_hands(B)
+ chap_religion.equip_chaplain(H) // We do the misc things related to the religion
chap_religion.holy_book = B
+ B = new /obj/item/weapon/storage/bible
+ B.name = chap_religion.bible_name
+ B.my_rel = chap_religion
+ H.put_in_hands(B)
+ chap_religion.religiousLeader = H.mind
+ to_chat(H, "A great, intense revelation go through your spirit. You are know the religious leader of [chap_religion.name]. Convert people by [chap_religion.convert_method]")
+ chap_religion.convert(H, null)
//This goes down here due to problems with loading orders that took me 4 hours to identify
var/obj/item/weapon/card/id/I = null
@@ -90,7 +97,6 @@
var/new_deity = copytext(sanitize(input(H, "Would you like to change your deity? Your deity currently is [chap_religion.deity_name] (Leave empty or unchanged to keep deity name)", "Name of Deity", chap_religion.deity_name)), 1, MAX_NAME_LEN)
if(length(new_deity))
chap_religion.deity_name = new_deity
- B.deity_name = new_deity
var/accepted = 0
var/outoftime = 0
@@ -216,7 +222,8 @@
ticker.Bible_icon_state = B.icon_state
ticker.Bible_item_state = B.item_state
ticker.Bible_name = B.name
- ticker.Bible_deity_name = B.deity_name
+ ticker.Bible_deity_name = B.my_rel.deity_name
+ ticker.religions += chap_religion
feedback_set_details("religion_deity","[new_deity]")
feedback_set_details("religion_book","[new_book_style]")
return 1
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index 6a947eb44b6..79639af696c 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -1,3 +1,5 @@
+#define isChaplain(user) (user.mind && user.mind.assigned_role == "Chaplain")
+
/obj/item/weapon/storage/bible
name = "bible"
desc = "Apply to head repeatedly."
@@ -9,7 +11,8 @@
flags = FPRINT
attack_verb = list("whacks", "slaps", "slams", "forcefully blesses")
var/mob/affecting = null
- var/deity_name = "Christ"
+ var/datum/religion/my_rel = new /datum/religion
+ actions_types = list(/datum/action/item_action/convert)
autoignition_temperature = 522 // Kelvin
fire_fuel = 2
@@ -40,11 +43,6 @@
//What happens when you slap things with the Bible in general
/obj/item/weapon/storage/bible/attack(mob/living/M as mob, mob/living/user as mob)
- var/chaplain = 0 //Are we the Chaplain ? Used for simplification
- if(user.mind && (user.mind.assigned_role == "Chaplain"))
- chaplain = 1 //Indeed we are
-
-
M.attack_log += text("\[[time_stamp()]\] Has been attacked with [src.name] by [user.name] ([user.ckey])")
user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to attack [M.name] ([M.ckey])")
@@ -55,16 +53,16 @@
log_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])")
- if(!chaplain) //The user is not a Chaplain. BLASPHEMY !
+ if (!isChaplain(user) && !isReligiousLeader(user)) //The user is not a Chaplain, nor the leader of this religon. BLASPHEMY !
//Using the Bible as a member of the occult will get you smithed, aka holy cleansing fire. You'd have to be stupid to remotely consider it
if(isvampire(user)) //Vampire trying to use it
- to_chat(user, "[deity_name] channels through \the [src] and sets you ablaze for your blasphemy!")
+ to_chat(user, "[my_rel.deity_name] channels through \the [src] and sets you ablaze for your blasphemy!")
user.fire_stacks += 5
user.IgniteMob()
user.emote("scream",,, 1)
M.mind.vampire.smitecounter += 50 //Once we are extinguished, we will be quite vulnerable regardless
else if(iscult(user)) //Cultist trying to use it
- to_chat(user, "[deity_name] channels through \the [src] and sets you ablaze for your blasphemy!")
+ to_chat(user, "[my_rel.deity_name] channels through \the [src] and sets you ablaze for your blasphemy!")
user.fire_stacks += 5
user.IgniteMob()
user.emote("scream",,, 1)
@@ -95,7 +93,7 @@
if(M.stat == DEAD) //Our target is dead. RIP in peace
user.visible_message("[user] [pick(attack_verb)] [M]'s lifeless body with \the [src].",
- "You bless [M]'s lifeless body with \the [src], trying to conjure [deity_name]'s mercy on them.")
+ "You bless [M]'s lifeless body with \the [src], trying to conjure [my_rel.deity_name]'s mercy on them.")
playsound(get_turf(src), "punch", 25, 1, -1)
//TODO : Way to bring people back from death if they are your followers
@@ -103,28 +101,28 @@
//Our target is alive, prepare the blessing
user.visible_message("[user] [pick(attack_verb)] [M]'s head with \the [src].",
- "You bless [M]'s head with \the [src]. In the name of [deity_name], bless thee!")
+ "You bless [M]'s head with \the [src]. In the name of [my_rel.deity_name], bless thee!")
playsound(get_turf(src), "punch", 25, 1, -1)
- if(ishuman(M)) //Only humans can be vampires or cultists
+ if(ishuman(M)) //Only humans can be vampires or cultists. isChaplain() checks are here to ensure only the proper chaplain has the gameplay-related interactions.
var/mob/living/carbon/human/H = M
- if(H.mind && isvampire(H) && !(VAMP_MATURE in H.mind.vampire.powers)) //The user is a "young" Vampire, fuck up his vampiric powers and hurt his head
- to_chat(H, "[deity_name]'s power nullifies your own!")
+ if(H.mind && isvampire(H) && !(VAMP_MATURE in H.mind.vampire.powers) && isChaplain(user)) //The user is a "young" Vampire, fuck up his vampiric powers and hurt his head
+ to_chat(H, "[my_rel.deity_name]'s power nullifies your own!")
if(H.mind.vampire.nullified < 5) //Don't actually reduce their debuff if it's over 5
H.mind.vampire.nullified = max(5, H.mind.vampire.nullified + 2)
H.mind.vampire.smitecounter += 10 //Better get out of here quickly before the problem shows. Ten hits and you are literal toast
return 1 //Don't heal the mob
- if(H.mind && iscult(H)) //The user is a Cultist. We are thus deconverting him
+ if(H.mind && iscult(H) && isChaplain(user)) //The user is a Cultist. We are thus deconverting him
if(prob(20))
- to_chat(H, "The power of [deity_name] suddenly clears your mind of heresy. Your allegiance to Nar'Sie wanes!")
- to_chat(user, "You see [H]'s eyes become clear. Nar'Sie no longer controls his mind, [deity_name] saved \him!")
+ to_chat(H, "The power of [my_rel.deity_name] suddenly clears your mind of heresy. Your allegiance to Nar'Sie wanes!")
+ to_chat(user, "You see [H]'s eyes become clear. Nar'Sie no longer controls his mind, [my_rel.deity_name] saved \him!")
ticker.mode.remove_cultist(H.mind)
else //We aren't deconverting him this time, give the Cultist a fair warning
- to_chat(H, "The power of [deity_name] is overwhelming you. Your mind feverishly questions Nar'Sie's teachings!")
+ to_chat(H, "The power of [my_rel.deity_name] is overwhelming you. Your mind feverishly questions Nar'Sie's teachings!")
return 1 //Don't heal the mob
- if(H.mind && H.mind.special_role == "VampThrall")
+ if(H.mind && H.mind.special_role == "VampThrall" && isChaplain(user))
ticker.mode.remove_thrall(H.mind)
H.visible_message("[H] suddenly becomes calm and collected again, \his eyes clear up.",
"Your blood cools down and you are inhabited by a sensation of untold calmness.")
@@ -136,7 +134,7 @@
/obj/item/weapon/storage/bible/proc/bless_mob(mob/living/carbon/human/user, mob/living/carbon/human/H)
var/datum/organ/internal/brain/sponge = H.internal_organs_by_name["brain"]
if(sponge && sponge.damage >= 60) //Massive brain damage
- to_chat(user, "[H] responds to \the [src]'s blessing with drooling and an empty stare. [deity_name]'s teachings appear to be lost on this poor soul.")
+ to_chat(user, "[H] responds to \the [src]'s blessing with drooling and an empty stare. [my_rel.deity_name]'s teachings appear to be lost on this poor soul.")
return //Brainfart
//TODO: Put code for followers right here
if(prob(20)) //1/5 chance of adding some brain damage. You can't just heal people for free
@@ -152,7 +150,7 @@
if(!proximity_flag)
return
user.delayNextAttack(5)
- if(user.mind && (user.mind.assigned_role == "Chaplain")) //Make sure we still are a Chaplain, just in case
+ if(isChaplain(user) || isReligiousLeader(user)) //Make sure we still are a Chaplain, just in case - or a religious leader of our religion
if(A.reagents && A.reagents.has_reagent(WATER)) //Blesses all the water in the holder
user.visible_message("[user] blesses \the [A].",
"You bless \the [A].")
@@ -166,12 +164,45 @@
. = ..()
/obj/item/weapon/storage/bible/pickup(mob/living/user as mob)
- if(user.mind && user.mind.assigned_role == "Chaplain") //We are the Chaplain, yes we are
- to_chat(user, "You feel [deity_name]'s holy presence as you pick up \the [src].")
+ if(isChaplain(user) || isReligiousLeader(user)) //We are the Chaplain, yes we are
+ to_chat(user, "You feel [my_rel.deity_name]'s holy presence as you pick up \the [src].")
if(ishuman(user)) //We are checking for antagonists, only humans can be antagonists
var/mob/living/carbon/human/H = user
if(isvampire(H) && (!(VAMP_UNDYING in H.mind.vampire.powers))) //We are a Vampire, we aren't very smart
- to_chat(H, "[deity_name]'s power channels through \the [src]. You feel extremely uneasy as you grab it!")
+ to_chat(H, "[my_rel.deity_name]'s power channels through \the [src]. You feel extremely uneasy as you grab it!")
H.mind.vampire.smitecounter += 10
if(iscult(H)) //We are a Cultist, we aren't very smart either, but at least there will be no consequences for us
- to_chat(H, "[deity_name]'s power channels through \the [src]. You feel uneasy as you grab it, but Nar'Sie protects you from its influence!")
+ to_chat(H, "[my_rel.deity_name]'s power channels through \the [src]. You feel uneasy as you grab it, but Nar'Sie protects you from its influence!")
+
+/obj/item/weapon/storage/bible/proc/isReligiousLeader(var/mob/living/user)
+ return (user.mind && user.mind == my_rel.religiousLeader)
+
+// Action : convert people
+
+/datum/action/item_action/convert
+ name = "Convert people"
+ desc = "Convert someone next to you."
+
+/datum/action/item_action/convert/Trigger()
+ var/obj/item/weapon/storage/bible/B = target
+
+ if (owner.incapacitated() || owner.lying || owner.locked_to || !ishigherbeing(owner)) // Sanity
+ return FALSE
+ if (!owner.mind.faith)
+ to_chat(usr, " You do not have a religion to convert people to.")
+ return FALSE
+
+ var/list/mob/living/moblist = range(1, owner)
+ moblist -= owner
+
+ var/mob/living/subject = input(owner, "Who do you wish to convert?", "Religious converting") as null|mob in moblist
+
+ if (!subject)
+ to_chat(owner, "No target selected.")
+ return FALSE
+
+ if (subject.incapacitated() || subject.lying || subject.locked_to || !ishigherbeing(subject) || !subject.mind) // Sanity
+ to_chat(owner, " \The [subject] does not seem receptive to conversion.")
+ else
+ owner.mind.faith.convertAct(owner, subject, B) // usr = preacher ; target = subject
+ return TRUE
\ No newline at end of file
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 48c63483297..704469dfaa4 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -704,6 +704,7 @@ var/global/floorIsLava = 0
else
dat += "Enable wages
"
dat += "Manage accounts database
"
+ dat += "Manage religions
"
usr << browse(dat, "window=admin2;size=280x370")
return
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 517b72dcbdc..a54e2bb28be 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -4580,6 +4580,7 @@
wages_enabled = 0
message_admins("[key_name_admin(usr)] has disabled wages!")
return
+
if(href_list["econ_panel"])
var/choice = href_list["econ_panel"]
EconomyPanel(choice, href_list)
@@ -4595,3 +4596,189 @@
error_viewer.show_to(owner, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
else
error_viewer.show_to(owner, null, href_list["viewruntime_linear"])
+
+ // ----- Religion and stuff
+ if (href_list["religions"])
+ #define MAX_MSG_LENGTH 200
+ #define NUMBER_MAX_REL 4
+ if (href_list["display"])
+ updateRelWindow()
+
+ switch (href_list["religions"])
+ if ("global_subtle_pm")
+ if (!href_list["rel"])
+ return FALSE
+
+ var/datum/religion/R = locate(href_list["rel"])
+
+ if (!istype(R, /datum/religion))
+ return FALSE
+
+ var/deity = sanitize(stripped_input(usr, "Which deity addresses this group of believers?", "Deity Name", R.deity_name), 1, MAX_NAME_LEN)
+ var/message = sanitize(stripped_input(usr, "Which message do you want to send?", "Message", ""), 1, MAX_MSG_LENGTH)
+
+ if (!deity || !message)
+ to_chat(usr, "Error: no deity or message selected.")
+
+ for (var/datum/mind/M in R.adepts)
+ to_chat(M.current, "You hear [deity]'s voice in your head... [message]")
+
+ var/msg = "[key_name(usr)] sent message [message] to [R.name]'s adepts as [deity]"
+ message_admins(msg)
+
+
+ if ("new") // --- Busing in a new rel ---
+ // This is copypasted from chaplain code, with adaptations
+
+ if (ticker.religions.len >= NUMBER_MAX_REL)
+ to_chat(usr, "Maximum number of religions reached.")
+ return FALSE // Just in case a href exploit allows someone to create a gazillion religions with no purpose.
+
+ var/new_religion = sanitize(stripped_input(usr, "Enter the key to the new religion (leave empty to abort)", "New religion", "Adminbus"), 0, MAX_NAME_LEN)
+
+ if (!new_religion)
+ return FALSE
+
+ var/datum/religion/rel_added
+
+ var/choice = FALSE
+ for (var/R in typesof(/datum/religion))
+ rel_added = new R
+ for (var/key in rel_added.keys)
+ if (lowertext(new_religion) == key)
+ rel_added.holy_book = new rel_added.bible_type
+ rel_added.holy_book.name = rel_added.bible_name
+ rel_added.holy_book.my_rel = rel_added
+ choice = TRUE
+ break // Religion found - time to abort
+ if (choice)
+ break
+
+ if (!choice) // No religion found
+ rel_added = new /datum/religion
+ rel_added.name = "[new_religion]"
+ rel_added.deity_name = "[new_religion]"
+ rel_added.bible_name = "The Holy Book of [new_religion]"
+ rel_added.holy_book = new rel_added.bible_type
+ rel_added.holy_book.name = rel_added.bible_name
+ rel_added.holy_book.my_rel = rel_added
+
+ var/new_deity = copytext(sanitize(input(usr, "Would you like to change the deity? The deity currently is [rel_added.deity_name] (Leave empty or unchanged to keep deity name)", "Name of Deity", rel_added.deity_name)), 1, MAX_NAME_LEN)
+ if(length(new_deity))
+ rel_added.deity_name = new_deity
+
+ // Bible chosing - without preview this time
+ chooseBible(rel_added, usr)
+
+ var/msg = "[key_name(usr)] created a religion: [rel_added.name]."
+ message_admins(msg)
+
+ ticker.religions += rel_added
+ updateRelWindow()
+ if ("delete")
+ if (!href_list["rel"])
+ return FALSE
+
+ var/datum/religion/R = locate(href_list["rel"])
+
+ if (!istype(R, /datum/religion))
+ return FALSE
+
+ if (R.adepts.len)
+ to_chat(usr, "You can't delete a religion which has adepts.")
+ return FALSE
+
+ var/msg = "[key_name(usr)] deleted a religion: [R.name]."
+ ticker.religions -= R
+ qdel(R.holy_book)
+ qdel(R)
+ message_admins(msg)
+ updateRelWindow()
+
+ if ("activate")
+ if (!href_list["rel"])
+ return FALSE
+
+ var/datum/religion/R = locate(href_list["rel"])
+
+ if (!istype(R, /datum/religion))
+ return FALSE
+
+ if (R.adepts.len)
+ to_chat(usr, "The religion already has adepts!")
+ return FALSE
+
+ if (alert("Do you wish to activate this religion? You will have to pick a player as its guide. Make sure the player is aware your plans!", "Activating a religion", "Yes", "No") != "Yes")
+ return FALSE
+
+ var/list/mob/moblist = list()
+
+ for (var/client/c in clients)
+ if (!c.mob.isDead() && !c.mob.mind.faith) // Can't use dead guys, nor people with already a religion
+ moblist += c.mob
+
+ var/mob/living/carbon/human/preacher = input(usr, "Who should be the leader of this new religion?", "Activating a religion") as null|anything in moblist
+
+ if (alert("Do you want to make \the [preacher] the leader of [R.name] ?", "Activating a religion", "Yes", "No") != "Yes")
+ return FALSE
+
+ if (!preacher)
+ to_chat(world, "No mob selected.")
+ return FALSE
+
+ if (!preacher.mind)
+ to_chat(usr, "This mob has no mind.")
+ return FALSE
+
+ if (preacher.mind.faith)
+ to_chat(usr, "This person already follows a religion.")
+ return FALSE
+
+ R.activate(preacher)
+ var/msg = "[key_name(usr)] activated religion [R.name], with preacher [key_name(preacher)]."
+ message_admins(msg)
+ updateRelWindow()
+
+ if ("renounce")
+ if (!href_list["mob"])
+ return FALSE
+
+ var/mob/living/M = locate(href_list["mob"])
+
+ if (!isliving(M) || !M.mind.faith)
+ return FALSE
+
+ if (M.mind.faith.religiousLeader == M.mind)
+ var/choice = alert("This mob is the leader of the religion. Are you sure you wish to remove him from his faith?", "Removing religion", "Yes", "No")
+ if (choice != "Yes")
+ return FALSE
+ M.mind.faith.action_renounce.Remove(M)
+ M.mind.faith.renounce(M) // Bypass checks
+
+ var/msg = "[key_name(usr)] removed [key_name(M)] from his religion."
+ message_admins(msg)
+ updateRelWindow()
+
+/datum/admins/proc/updateRelWindow()
+ var/text = list()
+ text += "Religions in game
"
+ // --- Displaying of all religions ---
+ for (var/datum/religion/R in ticker.religions)
+ text += "Name: [R.name]
"
+ text += "Deity name: [R.deity_name]
"
+ if (!R.adepts.len) // Religion not activated yet
+ text += "No adepts yet. "
+ text += "(Delete) "
+ text += "(Activate)
"
+ text += "
"
+ else
+ text += "Leader: \the [R.religiousLeader.current] (VV) (JMP) \
+ (SM)
"
+ text += "Adepts: "
+ for (var/datum/mind/M in R.adepts)
+ text += "- [M.name] (VV) (JMP) \
+ (SM) (Deconvert)
"
+ text +="
"
+ text += "Subtle PM all believers
"
+ text += "Bus in a new religion
"
+ usr << browse(jointext(text, ""), "window=admin2;size=300x370")
\ No newline at end of file
diff --git a/code/modules/library/computers/checkout.dm b/code/modules/library/computers/checkout.dm
index 1523bf0a5c9..0a7b3bda248 100644
--- a/code/modules/library/computers/checkout.dm
+++ b/code/modules/library/computers/checkout.dm
@@ -319,7 +319,7 @@
B.icon_state = ticker.Bible_icon_state
B.item_state = ticker.Bible_item_state
B.name = ticker.Bible_name
- B.deity_name = ticker.Bible_deity_name
+ B.my_rel.deity_name = ticker.Bible_deity_name
bibledelay = 1
spawn(60)
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index de39e1f95ae..da1bd98e0e8 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -723,7 +723,7 @@
var/obj/item/weapon/storage/bible/B = locate(/obj/item/weapon/storage/bible) in src.loc
if(B)
if(iscult(src))
- to_chat(src, "Nar-Sie shields you from [B.deity_name]'s wrath!")
+ to_chat(src, "Nar-Sie shields you from [B.my_rel.deity_name]'s wrath!")
else
if(istype(src.head, /obj/item/clothing/head/fedora))
to_chat(src, "You feel incredibly enlightened after farting on [B]!")
@@ -734,13 +734,13 @@
if(prob(80)) //20% chance to escape God's justice
spawn(rand(10,30))
if(src && B)
- src.show_message("[B.deity_name] says, \"Thou hast angered me, mortal!\"",2)
+ src.show_message("[B.my_rel.deity_name] says, \"Thou hast angered me, mortal!\"",2)
sleep(10)
if(src && B)
- to_chat(src, "You were disintegrated by [B.deity_name]'s bolt of lightning.")
- src.attack_log += text("\[[time_stamp()]\] Farted on a bible and suffered [B.deity_name]'s wrath.")
+ to_chat(src, "You were disintegrated by [B.my_rel.deity_name]'s bolt of lightning.")
+ src.attack_log += text("\[[time_stamp()]\] Farted on a bible and suffered [B.my_rel.deity_name]'s wrath.")
explosion(get_turf(src),-1,-1,1,5) //Tiny explosion with flash
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 96884a52d41..183bc2a5477 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -238,6 +238,11 @@
else if(!client)
msg += "[t_He] [t_has] a vacant, braindead stare...\n"
+ // Religions
+ if (user.mind && user.mind.faith && user.mind.faith.isReligiousLeader(user))
+ if (src.mind.faith == user.mind.faith)
+ msg += "You recognise [t_him] as a follower of [user.mind.faith.name].
"
+
var/list/wound_flavor_text = list()
var/list/is_destroyed = list()
var/list/is_bleeding = list()
diff --git a/code/modules/mob/living/simple_animal/hostile/necro.dm b/code/modules/mob/living/simple_animal/hostile/necro.dm
index 092c1417031..f29b308a958 100644
--- a/code/modules/mob/living/simple_animal/hostile/necro.dm
+++ b/code/modules/mob/living/simple_animal/hostile/necro.dm
@@ -473,7 +473,7 @@
if(stat == DEAD) //Can only attempt to unzombify if they're dead
if(istype (W, /obj/item/weapon/storage/bible)) //This calls for divine intervention
var/obj/item/weapon/storage/bible/bible = W
- user.visible_message("\The [user] begins whacking at [src] repeatedly with a bible for some reason.", "You attempt to invoke the power of [bible.deity_name] to bring this poor soul back from the brink.")
+ user.visible_message("\The [user] begins whacking at [src] repeatedly with a bible for some reason.", "You attempt to invoke the power of [bible.my_rel.deity_name] to bring this poor soul back from the brink.")
var/chaplain = 0 //Are we the Chaplain ? Used for simplification
if(user.mind && (user.mind.assigned_role == "Chaplain"))
@@ -482,7 +482,7 @@
if(do_after(user, src, 25)) //So there's a nice delay
if(!chaplain)
if(prob(5)) //Let's be generous, they'll only get one regen for this
- to_chat (user, "By [bible.deity_name] it's working!.")
+ to_chat (user, "By [bible.my_rel.deity_name] it's working!.")
unzombify()
else
to_chat (user, "Well, that didn't work.")
@@ -500,7 +500,7 @@
holy_modifier += 1
if(prob(15*holy_modifier)) //Gotta have faith
- to_chat (user, "By [bible.deity_name] it's working!.")
+ to_chat (user, "By [bible.my_rel.deity_name] it's working!.")
unzombify()
else
to_chat (user, "Well, that didn't work.")
diff --git a/maps/RandomZLevels/stationCollision.dm b/maps/RandomZLevels/stationCollision.dm
index ab34b3b4ab5..9f764d73f4e 100644
--- a/maps/RandomZLevels/stationCollision.dm
+++ b/maps/RandomZLevels/stationCollision.dm
@@ -49,7 +49,7 @@
/obj/effect/landmark/sc_bible_spawner/New()
var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible/booze(src.loc)
B.name = "The Holy book of the Geometer"
- B.deity_name = "Narsie"
+ B.my_rel = new /datum/religion/cult
B.icon_state = "melted"
B.item_state = "melted"
new /obj/item/weapon/paper/sc_safehint_paper_bible(B)