mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-26 01:53:02 +00:00
Merge pull request #13035 from lm40/nogods
localizes religion and adds custom chaplain titles
This commit is contained in:
@@ -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)
|
|
||||||
@@ -75,6 +75,8 @@
|
|||||||
//used to store what traits the player had picked out in their preferences before joining, in text form.
|
//used to store what traits the player had picked out in their preferences before joining, in text form.
|
||||||
var/list/traits = list()
|
var/list/traits = list()
|
||||||
|
|
||||||
|
var/datum/religion/my_religion
|
||||||
|
|
||||||
/datum/mind/New(var/key)
|
/datum/mind/New(var/key)
|
||||||
src.key = key
|
src.key = key
|
||||||
purchase_log = list()
|
purchase_log = list()
|
||||||
|
|||||||
@@ -29,20 +29,14 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
var/obj/item/weapon/storage/bible/B = locate(/obj/item/weapon/storage/bible) in H
|
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
|
return
|
||||||
|
|
||||||
if(GLOB.religion)
|
INVOKE_ASYNC(src, .proc/religion_prompts, H, B, I)
|
||||||
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)
|
/datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/weapon/storage/bible/B, obj/item/weapon/card/id/I)
|
||||||
|
|
||||||
/datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/weapon/storage/bible/B)
|
|
||||||
var/religion_name = "Unitarianism"
|
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)
|
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)
|
if(!new_religion)
|
||||||
@@ -83,18 +77,48 @@
|
|||||||
B.name = "Guru Granth Sahib"
|
B.name = "Guru Granth Sahib"
|
||||||
else
|
else
|
||||||
B.name = "The Holy Book of [new_religion]"
|
B.name = "The Holy Book of [new_religion]"
|
||||||
feedback_set_details("religion_name","[new_religion]")
|
|
||||||
|
|
||||||
var/deity_name = "Hashem"
|
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)
|
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"))
|
if((length(new_deity) == 0) || (new_deity == "Hashem"))
|
||||||
new_deity = deity_name
|
new_deity = deity_name
|
||||||
B.deity_name = new_deity
|
|
||||||
|
|
||||||
GLOB.religion = new_religion
|
var/new_title = sanitize(input(H, "Would you like to change your title?", "Title Change", I.assignment), MAX_NAME_LEN)
|
||||||
GLOB.bible_name = B.name
|
|
||||||
GLOB.deity = B.deity_name
|
|
||||||
feedback_set_details("religion_deity","[new_deity]")
|
|
||||||
|
|
||||||
|
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
|
||||||
@@ -37,13 +37,14 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
|
|||||||
drop_sound = 'sound/bureaucracy/bookclose.ogg'
|
drop_sound = 'sound/bureaucracy/bookclose.ogg'
|
||||||
|
|
||||||
/obj/item/weapon/storage/bible/attack_self(mob/living/carbon/human/user)
|
/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")
|
if(user?.mind?.assigned_role != "Chaplain")
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
|
if (!user.mind.my_religion)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
if (!user.mind.my_religion.configured)
|
||||||
var/list/skins = list()
|
var/list/skins = list()
|
||||||
for(var/i in 1 to GLOB.biblestates.len)
|
for(var/i in 1 to GLOB.biblestates.len)
|
||||||
var/image/bible_image = image(icon = 'icons/obj/storage.dmi', icon_state = GLOB.biblestates[i])
|
var/image/bible_image = image(icon = 'icons/obj/storage.dmi', icon_state = GLOB.biblestates[i])
|
||||||
@@ -55,12 +56,16 @@ GLOBAL_LIST_INIT(bibleitemstates, list(
|
|||||||
var/bible_index = GLOB.biblenames.Find(choice)
|
var/bible_index = GLOB.biblenames.Find(choice)
|
||||||
if(!bible_index)
|
if(!bible_index)
|
||||||
return FALSE
|
return FALSE
|
||||||
icon_state = GLOB.biblestates[bible_index]
|
|
||||||
item_state = GLOB.bibleitemstates[bible_index]
|
|
||||||
|
|
||||||
GLOB.bible_icon_state = icon_state
|
user.mind.my_religion.bible_icon_state = GLOB.biblestates[bible_index]
|
||||||
GLOB.bible_item_state = item_state
|
user.mind.my_religion.bible_item_state = GLOB.bibleitemstates[bible_index]
|
||||||
feedback_set_details("religion_book", "[choice]")
|
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
|
* 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
|
* * user The mob interacting with the menu
|
||||||
*/
|
*/
|
||||||
/obj/item/weapon/storage/bible/proc/check_menu(mob/living/carbon/human/user)
|
/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
|
return FALSE
|
||||||
if(!istype(user))
|
if(!istype(user))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|||||||
@@ -345,14 +345,7 @@
|
|||||||
screenstate = 5
|
screenstate = 5
|
||||||
if("6")
|
if("6")
|
||||||
if(!bibledelay)
|
if(!bibledelay)
|
||||||
|
new /obj/item/weapon/storage/bible(src.loc)
|
||||||
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
|
|
||||||
|
|
||||||
bibledelay = 1
|
bibledelay = 1
|
||||||
spawn(60)
|
spawn(60)
|
||||||
bibledelay = 0
|
bibledelay = 0
|
||||||
|
|||||||
@@ -118,7 +118,6 @@
|
|||||||
#include "code\_global_vars\bitfields.dm"
|
#include "code\_global_vars\bitfields.dm"
|
||||||
#include "code\_global_vars\misc.dm"
|
#include "code\_global_vars\misc.dm"
|
||||||
#include "code\_global_vars\mobs.dm"
|
#include "code\_global_vars\mobs.dm"
|
||||||
#include "code\_global_vars\religion.dm"
|
|
||||||
#include "code\_global_vars\sensitive.dm"
|
#include "code\_global_vars\sensitive.dm"
|
||||||
#include "code\_global_vars\traits.dm"
|
#include "code\_global_vars\traits.dm"
|
||||||
#include "code\_global_vars\typecache.dm"
|
#include "code\_global_vars\typecache.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user