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:
bbusse@gmail.com
2011-10-05 02:00:41 +00:00
parent a69a4fbc46
commit 7f7eb8dee4
7 changed files with 95 additions and 1 deletions

View 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