Skip to content

Commit

Permalink
Merge pull request Darkrp-community#184 from Stutternov/faith-selecti…
Browse files Browse the repository at this point in the history
…on-fix

Blackstone Port - Faith Overhaul + Misc Patron Fixes
  • Loading branch information
Stutternov authored Jun 26, 2024
2 parents f0058da + 790d780 commit 144288f
Show file tree
Hide file tree
Showing 46 changed files with 557 additions and 248 deletions.
38 changes: 2 additions & 36 deletions code/__DEFINES/roguetown.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//used in various places
#define ALL_RACES_LIST list("human", "dwarf", "elf", "tiefling", "aasimar")
#define ALL_RACES_LIST list("human", "dwarf", "elf", "tiefling", "aasimar")

#define ALL_RACES_LIST_NAMES list("Humen", "Half-Elf", "Dark Elf", "Elf", "Dwarf","Tiefling", "Aasimar")

#define ALL_PATRON_NAMES_LIST list("Astrata", "Noc", "Xylix", "Eora", "Malum", "Dendor", "Abyssor", "Necra", "Pestra", "Malum", "Ravox")
#define ALL_CLERIC_PATRONS list(/datum/patron/divine/astrata, /datum/patron/divine/noc, /datum/patron/divine/dendor, /datum/patron/divine/necra, /datum/patron/divine/pestra)

