Merge pull request #157 from Rykka-Stormheart/shep-dev-round-end-stats

Port over Roundstats System
This commit is contained in:
Razgriz
2020-01-17 00:14:21 -07:00
committed by GitHub
12 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
//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] 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

View File

@@ -61,6 +61,7 @@
L.updateicon()
area.power_change()
GLOB.lights_switched_on_roundstat++
/obj/machinery/light_switch/power_change()

View File

@@ -507,6 +507,7 @@
visible_message("<span class='notice'>\The [src] clunks as it vends an additional item.</span>")
playsound(src, 'sound/items/vending.ogg', 50, 1, 1)
GLOB.items_sold_shift_roundstat++
status_message = ""
status_error = 0

View File

@@ -185,6 +185,8 @@
cell = null
internal_tank = null
GLOB.mech_destroyed_roundstat++ //This is for the roundtrivia system
QDEL_NULL(pr_int_temp_processor)
QDEL_NULL(pr_inertial_movement)
QDEL_NULL(pr_give_air)

View File

@@ -25,6 +25,7 @@
/obj/item/weapon/reagent_containers/food/drinks/proc/open(mob/user)
playsound(loc,"canopen", rand(10,50), 1)
GLOB.cans_opened_roundstat++
user << "<span class='notice'>You open [src] with an audible pop!</span>"
flags |= OPENCONTAINER

View File

@@ -305,6 +305,7 @@
if(seed.get_trait(TRAIT_SPREAD) > 0)
user << "<span class='notice'>You plant the [src.name].</span>"
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed)
GLOB.seed_planted_shift_roundstat++
qdel(src)
return

View File

@@ -567,6 +567,8 @@ turf/simulated/mineral/floor/light_corner
for (var/i = 1 to mineral.result_amount - mined_ore)
DropMineral()
GLOB.rocks_drilled_roundstat++
//destroyed artifacts have weird, unpleasant effects
//make sure to destroy them before changing the turf though
if(artifact_find && artifact_fail)

View File

@@ -236,6 +236,7 @@
return
var/S = pick(footstep_sounds)
GLOB.step_taken_shift_roundstat++
if(!S) return
// Play every 20 steps while walking, for the sneak

View File

@@ -852,6 +852,8 @@ Note that amputating the affected organ does in fact remove the infection from t
else if(disintegrate == DROPLIMB_EDGE && nonsolid) //VOREStation Add End
disintegrate = DROPLIMB_BLUNT //splut
GLOB.lost_limbs_shift_roundstat++
switch(disintegrate)
if(DROPLIMB_EDGE)
if(!clean)

View File

@@ -425,6 +425,7 @@
playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
last_sound = world.time
sleep(5) // wait for animation to finish
GLOB.disposals_flush_shift_roundstat++
H.init(src, air_contents) // copy the contents of disposer to holder

View File

@@ -127,6 +127,8 @@
doors_closing = 0 // The doors weren't open, so they are done closing
GLOB.turbo_lift_floors_moved_roundstat++
var/area/turbolift/origin = locate(current_floor.area_ref)
if(target_floor == current_floor)

View File

@@ -94,6 +94,7 @@
#include "code\_global_vars\bitfields.dm"
#include "code\_global_vars\misc.dm"
#include "code\_global_vars\mobs.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"