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

EchoPrefs part 1: Backgrounds, Languages and Quirks (Not done yet, but for the curious and for the watchers) #14

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions code/__DEFINES/echo_13/culture.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#define CULTURE_CULTURE "culture"
#define CULTURE_FACTION "faction"
#define CULTURE_LOCATION "location"

//Amount of linguistic points people have by default. 1 point to understand, 2 points to get it spoken
#define LINGUISTIC_POINTS_DEFAULT 5

#define LANGUAGE_UNDERSTOOD 1

Check failure on line 8 in code/__DEFINES/echo_13/culture.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Regex

indentions inside defines added to here, remove or update check_regex.yml
#define LANGUAGE_SPOKEN 2

Check failure on line 9 in code/__DEFINES/echo_13/culture.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Regex

indentions inside defines added to here, remove or update check_regex.yml

#define LESS_IMPORTANT_ROLE_LANGUAGE_REQUIREMENT null
#define NORMAL_ROLE_LANGUAGE_REQUIREMENT list(/datum/language/common = LANGUAGE_UNDERSTOOD)
#define IMPORTANT_ROLE_LANGUAGE_REQUIREMENT list(/datum/language/common = LANGUAGE_SPOKEN)

#define LANGUAGES_CULTURE_GENERIC /datum/language/common, /datum/language/draconic, /datum/language/moffic, /datum/language/spider, /datum/language/vox_pidgin, /datum/language/teceti_unified, /datum/language/buzzwords
#define LANGUAGES_CULTURE_EXOTIC LANGUAGES_GENERIC, /datum/language/slime, /datum/language/sylvan

//GROUPED CULTURAL DEFINES
#define CULTURES /datum/cultural_info/culture/generic, \

Check failure on line 19 in code/__DEFINES/echo_13/culture.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Regex

indentions inside defines added to here, remove or update check_regex.yml
/datum/cultural_info/culture/vatgrown, \
/datum/cultural_info/culture/spacer_core, \
/datum/cultural_info/culture/spacer_frontier, \
/datum/cultural_info/culture/generic_human, \

#define LOCATIONS /datum/cultural_info/location/generic, \

Check failure on line 25 in code/__DEFINES/echo_13/culture.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Regex

indentions inside defines added to here, remove or update check_regex.yml
/datum/cultural_info/location/stateless, \

#define FACTIONS /datum/cultural_info/faction/none, \

Check failure on line 28 in code/__DEFINES/echo_13/culture.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Regex

indentions inside defines added to here, remove or update check_regex.yml
/datum/cultural_info/faction/generic, \
/datum/cultural_info/faction/nanotrasen, \
/datum/cultural_info/faction/freetrade, \
7 changes: 7 additions & 0 deletions code/_globalvars/echo_13/lists/customization.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GLOBAL_LIST_EMPTY(augment_items)
GLOBAL_LIST_EMPTY(augment_categories_to_slots)
GLOBAL_LIST_EMPTY(augment_slot_to_items)

GLOBAL_LIST_EMPTY(culture_cultures)
GLOBAL_LIST_EMPTY(culture_factions)
GLOBAL_LIST_EMPTY(culture_locations)
5 changes: 3 additions & 2 deletions code/controllers/subsystem/processing/quirks.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Echo 13 - Mirrored to quirks.dm
//Used to process and handle roundstart quirks
// - Quirk strings are used for faster checking in code
// - Quirk datums are stored and hold different effects, as well as being a vector for applying trait string
Expand All @@ -14,7 +15,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
var/list/quirk_blacklist = list() //A list a list of quirks that can not be used with each other. Format: list(quirk1,quirk2),list(quirk3,quirk4)
var/list/species_blacklist = list() //A list of quirks and the species they can't be used by

/* /datum/controller/subsystem/processing/quirks/Initialize(timeofday) // Echo 13 - Start - Vampires
/datum/controller/subsystem/processing/quirks/Initialize(timeofday)
if(!quirks.len)
SetupQuirks()

Expand All @@ -29,7 +30,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)

for(var/client/client in GLOB.clients)
client?.prefs.check_quirk_compatibility()
return ..() */ // Echo 13 - End - Vampires
return ..()

