Merge pull request #13035 from lm40/nogods

localizes religion and adds custom chaplain titles
This commit is contained in:
Casey
2022-06-04 12:37:48 -04:00
committed by CHOMPStation2
parent ee099334c3
commit f958518ea9
6 changed files with 73 additions and 58 deletions

View File

@@ -1,8 +0,0 @@
// All religion stuff
GLOBAL_VAR(religion)
GLOBAL_VAR(deity)
//bible
GLOBAL_VAR(bible_name)
GLOBAL_VAR(bible_icon_state)
GLOBAL_VAR(bible_item_state)

View File

@@ -75,6 +75,8 @@
//used to store what traits the player had picked out in their preferences before joining, in text form.
var/list/traits = list()
var/datum/religion/my_religion
/datum/mind/New(var/key)
src.key = key
purchase_log = list()
@@ -571,4 +573,4 @@
/mob/living/simple_mob/construct/juggernaut/mind_initialize()
. = ..()
mind.assigned_role = "Juggernaut"
mind.special_role = "Cultist"
mind.special_role = "Cultist"

View File

@@ -29,20 +29,14 @@
return
var/obj/item/weapon/storage/bible/B = locate(/obj/item/weapon/storage/bible) in H
if(!B)
var/obj/item/weapon/card/id/I = locate(/obj/item/weapon/card/id) in H
if(!B || !I)
return
if(GLOB.religion)
B.deity_name = GLOB.deity
B.name = GLOB.bible_name
B.icon_state = GLOB.bible_icon_state
B.item_state = GLOB.bible_item_state
to_chat(H, "<span class='boldnotice'>There is already an established religion onboard the station. You are an acolyte of [GLOB.deity]. Defer to the [title].</span>")
return
INVOKE_ASYNC(src, .proc/religion_prompts, H, B)
INVOKE_ASYNC(src, .proc/religion_prompts, H, B, I)
/datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/weapon/storage/bible/B)
/datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/weapon/storage/bible/B, obj/item/weapon/card/id/I)
var/religion_name = "Unitarianism"
var/new_religion = sanitize(input(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name), MAX_NAME_LEN)
if(!new_religion)
@@ -83,18 +77,48 @@
B.name = "Guru Granth Sahib"
else
B.name = "The Holy Book of [new_religion]"
feedback_set_details("religion_name","[new_religion]")
var/deity_name = "Hashem"
var/new_deity = sanitize(input(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name), MAX_NAME_LEN)
if((length(new_deity) == 0) || (new_deity == "Hashem"))
new_deity = deity_name
B.deity_name = new_deity
GLOB.religion = new_religion
GLOB.bible_name = B.name
GLOB.deity = B.deity_name
feedback_set_details("religion_deity","[new_deity]")
var/new_title = sanitize(input(H, "Would you like to change your title?", "Title Change", I.assignment), MAX_NAME_LEN)
var/list/all_jobs = get_job_datums()
// Are they trying to fake an actual existent job
var/faking_job = FALSE
for (var/datum/job/J in all_jobs)
if (J.title == new_title || (new_title in get_alternate_titles(J.title)))
faking_job = TRUE
if (length(new_title) != 0 && !faking_job)
I.assignment = new_title
H.mind.my_religion = new /datum/religion(new_religion, new_deity, B.name, "bible", "bible", new_title)
B.deity_name = H.mind.my_religion.deity
I.assignment = H.mind.my_religion.title
I.name = text("[I.registered_name]'s ID Card ([I.assignment])")
data_core.manifest_modify(I.registered_name, I.assignment, I.rank)
/datum/religion
var/religion = "Unitarianism"
var/deity = "Hashem"
var/bible_name = "Bible"
var/bible_icon_state = "bible"
var/bible_item_state = "bible"
var/title = "Chaplain"
var/configured = FALSE
/datum/religion/New(var/r, var/d, var/bn, var/bis, var/bits, var/t)
. = ..()
religion = r
deity = d
bible_name = bn
bible_icon_state = bis
bible_item_state = bits
title = t

View File

@@ -37,30 +37,35 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
drop_sound = 'sound/bureaucracy/bookclose.ogg'
/obj/item/weapon/storage/bible/attack_self(mob/living/carbon/human/user)
if(GLOB.bible_icon_state)
icon_state = GLOB.bible_icon_state
item_state = GLOB.bible_item_state
return FALSE
if(user?.mind?.assigned_role != "Chaplain")
return FALSE
var/list/skins = list()
for(var/i in 1 to GLOB.biblestates.len)
var/image/bible_image = image(icon = 'icons/obj/storage.dmi', icon_state = GLOB.biblestates[i])
skins += list("[GLOB.biblenames[i]]" = bible_image)
var/choice = show_radial_menu(user, src, skins, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 40, require_near = TRUE)
if(!choice)
if (!user.mind.my_religion)
return FALSE
var/bible_index = GLOB.biblenames.Find(choice)
if(!bible_index)
return FALSE
icon_state = GLOB.biblestates[bible_index]
item_state = GLOB.bibleitemstates[bible_index]
GLOB.bible_icon_state = icon_state
GLOB.bible_item_state = item_state
feedback_set_details("religion_book", "[choice]")
if (!user.mind.my_religion.configured)
var/list/skins = list()
for(var/i in 1 to GLOB.biblestates.len)
var/image/bible_image = image(icon = 'icons/obj/storage.dmi', icon_state = GLOB.biblestates[i])
skins += list("[GLOB.biblenames[i]]" = bible_image)
var/choice = show_radial_menu(user, src, skins, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 40, require_near = TRUE)
if(!choice)
return FALSE
var/bible_index = GLOB.biblenames.Find(choice)
if(!bible_index)
return FALSE
user.mind.my_religion.bible_icon_state = GLOB.biblestates[bible_index]
user.mind.my_religion.bible_item_state = GLOB.bibleitemstates[bible_index]
user.mind.my_religion.configured = TRUE
deity_name = user.mind.my_religion.deity
name = user.mind.my_religion.bible_name
icon_state = user.mind.my_religion.bible_icon_state
item_state = user.mind.my_religion.bible_item_state
to_chat(user, "<span class='notice'>You invoke [user.mind.my_religion.deity] and prepare a copy of [src].</span>")
/**
* Checks if we are allowed to interact with a radial menu
@@ -69,7 +74,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
* * user The mob interacting with the menu
*/
/obj/item/weapon/storage/bible/proc/check_menu(mob/living/carbon/human/user)
if(GLOB.bible_icon_state)
if(user.mind.my_religion.configured)
return FALSE
if(!istype(user))
return FALSE
@@ -107,4 +112,4 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (src.use_sound)
playsound(src, src.use_sound, 50, 1, -5)
..()
..()

View File

@@ -345,14 +345,7 @@
screenstate = 5
if("6")
if(!bibledelay)
var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible(src.loc)
if(GLOB.religion)
B.icon_state = GLOB.bible_icon_state
B.item_state = GLOB.bible_item_state
B.name = GLOB.bible_name
B.deity_name = GLOB.deity
new /obj/item/weapon/storage/bible(src.loc)
bibledelay = 1
spawn(60)
bibledelay = 0
@@ -574,4 +567,4 @@
b.icon_state = "book[rand(1,7)]"
qdel(O)
else
..()
..()

View File

@@ -118,7 +118,6 @@
#include "code\_global_vars\bitfields.dm"
#include "code\_global_vars\misc.dm"
#include "code\_global_vars\mobs.dm"
#include "code\_global_vars\religion.dm"
#include "code\_global_vars\sensitive.dm"
#include "code\_global_vars\traits.dm"
#include "code\_global_vars\typecache.dm"