diff --git a/code/datums/roundstats/_defines_local.dm b/code/datums/roundstats/_defines_local.dm new file mode 100644 index 0000000000..951d7118ff --- /dev/null +++ b/code/datums/roundstats/_defines_local.dm @@ -0,0 +1,7 @@ + +#define GOAL_GENERAL "Common Goal" +#define GOAL_MEDICAL "Medical Goal" +#define GOAL_SECURITY "Security Goal" +#define GOAL_ENGINEERING "Engineering Goal" +#define GOAL_CARGO "Cargo Goal" +#define GOAL_RESEARCH "Research Goal" diff --git a/code/_global_vars/roundstats.dm b/code/datums/roundstats/roundstats.dm similarity index 70% rename from code/_global_vars/roundstats.dm rename to code/datums/roundstats/roundstats.dm index cdaf28f609..c5ceb686a7 100644 --- a/code/_global_vars/roundstats.dm +++ b/code/datums/roundstats/roundstats.dm @@ -1,55 +1,57 @@ - -//This is for the round end stats system. - -//roundstat is used for easy finding of the variables, if you ever want to delete all of this, -//just search roundstat and you'll find everywhere this thing reaches into. -//It used to be bazinga but it only fly with microwaves. - -GLOBAL_VAR_INIT(cans_opened_roundstat, 0) -GLOBAL_VAR_INIT(lights_switched_on_roundstat, 0) -GLOBAL_VAR_INIT(turbo_lift_floors_moved_roundstat, 0) -GLOBAL_VAR_INIT(lost_limbs_shift_roundstat, 0) -GLOBAL_VAR_INIT(seed_planted_shift_roundstat, 0) -GLOBAL_VAR_INIT(step_taken_shift_roundstat, 0) -GLOBAL_VAR_INIT(destroyed_research_items_roundstat, 0) -GLOBAL_VAR_INIT(items_sold_shift_roundstat, 0) -GLOBAL_VAR_INIT(disposals_flush_shift_roundstat, 0) -GLOBAL_VAR_INIT(rocks_drilled_roundstat, 0) -GLOBAL_VAR_INIT(mech_destroyed_roundstat, 0) - -/hook/roundend/proc/RoundEnd()//bazinga - - var/stats_printed_roundstat = 0 //Placeholder used as a counter. - var/list/valid_stats_list = list() //This is to be populated with the good shit - - if(GLOB.cans_opened_roundstat > 0) - valid_stats_list.Add("[GLOB.cans_opened_roundstat] cans were drank today!") - if(GLOB.lights_switched_on_roundstat > 0) - valid_stats_list.Add("[GLOB.lights_switched_on_roundstat] light switches were flipped today!") - if(GLOB.turbo_lift_floors_moved_roundstat > 20) - valid_stats_list.Add("The elevator moved up [GLOB.turbo_lift_floors_moved_roundstat] floors today!") - if(GLOB.lost_limbs_shift_roundstat > 1) - valid_stats_list.Add("[GLOB.lost_limbs_shift_roundstat] limbs left their owners bodies this shift, oh no!") - if(GLOB.seed_planted_shift_roundstat > 20) - valid_stats_list.Add("[GLOB.seed_planted_shift_roundstat] were planted according to our sensors this shift.") - if(GLOB.step_taken_shift_roundstat > 900) - valid_stats_list.Add("The employees walked a total of [GLOB.step_taken_shift_roundstat] steps for this shift! It should put them on the road to fitness!") - if(GLOB.destroyed_research_items_roundstat > 13) - valid_stats_list.Add("[GLOB.destroyed_research_items_roundstat] objects were destroyed in the name of Science! Keep it up!") - if(GLOB.items_sold_shift_roundstat > 15) - valid_stats_list.Add("The vending machines sold [GLOB.items_sold_shift_roundstat] items today.") - if(GLOB.disposals_flush_shift_roundstat > 40) - valid_stats_list.Add("The disposal system flushed a whole [GLOB.disposals_flush_shift_roundstat] times for this shift. We should really invest in waste treatement.") - if(GLOB.rocks_drilled_roundstat > 80) - valid_stats_list.Add("Our strong miners pulverized a whole [GLOB.rocks_drilled_roundstat] rock into piles of pathetic rubble.") - if(GLOB.mech_destroyed_roundstat > 1) - valid_stats_list.Add("How did you guys manage to break a mech? Those are expensive!") - - - to_world("Shift trivia!") - - while(stats_printed_roundstat < 6) - var/body = pick(valid_stats_list) - stats_printed_roundstat++ - to_world("[body]")//line that deletes the thing you just posted. - valid_stats_list -= body + +/* + * lbnesquik - Github + * Provided massive components of this. Polaris PR #5720. + */ + +//This is for the round end stats system. + +//roundstat is used for easy finding of the variables, if you ever want to delete all of this, +//just search roundstat and you'll find everywhere this thing reaches into. +//It used to be bazinga but it only fly with microwaves. + +GLOBAL_VAR_INIT(cans_opened_roundstat, 0) +GLOBAL_VAR_INIT(lights_switched_on_roundstat, 0) +GLOBAL_VAR_INIT(turbo_lift_floors_moved_roundstat, 0) +GLOBAL_VAR_INIT(lost_limbs_shift_roundstat, 0) +GLOBAL_VAR_INIT(seed_planted_shift_roundstat, 0) +GLOBAL_VAR_INIT(step_taken_shift_roundstat, 0) +GLOBAL_VAR_INIT(destroyed_research_items_roundstat, 0) +GLOBAL_VAR_INIT(items_sold_shift_roundstat, 0) +GLOBAL_VAR_INIT(disposals_flush_shift_roundstat, 0) +GLOBAL_VAR_INIT(rocks_drilled_roundstat, 0) +GLOBAL_VAR_INIT(mech_destroyed_roundstat, 0) + +/hook/roundend/proc/RoundTrivia()//bazinga + var/list/valid_stats_list = list() //This is to be populated with the good shit + + if(GLOB.lost_limbs_shift_roundstat > 1) + valid_stats_list.Add("[GLOB.lost_limbs_shift_roundstat] limbs left their owners bodies this shift, oh no!") + else if(GLOB.destroyed_research_items_roundstat > 13) + valid_stats_list.Add("[GLOB.destroyed_research_items_roundstat] objects were destroyed in the name of Science! Keep it up!") + else if(GLOB.mech_destroyed_roundstat > 1) + valid_stats_list.Add("[GLOB.mech_destroyed_roundstat] mechs were destroyed this shift. What did you do?") + else if(GLOB.seed_planted_shift_roundstat > 20) + valid_stats_list.Add("[GLOB.seed_planted_shift_roundstat] were planted according to our sensors this shift.") + + if(GLOB.rocks_drilled_roundstat > 80) + valid_stats_list.Add("Our strong miners pulverized a whole [GLOB.rocks_drilled_roundstat] piles of pathetic rubble.") + else if(GLOB.items_sold_shift_roundstat > 15) + valid_stats_list.Add("The vending machines sold [GLOB.items_sold_shift_roundstat] items today.") + else if(GLOB.step_taken_shift_roundstat > 900) + valid_stats_list.Add("The employees walked a total of [GLOB.step_taken_shift_roundstat] steps for this shift! It should put them on the road to fitness!") + + if(GLOB.cans_opened_roundstat > 0) + valid_stats_list.Add("[GLOB.cans_opened_roundstat] cans were drank today!") + else if(GLOB.lights_switched_on_roundstat > 0) + valid_stats_list.Add("[GLOB.lights_switched_on_roundstat] light switches were flipped today!") + else if(GLOB.turbo_lift_floors_moved_roundstat > 20) + valid_stats_list.Add("The elevator moved up [GLOB.turbo_lift_floors_moved_roundstat] floors today!") + else if(GLOB.disposals_flush_shift_roundstat > 40) + valid_stats_list.Add("The disposal system flushed a whole [GLOB.disposals_flush_shift_roundstat] times for this shift. We should really invest in waste treatement.") + + if(LAZYLEN(valid_stats_list)) + to_world("Shift trivia!") + + for(var/body in valid_stats_list) + to_world("[body]") diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 4f3d532c27..58107d9d0b 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -572,7 +572,7 @@ GLOBAL_LIST_EMPTY(vending_products) vend_ready = 1 currently_vending = null SStgui.update_uis(src) - + GLOB.items_sold_shift_roundstat++ /obj/machinery/vending/proc/do_logging(datum/stored_item/vending_product/R, mob/user, var/vending = 0) if(user.GetIdCard()) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index e58e427892..7b5bd1ae61 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -319,10 +319,11 @@ cell = null internal_tank = null - GLOB.mech_destroyed_roundstat++ //CHOMP Edit This is for the roundtrivia system if(smoke_possible) //Just making sure nothing is running. qdel(smoke_system) + GLOB.mech_destroyed_roundstat++ + QDEL_NULL(pr_int_temp_processor) QDEL_NULL(pr_inertial_movement) QDEL_NULL(pr_give_air) diff --git a/code/modules/food/food/drinks.dm b/code/modules/food/food/drinks.dm index 81c3e63c84..1f7bbc23d1 100644 --- a/code/modules/food/food/drinks.dm +++ b/code/modules/food/food/drinks.dm @@ -44,6 +44,7 @@ /obj/item/weapon/reagent_containers/food/drinks/proc/open(mob/user) playsound(src,"canopen", rand(10,50), 1) + GLOB.cans_opened_roundstat++ to_chat(user, "You open [src] with an audible pop!") flags |= OPENCONTAINER diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 30b5c69fef..8a05b792f3 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -17,10 +17,10 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/Initialize(var/mapload, var/planttype) . = ..() - + if(!dried_type) dried_type = type - + pixel_x = rand(-5.0, 5) pixel_y = rand(-5.0, 5) diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 2e06a8c51c..373a616e5b 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -213,6 +213,8 @@ qdel(S) + GLOB.seed_planted_shift_roundstat++ + check_health() update_icon() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 699a0cf2c4..2372be085a 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -31,7 +31,7 @@ // find the attached trunk (if present) and init gas resvr. /obj/machinery/disposal/Initialize() . = ..() - + trunk = locate() in loc if(!trunk) mode = 0 diff --git a/vorestation.dme b/vorestation.dme index 795d5f106b..83b1d7e7ad 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -114,7 +114,6 @@ #include "code\_global_vars\misc.dm" #include "code\_global_vars\mobs.dm" #include "code\_global_vars\religion.dm" -#include "code\_global_vars\roundstats.dm" #include "code\_global_vars\sensitive.dm" #include "code\_global_vars\lists\mapping.dm" #include "code\_global_vars\lists\misc.dm" @@ -433,6 +432,9 @@ #include "code\datums\repositories\decls.dm" #include "code\datums\repositories\repository.dm" #include "code\datums\repositories\unique.dm" +#include "code\datums\roundstats\_defines_local.dm" +#include "code\datums\roundstats\departmentgoal.dm" +#include "code\datums\roundstats\roundstats.dm" #include "code\datums\supplypacks\atmospherics.dm" #include "code\datums\supplypacks\contraband.dm" #include "code\datums\supplypacks\contraband_vr.dm"