Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prayer "refactor", patrons handle them now (+ underworld prayers) #652

Merged
merged 12 commits into from
Feb 9, 2025
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_carbon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// from /datum/emote/living/pray/run_emote(): (message)
#define COMSIG_CARBON_PRAY "carbon_prayed"
/// Prevents the carbon's patron from hearing this prayer.
#define CARBON_PRAY_CANCEL (1<<0)
3 changes: 1 addition & 2 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(

//Carbon mobs
#define iscarbon(A) (istype(A, /mob/living/carbon))

#define isroguespirit(A) (istype(A, /mob/living/carbon/spirit)) //underworld spirit
#define ishuman(A) (istype(A, /mob/living/carbon/human))

//Human sub-species
Expand Down Expand Up @@ -96,7 +96,6 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(
#define isobserver(A) (istype(A, /mob/dead/observer))

#define isrogueobserver(A) (istype(A, /mob/dead/observer/rogue))
#define isroguespirit(A) (istype(A, /mob/living/carbon/spirit)) //underworld spirit

#define isdead(A) (istype(A, /mob/dead))

Expand Down
48 changes: 47 additions & 1 deletion code/datums/gods/_patron.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GLOBAL_LIST_EMPTY(preference_patrons)
var/flaws = "This spagetti code"
///Strong that represents what this god views as sins
var/sins = "Codersocks"
/// What boons the god may offer:______qdel_list_wrapper(list/L)
/// What boons the god may offer
var/boons = "Code errors"
/// Faith this god belongs to
var/datum/faith/associated_faith = /datum/faith
Expand All @@ -35,6 +35,9 @@ GLOBAL_LIST_EMPTY(preference_patrons)
/// Final tier spell
var/t3

/// List of words that this god considers profane.
var/list/profane_words = list("zizo","cock","dick","fuck","shit","pussy","ass","cuck","fucker","fucked","cunt","asshole")
tontyGH marked this conversation as resolved.
Show resolved Hide resolved

///our traits thats applied by set_patron and removed when changed
var/list/added_traits
var/non_faith = FALSE
Expand All @@ -46,3 +49,46 @@ GLOBAL_LIST_EMPTY(preference_patrons)
/datum/patron/proc/on_remove(mob/living/pious)
for(var/trait in added_traits)
REMOVE_TRAIT(pious, trait, "[type]")

/* -----PRAYERS----- */

/// Called when a patron's follower attempts to pray.
/// Returns TRUE if they satisfy the needed conditions.
/datum/patron/proc/can_pray(mob/living/follower)
return TRUE

/// Called when a patron's follower prays to them.
/// Returns TRUE if their prayer was heard and the patron was not insulted
/datum/patron/proc/hear_prayer(mob/living/follower, message)
if(!follower || !message)
return FALSE
var/prayer = sanitize_hear_message(message)

if(length(profane_words))
for(var/profanity in profane_words)
if(findtext(prayer, profanity))
punish_prayer(follower)
return FALSE

if(length(prayer) <= 15)
to_chat(follower, span_danger("My prayer was kinda short..."))
return FALSE

. = TRUE //the prayer has succeeded by this point forward

if(findtext(prayer, name))
reward_prayer(follower)

/// The follower has somehow offended the patron and is now being punished.
/datum/patron/proc/punish_prayer(mob/living/follower)
follower.adjust_fire_stacks(100)
follower.IgniteMob()
SSticker.pplsmited++
follower.add_stress(/datum/stressevent/psycurse)

/// The follower has prayed in a special way to the patron and is being rewarded.
/datum/patron/proc/reward_prayer(mob/living/follower)
SHOULD_CALL_PARENT(TRUE)

follower.playsound_local(follower, 'sound/misc/notice (2).ogg', 100, FALSE)
follower.add_stress(/datum/stressevent/psyprayer)
3 changes: 2 additions & 1 deletion code/datums/gods/faiths/atheism.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/datum/faith/godless
name = "Apostasy"
desc = "Although gods obviously exist in this world, you refuse to bow down to them! Due to spite, ignorance, or your own ego; you are completely godless."
desc = "Although gods obviously exist in this world, you refuse to bow down to them! \
Due to spite, ignorance, or your own ego; you are completely godless."
godhead = /datum/patron/godless
3 changes: 2 additions & 1 deletion code/datums/gods/faiths/divine_pantheon.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/datum/faith/divine_pantheon
name = "Divine Pantheon"
desc = "The most accepted religion in the isle of Enigma. May Almighty Psydon and His ten children protect us from Zizo!"
desc = "The most accepted religion in the isle of Enigma. \
May Almighty Psydon and His ten children protect us from Zizo!"
godhead = /datum/patron/divine/astrata
4 changes: 3 additions & 1 deletion code/datums/gods/faiths/forgotten.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/datum/faith/psydon
name = "Old God"
desc = "Worship of Psydon as the primary diety. Popular among the Grenzelhofters, but can be found in all Humen Kingdoms. Worshippers hold grudges against the Church of the Ten for their butchery of their god."
desc = "Worship of Psydon as the primary diety. \n\
Popular among the Grenzelhofters, but can be found in all Humen Kingdoms. \n\
Worshippers hold grudges against the Church of the Ten for their butchery of their god."
godhead = /datum/patron/psydon
11 changes: 11 additions & 0 deletions code/datums/gods/patrons/atheism.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
sins = "Idolatry, Worship, Blind Faith"
boons = "None, you godless heathen."
associated_faith = /datum/faith/godless

profane_words = list()
confess_lines = list(
"No Gods, No Masters! There is only ME!",
"A man chooses, a slave obeys - I will be free from the Gods!",
"The old ways WILL CRUMBLE, the gods are UNJUST!"
)

/datum/patron/godless/can_pray(mob/living/follower)
// Redefined this entire proc just to tell you:
// Yes, the godless can pray. This is intentional.
// Maybe they pray to themselves?
return TRUE

/datum/patron/godless/hear_prayer(mob/living/follower, message)
return FALSE
2 changes: 2 additions & 0 deletions code/datums/gods/patrons/curses.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//the way this file is organized is also cursed! Enjoy

/mob/living/carbon/human
/// List of curses on this mob
var/list/curses = list()
Expand Down
14 changes: 14 additions & 0 deletions code/datums/gods/patrons/divine_pantheon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
associated_faith = /datum/faith/divine_pantheon
t0 = /obj/effect/proc_holder/spell/invoked/lesser_heal

/datum/patron/divine/can_pray(mob/living/follower)
//you can pray anywhere inside a church
if(istype(get_area(follower), /area/rogue/indoors/town/church))
return TRUE

for(var/obj/structure/fluff/psycross/cross in view(4, get_turf(follower)))
if(!cross.obj_broken)
return TRUE

to_chat(follower, span_danger("I need a nearby Pantheon Cross for my prayers to be heard..."))
return FALSE

/* ----------------- */

/datum/patron/divine/astrata
name = "Astrata"
domain = "Goddess of Order, the Sun Queen"
Expand Down
8 changes: 8 additions & 0 deletions code/datums/gods/patrons/forgotten.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@
"THE SUCCESSORS HALT HIS RETURN!",
"PSYDON LIVES!",
)

/datum/patron/psydon/can_pray(mob/living/carbon/human/follower)
//We just kind of assume the follower is a human here
if(istype(follower.wear_neck, /obj/item/clothing/neck/roguetown/psycross))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should also check elsewhere, like the wrists... that's where Inquisitors start with theirs. They currently have to awkwardly move it to their necks for a brief moment to pray.

return TRUE

to_chat(follower, span_danger("I can not talk to Him... I need His cross on my neck!"))
return FALSE
30 changes: 30 additions & 0 deletions code/datums/gods/patrons/inhumen_pantheon.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
/datum/patron/inhumen
name = null
associated_faith = /datum/faith/inhumen_pantheon

profane_words = list()
confess_lines = list(
"PSYDON AND HIS CHILDREN ARE THE DEMIURGE!",
"THE TEN ARE WORTHLESS COWARDS!",
"THE TEN ARE DECEIVERS!"
)

/datum/patron/inhumen/can_pray(mob/living/follower)
for(var/obj/structure/fluff/psycross/cross in view(7, get_turf(follower)))
if(!cross.obj_broken)
to_chat(follower, span_danger("That accursed cross won't let me commune with the Forbidden One!"))
return FALSE

return TRUE

/* ----------------- */

/datum/patron/inhumen/zizo
name = "Zizo"
domain = "Ascended Goddess of Forbidden Magic, Domination, and Power"
Expand Down Expand Up @@ -67,6 +79,7 @@
"BAOTHA'S WHISPERS CALM MY MIND!",
)

