mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
Fixes chaplains not being able to assign their deity/religion plus some minor refactor of the religion subsystem
This commit is contained in:
@@ -3,10 +3,8 @@ SUBSYSTEM_DEF(religion)
|
||||
init_order = 19
|
||||
flags = SS_NO_FIRE|SS_NO_INIT
|
||||
|
||||
var/bible_deity_name
|
||||
var/Bible_icon_state
|
||||
var/Bible_item_state
|
||||
var/Bible_name
|
||||
var/Bible_deity_name
|
||||
|
||||
var/holy_weapon
|
||||
var/religion
|
||||
var/deity
|
||||
var/bible_name
|
||||
var/list/bible_icons = list("icon_state", "item_state")
|
||||
var/holy_weapon_type
|
||||
@@ -15,37 +15,31 @@
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/nullrod/attack_self(mob/user)
|
||||
if(reskinned)
|
||||
return
|
||||
if(user.mind && (user.mind.isholy))
|
||||
if(user.mind && (user.mind.isholy) && !reskinned)
|
||||
reskin_holy_weapon(user)
|
||||
|
||||
/obj/item/weapon/nullrod/proc/reskin_holy_weapon(mob/M)
|
||||
if(SSreligion.holy_weapon_type)
|
||||
return
|
||||
var/obj/item/weapon/nullrod/holy_weapon
|
||||
var/list/holy_weapons_list = typesof(/obj/item/weapon/nullrod)
|
||||
var/list/display_names = list()
|
||||
for(var/V in holy_weapons_list)
|
||||
var/atom/A = V
|
||||
display_names += initial(A.name)
|
||||
|
||||
if(SSreligion.holy_weapon)
|
||||
holy_weapon = new SSreligion.holy_weapon
|
||||
to_chat(M, "<span class='notice'>The null rod suddenly morphs into your religions already chosen holy weapon.</span>")
|
||||
else
|
||||
var/list/holy_weapons_list = typesof(/obj/item/weapon/nullrod)
|
||||
var/list/display_names = list()
|
||||
for(var/V in holy_weapons_list)
|
||||
var/atom/A = V
|
||||
display_names += initial(A.name)
|
||||
var/choice = input(M,"What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
|
||||
if(QDELETED(src) || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || reskinned)
|
||||
return
|
||||
|
||||
var/choice = input(M,"What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
|
||||
if(!src || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || reskinned)
|
||||
return
|
||||
var/index = display_names.Find(choice)
|
||||
var/A = holy_weapons_list[index]
|
||||
|
||||
var/index = display_names.Find(choice)
|
||||
var/A = holy_weapons_list[index]
|
||||
holy_weapon = new A
|
||||
|
||||
holy_weapon = new A
|
||||
|
||||
SSreligion.holy_weapon = holy_weapon.type
|
||||
|
||||
feedback_set_details("chaplain_weapon","[choice]")
|
||||
SSreligion.holy_weapon_type = holy_weapon.type
|
||||
|
||||
feedback_set_details("chaplain_weapon","[choice]")
|
||||
|
||||
if(holy_weapon)
|
||||
holy_weapon.reskinned = TRUE
|
||||
|
||||
@@ -33,10 +33,9 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible",
|
||||
if(!istype(H))
|
||||
return
|
||||
// If H is the Chaplain, we can set the icon_state of the bible (but only once!)
|
||||
if(!SSreligion.Bible_icon_state && H.job == "Chaplain")
|
||||
if(!SSreligion.bible_icons["icon_state"] && H.job == "Chaplain")
|
||||
var/dat = "<html><head><title>Pick Bible Style</title></head><body><center><h2>Pick a bible style</h2></center><table>"
|
||||
var/i
|
||||
for(i = 1, i < biblestates.len, i++)
|
||||
for(var/i in 1 to biblestates.len)
|
||||
var/icon/bibleicon = icon('icons/obj/storage.dmi', biblestates[i])
|
||||
var/nicename = biblenames[i]
|
||||
H << browse_rsc(bibleicon, nicename)
|
||||
@@ -47,7 +46,7 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible",
|
||||
/obj/item/weapon/storage/book/bible/Topic(href, href_list)
|
||||
if(!usr.canUseTopic(src))
|
||||
return
|
||||
if(href_list["seticon"] && SSticker && !SSreligion.Bible_icon_state)
|
||||
if(href_list["seticon"] && SSreligion && !SSreligion.bible_icons["icon_state"])
|
||||
var/iconi = text2num(href_list["seticon"])
|
||||
var/biblename = biblenames[iconi]
|
||||
var/obj/item/weapon/storage/book/bible/B = locate(href_list["src"])
|
||||
@@ -59,8 +58,8 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible",
|
||||
H.dna.add_mutation(CLOWNMUT)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(H), slot_wear_mask)
|
||||
|
||||
SSreligion.Bible_icon_state = B.icon_state
|
||||
SSreligion.Bible_item_state = B.item_state
|
||||
SSreligion.bible_icons["icon_state"] = B.icon_state
|
||||
SSreligion.bible_icons["item_state"] = B.item_state
|
||||
|
||||
feedback_set_details("religion_book","[biblename]")
|
||||
usr << browse(null, "window=editicon")
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
cross = image('icons/obj/storage.dmi',"kingyellow")
|
||||
font_color = "blue"
|
||||
prayer_type = "CHAPLAIN PRAYER"
|
||||
if(SSreligion.Bible_deity_name)
|
||||
deity = SSreligion.Bible_deity_name
|
||||
if(SSreligion.deity)
|
||||
deity = SSreligion.deity
|
||||
else if(iscultist(usr))
|
||||
cross = image('icons/obj/storage.dmi',"tome")
|
||||
font_color = "red"
|
||||
|
||||
@@ -18,42 +18,33 @@ Chaplain
|
||||
access = list(access_morgue, access_chapel_office, access_crematorium, access_theatre)
|
||||
minimal_access = list(access_morgue, access_chapel_office, access_crematorium, access_theatre)
|
||||
|
||||
/datum/outfit/job/chaplain
|
||||
name = "Chaplain"
|
||||
jobtype = /datum/job/chaplain
|
||||
/datum/job/chaplain/after_spawn(mob/living/H, mob/M)
|
||||
if(M.mind)
|
||||
M.mind.isholy = TRUE
|
||||
|
||||
belt = /obj/item/device/pda/chaplain
|
||||
uniform = /obj/item/clothing/under/rank/chaplain
|
||||
backpack_contents = list(/obj/item/device/camera/spooky = 1)
|
||||
backpack = /obj/item/weapon/storage/backpack/cultpack
|
||||
satchel = /obj/item/weapon/storage/backpack/cultpack
|
||||
var/obj/item/weapon/storage/book/bible/booze/B = new
|
||||
|
||||
|
||||
/datum/outfit/job/chaplain/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
..()
|
||||
|
||||
if(visualsOnly)
|
||||
return
|
||||
|
||||
if(H.mind)
|
||||
H.mind.isholy = TRUE
|
||||
|
||||
var/obj/item/weapon/storage/book/bible/B = new /obj/item/weapon/storage/book/bible/booze(H)
|
||||
|
||||
if(SSreligion.Bible_deity_name)
|
||||
B.deity_name = SSreligion.Bible_deity_name
|
||||
B.name = SSreligion.Bible_name
|
||||
B.icon_state = SSreligion.Bible_icon_state
|
||||
B.item_state = SSreligion.Bible_item_state
|
||||
to_chat(H, "There is already an established religion onboard the station. You are an acolyte of [SSreligion.Bible_deity_name]. Defer to the Chaplain.")
|
||||
if(SSreligion.religion)
|
||||
B.deity_name = SSreligion.deity
|
||||
B.name = SSreligion.bible_name
|
||||
B.icon_state = SSreligion.bible_icons["icon_state"]
|
||||
B.item_state = SSreligion.bible_icons["item_state"]
|
||||
to_chat(H, "There is already an established religion onboard the station. You are an acolyte of [SSreligion.deity]. Defer to the Chaplain.")
|
||||
H.equip_to_slot_or_del(B, slot_in_backpack)
|
||||
var/obj/item/weapon/nullrod/N = new(H)
|
||||
var/obj/item/weapon/nullrod/N = new SSreligion.holy_weapon_type(H)
|
||||
H.equip_to_slot_or_del(N, slot_in_backpack)
|
||||
return
|
||||
|
||||
var/new_religion = "Christianity"
|
||||
if(H.client && H.client.prefs.custom_names["religion"])
|
||||
new_religion = H.client.prefs.custom_names["religion"]
|
||||
if(M.client && M.client.prefs.custom_names["religion"])
|
||||
new_religion = M.client.prefs.custom_names["religion"]
|
||||
|
||||
var/new_deity = "Space Jesus"
|
||||
if(M.client && M.client.prefs.custom_names["deity"])
|
||||
new_deity = M.client.prefs.custom_names["deity"]
|
||||
|
||||
B.deity_name = new_deity
|
||||
|
||||
|
||||
switch(lowertext(new_religion))
|
||||
if("christianity")
|
||||
@@ -81,14 +72,24 @@ Chaplain
|
||||
B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition")
|
||||
else
|
||||
B.name = "The Holy Book of [new_religion]"
|
||||
feedback_set_details("religion_name","[new_religion]")
|
||||
SSreligion.Bible_name = B.name
|
||||
|
||||
var/new_deity = "Space Jesus"
|
||||
if(H.client && H.client.prefs.custom_names["deity"])
|
||||
new_deity = H.client.prefs.custom_names["deity"]
|
||||
B.deity_name = new_deity
|
||||
|
||||
SSreligion.Bible_deity_name = B.deity_name
|
||||
feedback_set_details("religion_deity","[new_deity]")
|
||||
if(SSreligion)
|
||||
SSreligion.religion = new_religion
|
||||
SSreligion.bible_name = B.name
|
||||
SSreligion.deity = B.deity_name
|
||||
|
||||
H.equip_to_slot_or_del(B, slot_in_backpack)
|
||||
|
||||
feedback_set_details("religion_name","[new_religion]")
|
||||
feedback_set_details("religion_deity","[new_deity]")
|
||||
|
||||
/datum/outfit/job/chaplain
|
||||
name = "Chaplain"
|
||||
jobtype = /datum/job/chaplain
|
||||
|
||||
belt = /obj/item/device/pda/chaplain
|
||||
uniform = /obj/item/clothing/under/rank/chaplain
|
||||
backpack_contents = list(/obj/item/device/camera/spooky = 1)
|
||||
backpack = /obj/item/weapon/storage/backpack/cultpack
|
||||
satchel = /obj/item/weapon/storage/backpack/cultpack
|
||||
@@ -474,11 +474,11 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums
|
||||
if(href_list["printbible"])
|
||||
if(cooldown < world.time)
|
||||
var/obj/item/weapon/storage/book/bible/B = new /obj/item/weapon/storage/book/bible(src.loc)
|
||||
if(SSreligion.Bible_icon_state && SSreligion.Bible_item_state)
|
||||
B.icon_state = SSreligion.Bible_icon_state
|
||||
B.item_state = SSreligion.Bible_item_state
|
||||
B.name = SSreligion.Bible_name
|
||||
B.deity_name = SSreligion.Bible_deity_name
|
||||
if(SSreligion.bible_icons["icon_state"] && SSreligion.bible_icons["item_state"])
|
||||
B.icon_state = SSreligion.bible_icons["icon_state"]
|
||||
B.item_state = SSreligion.bible_icons["item_state"]
|
||||
B.name = SSreligion.bible_name
|
||||
B.deity_name = SSreligion.deity
|
||||
cooldown = world.time + PRINTER_COOLDOWN
|
||||
else
|
||||
say("Printer currently unavailable, please wait a moment.")
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
strengthdiv = 8
|
||||
for(var/mob/living/simple_animal/revenant/R in get_hearers_in_view(7,get_turf(holder.my_atom)))
|
||||
var/deity
|
||||
if(SSreligion.Bible_deity_name)
|
||||
deity = SSreligion.Bible_deity_name
|
||||
if(SSreligion.deity)
|
||||
deity = SSreligion.deity
|
||||
else
|
||||
deity = "Christ"
|
||||
to_chat(R, "<span class='userdanger'>The power of [deity] compels you!</span>")
|
||||
|
||||
Reference in New Issue
Block a user