From a43f297fc190c569ccc3e880f0271e731d3b4830 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 9 Feb 2023 17:58:53 +0000 Subject: [PATCH 01/14] adds bare bones and a dummy example --- ColonialMarinesALPHA.dme | 5 + code/__DEFINES/round.dm | 8 + code/__DEFINES/subsystems.dm | 1 + code/__DEFINES/traits.dm | 2 + .../configuration/entries/general.dm | 2 + .../controllers/subsystem/processing/round.dm | 85 ++++++ code/datums/round_traits/_round_traits.dm | 60 +++++ code/datums/round_traits/admin_panel.dm | 133 ++++++++++ code/datums/round_traits/human_positive.dm | 10 + .../tgui/interfaces/RoundTraitsPanel.tsx | 250 ++++++++++++++++++ 10 files changed, 556 insertions(+) create mode 100644 code/__DEFINES/round.dm create mode 100644 code/controllers/subsystem/processing/round.dm create mode 100644 code/datums/round_traits/_round_traits.dm create mode 100644 code/datums/round_traits/admin_panel.dm create mode 100644 code/datums/round_traits/human_positive.dm create mode 100644 tgui/packages/tgui/interfaces/RoundTraitsPanel.tsx diff --git a/ColonialMarinesALPHA.dme b/ColonialMarinesALPHA.dme index 75a5ad6a7c3e..a98a21060beb 100644 --- a/ColonialMarinesALPHA.dme +++ b/ColonialMarinesALPHA.dme @@ -82,6 +82,7 @@ #include "code\__DEFINES\qdel.dm" #include "code\__DEFINES\radio.dm" #include "code\__DEFINES\regex.dm" +#include "code\__DEFINES\round.dm" #include "code\__DEFINES\sentry_laptop_configurations.dm" #include "code\__DEFINES\shuttles.dm" #include "code\__DEFINES\skills.dm" @@ -279,6 +280,7 @@ #include "code\controllers\subsystem\processing\obj_tab_items.dm" #include "code\controllers\subsystem\processing\objects.dm" #include "code\controllers\subsystem\processing\processing.dm" +#include "code\controllers\subsystem\processing\round.dm" #include "code\controllers\subsystem\processing\shield_pillar.dm" #include "code\datums\_atmos_setup.dm" #include "code\datums\action.dm" @@ -520,6 +522,9 @@ #include "code\datums\paygrades\factions\wy\goons.dm" #include "code\datums\paygrades\factions\wy\pmc.dm" #include "code\datums\paygrades\factions\wy\wy.dm" +#include "code\datums\round_traits\_round_traits.dm" +#include "code\datums\round_traits\admin_panel.dm" +#include "code\datums\round_traits\human_positive.dm" #include "code\datums\stamina\_stamina.dm" #include "code\datums\stamina\none.dm" #include "code\datums\statistics\cause_data.dm" diff --git a/code/__DEFINES/round.dm b/code/__DEFINES/round.dm new file mode 100644 index 000000000000..3c88e5161ed0 --- /dev/null +++ b/code/__DEFINES/round.dm @@ -0,0 +1,8 @@ +#define ROUND_TRAIT_POSITIVE 1 +#define ROUND_TRAIT_NEUTRAL 2 +#define ROUND_TRAIT_NEGATIVE 3 + +#define ROUND_TRAIT_ABSTRACT (1<<0) + +/// The data file that future station traits are stored in +#define FUTURE_ROUND_TRAITS_FILE "data/future_round_traits.json" diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index c05cb64587ab..e3a7412d6d1d 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -115,6 +115,7 @@ #define SS_INIT_RUST 26 #define SS_INIT_SUPPLY_SHUTTLE 25 #define SS_INIT_GARBAGE 24 +#define SS_INIT_ROUND 23.6 #define SS_INIT_EVENTS 23.5 #define SS_INIT_JOB 23 #define SS_INIT_MAPPING 22 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index a81d4b0bce48..099c25e3245a 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -237,6 +237,8 @@ GLOBAL_LIST_INIT(mob_traits, list( #define TRAIT_SOURCE_ABILITY(ability) "t_s_ability_[ability]" ///Status trait forced by the xeno action charge #define TRAIT_SOURCE_XENO_ACTION_CHARGE "t_s_xeno_action_charge" +/// status trait given by a round trait +#define TRAIT_SOURCE_ROUND "t_s_round_trait" ///Status trait from weapons?? buh #define TRAIT_SOURCE_WEAPON "t_s_weapon" diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 77a8fded2fdb..5637030b419f 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -530,6 +530,8 @@ This maintains a list of ip addresses that are able to bypass topic filtering. /// logs all timers in buckets on automatic bucket reset (Useful for timer debugging) /datum/config_entry/flag/log_timers_on_bucket_reset +/datum/config_entry/flag/forbid_round_traits + /datum/config_entry/number/hard_deletes_overrun_threshold integer = FALSE min_val = 0 diff --git a/code/controllers/subsystem/processing/round.dm b/code/controllers/subsystem/processing/round.dm new file mode 100644 index 000000000000..9a279363da24 --- /dev/null +++ b/code/controllers/subsystem/processing/round.dm @@ -0,0 +1,85 @@ +PROCESSING_SUBSYSTEM_DEF(round) + name = "Round" + init_order = SS_INIT_ROUND + flags = SS_BACKGROUND + runlevels = RUNLEVEL_GAME + wait = 5 SECONDS + + ///A list of currently active round traits + var/list/round_traits = list() + ///Assoc list of trait type || assoc list of traits with weighted value. Used for picking traits from a specific category. + var/list/selectable_traits_by_types = list(ROUND_TRAIT_POSITIVE = list(), ROUND_TRAIT_NEUTRAL = list(), ROUND_TRAIT_NEGATIVE = list()) + +/datum/controller/subsystem/processing/round/Initialize() + + //If doing unit tests we don't do none of that trait shit ya know? + // Autowiki also wants consistent outputs, for example making sure the vending machine page always reports the normal products + #if !defined(UNIT_TESTS) && !defined(AUTOWIKI) + SetupTraits() + #endif + + return SS_INIT_SUCCESS + +///Rolls for the amount of traits and adds them to the traits list +/datum/controller/subsystem/processing/round/proc/SetupTraits() + if (CONFIG_GET(flag/forbid_round_traits)) + return + + if (fexists(FUTURE_ROUND_TRAITS_FILE)) + var/forced_traits_contents = file2text(FUTURE_ROUND_TRAITS_FILE) + fdel(FUTURE_ROUND_TRAITS_FILE) + + var/list/forced_traits_text_paths = json_decode(forced_traits_contents) + forced_traits_text_paths = SANITIZE_LIST(forced_traits_text_paths) + + for (var/trait_text_path in forced_traits_text_paths) + var/round_trait_path = text2path(trait_text_path) + if (!ispath(round_trait_path, /datum/round_trait) || round_trait_path == /datum/round_trait) + var/message = "Invalid round trait path [round_trait_path] was requested in the future round traits!" + log_game(message) + message_admins(message) + continue + + setup_trait(round_trait_path) + + return + + for(var/datum/round_trait/trait_typepath as anything in subtypesof(/datum/round_trait)) + + // If forced, (probably debugging), just set it up now, keep it out of the pool. + if(initial(trait_typepath.force)) + setup_trait(trait_typepath) + continue + + if(initial(trait_typepath.trait_flags) & ROUND_TRAIT_ABSTRACT) + continue //Dont add abstract ones to it + selectable_traits_by_types[initial(trait_typepath.trait_type)][trait_typepath] = initial(trait_typepath.weight) + + var/positive_trait_count = pick(20;0, 5;1, 1;2) + var/neutral_trait_count = pick(10;0, 10;1, 3;2) + var/negative_trait_count = pick(20;0, 5;1, 1;2) + + pick_traits(ROUND_TRAIT_POSITIVE, positive_trait_count) + pick_traits(ROUND_TRAIT_NEUTRAL, neutral_trait_count) + pick_traits(ROUND_TRAIT_NEGATIVE, negative_trait_count) + +///Picks traits of a specific category (e.g. bad or good) and a specified amount, then initializes them, adds them to the list of traits, +///then removes them from possible traits as to not roll twice. +/datum/controller/subsystem/processing/round/proc/pick_traits(trait_sign, amount) + if(!amount) + return + for(var/iterator in 1 to amount) + var/datum/round_trait/trait_type = pick_weight(selectable_traits_by_types[trait_sign]) //Rolls from the table for the specific trait type + selectable_traits_by_types[trait_sign] -= trait_type + setup_trait(trait_type) + +///Creates a given trait of a specific type, while also removing any blacklisted ones from the future pool. +/datum/controller/subsystem/processing/round/proc/setup_trait(datum/round_trait/trait_type) + var/datum/round_trait/trait_instance = new trait_type() + round_traits += trait_instance + log_game("round trait: [trait_instance.name] chosen for this round.") + if(!trait_instance.blacklist) + return + for(var/i in trait_instance.blacklist) + var/datum/round_trait/trait_to_remove = i + selectable_traits_by_types[initial(trait_to_remove.trait_type)] -= trait_to_remove diff --git a/code/datums/round_traits/_round_traits.dm b/code/datums/round_traits/_round_traits.dm new file mode 100644 index 000000000000..ecaa936ef82e --- /dev/null +++ b/code/datums/round_traits/_round_traits.dm @@ -0,0 +1,60 @@ +///Base class of round traits. These are used to influence rounds in one way or the other by influencing the levers of the round. + +/datum/round_trait + ///Name of the trait + var/name = "unnamed round trait" + ///The type of this trait. Used to classify how this trait influences the round + var/trait_type = ROUND_TRAIT_NEUTRAL + ///Whether or not this trait uses process() + var/trait_processes = FALSE + ///Whether this trait is always enabled; generally used for debugging + var/force = FALSE + ///Chance relative to other traits of its type to be picked + var/weight = 10 + ///Does this trait show in the human report? + var/show_in_human_report = FALSE + ///Does this trait show in the xeno report? + var/show_in_xeno_report = FALSE + ///What message to show in the human report? + var/human_report_message + ///What message to show in the xeno report? + var/xeno_report_message + ///What trait does this round trait give? gives none if null + var/trait_to_give + ///What traits are incompatible with this one? + var/blacklist + ///Extra flags for round traits such as it being abstract + var/trait_flags + /// Whether or not this trait can be reverted by an admin + var/can_revert = TRUE + + +/datum/round_trait/New() + . = ..() + SSticker.OnRoundstart(CALLBACK(src, .proc/on_round_start)) + if(trait_processes) + START_PROCESSING(SSround, src) + if(trait_to_give) + ADD_TRAIT(SSround, trait_to_give, TRAIT_SOURCE_ROUND) + +/datum/round_trait/Destroy() + SSround.round_traits -= src + return ..() + +///Proc ran when round starts. Use this for roundstart effects. +/datum/round_trait/proc/on_round_start() + return + +///type of info the human report has on this trait, if any. +/datum/round_trait/proc/get_report() + return "[name] - [human_report_message]" + +/// Will attempt to revert the round trait, used by admins. +/datum/round_trait/proc/revert() + if(!can_revert) + CRASH("revert() was called on [type], which can't be reverted!") + + if(trait_to_give) + REMOVE_TRAIT(SSround, trait_to_give, TRAIT_SOURCE_ROUND) + + qdel(src) diff --git a/code/datums/round_traits/admin_panel.dm b/code/datums/round_traits/admin_panel.dm new file mode 100644 index 000000000000..ed667d7e4263 --- /dev/null +++ b/code/datums/round_traits/admin_panel.dm @@ -0,0 +1,133 @@ +/// Opens the station traits admin panel +/datum/admins/proc/round_traits_panel() + set name = "Modify Round Traits" + set category = "Admin.Events" + + var/static/datum/round_traits_panel/round_traits_panel = new + round_traits_panel.tgui_interact(usr) + +/datum/round_traits_panel + var/static/list/future_traits + +/datum/round_traits_panel/ui_data(mob/user) + var/list/data = list() + + data["too_late_to_revert"] = too_late_to_revert() + + var/list/current_round_traits = list() + for (var/datum/round_trait/round_trait as anything in SSround.round_traits) + current_round_traits += list(list( + "name" = round_trait.name, + "can_revert" = round_trait.can_revert, + "ref" = REF(round_trait), + )) + + data["current_traits"] = current_round_traits + data["future_round_traits"] = future_traits + + return data + +/datum/round_traits_panel/ui_static_data(mob/user) + var/list/data = list() + + var/list/valid_round_traits = list() + + for (var/datum/round_trait/round_trait_path as anything in subtypesof(/datum/round_trait)) + valid_round_traits += list(list( + "name" = initial(round_trait_path.name), + "path" = round_trait_path, + )) + + data["valid_round_traits"] = valid_round_traits + + return data + +/datum/round_traits_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if (.) + return + + switch (action) + if ("revert") + var/ref = params["ref"] + if (!ref) + return TRUE + + var/datum/round_trait/round_trait = locate(ref) + + if (!istype(round_trait)) + return TRUE + + if (too_late_to_revert()) + to_chat(usr, SPAN_WARNING("It's too late to revert station traits, the round has already started!")) + return TRUE + + if (!round_trait.can_revert) + stack_trace("[round_trait.type] can't be reverted, but was requested anyway.") + return TRUE + + var/message = "[key_name(usr)] reverted the station trait [round_trait.name] ([round_trait.type])" + log_admin(message) + message_admins(message) + + round_trait.revert() + + return TRUE + if ("setup_future_traits") + if (too_late_for_future_traits()) + to_chat(usr, SPAN_WARNING("It's too late to add future station traits, the round is already over!")) + return TRUE + + var/list/new_future_traits = list() + var/list/round_trait_names = list() + + for (var/round_trait_text in params["round_traits"]) + var/datum/round_trait/round_trait_path = text2path(round_trait_text) + if (!ispath(round_trait_path, /datum/round_trait) || round_trait_path == /datum/round_trait) + log_admin("[key_name(usr)] tried to set an invalid future station trait: [round_trait_text]") + to_chat(usr, SPAN_WARNING("Invalid future station trait: [round_trait_text]")) + return TRUE + + round_trait_names += initial(round_trait_path.name) + + new_future_traits += list(list( + "name" = initial(round_trait_path.name), + "path" = round_trait_path, + )) + + var/message = "[key_name(usr)] has prepared the following station traits for next round: [round_trait_names.Join(", ") || "None"]" + log_admin(message) + message_admins(message) + + future_traits = new_future_traits + rustg_file_write(json_encode(params["round_traits"]), FUTURE_ROUND_TRAITS_FILE) + + return TRUE + if ("clear_future_traits") + if (!future_traits) + to_chat(usr, SPAN_WARNING("There are no future station traits.")) + return TRUE + + var/message = "[key_name(usr)] has cleared the station traits for next round." + log_admin(message) + message_admins(message) + + fdel(FUTURE_ROUND_TRAITS_FILE) + future_traits = null + + return TRUE + +/datum/round_traits_panel/proc/too_late_for_future_traits() + return SSticker.current_state >= GAME_STATE_FINISHED + +/datum/round_traits_panel/proc/too_late_to_revert() + return SSticker.current_state >= GAME_STATE_PLAYING + +/datum/round_traits_panel/ui_status(mob/user, datum/ui_state/state) + return check_rights_for(user.client, R_EVENT) ? UI_INTERACTIVE : UI_CLOSE + +/datum/round_traits_panel/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "RoundTraitsPanel") + ui.open() diff --git a/code/datums/round_traits/human_positive.dm b/code/datums/round_traits/human_positive.dm new file mode 100644 index 000000000000..10209b890380 --- /dev/null +++ b/code/datums/round_traits/human_positive.dm @@ -0,0 +1,10 @@ +/datum/round_trait/galactic_grant + name = "Galactic grant" + trait_type = ROUND_TRAIT_POSITIVE + weight = 5 + show_in_human_report = TRUE + human_report_message = "Your station has been selected for a special grant. Some extra funds has been made available to your cargo department." + force = TRUE + +/datum/round_trait/galactic_grant/on_round_start() + supply_controller.points += 500 diff --git a/tgui/packages/tgui/interfaces/RoundTraitsPanel.tsx b/tgui/packages/tgui/interfaces/RoundTraitsPanel.tsx new file mode 100644 index 000000000000..2184697c2b31 --- /dev/null +++ b/tgui/packages/tgui/interfaces/RoundTraitsPanel.tsx @@ -0,0 +1,250 @@ +import { filterMap } from 'common/collections'; +import { exhaustiveCheck } from 'common/exhaustive'; +import { BooleanLike } from 'common/react'; +import { useBackend, useLocalState } from '../backend'; +import { Box, Button, Divider, Dropdown, Stack, Tabs } from '../components'; +import { Window } from '../layouts'; + +type CurrentRoundTrait = { + can_revert: BooleanLike; + name: string; + ref: string; +}; + +type ValidRoundTrait = { + name: string; + path: string; +}; + +type RoundTraitsData = { + current_traits: CurrentRoundTrait[]; + future_round_traits?: ValidRoundTrait[]; + too_late_to_revert: BooleanLike; + valid_round_traits: ValidRoundTrait[]; +}; + +enum Tab { + SetupFutureRoundTraits, + ViewRoundTraits, +} + +const FutureRoundTraitsPage = (props, context) => { + const { act, data } = useBackend(context); + const { future_round_traits } = data; + + const [selectedTrait, setSelectedTrait] = useLocalState( + context, + 'selectedFutureTrait', + null + ); + + const traitsByName = Object.fromEntries( + data.valid_round_traits.map((trait) => { + return [trait.name, trait.path]; + }) + ); + + const traitNames = Object.keys(traitsByName); + traitNames.sort(); + + return ( + + + + + + + + + + + + + + {Array.isArray(future_round_traits) ? ( + future_round_traits.length > 0 ? ( + + {future_round_traits.map((trait) => ( + + + {trait.name} + + + + + + + ))} + + ) : ( + <> + No round traits will run next round. + + + + + + ) + ) : ( + <> + No future round traits are planned. + + + + + + )} + + ); +}; + +const ViewRoundTraitsPage = (props, context) => { + const { act, data } = useBackend(context); + + return data.current_traits.length > 0 ? ( + + {data.current_traits.map((roundTrait) => ( + + + {roundTrait.name} + + + + act('revert', { + ref: roundTrait.ref, + }) + } + /> + + + + ))} + + ) : ( + There are no active round traits. + ); +}; + +export const RoundTraitsPanel = (props, context) => { + const [currentTab, setCurrentTab] = useLocalState( + context, + 'round_traits_tab', + Tab.ViewRoundTraits + ); + + let currentPage; + + switch (currentTab) { + case Tab.SetupFutureRoundTraits: + currentPage = ; + break; + case Tab.ViewRoundTraits: + currentPage = ; + break; + default: + exhaustiveCheck(currentTab); + } + + return ( + + + + setCurrentTab(Tab.ViewRoundTraits)}> + View + + + setCurrentTab(Tab.SetupFutureRoundTraits)}> + Edit + + + + + + {currentPage} + + + ); +}; From 8ab2edceaf8112b6c0faef3f867ca065743b80a2 Mon Sep 17 00:00:00 2001 From: harryob Date: Fri, 10 Feb 2023 01:39:45 +0000 Subject: [PATCH 02/14] more work on the tgui to be done --- code/datums/round_traits/_round_traits.dm | 7 +- code/datums/round_traits/human_positive.dm | 20 ++++-- code/modules/admin/admin_verbs.dm | 3 +- code/modules/almayer/machinery.dm | 37 ++++++++++ .../tgui/interfaces/HumanEventsComputer.tsx | 72 +++++++++++++++++++ 5 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/HumanEventsComputer.tsx diff --git a/code/datums/round_traits/_round_traits.dm b/code/datums/round_traits/_round_traits.dm index ecaa936ef82e..62b47e691857 100644 --- a/code/datums/round_traits/_round_traits.dm +++ b/code/datums/round_traits/_round_traits.dm @@ -31,7 +31,8 @@ /datum/round_trait/New() . = ..() - SSticker.OnRoundstart(CALLBACK(src, .proc/on_round_start)) + SSticker.OnRoundstart(CALLBACK(src, PROC_REF(on_round_start))) + setup_report_messages() if(trait_processes) START_PROCESSING(SSround, src) if(trait_to_give) @@ -49,6 +50,10 @@ /datum/round_trait/proc/get_report() return "[name] - [human_report_message]" +/// prepares the relevant report messages, stub +/datum/round_trait/proc/setup_report_messages() + return + /// Will attempt to revert the round trait, used by admins. /datum/round_trait/proc/revert() if(!can_revert) diff --git a/code/datums/round_traits/human_positive.dm b/code/datums/round_traits/human_positive.dm index 10209b890380..ed07001e4f31 100644 --- a/code/datums/round_traits/human_positive.dm +++ b/code/datums/round_traits/human_positive.dm @@ -1,10 +1,20 @@ -/datum/round_trait/galactic_grant - name = "Galactic grant" +/datum/round_trait/book_balancing + name = "A.S.R.S. Book Balancing" trait_type = ROUND_TRAIT_POSITIVE weight = 5 show_in_human_report = TRUE - human_report_message = "Your station has been selected for a special grant. Some extra funds has been made available to your cargo department." + human_report_message = "I'm not sure what happened." force = TRUE -/datum/round_trait/galactic_grant/on_round_start() - supply_controller.points += 500 +/datum/round_trait/book_balancing/setup_report_messages() + var/who = pick("Requistions Officer", "Commanding Officer", "Executive Officer", "Rifleman") + var/what = pick("made a deal", "had a negotation", "made a trade", "had an exchange", "had an interesting conversation") + var/where = pick("on a recent stop to a leisure planet", "on shore leave at a station", "on a back water colony") + human_report_message = "The [who] [what] [where] and managed to secure some additional funding for the operation. Unfortunately, the upfront funding results in less resources available over time." + +/datum/round_trait/book_balancing/on_round_start() + supply_controller.points += 800 + supply_controller.points_per_process = 0.6 + + + diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index fd552e7b6a77..94e4dd26e7f7 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -122,7 +122,8 @@ var/list/admin_verbs_minor_event = list( /client/proc/cmd_admin_medals_panel, // Marine and Xeno medals editor panel /client/proc/force_event, /client/proc/toggle_events, - /client/proc/toggle_shipside_sd + /client/proc/toggle_shipside_sd, + /datum/admins/proc/round_traits_panel, ) var/list/admin_verbs_major_event = list( /client/proc/enable_event_mob_verbs, diff --git a/code/modules/almayer/machinery.dm b/code/modules/almayer/machinery.dm index 14fe0b4bf8c4..242a7f48db76 100644 --- a/code/modules/almayer/machinery.dm +++ b/code/modules/almayer/machinery.dm @@ -262,6 +262,43 @@ icon = 'icons/obj/structures/props/almayer_props.dmi' icon_state = "sensor_comp1" +/obj/structure/prop/almayer/computers/sensor_computer1/attack_hand(mob/user) + . = ..() + + if(user.is_mob_incapacitated()) + return + + tgui_interact(user) + +/obj/structure/prop/almayer/computers/sensor_computer1/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "HumanEventsComputer") + ui.open() + +/obj/structure/prop/almayer/computers/sensor_computer1/ui_data(mob/user) + var/data = list() + + data["traits"] = list() + for(var/datum/round_trait/trait as anything in SSround.round_traits) + if(!trait.show_in_human_report || !trait.human_report_message) + continue + + var/trait_info = list() + trait_info["name"] = trait.name + trait_info["report"] = trait.human_report_message + data["traits"] += list(trait_info) + + return data + +/obj/structure/prop/almayer/computers/sensor_computer1/ui_static_data(mob/user) + var/data = list() + + data["shipmap_name"] = SSmapping.get_main_ship_name() + data["groundmap_name"] = SSmapping.configs[GROUND_MAP].map_name + + return data + /obj/structure/prop/almayer/computers/sensor_computer2 name = "sensor computer" desc = "The IBM series 10 computer retrofitted to work as a sensor computer for the ship. While somewhat dated it still serves its purpose." diff --git a/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx b/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx new file mode 100644 index 000000000000..63ec6701f3a1 --- /dev/null +++ b/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx @@ -0,0 +1,72 @@ +import { useBackend } from '../backend'; +import { Button, Section, Stack } from '../components'; +import { Window } from '../layouts'; + +interface EventComputerData { + shipmap_name: String; + groundmap_name: String; + traits: TraitItem[]; +} + +interface TraitItem { + name: String; + report: String; +} + +export const HumanEventsComputer = (props, context) => { + const { data } = useBackend(context); + return ( + + + + + + + + + + + + + ); +}; + +const ShipInfo = (props, context) => { + const { data } = useBackend(context); + const { shipmap_name, groundmap_name } = data; + return ( +
+ + +