/// Maniac Patron
/datum/patron/inhumen/graggar_zizo
name = "Graggazo"
domain = "Ascended God who slaughtered Her kind in ascension, the Dark Sini-Star of Unnatural Beasts, Forbidden Magic, and Unbridled Hatred."
Expand All @@ -82,3 +95,20 @@
"WHO AM I WORSHIPPING?!"
)
non_faith = TRUE

/datum/patron/inhumen/graggar_zizo/can_pray(mob/living/follower)
var/datum/antagonist/maniac/dreamer = follower.mind.has_antag_datum(/datum/antagonist/maniac)
if(!dreamer)
// if a non-maniac somehow gets this patron,
// something interesting should happen if they try to pray
return FALSE
return TRUE

/datum/patron/inhumen/graggar_zizo/hear_prayer(mob/living/follower, message)
var/datum/antagonist/maniac/dreamer = follower.mind.has_antag_datum(/datum/antagonist/maniac)
if(!dreamer)
return FALSE

// something interesting should happen...

. = ..()
54 changes: 54 additions & 0 deletions code/game/area/roguetownareas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,60 @@ GLOBAL_LIST_INIT(roguetown_areas_typecache, typecacheof(/area/rogue/indoors/town
droning_sound_night = null
first_time_text = "The Forest of Repentence"

/area/rogue/underworld/Entered(atom/movable/movable, oldloc)
. = ..()
if(!iscarbon(movable))
return
RegisterSignal(movable, COMSIG_CARBON_PRAY, PROC_REF(on_underworld_prayer))

/area/rogue/underworld/Exited(atom/movable/movable)
. = ..()
if(!iscarbon(movable))
return
UnregisterSignal(movable, COMSIG_CARBON_PRAY)

/area/rogue/underworld/proc/on_underworld_prayer(mob/living/carbon/damned, message)
// Who do the underworld spirits pray to? Good question
. |= CARBON_PRAY_CANCEL

if(!damned || !message)
return

var/static/list/profane_words = list("zizo","cock","dick","fuck","shit","pussy","ass","cuck","fucker","fucked","cunt","asshole")
tontyGH marked this conversation as resolved.
Show resolved Hide resolved
var/prayer = sanitize_hear_message(message)

for(var/profanity in profane_words)
if(findtext(prayer, profanity))
//put this idiot SOMEWHERE
var/static/list/unsafe_turfs = list(
/turf/open/floor/rogue/underworld/space,
/turf/open/transparent/openspace,
)

var/static/list/turfs = list()
if(!length(turfs)) //there is a lot of turfs, let's only do this once
tontyGH marked this conversation as resolved.
Show resolved Hide resolved
for(var/turf/turf in src)
if(turf.density)
continue
if(is_type_in_list(turf.type, unsafe_turfs))
continue
turfs.Add(turf)

var/turf/safe_turf = safepick(turfs)
if(!safe_turf) //fuck
return

damned.forceMove(safe_turf)
to_chat(damned, "<font color='yellow'>INSOLENT WRETCH, YOUR STRUGGLE CONTINUES</font>")
return

if(length(prayer) <= 15)
to_chat(damned, span_danger("My prayer was kinda short..."))
return

if(findtext(prayer, damned.patron.name))
damned.playsound_local(damned, 'sound/misc/notice (2).ogg', 100, FALSE)
to_chat(damned, "<font color='yellow'>I, [damned.patron], have heard your prayer and yet cannot aid you.</font>")

///// DAKKATOWN AREAS //////

Expand Down
39 changes: 0 additions & 39 deletions code/modules/admin/verbs/pray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,42 +74,3 @@
msg = "<span class='adminnotice'><b><font color=orange>NUKE CODE REQUEST:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_CENTCOM_REPLY(Sender)] [ADMIN_SET_SD_CODE]:</b> [msg]</span>"
to_chat(GLOB.admins, msg)


/mob/proc/roguepray(msg as text)
// set category = "IC"
// set name = "Pray"
// set hidden = 1
// if(!usr.client.holder)
// return
//
// msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
if(!msg)
return

// Make it show only for admins, linked so that it's easier for them to jump to the person praying
message_admins("[src.key]/([src.real_name]) [ADMIN_JMP(src)] prays: <span class='info'>[msg]</span>")

// Log the prayer to file
log_prayer("<span class='info'>[src.key]/([src.real_name]) prays: [msg]</span>")

/* for(var/client/C in GLOB.admins)
// if(C.prefs.chat_toggles & CHAT_PRAYER)
/// to_chat(C, msg)

for(var/client/J in GLOB.clients)
if(!J.mob)
continue
// var/T = get_turf(src)
var/go = FALSE
if(isliving(J.mob))
var/mob/living/M = J.mob
if(M.stat == DEAD)
go = TRUE
if(isobserver(J.mob))
go = TRUE
if(istype(J.mob, /mob/dead/new_player))
go = TRUE
if(!go)
continue
to_chat(J, msg)
*/
4 changes: 3 additions & 1 deletion code/modules/client/verbs/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
ADD_TRAIT(O, TRAIT_PACIFISM, TRAIT_GENERIC)
O.set_patron(prefs.selected_patron)
SSdeath_arena.add_fighter(O, mind?.last_death)
SSdroning.area_entered(get_area(O), O.client)

var/area/rogue/underworld/underworld = get_area(spawn_loc)
underworld.Entered(O, null)
verbs -= /client/proc/descend
if("No")
usr << "You have second thoughts."
Loading
Loading