#define PLATEHIT "plate"
#define CHAINHIT "chain"
Expand Down Expand Up @@ -42,40 +42,6 @@ GLOBAL_LIST_INIT(wolf_suffixes, list("Fang", "Claw", "Stalker", "Prowler", "Roar
#define FAMILY_PARTIAL 2
#define FAMILY_FULL 3

#define FAITH_NONE 0
#define FAITH_PSYDON 1
#define FAITH_ELF 2
#define FAITH_DWARF 3
#define FAITH_SPIDER 4
#define FAITH_ZIZO 5

/proc/get_faith_name(faith)
switch(faith)
if(FAITH_PSYDON)
return "Father-Son"
if(FAITH_ELF)
return "Elfish Pantheon"
if(FAITH_DWARF)
return "Dwarfish Paganism"
if(FAITH_SPIDER)
return "Spider Queen"
if(FAITH_ZIZO)
return "Zizo"

/proc/get_faith_desc(faith)
switch(faith)
if(FAITH_PSYDON)
return "You believe in the Father-Son. Only through His sun SAVIOR PSYDON may you join His golden kingdom in death."
if(FAITH_ELF)
return "You believe in the FAERIE PANTHEON, may Brother Courage and Sister Pride protect you from the wrath of the Trickster."
if(FAITH_DWARF)
return "By rock, you believe in DWARFISH PAGANISM! Only by respecting the gods of soil and water may you survive this week."
if(FAITH_SPIDER)
return "You pledged your faith in the SPIDER QUEEN, a godlike creature who ruled the Under-World before her untimely death."
if(FAITH_ZIZO)
return "You are a disgusting slave of ZIZO! Let the scum of creation die in obscene ways as your beautiful evil turns the world dark and miserable."


GLOBAL_LIST_EMPTY(sunlights)
GLOBAL_LIST_EMPTY(job_respawn_delays)

Expand Down
17 changes: 14 additions & 3 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,21 @@
for(var/i in 0 to 20)
GLOB.mouseicons_human += file("icons/effects/mousemice/swang/[i * 5].dmi")

// Faiths
for(var/path in subtypesof(/datum/faith))
var/datum/faith/faith = new path()
GLOB.faithlist[path] = faith
if(faith.preference_accessible)
GLOB.preference_faiths[path] = faith

// Patron Gods
for(var/gods in subtypesof(/datum/patrongods))
var/datum/patrongods/A = new gods()
GLOB.patronlist[A] = gods
for(var/path in subtypesof(/datum/patron))
var/datum/patron/patron = new path()
GLOB.patronlist[path] = patron
LAZYINITLIST(GLOB.patrons_by_faith[patron.associated_faith])
GLOB.patrons_by_faith[patron.associated_faith][path] = patron
if(patron.preference_accessible)
GLOB.preference_patrons[path] = patron

//creates every subtype of prototype (excluding prototype) and adds it to list L.
//if no list/L is provided, one is created.
Expand Down
34 changes: 17 additions & 17 deletions code/controllers/subsystem/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,24 @@ SUBSYSTEM_DEF(job)
if(flag && (!(flag in player.client.prefs.be_special)))
JobDebug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
if(player.mind && job.title in player.mind.restricted_roles)
if(player.mind && (job.title in player.mind.restricted_roles))
JobDebug("FOC incompatible with antagonist role, Player: [player]")
continue
if(!(player.client.prefs.pref_species.name in job.allowed_races))
if(length(job.allowed_races) && !(player.client.prefs.pref_species.name in job.allowed_races))
JobDebug("FOC incompatible with species, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue
if(!(player.client.prefs.selected_patron.name in job.allowed_patrons))
if(length(job.allowed_patrons) && !(player.client.prefs.selected_patron.type in job.allowed_patrons))
JobDebug("FOC incompatible with patron, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue
if(job.plevel_req > player.client.patreonlevel())
JobDebug("FOC incompatible with PATREON LEVEL, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue
if(get_playerquality(player.ckey) < job.min_pq)
continue
if(!(player.client.prefs.gender in job.allowed_sexes))
if(length(job.allowed_sexes) && !(player.client.prefs.gender in job.allowed_sexes))
JobDebug("FOC incompatible with sex, Player: [player], Job: [job.title]")
continue
if(!(player.client.prefs.age in job.allowed_ages))
if(length(job.allowed_ages) && !(player.client.prefs.age in job.allowed_ages))
JobDebug("FOC incompatible with age, Player: [player], Job: [job.title], Age: [player.client.prefs.age]")
continue
if(check_blacklist(player.client.ckey) && !job.bypass_jobban)
Expand Down Expand Up @@ -200,11 +200,11 @@ SUBSYSTEM_DEF(job)
JobDebug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
continue

if(!(player.client.prefs.pref_species.name in job.allowed_races))
if(length(job.allowed_races) && !(player.client.prefs.pref_species.name in job.allowed_races))
JobDebug("GRJ incompatible with species, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue

if(!(player.client.prefs.selected_patron.name in job.allowed_patrons))
if(length(job.allowed_patrons) && !(player.client.prefs.selected_patron.type in job.allowed_patrons))
JobDebug("GRJ incompatible with patron, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue

Expand All @@ -215,11 +215,11 @@ SUBSYSTEM_DEF(job)
if(get_playerquality(player.ckey) < job.min_pq)
continue

if(!(player.client.prefs.age in job.allowed_ages))
if(length(job.allowed_ages) && !(player.client.prefs.age in job.allowed_ages))
JobDebug("GRJ incompatible with age, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue

if(!(player.client.prefs.gender in job.allowed_sexes))
if(length(job.allowed_sexes) && !(player.client.prefs.gender in job.allowed_sexes))
JobDebug("GRJ incompatible with sex, Player: [player], Job: [job.title]")
continue

Expand Down Expand Up @@ -439,11 +439,11 @@ SUBSYSTEM_DEF(job)
JobDebug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
continue

if(!(player.client.prefs.pref_species.name in job.allowed_races))
if(length(job.allowed_races) && !(player.client.prefs.pref_species.name in job.allowed_races))
JobDebug("DO incompatible with species, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue

if(!(player.client.prefs.selected_patron.name in job.allowed_patrons))
if(length(job.allowed_patrons) && !(player.client.prefs.selected_patron.type in job.allowed_patrons))
JobDebug("DO incompatible with patron, Player: [player], Job: [job.title], Race: [player.client.prefs.pref_species.name]")
continue

Expand All @@ -465,11 +465,11 @@ SUBSYSTEM_DEF(job)
if(job.whitelist_req && (!player.client.whitelisted()))
continue

if(!(player.client.prefs.age in job.allowed_ages))
if(length(job.allowed_ages) && !(player.client.prefs.age in job.allowed_ages))
JobDebug("DO incompatible with age, Player: [player], Job: [job.title]")
continue

if(!(player.client.prefs.gender in job.allowed_sexes))
if(length(job.allowed_sexes) && !(player.client.prefs.gender in job.allowed_sexes))
JobDebug("DO incompatible with gender preference, Player: [player], Job: [job.title]")
continue

Expand Down Expand Up @@ -527,10 +527,10 @@ SUBSYSTEM_DEF(job)
if(player.mind && job.title in player.mind.restricted_roles)
continue

if(!(player.client.prefs.pref_species.name in job.allowed_races))
if(length(job.allowed_races) && !(player.client.prefs.pref_species.name in job.allowed_races))
continue

if(!(player.client.prefs.selected_patron.name in job.allowed_patrons))
if(length(job.allowed_patrons) && !(player.client.prefs.selected_patron.type in job.allowed_patrons))
continue

if(job.plevel_req > player.client.patreonlevel())
Expand All @@ -549,10 +549,10 @@ SUBSYSTEM_DEF(job)
if(job.whitelist_req && (!player.client.whitelisted()))
continue

if(!(player.client.prefs.age in job.allowed_ages))
if(length(job.allowed_ages) && !(player.client.prefs.age in job.allowed_ages))
continue

if(!(player.client.prefs.gender in job.allowed_sexes))
if(length(job.allowed_sexes) && !(player.client.prefs.gender in job.allowed_sexes))
continue

if(!job.special_job_check(player))
Expand Down
10 changes: 5 additions & 5 deletions code/controllers/subsystem/rogue/devotion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
return FALSE

/datum/devotion/cleric_holder/proc/update_devotion(dev_amt, prog_amt)
var/datum/patrongods/P = patron
var/datum/patron/P = patron
devotion += dev_amt
//Max devotion limit
if(devotion > max_devotion)
Expand Down Expand Up @@ -63,7 +63,7 @@
if(!H || !H.mind)
return

var/datum/patrongods/A = H.PATRON
var/datum/patron/A = H.patron
var/list/spelllist = list(A.t0, A.t1, A.t2, A.t3)
for(var/spell_type in spelllist)
if(!spell_type || H.mind.has_spell(spell_type))
Expand All @@ -76,7 +76,7 @@
if(!H || !H.mind)
return

var/datum/patrongods/A = H.PATRON
var/datum/patron/A = H.patron
var/list/spelllist = list(A.t0, A.t1)
for(var/spell_type in spelllist)
if(!spell_type || H.mind.has_spell(spell_type))
Expand All @@ -88,7 +88,7 @@
if(!H || !H.mind)
return

var/datum/patrongods/A = H.PATRON
var/datum/patron/A = H.patron
var/list/spelllist = list(/obj/effect/proc_holder/spell/targeted/churn, A.t0)
for(var/spell_type in spelllist)
if(!spell_type || H.mind.has_spell(spell_type))
Expand Down Expand Up @@ -123,7 +123,7 @@
var/datum/devotion/cleric_holder/C = src.cleric
var/prayersesh = 0

visible_message("[src] kneels their head in prayer to the Gods.", "I kneel my head in prayer to [PATRON]")
visible_message("[src] kneels their head in prayer to the Gods.", "I kneel my head in prayer to [patron.name]")
for(var/i in 1 to 20)
if(do_after(src, 30))
if(C.devotion >= C.max_devotion)
Expand Down
13 changes: 13 additions & 0 deletions code/datums/gods/_faith.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
GLOBAL_LIST_EMPTY(faithlist)

GLOBAL_LIST_EMPTY(preference_faiths)

/datum/faith
/// Name of the faith
var/name
/// Description of the faith
var/desc = "A faith that believes in the power of reporting this issue on GitHub - You shouldn't be seeing this, someone forgot to set the description for this faith."
/// Our "primary" patron god
var/datum/patron/godhead = /datum/patron
/// Whether or not this faith can be accessed in preferences
var/preference_accessible = TRUE
34 changes: 34 additions & 0 deletions code/datums/gods/_patron.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#define CLERIC_SPELLS "Cleric"
#define PRIEST_SPELLS "Priest"

GLOBAL_LIST_EMPTY(patronlist)
GLOBAL_LIST_EMPTY(patrons_by_faith)
GLOBAL_LIST_EMPTY(preference_patrons)

/datum/patron
/// Name of the god
var/name
/// Domain of the god, such as earth, fire, water, murder etc
var/domain = "Bad coding practices"
/// Description of the god
var/desc = "A god that ordains you to report this on GitHub - You shouldn't be seeing this, someone forgot to set the description of this patron."
/// String that represents who worships this guy
var/worshippers = "Shitty coders"
///String that represents the god's flaws
var/flaws = "This spagetti code"
///Strong that represents what this god views as sins
var/sins = "Codersocks"
/// Faith this god belongs to
var/datum/faith/associated_faith = /datum/faith
/// Whether or not we are accessible in preferences
var/preference_accessible = TRUE
/// Some gods have related confessions, if they're evil and such
var/list/confess_lines
/// Tier 0 spell
var/t0
/// Tier 1 spell
var/t1
/// Tier 2 spell
var/t2
/// Final tier spell
var/t3
5 changes: 5 additions & 0 deletions code/datums/gods/faiths/atheism.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/datum/faith/godless
name = "Godless" //Redditor religion
desc = "Although gods obviously exist in this world, you refuse to bow down to them! You are completely godless."
godhead = /datum/patron/godless
preference_accessible = FALSE
4 changes: 4 additions & 0 deletions code/datums/gods/faiths/divine_pantheon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/faith/divine_pantheon
name = "Divine Pantheon"
desc = "The most accepted religion in Rockhill. May Almighty Psydon and His ten children protect us from Zizo!"
godhead = /datum/patron/divine/astrata
8 changes: 8 additions & 0 deletions code/datums/gods/faiths/inhumen_pantheon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/datum/faith/inhumen_pantheon
name = "Inhumen Pantheon"
desc = "The nine are FALSE GODS.\n\
They keep us trapped in tartarus and choke out our divine light, \
but only though FULL BELIEF in the divinity of men and women can we escape and reach the TRUE spiritual realm.\n\
The godhead smiles upon us as we defile Psydon and become the divinities we were always meant to be."
godhead = /datum/patron/inhumen/zizo
preference_accessible = FALSE
12 changes: 12 additions & 0 deletions code/datums/gods/patrons/atheism.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/datum/patron/godless
name = "Science"
domain = "Ontological Reality"
desc = "No gods or kings, only man! Gods exist but you give them the finger."
worshippers = "Madmen, some dwarves, the occasional mathematician"
associated_faith = /datum/faith/godless
preference_accessible = FALSE
confess_lines = list(
"No Gods, No Masters! The faith is FALSE!",
"A man chooses, a slave obeys - I will be free from the Gods!",
"The old ways WILL CRUMBLE, the gods are UNTRUE!"
)
Loading

0 comments on commit 144288f

Please sign in to comment.