Merge pull request #1386 from CHOMPStationBot/upstream-merge-9445

[MIRROR] [MIRROR] Department and Round Goals
This commit is contained in:
Nadyr
2021-03-30 03:46:36 -04:00
committed by GitHub
9 changed files with 76 additions and 61 deletions

View File

@@ -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"

View File

@@ -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("<B>Shift trivia!</B>")
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("<B>Shift trivia!</B>")
for(var/body in valid_stats_list)
to_world("[body]")

View File

@@ -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())

View File

@@ -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)

View File

@@ -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, "<span class='notice'>You open [src] with an audible pop!</span>")
flags |= OPENCONTAINER

View File

@@ -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)

View File

@@ -213,6 +213,8 @@
qdel(S)
GLOB.seed_planted_shift_roundstat++
check_health()
update_icon()

View File

@@ -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

View File

@@ -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"