Skip to content

Commit

Permalink
A separate list for cultural info - about as modular as its gonna get
Browse files Browse the repository at this point in the history
  • Loading branch information
UEDCommander committed Nov 17, 2023
1 parent e83af8e commit e4a621b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "code\language\russian.dm"
#include "code\language\selenian.dm"
#include "code\language\spanish.dm"
#include "code\species\species.dm"
#include "code\species\station.dm"
#include "code\species\machine.dm"
#include "code\species\lizard.dm"
Expand Down
2 changes: 1 addition & 1 deletion mods/expanded_culture_descriptor/code/species/lizard.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/species/unathi
additional_available_cultural_info = list(
extended_cultural_info = list(
TAG_CULTURE = list(
CULTURE_UNATHI_TERSTEN
),
Expand Down
2 changes: 1 addition & 1 deletion mods/expanded_culture_descriptor/code/species/machine.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/species/machine
additional_available_cultural_info = list(
extended_cultural_info = list(
TAG_HOMEWORLD = list(
HOME_SYSTEM_ROOT
),
Expand Down
31 changes: 31 additions & 0 deletions mods/expanded_culture_descriptor/code/species/species.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/datum/species
var/list/extended_cultural_info = list()


/datum/species/New()
. = ..()
for(var/token in ALL_CULTURAL_TAGS)

var/force_val = force_cultural_info[token]
if(force_val)
default_cultural_info[token] = force_val
available_cultural_info[token] = list(force_val)

else if(additional_available_cultural_info[token])
if(!available_cultural_info[token])
available_cultural_info[token] = list()
available_cultural_info[token] |= additional_available_cultural_info[token]

else if(!LAZYLEN(available_cultural_info[token]))
var/list/map_systems = GLOB.using_map.available_cultural_info[token]
available_cultural_info[token] = map_systems.Copy()

if(extended_cultural_info[token])
available_cultural_info[token] |= extended_cultural_info[token]

if(LAZYLEN(available_cultural_info[token]) && !default_cultural_info[token])
var/list/avail_systems = available_cultural_info[token]
default_cultural_info[token] = avail_systems[1]

if(!default_cultural_info[token])
default_cultural_info[token] = GLOB.using_map.default_cultural_info[token]
4 changes: 2 additions & 2 deletions mods/expanded_culture_descriptor/code/species/station.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/species/human
additional_available_cultural_info = list(
extended_cultural_info = list(
TAG_CULTURE = list(
CULTURE_HUMAN_AVACOMMON,
CULTURE_HUMAN_AVANOBLE,
Expand Down Expand Up @@ -68,7 +68,7 @@
)

/datum/species/skrell
additional_available_cultural_info = list(
extended_cultural_info = list(
TAG_FACTION = list(
FACTION_SKRELL_MED,
FACTION_SKRELL_AIR,
Expand Down

0 comments on commit e4a621b

Please sign in to comment.