mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Tension Report
Adding a reporting function, available in the debug menu, which tracks some crude statistics for the current round and attempts to estimate the round's current level of stuff happening (or lack thereof) for more consistent and focused badminnery. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2329 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
57
code/datums/helper_datums/tension.dm
Normal file
57
code/datums/helper_datums/tension.dm
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#define PLAYER_WEIGHT 1
|
||||||
|
#define HUMAN_DEATH -500
|
||||||
|
#define OTHER_DEATH -500
|
||||||
|
#define EXPLO_SCORE -1000 //boum
|
||||||
|
|
||||||
|
//estimated stats
|
||||||
|
//80 minute round
|
||||||
|
//60 player server
|
||||||
|
//48k player-ticks
|
||||||
|
|
||||||
|
//60 deaths (ideally)
|
||||||
|
//20 explosions
|
||||||
|
|
||||||
|
|
||||||
|
var/global/datum/tension/tension_master
|
||||||
|
|
||||||
|
/datum/tension
|
||||||
|
var/score
|
||||||
|
|
||||||
|
var/deaths
|
||||||
|
var/human_deaths
|
||||||
|
var/explosions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
proc/process()
|
||||||
|
score += get_num_players()*PLAYER_WEIGHT
|
||||||
|
|
||||||
|
proc/get_num_players()
|
||||||
|
var/peeps = 0
|
||||||
|
for (var/mob/M in world)
|
||||||
|
if (!M.client)
|
||||||
|
continue
|
||||||
|
peeps += 1
|
||||||
|
|
||||||
|
return peeps
|
||||||
|
|
||||||
|
proc/death(var/mob/M)
|
||||||
|
if (!M) return
|
||||||
|
deaths++
|
||||||
|
|
||||||
|
if (istype(M,/mob/living/carbon/human))
|
||||||
|
score += HUMAN_DEATH
|
||||||
|
human_deaths++
|
||||||
|
else
|
||||||
|
score += OTHER_DEATH
|
||||||
|
|
||||||
|
|
||||||
|
proc/explosion()
|
||||||
|
score += EXPLO_SCORE
|
||||||
|
explosions++
|
||||||
|
|
||||||
|
New()
|
||||||
|
score = 0
|
||||||
|
deaths=0
|
||||||
|
human_deaths=0
|
||||||
|
explosions=0
|
||||||
@@ -19,6 +19,9 @@ datum/controller/game_controller
|
|||||||
air_master = new /datum/controller/air_system()
|
air_master = new /datum/controller/air_system()
|
||||||
air_master.setup()
|
air_master.setup()
|
||||||
|
|
||||||
|
if(!tension_master)
|
||||||
|
tension_master = new /datum/tension()
|
||||||
|
|
||||||
world.tick_lag = 0.9
|
world.tick_lag = 0.9
|
||||||
|
|
||||||
setup_objects()
|
setup_objects()
|
||||||
@@ -77,6 +80,8 @@ datum/controller/game_controller
|
|||||||
|
|
||||||
air_master.process()
|
air_master.process()
|
||||||
|
|
||||||
|
tension_master.process()
|
||||||
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
sun.calc_position()
|
sun.calc_position()
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
|||||||
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
|
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
|
||||||
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
|
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
|
||||||
|
|
||||||
|
tension_master.explosion()
|
||||||
|
|
||||||
if(heavy_impact_range > 1)
|
if(heavy_impact_range > 1)
|
||||||
var/datum/effect/system/explosion/E = new/datum/effect/system/explosion()
|
var/datum/effect/system/explosion/E = new/datum/effect/system/explosion()
|
||||||
E.set_up(epicenter)
|
E.set_up(epicenter)
|
||||||
|
|||||||
@@ -192,6 +192,7 @@
|
|||||||
verbs += /client/proc/toggleadminhelpsound
|
verbs += /client/proc/toggleadminhelpsound
|
||||||
verbs += /client/proc/togglebuildmodeself
|
verbs += /client/proc/togglebuildmodeself
|
||||||
verbs += /client/proc/hide_most_verbs
|
verbs += /client/proc/hide_most_verbs
|
||||||
|
verbs += /client/proc/tension_report
|
||||||
|
|
||||||
if (holder.level >= 3)//Trial Admin********************************************************************
|
if (holder.level >= 3)//Trial Admin********************************************************************
|
||||||
verbs += /obj/admins/proc/toggleaban //abandon mob
|
verbs += /obj/admins/proc/toggleaban //abandon mob
|
||||||
|
|||||||
@@ -194,3 +194,29 @@
|
|||||||
var/datum/air_group/dest_group = pick(dead_groups)
|
var/datum/air_group/dest_group = pick(dead_groups)
|
||||||
usr.loc = pick(dest_group.members)
|
usr.loc = pick(dest_group.members)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
tension_report()
|
||||||
|
set category = "Debug"
|
||||||
|
set name = "Show Tension Report"
|
||||||
|
|
||||||
|
if(!master_controller || !tension_master)
|
||||||
|
alert(usr,"Master_controller or tension_master not found.","Tension Report")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if (!tension_master.get_num_players())
|
||||||
|
alert(usr,"No players found. How the fuck are you calling this?","Tension Report")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
var/output = {"<B>TENSION REPORT</B><HR>
|
||||||
|
<B>General Statistics</B><BR>
|
||||||
|
<B>Deaths:</B> [tension_master.deaths]<BR>
|
||||||
|
---- <I>Humans:</I> [tension_master.human_deaths]<BR>
|
||||||
|
<B>Explosions:</B> [tension_master.explosions]<BR>
|
||||||
|
<BR>
|
||||||
|
<B>Current Status</B><BR>
|
||||||
|
<B>Tension:</B> [tension_master.score]<BR>
|
||||||
|
<B>Tension per player:</B> [tension_master.score/tension_master.get_num_players()]<BR>
|
||||||
|
<B>Recommendations:</B> not yet implemented<BR>
|
||||||
|
"}
|
||||||
|
|
||||||
|
usr << browse(output,"window=tensionreport")
|
||||||
@@ -7,6 +7,8 @@
|
|||||||
src.dizziness = 0
|
src.dizziness = 0
|
||||||
src.jitteriness = 0
|
src.jitteriness = 0
|
||||||
|
|
||||||
|
tension_master.death(src)
|
||||||
|
|
||||||
if (!gibbed)
|
if (!gibbed)
|
||||||
emote("deathgasp") //let the world KNOW WE ARE DEAD
|
emote("deathgasp") //let the world KNOW WE ARE DEAD
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,7 @@
|
|||||||
#include "code\datums\diseases\xeno_transformation.dm"
|
#include "code\datums\diseases\xeno_transformation.dm"
|
||||||
#include "code\datums\helper_datums\construction_datum.dm"
|
#include "code\datums\helper_datums\construction_datum.dm"
|
||||||
#include "code\datums\helper_datums\global_iterator.dm"
|
#include "code\datums\helper_datums\global_iterator.dm"
|
||||||
|
#include "code\datums\helper_datums\tension.dm"
|
||||||
#include "code\datums\spells\area_teleport.dm"
|
#include "code\datums\spells\area_teleport.dm"
|
||||||
#include "code\datums\spells\conjure.dm"
|
#include "code\datums\spells\conjure.dm"
|
||||||
#include "code\datums\spells\emplosion.dm"
|
#include "code\datums\spells\emplosion.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user