From d7d68b5a86c2b8734c3f328cca0f99ca1568abba Mon Sep 17 00:00:00 2001 From: alsoandanswer Date: Fri, 17 Jul 2026 07:31:18 +0800 Subject: [PATCH] Bartending Codex --- aurorastation.dme | 1 + .../subsystems/initialization/codex.dm | 57 +++++++++++++++++- .../file_system/programs/app_presets_crew.dm | 3 +- .../programs/civilian/bartending_codex.dm | 25 ++++++++ html/changelogs/wezzy-bar-codex.yml | 58 +++++++++++++++++++ 5 files changed, 141 insertions(+), 3 deletions(-) create mode 100644 code/modules/modular_computers/file_system/programs/civilian/bartending_codex.dm create mode 100644 html/changelogs/wezzy-bar-codex.yml diff --git a/aurorastation.dme b/aurorastation.dme index d18fb920ebe..e99cfb5d776 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -3096,6 +3096,7 @@ #include "code\modules\modular_computers\file_system\programs\app_presets_equipment.dm" #include "code\modules\modular_computers\file_system\programs\app_presets_third_party.dm" #include "code\modules\modular_computers\file_system\programs\antagonist\hacked_camera.dm" +#include "code\modules\modular_computers\file_system\programs\civilian\bartending_codex.dm" #include "code\modules\modular_computers\file_system\programs\civilian\cargo_control.dm" #include "code\modules\modular_computers\file_system\programs\civilian\cargo_delivery.dm" #include "code\modules\modular_computers\file_system\programs\civilian\cargo_order.dm" diff --git a/code/controllers/subsystems/initialization/codex.dm b/code/controllers/subsystems/initialization/codex.dm index ab014562b0b..a7a8669421b 100644 --- a/code/controllers/subsystems/initialization/codex.dm +++ b/code/controllers/subsystems/initialization/codex.dm @@ -7,6 +7,11 @@ SUBSYSTEM_DEF(codex) /// List of cooking recipes and associated data. var/list/cooking_codex_data = list() + /// List of chemistry/reagent reactions and associated data. + var/list/bartending_codex_data = list() + var/list/bartending_codex_ignored_reaction_path = list(/datum/chemical_reaction/slime) + var/list/bartending_codex_unignored_result_path = list(/singleton/reagent/drink, /singleton/reagent/alcohol) + /// List of chemistry/reagent reactions and associated data. var/list/chemistry_codex_data = list() var/list/chemistry_codex_ignored_reaction_path = list(/datum/chemical_reaction/slime) @@ -22,9 +27,10 @@ SUBSYSTEM_DEF(codex) else generate_cooking_codex() + generate_bartending_codex() generate_chemistry_codex() generate_fusion_codex() - log_subsystem_codex("SScodex: [length(cooking_codex_data)] cooking recipes; [length(chemistry_codex_data)] chemistry recipes; [length(fusion_codex_data)] fusion recipes;") + log_subsystem_codex("SScodex: [length(cooking_codex_data)] cooking recipes; [length(bartending_codex_data)] bartending recipes; [length(chemistry_codex_data)] chemistry recipes; [length(fusion_codex_data)] fusion recipes;") return SS_INIT_SUCCESS @@ -81,6 +87,55 @@ SUBSYSTEM_DEF(codex) cookingRecipeData["ingredients"] = english_list(cookingRecipeData["ingredients"]) cooking_codex_data += list(cookingRecipeData) +/datum/controller/subsystem/codex/proc/generate_bartending_codex() + bartending_codex_data = list() + for(var/chem_path in SSchemistry.chemical_reactions_clean) + if(bartending_codex_ignored_reaction_path && is_path_in_list(chem_path, bartending_codex_ignored_reaction_path)) + continue + var/datum/chemical_reaction/CR = new chem_path + if(!CR.result) + continue + if(bartending_codex_unignored_result_path && !is_path_in_list(CR.result, bartending_codex_unignored_result_path)) + continue + var/singleton/reagent/R = GET_SINGLETON(CR.result) + var/bartendingReactionData = list(id = CR.id) + bartendingReactionData["result"] = list( + name = R.name, + description = R.description, + amount = CR.result_amount + ) + + bartendingReactionData["reagents"] = list() + for(var/reagent in CR.required_reagents) + var/singleton/reagent/required_reagent = reagent + bartendingReactionData["reagents"] += list(list( + name = initial(required_reagent.name), + amount = CR.required_reagents[reagent] + )) + + bartendingReactionData["catalysts"] = list() + for(var/reagent_path in CR.catalysts) + var/singleton/reagent/required_reagent = reagent_path + bartendingReactionData["catalysts"] += list(list( + name = initial(required_reagent.name), + amount = CR.catalysts[reagent_path] + )) + + bartendingReactionData["inhibitors"] = list() + for(var/reagent_path in CR.inhibitors) + var/singleton/reagent/required_reagent = reagent_path + var/inhibitor_amount = CR.inhibitors[reagent_path] ? CR.inhibitors[reagent_path] : "Any" + bartendingReactionData["inhibitors"] += list(list( + name = initial(required_reagent.name), + amount = inhibitor_amount + )) + + bartendingReactionData["temp_min"] = CR.required_temperature_min + + bartendingReactionData["temp_max"] = CR.required_temperature_max + + bartending_codex_data += list(bartendingReactionData) + /datum/controller/subsystem/codex/proc/generate_chemistry_codex() chemistry_codex_data = list() for(var/chem_path in SSchemistry.chemical_reactions_clean) diff --git a/code/modules/modular_computers/file_system/programs/app_presets_crew.dm b/code/modules/modular_computers/file_system/programs/app_presets_crew.dm index 47e3e199183..f2d4f03cad8 100644 --- a/code/modules/modular_computers/file_system/programs/app_presets_crew.dm +++ b/code/modules/modular_computers/file_system/programs/app_presets_crew.dm @@ -204,8 +204,7 @@ /datum/modular_computer_app_presets/civilian/New() . = ..() program_list += COMPUTER_APP_PRESET_SYSTEM + COMPUTER_APP_PRESET_HORIZON_CIVILIAN - program_list += list(/datum/computer_file/program/game/arcade, /datum/computer_file/program/cooking_codex) - + program_list += list(/datum/computer_file/program/game/arcade, /datum/computer_file/program/cooking_codex, /datum/computer_file/program/bartending_codex) /datum/modular_computer_app_presets/civilian/janitor name = "janitor" diff --git a/code/modules/modular_computers/file_system/programs/civilian/bartending_codex.dm b/code/modules/modular_computers/file_system/programs/civilian/bartending_codex.dm new file mode 100644 index 00000000000..f838482826a --- /dev/null +++ b/code/modules/modular_computers/file_system/programs/civilian/bartending_codex.dm @@ -0,0 +1,25 @@ +/datum/computer_file/program/bartending_codex + filename = "barcodex" + filedesc = "Bartending Codex" + program_icon_state = "generic" + program_key_icon_state = "teal_key" + extended_desc = "Useful program to view cocktail recipes and how to make them." + size = 2 + required_access_download = null + requires_ntnet = FALSE + available_on_ntnet = TRUE + tgui_id = "ChemCodex" + +/datum/computer_file/program/bartending_codex/ui_data(mob/user) + var/list/data = list() + // Gather data for computer header + var/headerdata = get_header_data(data["_PC"]) + if(headerdata) + data["_PC"] = headerdata + . = data + + // Here goes listification + if(!data["reactions"]) + data["reactions"] = SScodex.bartending_codex_data + + return data diff --git a/html/changelogs/wezzy-bar-codex.yml b/html/changelogs/wezzy-bar-codex.yml new file mode 100644 index 00000000000..65c0c08afb4 --- /dev/null +++ b/html/changelogs/wezzy-bar-codex.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Wowzewow (Wezzy) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds the bartending codex."