/datum/controller/subsystem/processing/quirks/proc/SetupQuirks()
// Sort by Positive, Negative, Neutral; and then by name
Expand Down
8 changes: 4 additions & 4 deletions code/datums/traits/negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
/datum/quirk/nearsighted/add()
quirk_holder.become_nearsighted(ROUNDSTART_TRAIT)

/datum/quirk/nearsighted/on_spawn()
/* /datum/quirk/nearsighted/on_spawn() // Echo 13 - Start - Mirrored to negative.dm
var/mob/living/carbon/human/H = quirk_holder
var/obj/item/glasses_type

Expand Down Expand Up @@ -314,7 +314,7 @@
"in your backpack." = ITEM_SLOT_BACKPACK,
"in your hands." = ITEM_SLOT_HANDS
)
where = H.equip_in_one_of_slots(glasses, slots, FALSE) || "at your feet, don't drop them next time!"
where = H.equip_in_one_of_slots(glasses, slots, FALSE) || "at your feet, don't drop them next time!" */ // Echo 13 - End - Mirrored to negative.dm

/datum/quirk/nearsighted/post_add()
if(where == "in your backpack.")
Expand Down Expand Up @@ -508,7 +508,7 @@
mood_change = -5
timeout = 3 MINUTES

/datum/quirk/junkie
/* /datum/quirk/junkie Echo 13 - Start - Replaced by quirks in variable.dm
name = "Junkie"
desc = "You can't get enough of hard drugs."
value = -2
Expand Down Expand Up @@ -640,7 +640,7 @@
if(istype(I, initial(C.spawn_type)))
SEND_SIGNAL(quirk_holder, COMSIG_CLEAR_MOOD_EVENT, "wrong_cigs")
return
SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "wrong_cigs", /datum/mood_event/wrong_brand)
SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "wrong_cigs", /datum/mood_event/wrong_brand) */ // Echo 13 - // End replaced by quirks in variable.dm

/datum/quirk/unstable
name = "Unstable"
Expand Down
4 changes: 2 additions & 2 deletions code/datums/traits/neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
if(quirk_holder)
quirk_holder.remove_client_colour(/datum/client_colour/monochrome)

/datum/quirk/phobia
/* /datum/quirk/phobia // Echo 13 - Start - Replaced by quirk in variable.dm
name = "Phobia"
desc = "You are irrationally afraid of something."
value = 0
Expand All @@ -133,7 +133,7 @@
/datum/quirk/phobia/remove()
var/mob/living/carbon/human/H = quirk_holder
if(H)
H.cure_trauma_type(/datum/brain_trauma/mild/phobia, TRAUMA_RESILIENCE_ABSOLUTE)
H.cure_trauma_type(/datum/brain_trauma/mild/phobia, TRAUMA_RESILIENCE_ABSOLUTE) */ // Echo 13 - End - Replaced by quirk in variable.dm

/datum/quirk/needswayfinder
name = "Navigationally Challenged"
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/cryopod/retro, 17)
linked_ship = port
linked_ship.spawn_points += src

