Added support for religious restrictions in the loadout (#18685)

Co-authored-by: Cody Brittain <cbrittain10@live.com>
This commit is contained in:
Cody Brittain
2024-03-21 11:41:47 +00:00
committed by GitHub
co-authored by Cody Brittain
parent c15f93236e
commit a2bdb77577
3 changed files with 62 additions and 12 deletions
@@ -244,7 +244,8 @@ var/list/gear_datums = list()
var/available = (G.check_faction(pref.faction) \
&& (job && G.check_role(job.title)) \
&& G.check_culture(text2path(pref.culture)) \
&& G.check_origin(text2path(pref.origin)))
&& G.check_origin(text2path(pref.origin)) \
&& G.check_religion(pref.religion))
var/ticked = (G.display_name in pref.gear)
var/style = ""
@@ -458,6 +459,13 @@ var/list/gear_datums = list()
*/
var/faction
/**
* A string of the religion that can use this item
*
* If left `null`, any religion can spawn with this item
*/
var/religion
/**
* A `/list` of [/singleton/origin_item/culture] paths that can use this item
*/
@@ -583,6 +591,12 @@ var/list/gear_datums = list()
return FALSE
return TRUE
// arg should be a religion name string
/datum/gear/proc/check_religion(var/religion_)
if((religion && religion_) && (religion != religion_))
return FALSE
return TRUE
// arg should be a role name string
/datum/gear/proc/check_role(var/role)
if(role && allowed_roles && !(role in allowed_roles))