mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 05:27:39 +01:00
localizes religion and adds custom chaplain titles
This commit is contained in:
@@ -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)
|
||||
..()
|
||||
..()
|
||||
Reference in New Issue
Block a user