Ship: {shipmap_name}

+

Orbiting:{groundmap_name}

+
+ +

Time: 12:07

+
+
+
+ ); +}; + +const Notifications = (props, context) => { + const { data } = useBackend(context); + const traits = Array.from(data.traits); + + return ( + + +
+ {traits.map((val, index) => ( + + ))} +
+
+ +
woooh woaah!!
+
+
+ ); +}; From a022bc851f33543467089f815b711784dabbd8f7 Mon Sep 17 00:00:00 2001 From: harryob Date: Wed, 15 Feb 2023 12:51:37 +0000 Subject: [PATCH 03/14] adds some more dummy round traits --- ColonialMarinesALPHA.dme | 1 + code/__DEFINES/round.dm | 11 +++- code/__DEFINES/traits.dm | 5 ++ .../controllers/subsystem/processing/round.dm | 16 +++-- code/datums/round_traits/_round_traits.dm | 5 -- code/datums/round_traits/human_positive.dm | 15 +++-- code/datums/round_traits/neutral.dm | 19 ++++++ code/game/jobs/job/job.dm | 3 + .../tgui/interfaces/HumanEventsComputer.tsx | 65 ++++++++++++++----- 9 files changed, 104 insertions(+), 36 deletions(-) create mode 100644 code/datums/round_traits/neutral.dm diff --git a/ColonialMarinesALPHA.dme b/ColonialMarinesALPHA.dme index a98a21060beb..568ea1266483 100644 --- a/ColonialMarinesALPHA.dme +++ b/ColonialMarinesALPHA.dme @@ -525,6 +525,7 @@ #include "code\datums\round_traits\_round_traits.dm" #include "code\datums\round_traits\admin_panel.dm" #include "code\datums\round_traits\human_positive.dm" +#include "code\datums\round_traits\neutral.dm" #include "code\datums\stamina\_stamina.dm" #include "code\datums\stamina\none.dm" #include "code\datums\statistics\cause_data.dm" diff --git a/code/__DEFINES/round.dm b/code/__DEFINES/round.dm index 3c88e5161ed0..1959f63b098f 100644 --- a/code/__DEFINES/round.dm +++ b/code/__DEFINES/round.dm @@ -1,6 +1,11 @@ -#define ROUND_TRAIT_POSITIVE 1 -#define ROUND_TRAIT_NEUTRAL 2 -#define ROUND_TRAIT_NEGATIVE 3 +#define ROUND_TRAIT_HUMAN_POSITIVE "human_positive" +#define ROUND_TRAIT_HUMAN_NEGATIVE "human_negative" + +#define ROUND_TRAIT_XENO_POSITIVE "xeno_positive" +#define ROUND_TRAIT_XENO_NEGATIVE "xeno_negative" + +#define ROUND_TRAIT_NEUTRAL "neutral" + #define ROUND_TRAIT_ABSTRACT (1<<0) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 099c25e3245a..5443fdc9a220 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -195,6 +195,11 @@ //This item will force clickdrag to work even if the preference to disable is enabled. (Full-auto items) #define TRAIT_OVERRIDE_CLICKDRAG "t_override_clickdrag" +// Round Traits + +#define TRAIT_STATION_CRYOSLEEP_SICKNESS "t_cryosleep_sickness" + + //List of all traits GLOBAL_LIST_INIT(mob_traits, list( TRAIT_YAUTJA_TECH, diff --git a/code/controllers/subsystem/processing/round.dm b/code/controllers/subsystem/processing/round.dm index 9a279363da24..6ca65393d97f 100644 --- a/code/controllers/subsystem/processing/round.dm +++ b/code/controllers/subsystem/processing/round.dm @@ -55,13 +55,21 @@ PROCESSING_SUBSYSTEM_DEF(round) continue //Dont add abstract ones to it selectable_traits_by_types[initial(trait_typepath.trait_type)][trait_typepath] = initial(trait_typepath.weight) - var/positive_trait_count = pick(20;0, 5;1, 1;2) + var/human_positive_trait_count = pick(20;0, 5;1, 1;2) + var/human_negative_trait_count = pick(20;0, 5;1, 1;2) + + var/xeno_positive_trait_count = pick(20;0, 5;1, 1;2) + var/xeno_negative_trait_count = pick(20;0, 5;1, 1;2) + var/neutral_trait_count = pick(10;0, 10;1, 3;2) - var/negative_trait_count = pick(20;0, 5;1, 1;2) - pick_traits(ROUND_TRAIT_POSITIVE, positive_trait_count) + pick_traits(ROUND_TRAIT_HUMAN_POSITIVE, human_positive_trait_count) + pick_traits(ROUND_TRAIT_HUMAN_NEGATIVE, human_negative_trait_count) + + pick_traits(ROUND_TRAIT_XENO_POSITIVE, xeno_positive_trait_count) + pick_traits(ROUND_TRAIT_XENO_NEGATIVE, xeno_negative_trait_count) + pick_traits(ROUND_TRAIT_NEUTRAL, neutral_trait_count) - pick_traits(ROUND_TRAIT_NEGATIVE, negative_trait_count) ///Picks traits of a specific category (e.g. bad or good) and a specified amount, then initializes them, adds them to the list of traits, ///then removes them from possible traits as to not roll twice. diff --git a/code/datums/round_traits/_round_traits.dm b/code/datums/round_traits/_round_traits.dm index 62b47e691857..839a47f80ce4 100644 --- a/code/datums/round_traits/_round_traits.dm +++ b/code/datums/round_traits/_round_traits.dm @@ -32,7 +32,6 @@ /datum/round_trait/New() . = ..() SSticker.OnRoundstart(CALLBACK(src, PROC_REF(on_round_start))) - setup_report_messages() if(trait_processes) START_PROCESSING(SSround, src) if(trait_to_give) @@ -50,10 +49,6 @@ /datum/round_trait/proc/get_report() return "[name] - [human_report_message]" -/// prepares the relevant report messages, stub -/datum/round_trait/proc/setup_report_messages() - return - /// Will attempt to revert the round trait, used by admins. /datum/round_trait/proc/revert() if(!can_revert) diff --git a/code/datums/round_traits/human_positive.dm b/code/datums/round_traits/human_positive.dm index ed07001e4f31..e5242cb6e64a 100644 --- a/code/datums/round_traits/human_positive.dm +++ b/code/datums/round_traits/human_positive.dm @@ -1,20 +1,21 @@ /datum/round_trait/book_balancing name = "A.S.R.S. Book Balancing" - trait_type = ROUND_TRAIT_POSITIVE + trait_type = ROUND_TRAIT_HUMAN_POSITIVE weight = 5 show_in_human_report = TRUE - human_report_message = "I'm not sure what happened." + human_report_message = "Someone got us more money upfront for less over time. Hope the operation doesn't drag on." force = TRUE -/datum/round_trait/book_balancing/setup_report_messages() - var/who = pick("Requistions Officer", "Commanding Officer", "Executive Officer", "Rifleman") +/datum/round_trait/book_balancing/New() + . = ..() + + var/who = pick("The Requistions Officer", "The Commanding Officer", "The Executive Officer", "A Rifleman") var/what = pick("made a deal", "had a negotation", "made a trade", "had an exchange", "had an interesting conversation") var/where = pick("on a recent stop to a leisure planet", "on shore leave at a station", "on a back water colony") - human_report_message = "The [who] [what] [where] and managed to secure some additional funding for the operation. Unfortunately, the upfront funding results in less resources available over time." + human_report_message = "[who] [what] [where] and managed to secure some additional funding for the operation. Unfortunately, the upfront funding results in less resources available over time." /datum/round_trait/book_balancing/on_round_start() supply_controller.points += 800 supply_controller.points_per_process = 0.6 - - +/datum/round_trait/ diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm new file mode 100644 index 000000000000..d147e2de3022 --- /dev/null +++ b/code/datums/round_traits/neutral.dm @@ -0,0 +1,19 @@ +/datum/round_trait/black_market + name = "Illicit Dealings" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 5 + show_in_human_report = TRUE + human_report_message = "The software managing the A.S.R.S. has been playing up lately, with some unusual transmissions appearing on the terminals. Seems strange." + force = TRUE + +/datum/round_trait/black_market/on_round_start() + supply_controller.black_market_enabled = TRUE + +/datum/round_trait/bad_wakeup + name = "Faulty Cryogenics" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 5 + show_in_human_report = TRUE + human_report_message = "A.R.E.S. was flagging up some errors for a minor subsystem in the cryogenics pods. Should all be fine." + trait_to_give = TRAIT_STATION_CRYOSLEEP_SICKNESS + force = TRUE diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index e5980c338979..8392a24e7f82 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -294,6 +294,9 @@ pod.go_in_cryopod(human, TRUE) break + if(HAS_TRAIT(SSround, TRAIT_STATION_CRYOSLEEP_SICKNESS)) + human.vomit_on_floor() + human.sec_hud_set_ID() human.hud_set_squad() diff --git a/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx b/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx index 63ec6701f3a1..358529a9459c 100644 --- a/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx +++ b/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx @@ -1,16 +1,16 @@ -import { useBackend } from '../backend'; +import { useBackend, useLocalState } from '../backend'; import { Button, Section, Stack } from '../components'; import { Window } from '../layouts'; interface EventComputerData { - shipmap_name: String; - groundmap_name: String; + shipmap_name: string; + groundmap_name: string; traits: TraitItem[]; } interface TraitItem { - name: String; - report: String; + name: string; + report: string; } export const HumanEventsComputer = (props, context) => { @@ -18,11 +18,11 @@ export const HumanEventsComputer = (props, context) => { return ( - + - + @@ -36,13 +36,29 @@ const ShipInfo = (props, context) => { const { shipmap_name, groundmap_name } = data; return (
- + -

