mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #6219 from Mechoid/Event_Retweakening
Tweaks the NewTM event system further
This commit is contained in:
@@ -80,3 +80,14 @@
|
||||
num++
|
||||
if(num)
|
||||
. = round(. / num, 0.1)
|
||||
|
||||
/datum/metric/proc/assess_all_outdoor_mobs()
|
||||
. = 0
|
||||
var/num = 0
|
||||
for(var/mob/living/L in player_list)
|
||||
var/turf/T = get_turf(L)
|
||||
if(istype(T) && !istype(T, /turf/space) && T.outdoors)
|
||||
. += assess_player_activity(L)
|
||||
num++
|
||||
if(num)
|
||||
. = round(. / num, 0.1)
|
||||
|
||||
21
code/modules/metric/count.dm
Normal file
21
code/modules/metric/count.dm
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Procs for counting active players in different situations. Returns the number of active players within the given cutoff.
|
||||
*/
|
||||
|
||||
/datum/metric/proc/count_all_outdoor_mobs(var/cutoff = 75)
|
||||
var/num = 0
|
||||
for(var/mob/living/L in player_list)
|
||||
var/turf/T = get_turf(L)
|
||||
if(istype(T) && !istype(T, /turf/space) && T.outdoors)
|
||||
if(assess_player_activity(L) >= cutoff)
|
||||
num++
|
||||
return num
|
||||
|
||||
/datum/metric/proc/count_all_space_mobs(var/cutoff = 75)
|
||||
var/num = 0
|
||||
for(var/mob/living/L in player_list)
|
||||
var/turf/T = get_turf(L)
|
||||
if(istype(T, /turf/space))
|
||||
if(assess_player_activity(L) >= cutoff)
|
||||
num++
|
||||
return num
|
||||
@@ -69,4 +69,4 @@
|
||||
for(var/mob/M in player_list)
|
||||
if(guess_department(M) != department) // Ignore people outside the department we're counting.
|
||||
continue
|
||||
. += 1
|
||||
. += 1
|
||||
|
||||
Reference in New Issue
Block a user