/* /obj/machinery/cryopod/apply_effects_to_mob(mob/living/carbon/sleepyhead)
/* /obj/machinery/cryopod/apply_effects_to_mob(mob/living/carbon/sleepyhead) // Echo 13 - Start - Mirrored to cryopod.dm
//it always sucks a little to get up
sleepyhead.set_nutrition(200)
sleepyhead.SetSleeping(60)
Expand Down
26 changes: 26 additions & 0 deletions echo_13/code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,29 @@
GLOB.emote_list = init_emote_list()

init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes)

make_echo_datum_references()

// Echo 13 - Echoprefs
/proc/make_echo_datum_references()
make_culture_references()

/proc/make_culture_references()
for(var/path in subtypesof(/datum/cultural_info/culture))
var/datum/cultural_info/L = path
if(!initial(L.name))
continue
L = new path()
GLOB.culture_cultures[path] = L
for(var/path in subtypesof(/datum/cultural_info/location))
var/datum/cultural_info/L = path
if(!initial(L.name))
continue
L = new path()
GLOB.culture_locations[path] = L
for(var/path in subtypesof(/datum/cultural_info/faction))
var/datum/cultural_info/L = path
if(!initial(L.name))
continue
L = new path()
GLOB.culture_factions[path] = L
115 changes: 111 additions & 4 deletions echo_13/code/controllers/subsystem/processing/quirks.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,79 @@
// Echo 13 - Vampires
// Echo 13 - Vampires and more
#define TRAIT_SPECIES_WHITELIST(ids...) list("type" = "allowed", ids)
#define TRAIT_SPECIES_BLACKLIST(ids...) list("type" = "blocked", ids)
//Used to process and handle roundstart quirks
// - Quirk strings are used for faster checking in code
// - Quirk datums are stored and hold different effects, as well as being a vector for applying trait string
PROCESSING_SUBSYSTEM_DEF(quirks)
name = "Quirks"
init_order = INIT_ORDER_QUIRKS
flags = SS_BACKGROUND
wait = 10
runlevels = RUNLEVEL_GAME

///Assoc. list of all roundstart quirk datum types; "name" = /path/
var/list/quirks = list()
///Assoc. list of quirk names and their "point cost"; positive numbers are good traits, and negative ones are bad
var/list/quirk_points = list()
///A list of all quirk objects in the game, since some may process
var/list/quirk_objects = list()
///A list a list of quirks that can not be used with each other. Format: list(quirk1,quirk2),list(quirk3,quirk4)
var/list/quirk_blacklist = list()
///List of id-based locks for species, use either TRAIT_SPECIES_WHITELIST or TRAIT_SPECIES_BLACKLIST inputting the species ids to said macros. Example: species_lock = TRAIT_SPECIES_WHITELIST(SPECIES_IPC, SPECIES_MOTH)
var/list/quirk_species_locks = list("Phobia" = list("Phobia"= list("limit" = 5, )))
var/list/quirk_customizations = list(
"Phobia" = list(
"Phobia"= list(
"limit" = 5,
"options" = list(
"anime"= list("cost" = 1, "value" = -1),
"aliens" = list("cost" = 2, "value" = -4),
"authority" = list("cost" = 1, "value" = -2),
"birds" = list("cost" = 2, "value" = -4),
"clowns"= list("cost" = 1, "value" = -1),
"doctors" = list("cost" = 2, "value" = -4),
"falling" = list("cost" = 0, "value" = -1),
"greytide" = list("cost" = 1, "value" = -2),
"lizards" = list("cost" = 2, "value" = -4),
"robots" = list("cost" = 2, "value" = -4),
"security" = list("cost" = 1, "value" = -2),
"skeletons" = list("cost" = 1, "value" = -2),
"snakes"= list("cost" = 1, "value" = -1),
"space" = list("cost" = 2, "value" = -5),
"spiders" = list("cost" = 2, "value" = -3),
"strangers" = list("cost" = 0, "value" = 0),
"the supernatural" = list("cost" = 2, "value" = -3)
)
)
),
"Addicted" = list(
"Addiction"= list(
"limit" = 6,
"options" = list(
"Crank" = list("cost" = 1, "value" = -1),
"Happiness" = list("cost" = 1, "value" = -1),
"Krokodil" = list("cost" = 3, "value" = -2),
"Methamphetamine" = list("cost" = 2, "value" = -1),
"Morphine"= list("cost" = 1, "value" = -1)
)
)
),
"Smoker" = list(
"Favorite Brand"= list(
"limit" = 1,
"options" = list(
"None" = list("cost" = 1, "value" = 0),
"Carp Classic"= list("cost" = 1, "value" = -2),
"Midori Tabako" = list("cost" = 1, "value" = -2),
"Robust" = list("cost" = 1, "value" = -2),
"Robust Gold" = list("cost" = 1, "value" = -2),
"Space Cigarettes"= list("cost" = 1, "value" = -2),
"Uplift Smooth" = list("cost" = 1, "value" = -2)
)
)
)
)

/datum/controller/subsystem/processing/quirks/Initialize(timeofday)
if(!quirks.len)
SetupQuirks()
Expand All @@ -8,13 +83,45 @@
list("Ageusia","Vegetarian","Deviant Tastes"), \
list("Ananas Affinity","Ananas Aversion"), \
list("Alcohol Tolerance","Light Drinker"), \
list("Blood Deficiency", "Vampirism"), \
list("Clown Fan","Mime Fan", "RILENA Super Fan"), \
list("Bad Touch", "Friendly"))
quirk_species_locks = list("Blood Deficiency" = TRAIT_SPECIES_BLACKLIST(SPECIES_IPC, SPECIES_JELLYPERSON, SPECIES_PLASMAMAN, SPECIES_VAMPIRE), \
"Vampirism" = TRAIT_SPECIES_BLACKLIST(SPECIES_IPC, SPECIES_JELLYPERSON, SPECIES_PLASMAMAN, SPECIES_ELZUOSE, SPECIES_VAMPIRE, SPECIES_POD))

species_blacklist = list("Blood Deficiency" = list(SPECIES_IPC, SPECIES_JELLYPERSON, SPECIES_PLASMAMAN, SPECIES_VAMPIRE), \
"Vampirism" = list(SPECIES_IPC, SPECIES_JELLYPERSON, SPECIES_PLASMAMAN, SPECIES_ELZUOSE, SPECIES_VAMPIRE, SPECIES_POD))

for(var/client/client in GLOB.clients)
client?.prefs.check_quirk_compatibility()
client?.prefs.update_quirk_preferences()
return ..()

/datum/controller/subsystem/processing/quirks/proc/SetupQuirks()
// Sort by Positive, Negative, Neutral; and then by name
var/list/quirk_list = sortList(subtypesof(/datum/quirk), /proc/cmp_quirk_asc)

for(var/V in quirk_list)
var/datum/quirk/T = V
quirks[initial(T.name)] = T
quirk_points[initial(T.name)] = initial(T.value)

/datum/controller/subsystem/processing/quirks/proc/AssignQuirks(mob/living/user, client/cli, spawn_effects)
var/badquirk = FALSE
var/list/conflicting_quirks = cli?.prefs.check_quirk_compatibility()
conflicting_quirks &= cli?.prefs.all_quirks
if(length(conflicting_quirks) > 0)
stack_trace("Conflicting quirks [conflicting_quirks.Join(", ")] in client [cli.ckey] preferences on spawn")
for(var/V in cli?.prefs.all_quirks)
var/datum/quirk/Q = quirks[V]
if(Q)
user.add_quirk(Q, spawn_effects)
else
stack_trace("Invalid quirk \"[V]\" in client [cli.ckey] preferences")
cli?.prefs.all_quirks -= V
badquirk = TRUE
if(badquirk)
cli?.prefs.save_character()

if(length(conflicting_quirks) > 0)
alert(user, "Your quirks have been altered because you had a conflicting or invalid quirk, this was likely caused by mood being disabled or the species locks on a quirk being updated!")

#undef TRAIT_SPECIES_BLACKLIST
#undef TRAIT_SPECIES_WHITELIST
13 changes: 13 additions & 0 deletions echo_13/code/datums/traits/negative.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Echo 13 - Remove Prescription hud thing
/datum/quirk/nearsighted/on_spawn()
var/mob/living/carbon/human/H = quirk_holder
var/obj/item/glasses_type = /obj/item/clothing/glasses/regular
glasses = new glasses_type(get_turf(quirk_holder))
var/list/slots = list(
"on your face, silly!" = ITEM_SLOT_EYES,
"in your left pocket." = ITEM_SLOT_LPOCKET,
"in your right pocket." = ITEM_SLOT_RPOCKET,
"in your backpack." = ITEM_SLOT_BACKPACK,
"in your hands." = ITEM_SLOT_HANDS
)
where = H.equip_in_one_of_slots(glasses, slots, FALSE) || "at your feet, don't drop them next time!"
Loading
Loading