Ship: {shipmap_name}

-

Orbiting:{groundmap_name}

+ + + Ship: {shipmap_name} + + + Orbiting: {groundmap_name} + + + Time: 12:07 + +
-

Time: 12:07

+ + + User: Daniel Jimenez + + + Assignment: Executive Officer + +
@@ -53,19 +69,34 @@ const Notifications = (props, context) => { const { data } = useBackend(context); const traits = Array.from(data.traits); + const [currentNotification, setNotification] = useLocalState( + context, + 'notificationText', + '' + ); + return ( - -
- {traits.map((val, index) => ( - ))}
- -
woooh woaah!!
+ +
+ { + traits.find((element) => element.name === currentNotification) + ?.report + } +
); From e5dde656bff7ca5c0f830a0ac7ffbff1b054a552 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 26 Feb 2023 20:39:43 +0000 Subject: [PATCH 04/14] todo: debug --- code/__DEFINES/traits.dm | 2 +- code/controllers/subsystem/processing/round.dm | 3 +++ code/datums/round_traits/human_positive.dm | 4 +--- code/datums/round_traits/neutral.dm | 2 +- code/game/jobs/job/job.dm | 4 ++-- tgui/packages/tgui/interfaces/HumanEventsComputer.tsx | 6 ++++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index de623e3c7b97..0c1c7aa55ff6 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -201,7 +201,7 @@ // Round Traits -#define TRAIT_STATION_CRYOSLEEP_SICKNESS "t_cryosleep_sickness" +#define TRAIT_ROUND_CRYOSLEEP_SICKNESS "t_cryosleep_sickness" //-- structure traits -- // TABLE TRAITS diff --git a/code/controllers/subsystem/processing/round.dm b/code/controllers/subsystem/processing/round.dm index 6ca65393d97f..8b5489f8ffc5 100644 --- a/code/controllers/subsystem/processing/round.dm +++ b/code/controllers/subsystem/processing/round.dm @@ -83,6 +83,9 @@ PROCESSING_SUBSYSTEM_DEF(round) ///Creates a given trait of a specific type, while also removing any blacklisted ones from the future pool. /datum/controller/subsystem/processing/round/proc/setup_trait(datum/round_trait/trait_type) + if(!trait_type) + return + var/datum/round_trait/trait_instance = new trait_type() round_traits += trait_instance log_game("round trait: [trait_instance.name] chosen for this round.") diff --git a/code/datums/round_traits/human_positive.dm b/code/datums/round_traits/human_positive.dm index e5242cb6e64a..76654dd9e939 100644 --- a/code/datums/round_traits/human_positive.dm +++ b/code/datums/round_traits/human_positive.dm @@ -10,12 +10,10 @@ . = ..() var/who = pick("The Requistions Officer", "The Commanding Officer", "The Executive Officer", "A Rifleman") - var/what = pick("made a deal", "had a negotation", "made a trade", "had an exchange", "had an interesting conversation") + var/what = pick("made a deal", "had a negotation while", "made a trade", "had an exchange", "had an interesting conversation") var/where = pick("on a recent stop to a leisure planet", "on shore leave at a station", "on a back water colony") human_report_message = "[who] [what] [where] and managed to secure some additional funding for the operation. Unfortunately, the upfront funding results in less resources available over time." /datum/round_trait/book_balancing/on_round_start() supply_controller.points += 800 supply_controller.points_per_process = 0.6 - -/datum/round_trait/ diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index d147e2de3022..4a176f55f437 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -15,5 +15,5 @@ weight = 5 show_in_human_report = TRUE human_report_message = "A.R.E.S. was flagging up some errors for a minor subsystem in the cryogenics pods. Should all be fine." - trait_to_give = TRAIT_STATION_CRYOSLEEP_SICKNESS + trait_to_give = TRAIT_ROUND_CRYOSLEEP_SICKNESS force = TRUE diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 8392a24e7f82..9b20eb40bccf 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -294,8 +294,8 @@ pod.go_in_cryopod(human, TRUE) break - if(HAS_TRAIT(SSround, TRAIT_STATION_CRYOSLEEP_SICKNESS)) - human.vomit_on_floor() + if(HAS_TRAIT(SSround, TRAIT_ROUND_CRYOSLEEP_SICKNESS)) + addtimer(human, CALLBACK(TYPE_PROC_REF(/mob/living/carbon/human, vomit_on_floor)), range(1-5) SECONDS) human.sec_hud_set_ID() human.hud_set_squad() diff --git a/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx b/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx index 358529a9459c..64e4cd9a1be4 100644 --- a/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx +++ b/tgui/packages/tgui/interfaces/HumanEventsComputer.tsx @@ -72,7 +72,7 @@ const Notifications = (props, context) => { const [currentNotification, setNotification] = useLocalState( context, 'notificationText', - '' + traits[0] ? traits[0]?.name : '' ); return ( @@ -83,7 +83,9 @@ const Notifications = (props, context) => { From dd5db9b352094ff368dff4149347d4100fbae6a7 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:25:48 +0000 Subject: [PATCH 05/14] new traits + better handling --- ColonialMarinesALPHA.dme | 1 + code/__DEFINES/traits.dm | 8 +- code/_globalvars/misc.dm | 4 + .../controllers/subsystem/processing/round.dm | 8 +- code/datums/diseases/flu.dm | 4 + code/datums/round_traits/human_negative.dm | 15 +++ code/datums/round_traits/human_positive.dm | 3 - code/datums/round_traits/neutral.dm | 75 ++++++++++- code/game/area/areas.dm | 5 + code/game/jobs/job/job.dm | 2 +- code/game/jobs/job/marine/squad/standard.dm | 11 ++ code/game/jobs/job/marine/squads.dm | 15 ++- code/game/jobs/role_authority.dm | 6 + .../vendor_types/squad_prep/squad_prep.dm | 124 ++++++++++++++++++ .../objects/effects/landmarks/landmarks.dm | 5 + code/game/objects/structures/pipes/pipes.dm | 11 ++ code/modules/economy/Accounts.dm | 6 + code/modules/gear_presets/uscm.dm | 20 +++ 18 files changed, 314 insertions(+), 9 deletions(-) create mode 100644 code/datums/round_traits/human_negative.dm diff --git a/ColonialMarinesALPHA.dme b/ColonialMarinesALPHA.dme index 568ea1266483..e9a7d3b46dfb 100644 --- a/ColonialMarinesALPHA.dme +++ b/ColonialMarinesALPHA.dme @@ -524,6 +524,7 @@ #include "code\datums\paygrades\factions\wy\wy.dm" #include "code\datums\round_traits\_round_traits.dm" #include "code\datums\round_traits\admin_panel.dm" +#include "code\datums\round_traits\human_negative.dm" #include "code\datums\round_traits\human_positive.dm" #include "code\datums\round_traits\neutral.dm" #include "code\datums\stamina\_stamina.dm" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 5443fdc9a220..5fef44def3ec 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -197,7 +197,13 @@ // Round Traits -#define TRAIT_STATION_CRYOSLEEP_SICKNESS "t_cryosleep_sickness" +#define TRAIT_ROUND_CRYOSLEEP_SICKNESS "t_cryosleep_sickness" +#define TRAIT_ROUND_FLU_SEASON "t_flu_season" +#define TRAIT_ROUND_FAULTY_PIPING "t_faulty_piping" +#define TRAIT_ROUND_ECONOMIC_BOOM "t_economic_boom" +#define TRAIT_ROUND_ECONOMIC_SLUMP "t_economic_slump" +#define TRAIT_ROUND_STANDARD_ISSUE "t_standard_issue" +#define TRAIT_ROUND_WRONG_TUBES "t_wrongtubes" //List of all traits diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 07643e07f11a..d12dbc010e4c 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -20,3 +20,7 @@ GLOBAL_LIST_INIT(gamemode_roles, list()) GLOBAL_VAR_INIT(minimum_exterior_lighting_alpha, 255) GLOBAL_DATUM_INIT(item_to_box_mapping, /datum/item_to_box_mapping, init_item_to_box_mapping()) + +GLOBAL_VAR(temperature_change) + +GLOBAL_VAR(squad_mappings) diff --git a/code/controllers/subsystem/processing/round.dm b/code/controllers/subsystem/processing/round.dm index 6ca65393d97f..9b47a1df011a 100644 --- a/code/controllers/subsystem/processing/round.dm +++ b/code/controllers/subsystem/processing/round.dm @@ -8,7 +8,13 @@ PROCESSING_SUBSYSTEM_DEF(round) ///A list of currently active round traits var/list/round_traits = list() ///Assoc list of trait type || assoc list of traits with weighted value. Used for picking traits from a specific category. - var/list/selectable_traits_by_types = list(ROUND_TRAIT_POSITIVE = list(), ROUND_TRAIT_NEUTRAL = list(), ROUND_TRAIT_NEGATIVE = list()) + var/list/selectable_traits_by_types = list( + ROUND_TRAIT_HUMAN_POSITIVE = list(), + ROUND_TRAIT_HUMAN_NEGATIVE = list(), + ROUND_TRAIT_XENO_POSITIVE = list(), + ROUND_TRAIT_XENO_NEGATIVE = list(), + ROUND_TRAIT_NEUTRAL = list(), + ) /datum/controller/subsystem/processing/round/Initialize() diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index f2c029587616..4c168df410db 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -64,3 +64,7 @@ affected_mob.apply_damage(1, TOX) affected_mob.updatehealth() return + + +/datum/disease/flu/cryo_flu + spread_type = NON_CONTAGIOUS diff --git a/code/datums/round_traits/human_negative.dm b/code/datums/round_traits/human_negative.dm new file mode 100644 index 000000000000..afb0c7efcb0a --- /dev/null +++ b/code/datums/round_traits/human_negative.dm @@ -0,0 +1,15 @@ +/datum/round_trait/flu_season + name = "Flu Season" + trait_type = ROUND_TRAIT_HUMAN_NEGATIVE + weight = 5 + show_in_human_report = TRUE + human_report_message = "Someone was sick in cryo, and the tubes linking the pods carried the disease to the rest of us. Seems like we might be getting sick." + trait_to_give = TRAIT_ROUND_FLU_SEASON + +/datum/round_trait/faulty_piping + name = "Faulty Piping" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 1 + show_in_human_report = TRUE + human_report_message = "Looks like something got busted last time we were in drydock. Pipes are busted all over the place, looks a real mess." + trait_to_give = TRAIT_ROUND_FAULTY_PIPING diff --git a/code/datums/round_traits/human_positive.dm b/code/datums/round_traits/human_positive.dm index e5242cb6e64a..5aeed55124b5 100644 --- a/code/datums/round_traits/human_positive.dm +++ b/code/datums/round_traits/human_positive.dm @@ -4,7 +4,6 @@ weight = 5 show_in_human_report = TRUE human_report_message = "Someone got us more money upfront for less over time. Hope the operation doesn't drag on." - force = TRUE /datum/round_trait/book_balancing/New() . = ..() @@ -17,5 +16,3 @@ /datum/round_trait/book_balancing/on_round_start() supply_controller.points += 800 supply_controller.points_per_process = 0.6 - -/datum/round_trait/ diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index d147e2de3022..b743063fd6cf 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -4,7 +4,6 @@ weight = 5 show_in_human_report = TRUE human_report_message = "The software managing the A.S.R.S. has been playing up lately, with some unusual transmissions appearing on the terminals. Seems strange." - force = TRUE /datum/round_trait/black_market/on_round_start() supply_controller.black_market_enabled = TRUE @@ -15,5 +14,77 @@ weight = 5 show_in_human_report = TRUE human_report_message = "A.R.E.S. was flagging up some errors for a minor subsystem in the cryogenics pods. Should all be fine." - trait_to_give = TRAIT_STATION_CRYOSLEEP_SICKNESS + trait_to_give = TRAIT_ROUND_CRYOSLEEP_SICKNESS + +/datum/round_trait/economic_boom + name = "Economic Boom" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 5 + show_in_human_report = TRUE + human_report_message = "A small bonus has been deposited in the accounts of our personnel by The Company. Seemingly, they want everyone to co-operate with them on this operation." + trait_to_give = TRAIT_ROUND_ECONOMIC_BOOM + blacklist = list(/datum/round_trait/economic_boom) + +/datum/round_trait/economic_boom/on_round_start() + marine_announcement("As an act of generosity from Weyland-Yutani, we have deposited a bonus in each and every account located on the [MAIN_SHIP_NAME]. We hope it is spent effectively, and we hope to see increased co-operation in the future.", "Weyland-Yutani Account Manager") + +/datum/round_trait/economic_slump + name = "Economic Slump" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 5 + show_in_human_report = TRUE + human_report_message = "Command's been cutting costs again. While we were in hypersleep, we were fired and rehired on worse contracts, with much worse pay agreements." + trait_to_give = TRAIT_ROUND_ECONOMIC_SLUMP + blacklist = list(/datum/round_trait/economic_boom) + +/datum/round_trait/economic_slump/on_round_start() + marine_announcement("Due to budgetary constraints, we have been forced to alter the contracts of USCM employees on board the [MAIN_SHIP_NAME]. This is non-negotiable.", "USCM Office of Fiscal Affairs") + +/datum/round_trait/temperature_change + name = "Temperature Change" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 5 + show_in_human_report = TRUE + human_report_message = "Location we're orbiting seems to have different conditions than we were anticipating. Very unusual." + show_in_xeno_report = TRUE + xeno_report_message = "The feel of this world has changed since we emerged. The metal contraptions of the tall's are no longer rattling." + +/datum/round_trait/temperature_change/New() + . = ..() + + GLOB.temperature_change = rand(-10, 10) + +/datum/round_trait/hair_loss + name = "Hair Loss" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 1 + show_in_human_report = TRUE + human_report_message = "The ship was hit by a big blast of radiation while we were in cryogenics. Seems the systems managed to stabilize our health, but not our hair." + trait_to_give = TRAIT_ROUND_HAIR_LOSS + +/datum/round_trait/wrong_tubes + name = "Mismatched Squads" + trait_type = ROUND_TRAIT_NEUTRAL + weight = 1 + show_in_human_report = TRUE + human_report_message = "Cryogenics system's woken everyone up in the wrong pods for their squad. No biggie, looks like they've been given the right access." + trait_to_give = TRAIT_ROUND_WRONG_TUBES force = TRUE + +/datum/round_trait/wrong_tubes/New() + . = ..() + + var/list/squads = list() + + for(var/obj/effect/landmark/late_join/landmark as anything in subtypesof(/obj/effect/landmark/late_join)) + var/squad_to_add = initial(landmark.squad) + squads |= squad_to_add + + var/list/shuffled_squads = shuffle(squads.Copy()) + + var/list/squad_mappings = list() + + for(var/i = 1 to length(squads)) + squad_mappings[squads[i]] = shuffled_squads[i] + + GLOB.squad_mappings = squad_mappings diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 8c019e00c8a6..4585c5a7297c 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -98,6 +98,11 @@ all_areas += src reg_in_areas_in_z() + if(!is_ground_level(z)) + return + + temperature += GLOB.temperature_change + /area/proc/initialize_power_and_lighting(override_power) if(requires_power) luminosity = 0 diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 8392a24e7f82..1696ac31347f 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -294,7 +294,7 @@ pod.go_in_cryopod(human, TRUE) break - if(HAS_TRAIT(SSround, TRAIT_STATION_CRYOSLEEP_SICKNESS)) + if(HAS_TRAIT(SSround, TRAIT_ROUND_CRYOSLEEP_SICKNESS)) human.vomit_on_floor() human.sec_hud_set_ID() diff --git a/code/game/jobs/job/marine/squad/standard.dm b/code/game/jobs/job/marine/squad/standard.dm index e2502576e5ea..5c6996f628c9 100644 --- a/code/game/jobs/job/marine/squad/standard.dm +++ b/code/game/jobs/job/marine/squad/standard.dm @@ -16,6 +16,17 @@ flags_startup_parameters = ROLE_ADD_TO_SQUAD gear_preset = /datum/equipment_preset/wo/marine/pfc +/obj/effect/landmark/start/marine/Initialize(mapload, ...) + . = ..() + + if(!HAS_TRAIT(SSround, TRAIT_ROUND_WRONG_TUBES)) + return + + if(!squad) + return + + squad = GLOB.squad_mappings[squad] + /obj/effect/landmark/start/marine name = JOB_SQUAD_MARINE icon_state = "marine_spawn" diff --git a/code/game/jobs/job/marine/squads.dm b/code/game/jobs/job/marine/squads.dm index cf4a6407a4fc..f1fac90313ac 100644 --- a/code/game/jobs/job/marine/squads.dm +++ b/code/game/jobs/job/marine/squads.dm @@ -448,7 +448,20 @@ marines_list += M M.assigned_squad = src //Add them to the squad - C.access += (src.access + extra_access) //Add their squad access to their ID + + var/mapped_access + if(HAS_TRAIT(SSround, TRAIT_ROUND_WRONG_TUBES)) + var/mapped_name + for(var/squad in GLOB.squad_mappings) + if(GLOB.squad_mappings[squad] == name) + mapped_name = squad + break + var/datum/squad/mapped_squad = get_squad_by_name(mapped_name) + mapped_access = mapped_squad.access + var/access_to_add = mapped_access ? mapped_access : access + + C.access += (access_to_add + extra_access) //Add their squad access to their ID + C.assignment = "[name] [assignment]" SEND_SIGNAL(M, COMSIG_SET_SQUAD) diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 01e860160c48..8c01c419fdd8 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -564,6 +564,12 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou var/obj/structure/machinery/cryopod/pod = locate() in get_step(H, cardinal) if(pod) pod.go_in_cryopod(H, silent = TRUE) + if(ishuman_strict(H)) + if(HAS_TRAIT(SSround, TRAIT_ROUND_CRYOSLEEP_SICKNESS)) + addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, vomit_on_floor)), rand(1, 5) SECONDS) + if(HAS_TRAIT(SSround, TRAIT_ROUND_FLU_SEASON)) + if(prob(33)) + H.contract_disease(new /datum/disease/flu/cryo_flu) break H.sec_hud_set_ID() diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm index e022f8b28afc..f3ab9620ac03 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm @@ -13,6 +13,32 @@ return GLOB.not_incapacitated_and_adjacent_strict_state /obj/structure/machinery/cm_vending/sorted/cargo_guns/squad_prep/populate_product_list(scale) + if(HAS_TRAIT(SSround, TRAIT_ROUND_STANDARD_ISSUE)) + listed_products = list( + list("PRIMARY FIREARMS", -1, null, null), + list("M41A Pulse Rifle MK2", round(scale * 30), /obj/item/weapon/gun/rifle/m41a, VENDOR_ITEM_RECOMMENDED), + + list("PRIMARY AMMUNITION", -1, null, null), + list("M41A Magazine (10x24mm)", round(scale * 25), /obj/item/ammo_magazine/rifle, VENDOR_ITEM_REGULAR), + + list("SIDEARMS", -1, null, null), + list("M4A3 Service Pistol", round(scale * 25), /obj/item/weapon/gun/pistol/m4a3, VENDOR_ITEM_REGULAR), + + list("SIDEARM AMMUNITION", -1, null, null), + list("M4A3 Magazine (9mm)", round(scale * 25), /obj/item/ammo_magazine/pistol, VENDOR_ITEM_REGULAR), + + list("ATTACHMENTS", -1, null, null), + list("M41A Folding Stock", round(scale * 10), /obj/item/attachable/stock/rifle/collapsible, VENDOR_ITEM_REGULAR), + list("Rail Flashlight", round(scale * 25), /obj/item/attachable/flashlight, VENDOR_ITEM_RECOMMENDED), + list("Underbarrel Flashlight Grip", round(scale * 10), /obj/item/attachable/flashlight/grip, VENDOR_ITEM_RECOMMENDED), + list("Underslung Grenade Launcher", round(scale * 25), /obj/item/attachable/attached_gun/grenade, VENDOR_ITEM_REGULAR), //They already get these as on-spawns, might as well formalize some spares. + + list("UTILITIES", -1, null, null), + list("M5 Bayonet", round(scale * 25), /obj/item/attachable/bayonet, VENDOR_ITEM_REGULAR), + list("M94 Marking Flare Pack", round(scale * 10), /obj/item/storage/box/m94, VENDOR_ITEM_RECOMMENDED) + ) + return + listed_products = list( list("PRIMARY FIREARMS", -1, null, null), list("L42A Battle Rifle", round(scale * 10), /obj/item/weapon/gun/rifle/l42a, VENDOR_ITEM_REGULAR), @@ -93,6 +119,102 @@ //------------SQUAD MARINE UNIFORM AND GEAR VENDOR--------------- +GLOBAL_LIST_INIT(cm_vending_clothing_marine_standard_issue, list( + list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null), + list("Boots", 0, /obj/item/clothing/shoes/marine/knife, MARINE_CAN_BUY_SHOES, VENDOR_ITEM_MANDATORY), + list("Uniform", 0, /obj/item/clothing/under/marine, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY), + list("Gloves", 0, /obj/item/clothing/gloves/marine, MARINE_CAN_BUY_GLOVES, VENDOR_ITEM_MANDATORY), + list("Headset", 0, /obj/item/device/radio/headset/almayer/marine, MARINE_CAN_BUY_EAR, VENDOR_ITEM_MANDATORY), + list("Helmet", 0, /obj/item/clothing/head/helmet/marine, MARINE_CAN_BUY_HELMET, VENDOR_ITEM_MANDATORY), + list("MRE", 0, /obj/item/storage/box/MRE, MARINE_CAN_BUY_MRE, VENDOR_ITEM_MANDATORY), + + list("ARMOR (CHOOSE 1)", 0, null, null, null), + list("Medium Armor", 0, /obj/item/clothing/suit/storage/marine/medium, MARINE_CAN_BUY_ARMOR, VENDOR_ITEM_REGULAR), + + list("BACKPACK (CHOOSE 1)", 0, null, null, null), + list("Backpack", 0, /obj/item/storage/backpack/marine, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR), + + list("BELT (CHOOSE 1)", 0, null, null, null), + list("M276 Ammo Load Rig", 0, /obj/item/storage/belt/marine, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED), + list("M276 General Pistol Holster Rig", 0, /obj/item/storage/belt/gun/m4a3, MARINE_CAN_BUY_BELT, VENDOR_ITEM_REGULAR), + list("M276 Knife Rig (Full)", 0, /obj/item/storage/belt/knifepouch, MARINE_CAN_BUY_BELT, VENDOR_ITEM_REGULAR), + + list("POUCHES (CHOOSE 2)", 0, null, null, null), + list("Bayonet Sheath (Full)", 0, /obj/item/storage/pouch/bayonet, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + list("First-Aid Pouch (Refillable Injectors)", 0, /obj/item/storage/pouch/firstaid/full, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_RECOMMENDED), + list("First-Aid Pouch (Splints, Gauze, Ointment)", 0, /obj/item/storage/pouch/firstaid/full/alternate, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_RECOMMENDED), + list("First-Aid Pouch (Pill Packets)", 0, /obj/item/storage/pouch/firstaid/full/pills, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_RECOMMENDED), + list("Flare Pouch (Full)", 0, /obj/item/storage/pouch/flare/full, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_RECOMMENDED), + list("Small Document Pouch", 0, /obj/item/storage/pouch/document/small, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + list("Magazine Pouch", 0, /obj/item/storage/pouch/magazine, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + list("Shotgun Shell Pouch", 0, /obj/item/storage/pouch/shotgun, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + list("Medium General Pouch", 0, /obj/item/storage/pouch/general/medium, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + list("Pistol Magazine Pouch", 0, /obj/item/storage/pouch/magazine/pistol, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + list("Pistol Pouch", 0, /obj/item/storage/pouch/pistol, (MARINE_CAN_BUY_R_POUCH|MARINE_CAN_BUY_L_POUCH), VENDOR_ITEM_REGULAR), + + list("MASK (CHOOSE 1)", 0, null, null, null), + list("Gas Mask", 0, /obj/item/clothing/mask/gas, MARINE_CAN_BUY_MASK, VENDOR_ITEM_REGULAR), + list("Heat Absorbent Coif", 0, /obj/item/clothing/mask/rebreather/scarf, MARINE_CAN_BUY_MASK, VENDOR_ITEM_REGULAR), + list("Rebreather", 0, /obj/item/clothing/mask/rebreather, MARINE_CAN_BUY_MASK, VENDOR_ITEM_REGULAR), + + list("RESTRICTED FIREARMS", 0, null, null, null), + list("VP78 Pistol", 15, /obj/item/storage/box/guncase/vp78, null, VENDOR_ITEM_REGULAR), + list("SU-6 Smart Pistol", 15, /obj/item/storage/box/guncase/smartpistol, null, VENDOR_ITEM_REGULAR), + list("M41AE2 Heavy Pulse Rifle", 30, /obj/item/storage/box/guncase/lmg, null, VENDOR_ITEM_REGULAR), + list("M79 Grenade Launcher", 30, /obj/item/storage/box/guncase/m79, null, VENDOR_ITEM_REGULAR), + + list("EXPLOSIVES", 0, null, null, null), + list("M40 HEDP High Explosive Packet (x3 grenades)", 20, /obj/item/storage/box/packet/high_explosive, null, VENDOR_ITEM_REGULAR), + list("M40 HIDP Incendiary Packet (x3 grenades)", 20, /obj/item/storage/box/packet/incendiary, null, VENDOR_ITEM_REGULAR), + list("M40 HPDP White Phosphorus Packet (x3 grenades)", 20, /obj/item/storage/box/packet/phosphorus, null, VENDOR_ITEM_REGULAR), + list("M40 HSDP Smoke Packet (x3 grenades)", 10, /obj/item/storage/box/packet/smoke, null, VENDOR_ITEM_REGULAR), + list("M74 AGM-Frag Airburst Packet (x3 airburst grenades)", 15, /obj/item/storage/box/packet/airburst_he, null, VENDOR_ITEM_REGULAR), + list("M74 AGM-Incendiary Airburst Packet (x3 airburst grenades)", 15, /obj/item/storage/box/packet/airburst_incen, null, VENDOR_ITEM_REGULAR), + list("M74 AGM-Smoke Airburst Packet (x3 airburst grenades)", 10, /obj/item/storage/box/packet/airburst_smoke, null, VENDOR_ITEM_REGULAR), + list("M74 AGM-Hornet Airburst Packet (x3 airburst grenades", 15, /obj/item/storage/box/packet/hornet, null, VENDOR_ITEM_REGULAR), + list("M20 Mine Box (x4 mines)", 20, /obj/item/storage/box/explosive_mines, null, VENDOR_ITEM_REGULAR), + + list("AMMUNITION", 0, null, null, null), + list("L42A AP Magazine (10x24mm)", 10, /obj/item/ammo_magazine/rifle/l42a/ap, null, VENDOR_ITEM_REGULAR), + list("M39 AP Magazine (10x20mm)", 10, /obj/item/ammo_magazine/smg/m39/ap , null, VENDOR_ITEM_REGULAR), + list("M39 Extended Magazine (10x20mm)", 10, /obj/item/ammo_magazine/smg/m39/extended , null, VENDOR_ITEM_REGULAR), + list("M41A AP Magazine (10x24mm)", 10, /obj/item/ammo_magazine/rifle/ap , null, VENDOR_ITEM_REGULAR), + list("M41A Extended Magazine (10x24mm)", 10, /obj/item/ammo_magazine/rifle/extended , null, VENDOR_ITEM_REGULAR), + list("M44 Heavy Speed Loader (.44)", 10, /obj/item/ammo_magazine/revolver/heavy, null, VENDOR_ITEM_REGULAR), + + list("UTILITIES", 0, null, null, null), + list("Webbing", 10, /obj/item/clothing/accessory/storage/webbing, null, VENDOR_ITEM_REGULAR), + list("Brown Webbing Vest", 15, /obj/item/clothing/accessory/storage/black_vest/brown_vest, null, VENDOR_ITEM_REGULAR), + list("Black Webbing Vest", 15, /obj/item/clothing/accessory/storage/black_vest, null, VENDOR_ITEM_REGULAR), + list("SensorMate Medical HUD", 15, /obj/item/clothing/glasses/hud/sensor, null, VENDOR_ITEM_REGULAR), + list("Roller Bed", 5, /obj/item/roller, null, VENDOR_ITEM_REGULAR), + list("Fulton Device Stack", 5, /obj/item/stack/fulton, null, VENDOR_ITEM_REGULAR), + list("B12 Pattern Marine Armor", 30, /obj/item/clothing/suit/storage/marine/leader, null, VENDOR_ITEM_REGULAR), + list("Range Finder", 10, /obj/item/device/binoculars/range, null, VENDOR_ITEM_REGULAR), + list("Laser Designator", 15, /obj/item/device/binoculars/range/designator, null, VENDOR_ITEM_REGULAR), + list("Large General Pouch", 15, /obj/item/storage/pouch/general/large, null, VENDOR_ITEM_REGULAR), + list("Large Magazine Pouch", 15, /obj/item/storage/pouch/magazine/large, null, VENDOR_ITEM_REGULAR), + list("Fuel Tank Strap Pouch", 5, /obj/item/storage/pouch/flamertank, null, VENDOR_ITEM_REGULAR), + list("Shoulder Holster", 15, /obj/item/clothing/accessory/storage/holster, null, VENDOR_ITEM_REGULAR), + list("Machete Scabbard (Full)", 15, /obj/item/storage/large_holster/machete/full, null, VENDOR_ITEM_REGULAR), + list("Machete Pouch (Full)", 15, /obj/item/storage/pouch/machete/full, null, VENDOR_ITEM_REGULAR), + list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), + list("Motion Detector", 15, /obj/item/device/motiondetector, null, VENDOR_ITEM_REGULAR), + list("Data Detector", 15, /obj/item/device/motiondetector/intel, null, VENDOR_ITEM_REGULAR), + list("Whistle", 5, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), + list("Welding Goggles", 5, /obj/item/clothing/glasses/welding, null, VENDOR_ITEM_REGULAR), + list("JTAC Pamphlet", 15, /obj/item/pamphlet/skill/jtac, null, VENDOR_ITEM_REGULAR), + list("Engineering Pamphlet", 15, /obj/item/pamphlet/skill/engineer, null, VENDOR_ITEM_REGULAR), + list("Powerloader Certification", 45, /obj/item/pamphlet/skill/powerloader, null, VENDOR_ITEM_REGULAR), + list("Large Shotgun Shell Pouch", 10, /obj/item/storage/pouch/shotgun/large, null, VENDOR_ITEM_REGULAR), + + list("RADIO KEYS", 0, null, null, null), + list("Engineering Radio Encryption Key", 5, /obj/item/device/encryptionkey/engi, null, VENDOR_ITEM_REGULAR), + list("Intel Radio Encryption Key", 5, /obj/item/device/encryptionkey/intel, null, VENDOR_ITEM_REGULAR), + list("JTAC Radio Encryption Key", 5, /obj/item/device/encryptionkey/jtac, null, VENDOR_ITEM_REGULAR), + list("Supply Radio Encryption Key", 5, /obj/item/device/encryptionkey/req, null, VENDOR_ITEM_REGULAR), +)) + GLOBAL_LIST_INIT(cm_vending_clothing_marine, list( list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null), list("Boots", 0, /obj/item/clothing/shoes/marine/knife, MARINE_CAN_BUY_SHOES, VENDOR_ITEM_MANDATORY), @@ -209,6 +331,8 @@ GLOBAL_LIST_INIT(cm_vending_clothing_marine, list( vendor_role = list(JOB_SQUAD_MARINE) /obj/structure/machinery/cm_vending/clothing/marine/get_listed_products(mob/user) + if(HAS_TRAIT(SSround, TRAIT_ROUND_STANDARD_ISSUE)) + return GLOB.cm_vending_clothing_marine_standard_issue return GLOB.cm_vending_clothing_marine /obj/structure/machinery/cm_vending/clothing/marine/alpha diff --git a/code/game/objects/effects/landmarks/landmarks.dm b/code/game/objects/effects/landmarks/landmarks.dm index 8971db4110d4..128bf9c10322 100644 --- a/code/game/objects/effects/landmarks/landmarks.dm +++ b/code/game/objects/effects/landmarks/landmarks.dm @@ -366,7 +366,12 @@ /obj/effect/landmark/late_join/Initialize(mapload, ...) . = ..() + if(squad) + + if(HAS_TRAIT(SSround, TRAIT_ROUND_WRONG_TUBES)) + squad = GLOB.squad_mappings[squad] + LAZYADD(GLOB.latejoin_by_squad[squad], src) else GLOB.latejoin += src diff --git a/code/game/objects/structures/pipes/pipes.dm b/code/game/objects/structures/pipes/pipes.dm index 8fea6dc238ce..febbd68c2626 100644 --- a/code/game/objects/structures/pipes/pipes.dm +++ b/code/game/objects/structures/pipes/pipes.dm @@ -34,6 +34,17 @@ search_for_connections() + if(!is_mainship_level(z)) + return + + if(!HAS_TRAIT(SSround, TRAIT_ROUND_FAULTY_PIPING)) + return + + if(!prob(1)) + return + + cell_explosion(src, 40, 40, explosion_cause_data = create_cause_data("faulty pipes")) + /obj/structure/pipes/Destroy() for(var/mob/living/M in src) M.remove_ventcrawl() diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm index ada3e95950f0..58eaf2bfeac5 100644 --- a/code/modules/economy/Accounts.dm +++ b/code/modules/economy/Accounts.dm @@ -26,6 +26,12 @@ M.remote_access_pin = rand(1111, 111111) M.money = starting_funds * id_paygrade.pay_multiplier + if(HAS_TRAIT(SSround, TRAIT_ROUND_ECONOMIC_BOOM)) + M.money *= 3 + + if(HAS_TRAIT(SSround, TRAIT_ROUND_ECONOMIC_SLUMP)) + M.money *= 0.3 + //create an entry in the account transaction log for when it was created var/datum/transaction/T = new() T.target_name = new_owner_name diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index 66f5c48fe7d5..4b055acf777d 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -23,6 +23,26 @@ dress_shoes = list(/obj/item/clothing/shoes/dress) var/auto_squad_name +/datum/equipment_preset/uscm/New() + . = ..() + + if(!HAS_TRAIT(SSround, TRAIT_ROUND_WRONG_TUBES)) + return + + var/static/list/squad_accesses = list(ACCESS_MARINE_ALPHA, ACCESS_MARINE_BRAVO, ACCESS_MARINE_CHARLIE, ACCESS_MARINE_DELTA) + + var/has_squad_access = FALSE + for(var/squad_access in squad_accesses) + if(LAZYISIN(access, squad_access)) + has_squad_access = TRUE + break + + if(!has_squad_access) + return + + for(var/squad_access in squad_accesses) + access |= squad_access + /datum/equipment_preset/uscm/load_status(mob/living/carbon/human/H) H.nutrition = rand(NUTRITION_VERYLOW, NUTRITION_LOW) From 7e08c9b15957ce2deca5897b85be268ad4604584 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 14:09:39 +0000 Subject: [PATCH 06/14] removes one that was never gonna work without really annoying people anyway --- code/datums/round_traits/neutral.dm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index b743063fd6cf..fffc52ec709d 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -54,14 +54,6 @@ GLOB.temperature_change = rand(-10, 10) -/datum/round_trait/hair_loss - name = "Hair Loss" - trait_type = ROUND_TRAIT_NEUTRAL - weight = 1 - show_in_human_report = TRUE - human_report_message = "The ship was hit by a big blast of radiation while we were in cryogenics. Seems the systems managed to stabilize our health, but not our hair." - trait_to_give = TRAIT_ROUND_HAIR_LOSS - /datum/round_trait/wrong_tubes name = "Mismatched Squads" trait_type = ROUND_TRAIT_NEUTRAL From 955f60f8bce7b615993014033bce5d57545e8a75 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 15:17:34 +0000 Subject: [PATCH 07/14] xenos can view xeno round traits --- ColonialMarinesALPHA.dme | 1 + code/_globalvars/global_lists.dm | 2 + code/datums/round_traits/xeno_round_traits.dm | 27 ++++++ .../living/carbon/xenomorph/hive_status.dm | 3 + tgui/packages/tgui/interfaces/HiveStatus.js | 17 ++-- .../tgui/interfaces/HumanEventsComputer.tsx | 2 +- .../tgui/interfaces/XenoRoundTraits.tsx | 89 +++++++++++++++++++ 7 files changed, 130 insertions(+), 11 deletions(-) create mode 100644 code/datums/round_traits/xeno_round_traits.dm create mode 100644 tgui/packages/tgui/interfaces/XenoRoundTraits.tsx diff --git a/ColonialMarinesALPHA.dme b/ColonialMarinesALPHA.dme index 4e9b50ea2397..7577bd7b2210 100644 --- a/ColonialMarinesALPHA.dme +++ b/ColonialMarinesALPHA.dme @@ -536,6 +536,7 @@ #include "code\datums\round_traits\human_negative.dm" #include "code\datums\round_traits\human_positive.dm" #include "code\datums\round_traits\neutral.dm" +#include "code\datums\round_traits\xeno_round_traits.dm" #include "code\datums\stamina\_stamina.dm" #include "code\datums\stamina\none.dm" #include "code\datums\statistics\cause_data.dm" diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index 54c6778b1c22..b19bd89be780 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -162,6 +162,8 @@ GLOBAL_LIST_INIT_TYPED(hive_datum, /datum/hive_status, list( XENO_HIVE_YAUTJA = new /datum/hive_status/yautja() )) +GLOBAL_DATUM_INIT(xeno_round_traits, /datum/xeno_round_traits, new()) + GLOBAL_LIST_INIT(custom_event_info_list, setup_custom_event_info()) // Posters diff --git a/code/datums/round_traits/xeno_round_traits.dm b/code/datums/round_traits/xeno_round_traits.dm new file mode 100644 index 000000000000..dacd670234f4 --- /dev/null +++ b/code/datums/round_traits/xeno_round_traits.dm @@ -0,0 +1,27 @@ +/datum/xeno_round_traits/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "XenoRoundTraits") + ui.open() + +/datum/xeno_round_traits/ui_data(mob/user) + var/data = list() + + data["traits"] = list() + for(var/datum/round_trait/trait as anything in SSround.round_traits) + if(!trait.show_in_xeno_report || !trait.xeno_report_message) + continue + + var/trait_info = list() + trait_info["name"] = trait.name + trait_info["report"] = trait.xeno_report_message + data["traits"] += list(trait_info) + + return data + +/datum/xeno_round_traits/ui_static_data(mob/user) + var/data = list() + + data["groundmap_name"] = SSmapping.configs[GROUND_MAP].map_name + + return data diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index f3a06c41bd0b..2e5e4c28351c 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -215,3 +215,6 @@ return xenoSrc.overwatch(xenoTarget) + + if("roundtraits") + GLOB.xeno_round_traits.tgui_interact(usr) diff --git a/tgui/packages/tgui/interfaces/HiveStatus.js b/tgui/packages/tgui/interfaces/HiveStatus.js index 6bd5d240debc..21ecbf6a6f2b 100644 --- a/tgui/packages/tgui/interfaces/HiveStatus.js +++ b/tgui/packages/tgui/interfaces/HiveStatus.js @@ -2,16 +2,7 @@ import { classes } from 'common/react'; import { createSearch } from 'common/string'; import { Fragment } from 'inferno'; import { useBackend, useLocalState } from '../backend'; -import { - Input, - Button, - Flex, - Divider, - Collapsible, - Icon, - NumberInput, - Table, -} from '../components'; +import { Input, Button, Flex, Divider, Collapsible, Icon, NumberInput, Table } from '../components'; import { Window } from '../layouts'; const redFont = { @@ -145,6 +136,12 @@ const GeneralInformation = (props, context) => { Evilution: {evilution_level} + + + ))} + + + +
+ { + traits.find((element) => element.name === currentNotification) + ?.report + } +
+
+
+ ); +}; From 5f87b836775caeda9170e0d4b823df8a3ec04d2f Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 15:44:14 +0000 Subject: [PATCH 08/14] final touches --- code/datums/round_traits/xeno_round_traits.dm | 3 + tgui/packages/tgui/interfaces/HiveStatus.js | 8 +- .../tgui/interfaces/XenoRoundTraits.tsx | 79 ++++--------------- 3 files changed, 23 insertions(+), 67 deletions(-) diff --git a/code/datums/round_traits/xeno_round_traits.dm b/code/datums/round_traits/xeno_round_traits.dm index dacd670234f4..1dffa882c709 100644 --- a/code/datums/round_traits/xeno_round_traits.dm +++ b/code/datums/round_traits/xeno_round_traits.dm @@ -25,3 +25,6 @@ data["groundmap_name"] = SSmapping.configs[GROUND_MAP].map_name return data + +/datum/xeno_round_traits/ui_state(mob/user) + return GLOB.always_state diff --git a/tgui/packages/tgui/interfaces/HiveStatus.js b/tgui/packages/tgui/interfaces/HiveStatus.js index 99ba042b251b..872d89aff330 100644 --- a/tgui/packages/tgui/interfaces/HiveStatus.js +++ b/tgui/packages/tgui/interfaces/HiveStatus.js @@ -106,7 +106,7 @@ export const HiveStatus = (props, context) => { }; const GeneralInformation = (props, context) => { - const { data } = useBackend(context); + const { data, act } = useBackend(context); const { queen_location, hive_location, @@ -408,9 +408,9 @@ const StatusIcon = (props, context) => { } }; -const XenoCollapsible = (props, context) => { +export const XenoCollapsible = (props, context) => { const { data } = useBackend(context); - const { title, children } = props; + const { title, children, closed } = props; const { hive_color } = data; return ( @@ -418,7 +418,7 @@ const XenoCollapsible = (props, context) => { title={title} backgroundColor={!!hive_color && hive_color} color={!hive_color && 'xeno'} - open> + open={!closed}> {children} ); diff --git a/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx b/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx index f2244b920e23..e8a78c9c6e31 100644 --- a/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx +++ b/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx @@ -1,6 +1,7 @@ -import { useBackend, useLocalState } from '../backend'; -import { Button, Section, Stack } from '../components'; +import { useBackend } from '../backend'; +import { Stack } from '../components'; import { Window } from '../layouts'; +import { XenoCollapsible } from './HiveStatus'; interface EventComputerData { shipmap_name: string; @@ -16,74 +17,26 @@ interface TraitItem { export const XenoRoundTraits = (props, context) => { const { data } = useBackend(context); return ( - + - - + +

Proclamations from the Queen Mother

+

+ There {data.traits.length > 1 ? 'are' : 'is'} {data.traits.length}{' '} + Proclamation + {data.traits.length > 1 ? 's' : ''} +

- + {data.traits.map((trait) => ( + + {trait.report} + + ))}
); }; - -const ShipInfo = (props, context) => { - const { data } = useBackend(context); - const { shipmap_name, groundmap_name } = data; - return ( -
- - - - - Infesting: {groundmap_name} - - - - -
- ); -}; - -const Notifications = (props, context) => { - const { data } = useBackend(context); - const traits = Array.from(data.traits); - - const [currentNotification, setNotification] = useLocalState( - context, - 'notificationText', - traits[0] ? traits[0]?.name : '' - ); - - return ( - - -
- {traits.map((val) => ( - - ))} -
-
- -
- { - traits.find((element) => element.name === currentNotification) - ?.report - } -
-
-
- ); -}; From 791d698b27696fc4e12257ef84d06c82532e07bc Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 15:45:56 +0000 Subject: [PATCH 09/14] changes interface size --- tgui/packages/tgui/interfaces/XenoRoundTraits.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx b/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx index e8a78c9c6e31..52d4b1b92e98 100644 --- a/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx +++ b/tgui/packages/tgui/interfaces/XenoRoundTraits.tsx @@ -17,7 +17,7 @@ interface TraitItem { export const XenoRoundTraits = (props, context) => { const { data } = useBackend(context); return ( - + From d8144ef939aa6d82cb7d7bcf9eb916f3f12066ca Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 16:07:55 +0000 Subject: [PATCH 10/14] i've got to go --- code/datums/round_traits/neutral.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index fffc52ec709d..1600b3189066 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -13,7 +13,7 @@ trait_type = ROUND_TRAIT_NEUTRAL weight = 5 show_in_human_report = TRUE - human_report_message = "A.R.E.S. was flagging up some errors for a minor subsystem in the cryogenics pods. Should all be fine." + human_report_message = "ARES was flagging up some errors for a minor subsystem in the cryogenics pods. Should all be fine." trait_to_give = TRAIT_ROUND_CRYOSLEEP_SICKNESS /datum/round_trait/economic_boom From 1b7e7f1b3151307a51226b505b90d860c24c7f6e Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 16:09:11 +0000 Subject: [PATCH 11/14] the public announcement waits a bit --- code/datums/round_traits/neutral.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index 1600b3189066..07dfe0e123ea 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -26,7 +26,7 @@ blacklist = list(/datum/round_trait/economic_boom) /datum/round_trait/economic_boom/on_round_start() - marine_announcement("As an act of generosity from Weyland-Yutani, we have deposited a bonus in each and every account located on the [MAIN_SHIP_NAME]. We hope it is spent effectively, and we hope to see increased co-operation in the future.", "Weyland-Yutani Account Manager") + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(marine_announcement), "As an act of generosity from Weyland-Yutani, we have deposited a bonus in each and every account located on the [MAIN_SHIP_NAME]. We hope it is spent effectively, and we hope to see increased co-operation in the future.", "Weyland-Yutani Account Manager"), 2 MINUTES) /datum/round_trait/economic_slump name = "Economic Slump" From 387ebf1a16806dd335d996938bcbf10c23d26cf1 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 18 Mar 2023 16:10:18 +0000 Subject: [PATCH 12/14] for economic slump too --- code/datums/round_traits/neutral.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index 07dfe0e123ea..5eade42642bd 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -38,7 +38,7 @@ blacklist = list(/datum/round_trait/economic_boom) /datum/round_trait/economic_slump/on_round_start() - marine_announcement("Due to budgetary constraints, we have been forced to alter the contracts of USCM employees on board the [MAIN_SHIP_NAME]. This is non-negotiable.", "USCM Office of Fiscal Affairs") + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(marine_announcement), "Due to budgetary constraints, we have been forced to alter the contracts of USCM employees on board the [MAIN_SHIP_NAME]. This is non-negotiable.", "USCM Office of Fiscal Affairs"), 2 MINUTES) /datum/round_trait/temperature_change name = "Temperature Change" From 8aad8070832f0a5abcfdb3e58e22ba4531d2cc7f Mon Sep 17 00:00:00 2001 From: harryob Date: Sat, 18 Mar 2023 17:08:34 +0000 Subject: [PATCH 13/14] Update code/datums/round_traits/neutral.dm Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com> --- code/datums/round_traits/neutral.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index 5eade42642bd..bb473b4fdf48 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -13,7 +13,7 @@ trait_type = ROUND_TRAIT_NEUTRAL weight = 5 show_in_human_report = TRUE - human_report_message = "ARES was flagging up some errors for a minor subsystem in the cryogenics pods. Should all be fine." + human_report_message = "ARES was flagging up some errors for a minor subsystem in the cryogenics pods. Should be all fine." trait_to_give = TRAIT_ROUND_CRYOSLEEP_SICKNESS /datum/round_trait/economic_boom From 4b4e7b9198077db2582dbdad1439c464255601e6 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 19 Mar 2023 12:38:55 +0000 Subject: [PATCH 14/14] adjust weighting + removed force trait --- code/controllers/subsystem/processing/round.dm | 10 +++++----- code/datums/round_traits/neutral.dm | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/code/controllers/subsystem/processing/round.dm b/code/controllers/subsystem/processing/round.dm index 8925437e55dd..bfceedaa3548 100644 --- a/code/controllers/subsystem/processing/round.dm +++ b/code/controllers/subsystem/processing/round.dm @@ -61,13 +61,13 @@ PROCESSING_SUBSYSTEM_DEF(round) continue //Dont add abstract ones to it selectable_traits_by_types[initial(trait_typepath.trait_type)][trait_typepath] = initial(trait_typepath.weight) - var/human_positive_trait_count = pick(20;0, 5;1, 1;2) - var/human_negative_trait_count = pick(20;0, 5;1, 1;2) + var/human_positive_trait_count = pick(50;0, 5;1, 1;2) + var/human_negative_trait_count = pick(50;0, 5;1, 1;2) - var/xeno_positive_trait_count = pick(20;0, 5;1, 1;2) - var/xeno_negative_trait_count = pick(20;0, 5;1, 1;2) + var/xeno_positive_trait_count = pick(50;0, 5;1, 1;2) + var/xeno_negative_trait_count = pick(50;0, 5;1, 1;2) - var/neutral_trait_count = pick(10;0, 10;1, 3;2) + var/neutral_trait_count = pick(50;0, 5;1, 1;2) pick_traits(ROUND_TRAIT_HUMAN_POSITIVE, human_positive_trait_count) pick_traits(ROUND_TRAIT_HUMAN_NEGATIVE, human_negative_trait_count) diff --git a/code/datums/round_traits/neutral.dm b/code/datums/round_traits/neutral.dm index bb473b4fdf48..ad42c3de33c7 100644 --- a/code/datums/round_traits/neutral.dm +++ b/code/datums/round_traits/neutral.dm @@ -61,7 +61,6 @@ show_in_human_report = TRUE human_report_message = "Cryogenics system's woken everyone up in the wrong pods for their squad. No biggie, looks like they've been given the right access." trait_to_give = TRAIT_ROUND_WRONG_TUBES - force = TRUE /datum/round_trait/wrong_tubes/New() . = ..()