From 72b7a266b33a128d25398dbf4fa9c653dc516bc6 Mon Sep 17 00:00:00 2001 From: moo <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> Date: Thu, 5 Mar 2020 22:11:52 -0500 Subject: [PATCH] Adds Religious Sects and Basic Technophile Sect for Proof of Concept (#49434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * このコミットの中が未来です * Adds Rites * :computer: * remove bible global * last minute code changes :smirk: * review brah * waaa_fb * :church: Review stuff, Doc stuff, You can now coax a user to the platform for !!FUN!! * Update code/modules/religion/religion_sects.dm Co-authored-by: spookydonut --- code/__DEFINES/misc.dm | 9 + code/_globalvars/misc.dm | 9 - code/_globalvars/religion.dm | 14 ++ code/datums/mind.dm | 2 +- code/game/gamemodes/cult/cult.dm | 2 +- code/game/objects/items/holy_weapons.dm | 6 +- code/game/objects/items/storage/book.dm | 19 +- code/modules/antagonists/ert/ert.dm | 8 +- code/modules/jobs/job_types/chaplain.dm | 8 +- .../mob/living/carbon/human/examine.dm | 2 +- .../chemistry/reagents/alcohol_reagents.dm | 2 +- code/modules/religion/religion_sects.dm | 195 ++++++++++++++++++ code/modules/religion/religion_structures.dm | 114 ++++++++++ code/modules/religion/rites.dm | 77 +++++++ tgstation.dme | 4 + 15 files changed, 442 insertions(+), 29 deletions(-) create mode 100644 code/_globalvars/religion.dm create mode 100644 code/modules/religion/religion_sects.dm create mode 100644 code/modules/religion/religion_structures.dm create mode 100644 code/modules/religion/rites.dm diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 0160aecb034..18b97ffdae5 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -471,3 +471,12 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) #define FALL_INTERCEPTED (1<<0) //Stops the movable from falling further and crashing on the ground #define FALL_NO_MESSAGE (1<<1) //Used to suppress the "[A] falls through [old_turf]" messages where it'd make little sense at all, like going downstairs. #define FALL_STOP_INTERCEPTING (1<<2) //Used in situations where halting the whole "intercept" loop would be better, like supermatter dusting (and thus deleting) the atom. + +//Religion + +#define HOLY_ROLE_PRIEST 1 //default priestly role +#define HOLY_ROLE_HIGHPRIEST 2 //the one who designates the religion + +#define ALIGNMENT_GOOD "good" +#define ALIGNMENT_NEUT "neutral" +#define ALIGNMENT_EVIL "evil" diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 0b5fa4842da..3efda260b62 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -16,12 +16,3 @@ GLOBAL_LIST_EMPTY(powernets) GLOBAL_VAR_INIT(bsa_unlock, FALSE) //BSA unlocked by head ID swipes GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details - -// All religion stuff -GLOBAL_VAR(religion) -GLOBAL_VAR(deity) -GLOBAL_VAR(bible_name) -GLOBAL_VAR(bible_icon_state) -GLOBAL_VAR(bible_item_state) -GLOBAL_VAR(holy_weapon_type) -GLOBAL_VAR(holy_armor_type) diff --git a/code/_globalvars/religion.dm b/code/_globalvars/religion.dm new file mode 100644 index 00000000000..4eb08d43849 --- /dev/null +++ b/code/_globalvars/religion.dm @@ -0,0 +1,14 @@ +// All religion stuff +GLOBAL_VAR(religion) +GLOBAL_VAR(deity) +GLOBAL_DATUM(religious_sect, /datum/religion_sect) +GLOBAL_VAR(favor) + +//bible +GLOBAL_VAR(bible_name) +GLOBAL_VAR(bible_icon_state) +GLOBAL_VAR(bible_item_state) + +//gear +GLOBAL_VAR(holy_weapon_type) +GLOBAL_VAR(holy_armor_type) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index f6fc597446c..fda13db0152 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -54,7 +54,7 @@ var/damnation_type = 0 var/datum/mind/soulOwner //who owns the soul. Under normal circumstances, this will point to src var/hasSoul = TRUE // If false, renders the character unable to sell their soul. - var/isholy = FALSE //is this person a chaplain or admin role allowed to use bibles + var/holy_role = NONE //is this person a chaplain or admin role allowed to use bibles, Any rank besides 'NONE' allows for this. var/mob/living/enslaved_to //If this mind's master is another mob (i.e. adamantine golems) var/datum/language_holder/language_holder diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 9677b9f1205..519f4646fbd 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -16,7 +16,7 @@ if(!istype(M)) return FALSE if(M.mind) - if(ishuman(M) && (M.mind.isholy)) + if(ishuman(M) && (M.mind.holy_role)) return FALSE if(specific_cult && specific_cult.is_sacrifice_target(M.mind)) return FALSE diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index bd79c3dffc8..23f99f3b7e3 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -25,7 +25,7 @@ desc = "Contains a set of armaments for the chaplain." /obj/item/choice_beacon/holy/canUseBeacon(mob/living/user) - if(user.mind && user.mind.isholy) + if(user.mind && user.mind.holy_role) return ..() else playsound(src, 'sound/machines/buzz-sigh.ogg', 40, TRUE) @@ -213,7 +213,7 @@ return (BRUTELOSS|FIRELOSS) /obj/item/nullrod/attack_self(mob/user) - if(user.mind && (user.mind.isholy) && !reskinned) + if(user.mind && (user.mind.holy_role) && !reskinned) reskin_holy_weapon(user) /obj/item/nullrod/proc/reskin_holy_weapon(mob/M) @@ -607,7 +607,7 @@ /obj/item/nullrod/carp/attack_self(mob/living/user) if(used_blessing) - else if(user.mind && (user.mind.isholy)) + else if(user.mind && (user.mind.holy_role)) to_chat(user, "You are blessed by Carp-Sie. Wild space carp will no longer attack you.") user.faction |= "carp" used_blessing = TRUE diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index a469a198937..788f9c5c59d 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", if(!H.can_read(src)) return FALSE // If H is the Chaplain, we can set the icon_state of the bible (but only once!) - if(!GLOB.bible_icon_state && H.job == "Chaplain") + if(!GLOB.bible_icon_state && H.mind.holy_role == HOLY_ROLE_HIGHPRIEST) var/dat = "Pick Bible Style

Pick a bible style

" for(var/i in 1 to GLOB.biblestates.len) var/icon/bibleicon = icon('icons/obj/storage.dmi', GLOB.biblestates[i]) @@ -91,7 +91,12 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", SSblackbox.record_feedback("text", "religion_book", 1, "[biblename]") usr << browse(null, "window=editicon") -/obj/item/storage/book/bible/proc/bless(mob/living/carbon/human/H, mob/living/user) +/obj/item/storage/book/bible/proc/bless(mob/living/L, mob/living/user) + if(GLOB.religious_sect) + return GLOB.religious_sect.sect_bless(L,user) + if(!ishuman(L)) + return + var/mob/living/carbon/human/H = L for(var/X in H.bodyparts) var/obj/item/bodypart/BP = X if(BP.status == BODYPART_ROBOTIC) @@ -125,7 +130,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", return var/chaplain = 0 - if(user.mind && (user.mind.isholy)) + if(user.mind && (user.mind.holy_role)) chaplain = 1 if(!chaplain) @@ -143,7 +148,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", to_chat(user, "You can't heal yourself!") return - if(ishuman(M) && prob(60) && bless(M, user)) + if(prob(60) && bless(M, user)) smack = 0 else if(iscarbon(M)) var/mob/living/carbon/C = M @@ -167,10 +172,10 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", return if(isfloorturf(A)) to_chat(user, "You hit the floor with the bible.") - if(user.mind && (user.mind.isholy)) + if(user.mind && (user.mind.holy_role)) for(var/obj/effect/rune/R in orange(2,user)) R.invisibility = 0 - if(user.mind && (user.mind.isholy)) + if(user?.mind?.holy_role) if(A.reagents && A.reagents.has_reagent(/datum/reagent/water)) // blesses all the water in the holder to_chat(user, "You bless [A].") var/water2holy = A.reagents.get_reagent_amount(/datum/reagent/water) @@ -260,7 +265,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning", /obj/item/storage/book/bible/syndicate/attack_self(mob/living/carbon/human/H) if (uses) - H.mind.isholy = TRUE + H.mind.holy_role = HOLY_ROLE_PRIEST uses -= 1 to_chat(H, "You try to open the book AND IT BITES YOU!") playsound(src.loc, 'sound/effects/snap.ogg', 50, TRUE) diff --git a/code/modules/antagonists/ert/ert.dm b/code/modules/antagonists/ert/ert.dm index 6562d28e44c..5cb1647f645 100644 --- a/code/modules/antagonists/ert/ert.dm +++ b/code/modules/antagonists/ert/ert.dm @@ -80,14 +80,14 @@ /datum/antagonist/ert/medic/inquisitor/on_gain() . = ..() - owner.isholy = TRUE + owner.holy_role = HOLY_ROLE_PRIEST /datum/antagonist/ert/security/inquisitor outfit = /datum/outfit/centcom/ert/security/inquisitor /datum/antagonist/ert/security/inquisitor/on_gain() . = ..() - owner.isholy = TRUE + owner.holy_role = HOLY_ROLE_PRIEST /datum/antagonist/ert/chaplain role = "Chaplain" @@ -98,14 +98,14 @@ /datum/antagonist/ert/chaplain/on_gain() . = ..() - owner.isholy = TRUE + owner.holy_role = HOLY_ROLE_PRIEST /datum/antagonist/ert/commander/inquisitor outfit = /datum/outfit/centcom/ert/commander/inquisitor /datum/antagonist/ert/commander/inquisitor/on_gain() . = ..() - owner.isholy = TRUE + owner.holy_role = HOLY_ROLE_PRIEST /datum/antagonist/ert/janitor role = "Janitor" diff --git a/code/modules/jobs/job_types/chaplain.dm b/code/modules/jobs/job_types/chaplain.dm index ce02dfa818a..3f695bcf2b8 100644 --- a/code/modules/jobs/job_types/chaplain.dm +++ b/code/modules/jobs/job_types/chaplain.dm @@ -21,12 +21,12 @@ /datum/job/chaplain/after_spawn(mob/living/H, mob/M) . = ..() - if(H.mind) - H.mind.isholy = TRUE var/obj/item/storage/book/bible/booze/B = new if(GLOB.religion) + if(H.mind) + H.mind.holy_role = HOLY_ROLE_PRIEST B.deity_name = GLOB.deity B.name = GLOB.bible_name B.icon_state = GLOB.bible_icon_state @@ -36,7 +36,11 @@ var/nrt = GLOB.holy_weapon_type || /obj/item/nullrod var/obj/item/nullrod/N = new nrt(H) H.put_in_hands(N) + if(GLOB.religious_sect) + GLOB.religious_sect.on_conversion(H) return + if(H.mind) + H.mind.holy_role = HOLY_ROLE_HIGHPRIEST var/new_religion = DEFAULT_RELIGION if(M.client && M.client.prefs.custom_names["religion"]) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index baaf4549fee..fa946fabd8b 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -287,7 +287,7 @@ msg += "" - if(HAS_TRAIT(user, TRAIT_SPIRITUAL) && mind?.isholy) + if(HAS_TRAIT(user, TRAIT_SPIRITUAL) && mind?.holy_role) msg += "[t_He] [t_has] a holy aura about [t_him].\n" SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "religious_comfort", /datum/mood_event/religiously_comforted) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 4419a82514e..1fc9bd473e7 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -2137,7 +2137,7 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_desc = "boozy Catholicism in a glass." /datum/reagent/consumable/ethanol/trappist/on_mob_life(mob/living/carbon/M) - if(M.mind.isholy) + if(M.mind.holy_role) M.adjustFireLoss(-2.5, 0) M.jitteriness = max(0, M.jitteriness-1) M.stuttering = max(0, M.stuttering-1) diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm new file mode 100644 index 00000000000..12aba6dbc5b --- /dev/null +++ b/code/modules/religion/religion_sects.dm @@ -0,0 +1,195 @@ +/** + * # Religious Sects + * + * Religious Sects are a way to convert the fun of having an active 'god' (admin) to code-mechanics so you aren't having to press adminwho. + * + * Sects are not meant to overwrite the fun of choosing a custom god/religion, but meant to enhance it. + * The idea is that Space Jesus (or whoever you worship) can be an evil bloodgod who takes the lifeforce out of people, a nature lover, or all things righteous and good. You decide! + * + */ +/datum/religion_sect +/// Name of the religious sect + var/name = "Religious Sect Base Type" +/// Description of the religious sect, Presents itself in the selection menu (AKA be brief) + var/desc = "Oh My! What Do We Have Here?!!?!?!?" +/// Opening message when someone gets converted + var/convert_opener +/// holder for alignments. + var/alignment = ALIGNMENT_GOOD +/// Does this require something before being available as an option? + var/starter = TRUE +/// The Sect's 'Mana' + var/favor = 0 //MANA! +/// The max amount of favor the sect can have + var/max_favor = 1000 +/// The default value for an item that can be sacrificed + var/default_item_favor = 5 +/// Turns into 'desired_items_typecache', lists the types that can be sacrificed barring optional features in can_sacrifice() + var/list/desired_items +/// Autopopulated by `desired_items` + var/list/desired_items_typecache +/// Lists of rites by type. Converts itself into a list of rites with "name - desc (favor_cost)" = type + var/list/rites_list +/// Changes the Altar of Gods icon + var/altar_icon +/// Changes the Altar of Gods icon_state + var/altar_icon_state + +/datum/religion_sect/New() + if(desired_items) + desired_items_typecache = typecacheof(desired_items) + if(rites_list) + var/listylist = generate_rites_list() + rites_list = listylist + on_select() + +///Generates a list of rites with 'name' = 'type' +/datum/religion_sect/proc/generate_rites_list() + . = list() + for(var/i in rites_list) + if(!ispath(i)) + continue + var/datum/religion_rites/RI = i + var/name_entry = "[initial(RI.name)]" + if(initial(RI.desc)) + name_entry += " - [initial(RI.desc)]" + if(initial(RI.favor_cost)) + name_entry += " ([initial(RI.favor_cost)] favor)" + + . += list(name_entry = i) + +/// Activates once selected +/datum/religion_sect/proc/on_select() + +/// Activates once selected and on newjoins, oriented around people who become holy. +/datum/religion_sect/proc/on_conversion(mob/living/L) + to_chat(L, "[convert_opener] max_favor)) + . = (max_favor-favor) //if favor = 5 and we want to add 10 with a max of 10, we'll only be able to add 5 + favor = clamp(0,max_favor, favor+amount) + +/// Sets favor to a specific amount. Can provide optional features based on a user. +/datum/religion_sect/proc/set_favor(amount = 0, mob/living/L) + favor = clamp(0,max_favor,amount) + return favor + +/// Activates when an individual uses a rite. Can provide different/additional benefits depending on the user. +/datum/religion_sect/proc/on_riteuse(mob/living/user, obj/structure/altar_of_gods/AOG) + +/// Replaces the bible's bless mechanic. Return TRUE if you want to not do the brain hit. +/datum/religion_sect/proc/sect_bless(mob/living/L, mob/living/user) + if(!ishuman(L)) + return FALSE + var/mob/living/carbon/human/H = L + for(var/X in H.bodyparts) + var/obj/item/bodypart/BP = X + if(BP.status == BODYPART_ROBOTIC) + to_chat(user, "[GLOB.deity] refuses to heal this metallic taint!") + return TRUE + + var/heal_amt = 10 + var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1, null, BODYPART_ORGANIC) + + if(hurt_limbs.len) + for(var/X in hurt_limbs) + var/obj/item/bodypart/affecting = X + if(affecting.heal_damage(heal_amt, heal_amt, null, BODYPART_ORGANIC)) + H.update_damage_overlays() + H.visible_message("[user] heals [H] with the power of [GLOB.deity]!") + to_chat(H, "May the power of [GLOB.deity] compel you to be healed!") + playsound(user, "punch", 25, TRUE, -1) + SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing) + return TRUE + +/datum/religion_sect/puritanism + name = "Puritanism (Default)" + desc = "Nothing special." + convert_opener = "Your run-of-the-mill sect, there are no benefits or boons associated. Praise normalcy!" + +/datum/religion_sect/technophile + name = "Technophile" + desc = "A sect oriented around technology." + convert_opener = "May you find peace in a metal shell, acolyte.
Bibles now recharge cyborgs and heal robotic limbs if targeted, but they do not heal organic limbs. You can now sacrifice cells, with favor depending on their charge." + alignment = ALIGNMENT_NEUT + desired_items = list(/obj/item/stock_parts/cell) + rites_list = list(/datum/religion_rites/synthconversion) + altar_icon_state = "convertaltar-blue" + +/datum/religion_sect/technophile/sect_bless(mob/living/L, mob/living/user) + if(iscyborg(L)) + var/mob/living/silicon/robot/R = L + var/charge_amt = 50 + if(L.mind?.holy_role == HOLY_ROLE_HIGHPRIEST) + charge_amt *= 2 + R.cell?.charge += charge_amt + R.visible_message("[user] charges [R] with the power of [GLOB.deity]!") + to_chat(R, "You are charged by the power of [GLOB.deity]!") + SEND_SIGNAL(R, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing) + playsound(user, 'sound/effects/bang.ogg', 25, TRUE, -1) + return TRUE + if(!ishuman(L)) + return + var/mob/living/carbon/human/H = L + + //first we determine if we can charge them + var/did_we_charge = FALSE + var/obj/item/organ/stomach/ethereal/eth_stomach = H.getorganslot(ORGAN_SLOT_STOMACH) + if(istype(eth_stomach)) + eth_stomach.adjust_charge(3) + did_we_charge = TRUE + + //if we're not targetting a robot part we stop early + var/obj/item/bodypart/BP = H.get_bodypart(user.zone_selected) + if(BP.status != BODYPART_ROBOTIC) + if(!did_we_charge) + to_chat(user, "[GLOB.deity] scoffs at the idea of healing such fleshy matter!") + else + H.visible_message("[user] charges [H] with the power of [GLOB.deity]!") + to_chat(H, "You feel charged by the power of [GLOB.deity]!") + SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing) + playsound(user, 'sound/machines/synth_yes.ogg', 25, TRUE, -1) + return TRUE + + //charge(?) and go + if(BP.heal_damage(5,5,null,BODYPART_ROBOTIC)) + H.update_damage_overlays() + + H.visible_message("[user] [did_we_charge ? "repairs" : "repairs and charges"] [H] with the power of [GLOB.deity]!") + to_chat(H, "The inner machinations of [GLOB.deity] [did_we_charge ? "repairs" : "repairs and charges"] you!") + playsound(user, 'sound/effects/bang.ogg', 25, TRUE, -1) + SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing) + return TRUE + +/datum/religion_sect/technophile/can_sacrifice(obj/item/I, mob/living/L) + if(!..()) + return FALSE + var/obj/item/stock_parts/cell/the_cell = I + if(the_cell.charge < 3000) + to_chat("[GLOB.deity] does not accept pity amounts of power.") + return FALSE + return TRUE + + +/datum/religion_sect/technophile/on_sacrifice(obj/item/I, mob/living/L) + if(!is_type_in_typecache(I, desired_items_typecache)) + return + var/obj/item/stock_parts/cell/the_cell = I + adjust_favor(round(the_cell.charge/3000), L) + to_chat(L, "You offer [the_cell]'s power to [GLOB.deity], pleasing them.") + qdel(I) diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm new file mode 100644 index 00000000000..b86fa0198d8 --- /dev/null +++ b/code/modules/religion/religion_structures.dm @@ -0,0 +1,114 @@ +/obj/structure/altar_of_gods + name = "\improper Altar of the Gods" + desc = "An altar which allows the head of the church to choose a sect of religious teachings as well as provide sacrifices to earn favor." + icon = 'icons/obj/hand_of_god_structures.dmi' + icon_state = "convertaltar" + density = TRUE + anchored = TRUE + layer = TABLE_LAYER + climbable = TRUE + pass_flags = LETPASSTHROW + can_buckle = TRUE + buckle_lying = 90 //we turn to you! + var/datum/religion_sect/sect_to_altar // easy access! + var/datum/religion_rites/performing_rite + +/obj/structure/altar_of_gods/examine(mob/user) + . = ..() + if(!isliving(user)) + return + var/mob/living/L = user + if(L.mind?.holy_role && sect_to_altar) + . += "The sect currently has [round(sect_to_altar.favor)] with [GLOB.deity]." + if(!sect_to_altar.rites_list) + return + . += "List of available Rites:" + . += sect_to_altar.rites_list + + +/obj/structure/altar_of_gods/Initialize(mapload) + . = ..() + if(GLOB.religious_sect) + sect_to_altar = GLOB.religious_sect + if(sect_to_altar.altar_icon) + icon = sect_to_altar.altar_icon + if(sect_to_altar.altar_icon_state) + icon_state = sect_to_altar.altar_icon_state + +/obj/structure/altar_of_gods/attack_hand(mob/living/user) + if(!Adjacent(user) || !user.pulling) + return ..() + if(!isliving(user.pulling)) + return ..() + var/mob/living/pushed_mob = user.pulling + if(pushed_mob.buckled) + to_chat(user, "[pushed_mob] is buckled to [pushed_mob.buckled]!") + return ..() + to_chat(user,"Your sect doesn't have any rites to perform!") + return + var/rite_select = input(user,"Select a rite to perform!","Select a rite",null) in sect_to_altar.rites_list + if(!rite_select || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) + to_chat(user,"You cannot perform the rite at this time.") + return + var/selection2type = sect_to_altar.rites_list[rite_select] + performing_rite = new selection2type(src, src) + if(!performing_rite.perform_rite(user, src)) + QDEL_NULL(performing_rite) + else + performing_rite.invoke_effect(user, src) + sect_to_altar.adjust_favor(performing_rite.favor_cost*-1) + QDEL_NULL(performing_rite) + return + + if(user.mind.holy_role != HOLY_ROLE_HIGHPRIEST) + to_chat(user, "You are not the high priest, and therefore cannot select a religious sect.") + return + + var/list/available_options = generate_available_sects(user) + if(!available_options) + return + + var/sect_select = input(user,"Select a sect (You CANNOT revert this decision!)","Select a Sect",null) in available_options + if(!sect_select || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) + to_chat(user,"You cannot select a sect at this time.") + return + var/type_selected = available_options[sect_select] + GLOB.religious_sect = new type_selected() + for(var/i in GLOB.player_list) + if(!isliving(i)) + continue + var/mob/living/am_i_holy_living = i + if(!am_i_holy_living.mind?.holy_role) + continue + GLOB.religious_sect.on_conversion(am_i_holy_living) + sect_to_altar = GLOB.religious_sect + if(sect_to_altar.altar_icon) + icon = sect_to_altar.altar_icon + if(sect_to_altar.altar_icon_state) + icon_state = sect_to_altar.altar_icon_state + + + +/obj/structure/altar_of_gods/proc/generate_available_sects(mob/user) //eventually want to add sects you get from unlocking certain achievements + . = list() + for(var/i in subtypesof(/datum/religion_sect)) + var/datum/religion_sect/not_a_real_instance_rs = i + if(initial(not_a_real_instance_rs.starter)) + . += list(initial(not_a_real_instance_rs.name) = i) diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm new file mode 100644 index 00000000000..acac35baea0 --- /dev/null +++ b/code/modules/religion/rites.dm @@ -0,0 +1,77 @@ +/datum/religion_rites +/// name of the religious rite + var/name = "religious rite" +/// Description of the religious rite + var/desc = "immm gonna rooon" +/// length it takes to complete the ritual + var/ritual_length = (10 SECONDS) //total length it'll take +/// list of invocations said (strings) throughout the rite + var/list/ritual_invocations //strings that are by default said evenly throughout the rite +/// message when you invoke + var/invoke_msg + var/favor_cost = 0 + +///Called to perform the invocation of the rite, with args being the performer and the altar where it's being performed. Maybe you want it to check for something else? +/datum/religion_rites/proc/perform_rite(mob/living/user, obj/structure/altar_of_gods/AOG) + if(GLOB.religious_sect?.favor < favor_cost) + to_chat(user, "This rite requires more favor!") + return FALSE + to_chat(user, "You begin to perform the rite of [name]...") + if(!ritual_invocations) + if(do_after(user, target = user, delay = ritual_length)) + return TRUE + return FALSE + var/first_invoke = TRUE + for(var/i in ritual_invocations) + if(first_invoke) //instant invoke + user.say(i) + first_invoke = FALSE + continue + if(!ritual_invocations.len) //we divide so we gotta protect + return FALSE + if(!do_after(user, target = user, delay = ritual_length/ritual_invocations.len)) + return FALSE + user.say(i) + if(!do_after(user, target = user, delay = ritual_length/ritual_invocations.len)) //because we start at 0 and not the first fraction in invocations, we still have another fraction of ritual_length to complete + return FALSE + if(invoke_msg) + user.say(invoke_msg) + return TRUE + + +///Does the thing if the rite was successfully performed. return value denotes that the effect successfully (IE a harm rite does harm) +/datum/religion_rites/proc/invoke_effect(mob/living/user, obj/structure/altar_of_gods/AOG) + GLOB.religious_sect.on_riteuse(user,AOG) + return TRUE + + +/*********Technophiles**********/ + +/datum/religion_rites/synthconversion + name = "Synthetic Conversion" + desc = "Convert a human-esque individual into a (superior) Android." + ritual_length = 1 MINUTES + ritual_invocations = list("By the inner workings of our god...", + "... We call upon you, in the face of adversity...", + "... to complete us, removing that which is undesirable...") + invoke_msg = "... Arise, our champion! Become that which your soul craves, live in the world as your true form!!" + favor_cost = 500 + +/datum/religion_rites/synthconversion/perform_rite(mob/living/user, obj/structure/altar_of_gods/AOG) + if(!AOG?.buckled_mobs?.len) + return FALSE + return ..() + +/datum/religion_rites/synthconversion/invoke_effect(mob/living/user, obj/structure/altar_of_gods/AOG) + if(!AOG?.buckled_mobs?.len) + return FALSE + var/mob/living/carbon/human/human2borg + for(var/i in AOG.buckled_mobs) + if(istype(i,/mob/living/carbon/human)) + human2borg = i + break + if(!human2borg) + return FALSE + human2borg.set_species(/datum/species/android) + human2borg.visible_message("[human2borg] has been converted by the rite of [name]!") + return TRUE diff --git a/tgstation.dme b/tgstation.dme index b12a58a2755..860e01b8c03 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -165,6 +165,7 @@ #include "code\_globalvars\logging.dm" #include "code\_globalvars\misc.dm" #include "code\_globalvars\regexes.dm" +#include "code\_globalvars\religion.dm" #include "code\_globalvars\traits.dm" #include "code\_globalvars\lists\achievements.dm" #include "code\_globalvars\lists\admin.dm" @@ -2697,6 +2698,9 @@ #include "code\modules\recycling\disposal\outlet.dm" #include "code\modules\recycling\disposal\pipe.dm" #include "code\modules\recycling\disposal\pipe_sorting.dm" +#include "code\modules\religion\religion_sects.dm" +#include "code\modules\religion\religion_structures.dm" +#include "code\modules\religion\rites.dm" #include "code\modules\research\bepis.dm" #include "code\modules\research\designs.dm" #include "code\modules\research\destructive_analyzer.dm"