Makes stat panels a browser (removes lag I guess) (#8407)

* Makes stat panels a browser

* oops

* heck

* oops
This commit is contained in:
Maxim Nikitin
2020-05-06 05:12:14 -04:00
committed by GitHub
parent 62a5f06e7c
commit 02ce376d69
59 changed files with 575 additions and 261 deletions

View File

@@ -48,6 +48,7 @@
#define INIT_ORDER_TITLE 100
#define INIT_ORDER_GARBAGE 99
#define INIT_ORDER_STATPANELS 98
#define INIT_ORDER_DBCORE 95
#define INIT_ORDER_BLACKBOX 94
#define INIT_ORDER_SERVER_MAINT 93

View File

@@ -166,16 +166,11 @@
return time
//hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc.
/datum/controller/subsystem/stat_entry(msg)
/datum/controller/subsystem/proc/stat_entry_legacy()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
if(can_fire && !(SS_NO_FIRE & flags))
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%([round(tick_overrun,1)]%)|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"
var/msg = stat_entry()
var/title = name
if (can_fire)
@@ -183,6 +178,13 @@
stat(title, statclick.update(msg))
/datum/controller/subsystem/stat_entry(msg)
if(can_fire && !(SS_NO_FIRE & flags))
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%([round(tick_overrun,1)]%)|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"
return msg
/datum/controller/subsystem/proc/state_letter()
switch (state)
if (SS_RUNNING)

View File

@@ -8,7 +8,7 @@ SUBSYSTEM_DEF(acid)
var/list/processing = list()
/datum/controller/subsystem/acid/stat_entry()
..("P:[processing.len]")
return ..("P:[processing.len]")
/datum/controller/subsystem/acid/fire(resumed = 0)

View File

@@ -8,9 +8,9 @@ SUBSYSTEM_DEF(adjacent_air)
/datum/controller/subsystem/adjacent_air/stat_entry()
#ifdef TESTING
..("P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]")
return ..("P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]")
#else
..("P:[length(queue)]")
return ..("P:[length(queue)]")
#endif
/datum/controller/subsystem/adjacent_air/Initialize()

View File

@@ -64,7 +64,7 @@ SUBSYSTEM_DEF(air)
msg += "HP:[high_pressure_delta.len]|"
msg += "AS:[active_super_conductivity.len]|"
msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]"
..(msg)
return ..(msg)
/datum/controller/subsystem/air/Initialize(timeofday)
extools_update_ssair()

View File

@@ -9,7 +9,7 @@ SUBSYSTEM_DEF(augury)
var/list/observers_given_action = list()
/datum/controller/subsystem/augury/stat_entry(msg)
..("W:[watchers.len]|D:[doombringers.len]")
return ..("W:[watchers.len]|D:[doombringers.len]")
/datum/controller/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity

View File

@@ -401,7 +401,7 @@ SUBSYSTEM_DEF(demo)
msg += "Upd:[marked_dirty.len]|"
msg += "Del:[del_list.len]"
msg += "}"
..(msg)
return ..(msg)
/datum/controller/subsystem/demo/proc/mark_turf(turf/T)
if(!isturf(T))

View File

@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(disease)
return ..()
/datum/controller/subsystem/disease/stat_entry(msg)
..("P:[active_diseases.len]")
return ..("P:[active_diseases.len]")
/datum/controller/subsystem/disease/proc/get_disease_name(id)
var/datum/disease/advance/A = archive_diseases[id]

View File

@@ -8,7 +8,7 @@ SUBSYSTEM_DEF(fire_burning)
var/list/processing = list()
/datum/controller/subsystem/fire_burning/stat_entry()
..("P:[processing.len]")
return ..("P:[processing.len]")
/datum/controller/subsystem/fire_burning/fire(resumed = 0)

View File

@@ -57,7 +57,7 @@ SUBSYSTEM_DEF(garbage)
msg += "TGR:[round((totalgcs/(totaldels+totalgcs))*100, 0.01)]%"
msg += " P:[pass_counts.Join(",")]"
msg += "|F:[fail_counts.Join(",")]"
..(msg)
return ..(msg)
/datum/controller/subsystem/garbage/Shutdown()
//Adds the del() log to the qdel log file

View File

@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(idlenpcpool)
/datum/controller/subsystem/idlenpcpool/stat_entry()
var/list/idlelist = GLOB.simple_animals[AI_IDLE]
var/list/zlist = GLOB.simple_animals[AI_Z_OFF]
..("IdleNPCS:[idlelist.len]|Z:[zlist.len]")
return ..("IdleNPCS:[idlelist.len]|Z:[zlist.len]")
/datum/controller/subsystem/idlenpcpool/proc/MaxZChanged()
if (!islist(idle_mobs_by_zlevel))

View File

@@ -9,7 +9,7 @@ SUBSYSTEM_DEF(lighting)
flags = SS_TICKER
/datum/controller/subsystem/lighting/stat_entry()
..("L:[GLOB.lighting_update_lights.len]|C:[GLOB.lighting_update_corners.len]|O:[GLOB.lighting_update_objects.len]")
return ..("L:[GLOB.lighting_update_lights.len]|C:[GLOB.lighting_update_corners.len]|O:[GLOB.lighting_update_objects.len]")
/datum/controller/subsystem/lighting/Initialize(timeofday)

View File

@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(machines)
propagate_network(PC,PC.powernet)
/datum/controller/subsystem/machines/stat_entry()
..("M:[processing.len]|PN:[powernets.len]")
return ..("M:[processing.len]|PN:[powernets.len]")
/datum/controller/subsystem/machines/fire(resumed = 0)

View File

@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(mobs)
var/static/list/cubemonkeys = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_living_list.len]")
return ..("P:[GLOB.mob_living_list.len]")
/datum/controller/subsystem/mobs/proc/MaxZChanged()
if (!islist(clients_by_zlevel))

View File

@@ -8,7 +8,7 @@ SUBSYSTEM_DEF(npcpool)
/datum/controller/subsystem/npcpool/stat_entry()
var/list/activelist = GLOB.simple_animals[AI_ON]
..("NPCS:[activelist.len]")
return ..("NPCS:[activelist.len]")
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)

View File

@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(overlays)
/datum/controller/subsystem/overlays/stat_entry()
..("Ov:[length(queue)]")
return ..("Ov:[length(queue)]")
/datum/controller/subsystem/overlays/Shutdown()

View File

@@ -8,7 +8,7 @@ SUBSYSTEM_DEF(ping)
var/list/currentrun = list()
/datum/controller/subsystem/ping/stat_entry()
..("P:[GLOB.clients.len]")
return ..("P:[GLOB.clients.len]")
/datum/controller/subsystem/ping/fire(resumed = 0)

View File

@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(processing)
var/list/currentrun = list()
/datum/controller/subsystem/processing/stat_entry()
..("[stat_tag]:[processing.len]")
return ..("[stat_tag]:[processing.len]")
/datum/controller/subsystem/processing/fire(resumed = 0)
if (!resumed)

View File

@@ -9,7 +9,7 @@ SUBSYSTEM_DEF(spacedrift)
var/list/processing = list()
/datum/controller/subsystem/spacedrift/stat_entry()
..("P:[processing.len]")
return ..("P:[processing.len]")
/datum/controller/subsystem/spacedrift/fire(resumed = 0)

View File

@@ -0,0 +1,67 @@
SUBSYSTEM_DEF(statpanels)
name = "Stat Panels"
wait = 4
init_order = INIT_ORDER_STATPANELS
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
var/list/currentrun = list()
var/encoded_global_data
var/mc_data_encoded
/datum/controller/subsystem/statpanels/fire(resumed = 0)
if (!resumed)
var/datum/map_config/cached = SSmapping.next_map_config
var/list/global_data = list(
"Map: [SSmapping.config?.map_name || "Loading..."]",
cached ? "Next Map: [cached.map_name]" : null,
"Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]",
"Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]",
"Round Time: [worldtime2text()]",
"Station Time: [station_time_timestamp()]",
"Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)"
)
if(SSshuttle.emergency)
var/ETA = SSshuttle.emergency.getModeStr()
if(ETA)
global_data += "[ETA] [SSshuttle.emergency.getTimerStr()]"
encoded_global_data = url_encode(json_encode(global_data))
var/list/mc_data = list(
list("CPU:", world.cpu),
list("Instances:", "[num2text(world.contents.len, 10)]"),
list("World Time:", "[world.time]"),
list("Globals:", "Edit", "\ref[GLOB]"),
list("[config]:", "Edit", "\ref[config]"),
list("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%))"),
list("Master Controller:", Master ? "(TickRate:[Master.processing]) (Iteration:[Master.iteration])" : "ERROR", "\ref[Master]"),
list("Failsafe Controller:", Failsafe ? "Defcon: [Failsafe.defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])" : "ERROR", "\ref[Failsafe]"),
list("","")
)
for(var/datum/controller/subsystem/SS in Master.subsystems)
mc_data[++mc_data.len] = list("\[[SS.state_letter()]][SS.name]", SS.stat_entry(), "\ref[SS]")
mc_data[++mc_data.len] = list("Camera Net", "Cameras: [GLOB.cameranet.cameras.len] | Chunks: [GLOB.cameranet.chunks.len]", "\ref[GLOB.cameranet]")
mc_data_encoded = url_encode(json_encode(mc_data))
src.currentrun = GLOB.clients.Copy()
var/list/currentrun = src.currentrun
while(currentrun.len)
var/client/C = currentrun[currentrun.len]
C << output(url_encode(C.statpanel), "statbrowser:tab_change") // work around desyncs
currentrun.len--
var/ping_str = url_encode("Ping: [round(C.lastping, 1)]ms (Average: [round(C.avgping, 1)]ms)")
var/other_str = url_encode(json_encode(C.mob.get_status_tab_items()))
C << output("[encoded_global_data];[ping_str];[other_str]", "statbrowser:update")
if(C.holder && C.statpanel == "MC")
var/turf/T = get_turf(C.eye)
var/coord_entry = url_encode(COORD(T))
C << output("[mc_data_encoded];[coord_entry];[url_encode(C.holder.href_token)]", "statbrowser:update_mc")
var/list/proc_holders = C.mob.get_proc_holders()
C.spell_tabs.Cut()
for(var/list/item in proc_holders)
C.spell_tabs |= item[1]
var/proc_holders_encoded = ""
if(C.statpanel in C.spell_tabs)
proc_holders_encoded = url_encode(json_encode(proc_holders))
C << output("[url_encode(json_encode(C.spell_tabs))];[proc_holders_encoded]", "statbrowser:update_spells")
if(MC_TICK_CHECK)
return

View File

@@ -15,7 +15,7 @@ SUBSYSTEM_DEF(sun)
rate = -rate
/datum/controller/subsystem/sun/stat_entry(msg)
..("P:[solars.len]")
return ..("P:[solars.len]")
/datum/controller/subsystem/sun/fire()
angle = (360 + angle + rate * 6) % 360 // increase/decrease the angle to the sun, adjusted by the rate

View File

@@ -17,7 +17,7 @@ SUBSYSTEM_DEF(tgui)
close_all_uis()
/datum/controller/subsystem/tgui/stat_entry()
..("P:[processing_uis.len]")
return ..("P:[processing_uis.len]")
/datum/controller/subsystem/tgui/fire(resumed = 0)
if (!resumed)

View File

@@ -12,7 +12,7 @@ SUBSYSTEM_DEF(throwing)
var/list/processing = list()
/datum/controller/subsystem/throwing/stat_entry()
..("P:[processing.len]")
return ..("P:[processing.len]")
/datum/controller/subsystem/throwing/fire(resumed = 0)

View File

@@ -34,7 +34,7 @@ SUBSYSTEM_DEF(timer)
bucket_resolution = world.tick_lag
/datum/controller/subsystem/timer/stat_entry(msg)
..("B:[bucket_count] P:[length(second_queue)] H:[length(hashes)] C:[length(clienttime_timers)] S:[length(timer_id_dict)]")
return ..("B:[bucket_count] P:[length(second_queue)] H:[length(hashes)] C:[length(clienttime_timers)] S:[length(timer_id_dict)]")
/datum/controller/subsystem/timer/fire(resumed = FALSE)
var/lit = last_invoke_tick

View File

@@ -18,6 +18,7 @@ GLOBAL_PROTECT(admin_verbs_default)
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/stop_sounds,
/client/proc/toggle_legacy_mc_tab,
/client/proc/fix_air // yogs - fix air verb
)
GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin())
@@ -667,6 +668,17 @@ GLOBAL_PROTECT(admin_verbs_hideable)
message_admins("[src] deadmined themself.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Deadmin")
/client/proc/toggle_legacy_mc_tab()
set name = "Toggle Legacy MC Tab"
set category = "Debug"
set desc = "For if the normal one breaks"
if(!holder)
return
holder.legacy_mc = !holder.legacy_mc
/client/proc/readmin()
set name = "Readmin"
set category = "Admin"

View File

@@ -28,6 +28,8 @@ GLOBAL_PROTECT(href_token)
var/deadmined
var/legacy_mc = FALSE
/datum/admins/New(datum/admin_rank/R, ckey, force_active = FALSE, protected)
if(IsAdminAdvancedProcCall())
var/msg = " has tried to elevate permissions!"

View File

@@ -242,20 +242,19 @@ GLOBAL_LIST_EMPTY(blob_nodes)
/mob/camera/blob/blob_act(obj/structure/blob/B)
return
/mob/camera/blob/Stat()
..()
if(statpanel("Status"))
if(blob_core)
stat(null, "Core Health: [blob_core.obj_integrity]")
stat(null, "Power Stored: [blob_points]/[max_blob_points]")
stat(null, "Blobs to Win: [blobs_legit.len]/[blobwincount]")
if(free_strain_rerolls)
stat(null, "You have [free_strain_rerolls] Free Strain Reroll\s Remaining")
if(!placed)
if(manualplace_min_time)
stat(null, "Time Before Manual Placement: [max(round((manualplace_min_time - world.time)*0.1, 0.1), 0)]")
stat(null, "Time Before Automatic Placement: [max(round((autoplace_max_time - world.time)*0.1, 0.1), 0)]")
/mob/camera/blob/get_status_tab_items()
. = ..()
if(blob_core)
. += "Core Health: [blob_core.obj_integrity]"
. += "Power Stored: [blob_points]/[max_blob_points]"
. += "Blobs to Win: [blobs_legit.len]/[blobwincount]"
if(free_strain_rerolls)
. += "You have [free_strain_rerolls] Free Strain Reroll\s Remaining"
if(!placed)
if(manualplace_min_time)
. += "Time Before Manual Placement: [max(round((manualplace_min_time - world.time)*0.1, 0.1), 0)]"
. += "Time Before Automatic Placement: [max(round((autoplace_max_time - world.time)*0.1, 0.1), 0)]"
/mob/camera/blob/Move(NewLoc, Dir = 0)
if(placed)
var/obj/structure/blob/B = locate() in range("3x3", NewLoc)

View File

@@ -80,4 +80,6 @@
var/encoding = "1252" // yogs - LibVG
var/list/seen_messages // Messages currently seen by this client
var/list/seen_messages // Messages currently seen by this client
var/list/spell_tabs = list()

View File

@@ -335,6 +335,8 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
if(SSinput.initialized)
set_macros()
src << browse(file('html/statbrowser.html'), "window=statbrowser")
chatOutput.start() // Starts the chat
if(alert_mob_dupe_login)

View File

@@ -46,6 +46,8 @@ Thanks to spacemaniac and mcdonald for help with the JS side of this.
winset(src, "output", "text-color = [COLOR_DARKMODE_TEXT];text-color = #000000")
winset(src, "outputwindow", "background-color = [COLOR_DARKMODE_BACKGROUND];background-color = none")
winset(src, "outputwindow", "text-color = [COLOR_DARKMODE_TEXT];text-color = #000000")
winset(src, "statbrowser", "background-color = [COLOR_DARKMODE_BACKGROUND];background-color = none")
winset(src, "statbrowser", "text-color = [COLOR_DARKMODE_TEXT];text-color = #000000")
winset(src, "statwindow", "background-color = [COLOR_DARKMODE_BACKGROUND];background-color = none")
winset(src, "statwindow", "text-color = #eaeaea;text-color = #000000")
winset(src, "stat", "background-color = [COLOR_DARKMODE_DARKBACKGROUND];background-color = #FFFFFF")
@@ -66,6 +68,8 @@ Thanks to spacemaniac and mcdonald for help with the JS side of this.
winset(src, "tooltip", "background-color = [COLOR_DARKMODE_BACKGROUND];background-color = none")
winset(src, "tooltip", "text-color = [COLOR_DARKMODE_TEXT];text-color = #000000")
src << output(null, "statbrowser:set_light_theme");
/client/proc/force_dark_theme() //Inversely, if theyre using white theme and want to swap to the superior dark theme, let's get WINSET() ing
//Main windows
winset(src, "infowindow", "background-color = none;background-color = [COLOR_DARKMODE_BACKGROUND]")
@@ -96,6 +100,8 @@ Thanks to spacemaniac and mcdonald for help with the JS side of this.
winset(src, "output", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
winset(src, "outputwindow", "background-color = none;background-color = [COLOR_DARKMODE_DARKBACKGROUND]")
winset(src, "outputwindow", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
winset(src, "statbrowser", "background-color = none;background-color = [COLOR_DARKMODE_DARKBACKGROUND]")
winset(src, "statbrowser", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
winset(src, "statwindow", "background-color = none;background-color = [COLOR_DARKMODE_DARKBACKGROUND]")
winset(src, "statwindow", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
winset(src, "stat", "background-color = #FFFFFF;background-color = [COLOR_DARKMODE_DARKBACKGROUND]")
@@ -114,4 +120,6 @@ Thanks to spacemaniac and mcdonald for help with the JS side of this.
winset(src, "asset_cache_browser", "background-color = none;background-color = [COLOR_DARKMODE_BACKGROUND]")
winset(src, "asset_cache_browser", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
winset(src, "tooltip", "background-color = none;background-color = [COLOR_DARKMODE_BACKGROUND]")
winset(src, "tooltip", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
winset(src, "tooltip", "text-color = #000000;text-color = [COLOR_DARKMODE_TEXT]")
src << output(null, "statbrowser:set_dark_theme");

View File

@@ -42,27 +42,25 @@ INITIALIZE_IMMEDIATE(/mob/dead)
loc = destination
Moved(oldloc, NONE, TRUE)
/mob/dead/Stat()
..()
if(!statpanel("Status"))
return
stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]")
/mob/dead/get_status_tab_items()
. = ..()
. += ""
. += "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]"
if(SSticker.HasRoundStarted())
return
var/time_remaining = SSticker.GetTimeLeft()
if(time_remaining > 0)
stat(null, "Time To Start: [round(time_remaining/10)]s")
. += "Time To Start: [round(time_remaining/10)]s"
else if(time_remaining == -10)
stat(null, "Time To Start: DELAYED")
. += "Time To Start: DELAYED"
else
stat(null, "Time To Start: SOON")
. += "Time To Start: SOON"
stat(null, "Players: [SSticker.totalPlayers]")
. += "Players: [SSticker.totalPlayers]"
if(client.holder)
stat(null, "Players Ready: [SSticker.totalPlayersReady]")
. += "Players Ready: [SSticker.totalPlayersReady]"
/mob/dead/proc/server_hop()
set category = "OOC"

View File

@@ -88,11 +88,9 @@
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
/mob/living/carbon/alien/Stat()
..()
if(statpanel("Status"))
stat(null, "Intent: [a_intent]")
/mob/living/carbon/alien/get_status_tab_items()
. = ..()
. += "Intent: [a_intent]"
/mob/living/carbon/alien/getTrail()
if(getBruteLoss() < 200)

View File

@@ -30,10 +30,9 @@
..()
//This needs to be fixed
/mob/living/carbon/alien/larva/Stat()
..()
if(statpanel("Status"))
stat(null, "Progress: [amount_grown]/[max_grown]")
/mob/living/carbon/alien/larva/get_status_tab_items()
. = ..()
. += "Progress: [amount_grown]/[max_grown]"
/mob/living/carbon/alien/larva/adjustPlasma(amount)
if(stat != DEAD && amount > 0)

View File

@@ -418,16 +418,17 @@
var/turf/target = get_turf(loc)
I.safe_throw_at(target,I.throw_range,I.throw_speed,src, force = move_force)
/mob/living/carbon/Stat()
..()
if(statpanel("Status"))
var/obj/item/organ/alien/plasmavessel/vessel = getorgan(/obj/item/organ/alien/plasmavessel)
if(vessel)
stat(null, "Plasma Stored: [vessel.storedPlasma]/[vessel.max_plasma]")
if(locate(/obj/item/assembly/health) in src)
stat(null, "Health: [health]")
/mob/living/carbon/get_status_tab_items()
. = ..()
var/obj/item/organ/alien/plasmavessel/vessel = getorgan(/obj/item/organ/alien/plasmavessel)
if(vessel)
. += "Plasma Stored: [vessel.storedPlasma]/[vessel.max_plasma]"
if(locate(/obj/item/assembly/health) in src)
. += "Health: [health]"
add_abilities_to_panel()
/mob/living/carbon/get_proc_holders()
. = ..()
. += add_abilities_to_panel()
/mob/living/carbon/attack_ui(slot)
if(!has_hand_for_held_index(active_hand_index))

View File

@@ -54,30 +54,34 @@
//...and display them.
add_to_all_human_data_huds()
/mob/living/carbon/human/get_status_tab_items()
. = ..()
. += "Intent: [a_intent]"
. += "Move Mode: [m_intent]"
if (internal)
if (!internal.air_contents)
qdel(internal)
else
. += ""
. += "Internal Atmosphere Info: [internal.name]"
. += "Tank Pressure: [internal.air_contents.return_pressure()]"
. += "Distribution Pressure: [internal.distribute_pressure]"
if(mind)
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
. += ""
. += "Chemical Storage: [changeling.chem_charges]/[changeling.chem_storage]"
. += "Absorbed DNA: [changeling.absorbedcount]"
var/datum/antagonist/hivemind/hivemind = mind.has_antag_datum(/datum/antagonist/hivemind)
if(hivemind)
. += ""
. += "Hivemind Vessels: [hivemind.hive_size] (+[hivemind.size_mod])"
. += "Psychic Link Duration: [(hivemind.track_bonus + TRACKER_DEFAULT_TIME)/10] seconds"
/mob/living/carbon/human/Stat()
..()
if(statpanel("Status"))
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
if (internal)
if (!internal.air_contents)
qdel(internal)
else
stat("Internal Atmosphere Info", internal.name)
stat("Tank Pressure", internal.air_contents.return_pressure())
stat("Distribution Pressure", internal.distribute_pressure)
if(mind)
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
stat("Chemical Storage", "[changeling.chem_charges]/[changeling.chem_storage]")
stat("Absorbed DNA", changeling.absorbedcount)
var/datum/antagonist/hivemind/hivemind = mind.has_antag_datum(/datum/antagonist/hivemind)
if(hivemind)
stat("Hivemind Vessels", "[hivemind.hive_size] (+[hivemind.size_mod])")
stat("Psychic Link Duration", "[(hivemind.track_bonus + TRACKER_DEFAULT_TIME)/10] seconds")
//NINJACODE
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)) //Only display if actually a ninja.
var/obj/item/clothing/suit/space/space_ninja/SN = wear_suit

View File

@@ -85,18 +85,16 @@
slow += ((283.222 - bodytemperature) / 10) * 1.75
add_movespeed_modifier(MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = slow)
/mob/living/carbon/monkey/Stat()
..()
if(statpanel("Status"))
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
if(client && mind)
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
stat("Chemical Storage", "[changeling.chem_charges]/[changeling.chem_storage]")
stat("Absorbed DNA", changeling.absorbedcount)
return
/mob/living/carbon/monkey/get_status_tab_items()
. = ..()
. += "Intent: [a_intent]"
. += "Move Mode: [m_intent]"
if(client && mind)
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
. += ""
. += "Chemical Storage: [changeling.chem_charges]/[changeling.chem_storage]"
. += "Absorbed DNA: [changeling.absorbedcount]"
/mob/living/carbon/monkey/verb/removeinternal()
set name = "Remove Internals"

View File

@@ -1164,8 +1164,10 @@
A.action.Remove(src)
/mob/living/proc/add_abilities_to_panel()
var/list/L = list()
for(var/obj/effect/proc_holder/A in abilities)
statpanel("[A.panel]",A.get_panel_text(),A)
L[++L.len] = list("[A.panel]",A.get_panel_text(),A.name,"\ref[A]")
return L
/mob/living/lingcheck()
if(mind)

View File

@@ -240,28 +240,27 @@
display_icon_override = ai_core_icon
set_core_display_icon(ai_core_icon)
/mob/living/silicon/ai/Stat()
..()
if(statpanel("Status"))
if(!stat)
stat(null, text("System integrity: [(health+100)/2]%"))
if(isturf(loc)) //only show if we're "in" a core
stat(null, text("Backup Power: [battery/2]%"))
stat(null, text("Connected cyborgs: [connected_robots.len]"))
for(var/mob/living/silicon/robot/R in connected_robots)
var/robot_status = "Nominal"
if(R.shell)
robot_status = "AI SHELL"
else if(R.stat || !R.client)
robot_status = "OFFLINE"
else if(!R.cell || R.cell.charge <= 0)
robot_status = "DEPOWERED"
//Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies!
stat(null, text("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \
Module: [R.designation] | Loc: [get_area_name(R, TRUE)] | Status: [robot_status]"))
stat(null, text("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]")) //Count of total AI shells
else
stat(null, text("Systems nonfunctional"))
/mob/living/silicon/ai/get_status_tab_items()
. = ..()
if(!stat)
. += text("System integrity: [(health+100)/2]%")
if(isturf(loc)) //only show if we're "in" a core
. += text("Backup Power: [battery/2]%")
. += text("Connected cyborgs: [connected_robots.len]")
for(var/mob/living/silicon/robot/R in connected_robots)
var/robot_status = "Nominal"
if(R.shell)
robot_status = "AI SHELL"
else if(R.stat || !R.client)
robot_status = "OFFLINE"
else if(!R.cell || R.cell.charge <= 0)
robot_status = "DEPOWERED"
//Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies!
. += text("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \
Module: [R.designation] | Loc: [get_area_name(R, TRUE)] | Status: [robot_status]")
. += text("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]") //Count of total AI shells
else
. += text("Systems nonfunctional")
/mob/living/silicon/ai/proc/ai_alerts()
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"

View File

@@ -166,13 +166,12 @@
else
client.eye = card
/mob/living/silicon/pai/Stat()
..()
if(statpanel("Status"))
if(!stat)
stat(null, text("Emitter Integrity: [emitterhealth * (100/emittermaxhealth)]"))
else
stat(null, text("Systems nonfunctional"))
/mob/living/silicon/pai/get_status_tab_items()
. += ..()
if(!stat)
. += text("Emitter Integrity: [emitterhealth * (100/emittermaxhealth)]")
else
. += text("Systems nonfunctional")
/mob/living/silicon/pai/restrained(ignore_grab)
. = FALSE

View File

@@ -304,19 +304,19 @@
if(thruster_button)
thruster_button.icon_state = "ionpulse[ionpulse_on]"
/mob/living/silicon/robot/Stat()
..()
if(statpanel("Status"))
if(cell)
stat("Charge Left:", "[cell.charge]/[cell.maxcharge]")
else
stat(null, text("No Cell Inserted!"))
/mob/living/silicon/robot/get_status_tab_items()
. = ..()
. += ""
if(cell)
. += "Charge Left: [cell.charge]/[cell.maxcharge]"
else
. += text("No Cell Inserted!")
if(module)
for(var/datum/robot_energy_storage/st in module.storages)
stat("[st.name]:", "[st.energy]/[st.max_energy]")
if(connected_ai)
stat("Master AI:", connected_ai.name)
if(module)
for(var/datum/robot_energy_storage/st in module.storages)
. += "[st.name]: [st.energy]/[st.max_energy]"
if(connected_ai)
. += "Master AI: [connected_ai.name]"
/mob/living/silicon/robot/restrained(ignore_grab)
. = 0

View File

@@ -153,18 +153,17 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
qdel(src)
snapback()
/mob/living/simple_animal/hostile/guardian/Stat()
..()
if(statpanel("Status"))
if(summoner)
var/resulthealth
if(iscarbon(summoner))
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.maxHealth)) * 100)
else
resulthealth = round((summoner.health / summoner.maxHealth) * 100, 0.5)
stat(null, "Summoner Health: [resulthealth]%")
if(cooldown >= world.time)
stat(null, "Manifest/Recall Cooldown Remaining: [DisplayTimeText(cooldown - world.time)]")
/mob/living/simple_animal/hostile/guardian/get_status_tab_items()
. += ..()
if(summoner)
var/resulthealth
if(iscarbon(summoner))
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.maxHealth)) * 100)
else
resulthealth = round((summoner.health / summoner.maxHealth) * 100, 0.5)
. += "Summoner Health: [resulthealth]%"
if(cooldown >= world.time)
. += "Manifest/Recall Cooldown Remaining: [DisplayTimeText(cooldown - world.time)]"
/mob/living/simple_animal/hostile/guardian/Move() //Returns to summoner if they move out of range
. = ..()

View File

@@ -26,11 +26,10 @@
if(loc == summoner && toggle)
ToggleMode(0)
/mob/living/simple_animal/hostile/guardian/assassin/Stat()
..()
if(statpanel("Status"))
if(stealthcooldown >= world.time)
stat(null, "Stealth Cooldown Remaining: [DisplayTimeText(stealthcooldown - world.time)]")
/mob/living/simple_animal/hostile/guardian/assassin/get_status_tab_items()
. = ..()
if(stealthcooldown >= world.time)
. += "Stealth Cooldown Remaining: [DisplayTimeText(stealthcooldown - world.time)]"
/mob/living/simple_animal/hostile/guardian/assassin/AttackingTarget()
. = ..()

View File

@@ -10,11 +10,10 @@
carp_fluff_string = "<span class='holoparasite'>CARP CARP CARP! Caught one! It's an explosive carp! Boom goes the fishy.</span>"
var/bomb_cooldown = 0
/mob/living/simple_animal/hostile/guardian/bomb/Stat()
..()
if(statpanel("Status"))
if(bomb_cooldown >= world.time)
stat(null, "Bomb Cooldown Remaining: [DisplayTimeText(bomb_cooldown - world.time)]")
/mob/living/simple_animal/hostile/guardian/bomb/get_status_tab_items()
. = ..()
if(bomb_cooldown >= world.time)
. += "Bomb Cooldown Remaining: [DisplayTimeText(bomb_cooldown - world.time)]"
/mob/living/simple_animal/hostile/guardian/bomb/AttackingTarget()
. = ..()

View File

@@ -20,11 +20,10 @@
var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
medsensor.add_hud_to(src)
/mob/living/simple_animal/hostile/guardian/healer/Stat()
..()
if(statpanel("Status"))
if(beacon_cooldown >= world.time)
stat(null, "Beacon Cooldown Remaining: [DisplayTimeText(beacon_cooldown - world.time)]")
/mob/living/simple_animal/hostile/guardian/healer/get_status_tab_items()
. = ..()
if(beacon_cooldown >= world.time)
. += "Beacon Cooldown Remaining: [DisplayTimeText(beacon_cooldown - world.time)]"
/mob/living/simple_animal/hostile/guardian/healer/AttackingTarget()
. = ..()

View File

@@ -137,11 +137,11 @@
..(gibbed)
/mob/living/simple_animal/parrot/Stat()
..()
if(statpanel("Status"))
stat("Held Item", held_item)
stat("Mode",a_intent)
/mob/living/simple_animal/parrot/get_status_tab_items()
. = ..()
. += ""
. += "Held Item: [held_item]"
. += "Mode: [a_intent]"
/mob/living/simple_animal/parrot/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode)
. = ..()

View File

@@ -294,11 +294,10 @@
remove_movespeed_modifier(MOVESPEED_ID_SIMPLEMOB_VARSPEED, TRUE)
add_movespeed_modifier(MOVESPEED_ID_SIMPLEMOB_VARSPEED, TRUE, 100, multiplicative_slowdown = speed, override = TRUE)
/mob/living/simple_animal/Stat()
..()
if(statpanel("Status"))
stat(null, "Health: [round((health / maxHealth) * 100)]%")
return 1
/mob/living/simple_animal/get_status_tab_items()
. = ..()
. += ""
. += "Health: [round((health / maxHealth) * 100)]%"
/mob/living/simple_animal/proc/drop_loot()
if(loot.len)

View File

@@ -229,21 +229,20 @@
/mob/living/simple_animal/slime/Process_Spacemove(movement_dir = 0)
return 2
/mob/living/simple_animal/slime/Stat()
if(..())
if(!docile)
stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD)
if(is_adult)
stat(null, "You can reproduce!")
else
stat(null, "You can evolve!")
if(stat == UNCONSCIOUS)
stat(null,"You are knocked out by high levels of BZ!")
/mob/living/simple_animal/slime/get_status_tab_items()
. = ..()
if(!docile)
. += "Nutrition: [nutrition]/[get_max_nutrition()]"
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD)
if(is_adult)
. += "You can reproduce!"
else
stat(null,"Power Level: [powerlevel]")
. += "You can evolve!"
if(stat == UNCONSCIOUS)
. += "You are knocked out by high levels of BZ!"
else
. += "Power Level: [powerlevel]"
/mob/living/simple_animal/slime/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)

View File

@@ -528,28 +528,16 @@
/mob/proc/is_muzzled()
return 0
/mob/proc/get_status_tab_items()
. = list()
/mob/Stat()
..()
if(statpanel("Status"))
if (client)
stat(null, "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)")
stat(null, "Map: [SSmapping.config?.map_name || "Loading..."]")
var/datum/map_config/cached = SSmapping.next_map_config
if(cached)
stat(null, "Next Map: [cached.map_name]")
stat(null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]")
stat(null, "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]")
stat(null, "Round Time: [worldtime2text()]")
stat(null, "Station Time: [station_time_timestamp()]")
stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
if(SSshuttle.emergency)
var/ETA = SSshuttle.emergency.getModeStr()
if(ETA)
stat(null, "[ETA] [SSshuttle.emergency.getTimerStr()]")
statpanel("Status")
if(client && client.holder)
if(statpanel("MC"))
statpanel("MC")
if(client.holder.legacy_mc && statpanel("MC (legacy)"))
var/turf/T = get_turf(client.eye)
stat("Location:", COORD(T))
stat("CPU:", "[world.cpu]")
@@ -569,7 +557,7 @@
if(Master)
stat(null)
for(var/datum/controller/subsystem/SS in Master.subsystems)
SS.stat_entry()
SS.stat_entry_legacy()
GLOB.cameranet.stat_entry()
// yogs start - Yogs Ticket
/*if(statpanel("Tickets"))
@@ -603,21 +591,28 @@
continue
statpanel(listed_turf.name, null, A)
if(client)
for(var/tab in client.spell_tabs)
statpanel(tab)
/mob/proc/get_proc_holders()
. = list()
if(mind)
add_spells_to_statpanel(mind.spell_list)
add_spells_to_statpanel(mob_spell_list)
. += add_spells_to_statpanel(mind.spell_list)
. += add_spells_to_statpanel(mob_spell_list)
/mob/proc/add_spells_to_statpanel(list/spells)
var/list/L = list()
for(var/obj/effect/proc_holder/spell/S in spells)
if(S.can_be_cast_by(src))
switch(S.charge_type)
if("recharge")
statpanel("[S.panel]","[S.charge_counter/10.0]/[S.charge_max/10]",S)
L[++L.len] = list("[S.panel]","[S.charge_counter/10.0]/[S.charge_max/10]",S.name,"\ref[S]")
if("charges")
statpanel("[S.panel]","[S.charge_counter]/[S.charge_max]",S)
L[++L.len] = list("[S.panel]","[S.charge_counter]/[S.charge_max]",S.name,S)
if("holdervar")
statpanel("[S.panel]","[S.holder_var_type] [S.holder_var_amount]",S)
L[++L.len] = list("[S.panel]","[S.holder_var_type] [S.holder_var_amount]",S.name,S)
return L
#define MOB_FACE_DIRECTION_DELAY 1

View File

@@ -47,6 +47,17 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
/obj/effect/proc_holder/singularity_pull()
return
/obj/effect/proc_holder/Topic(href, href_list)
. = ..()
if(href_list["click"])
// first of all make sure we valid
var/mob/living/as_living = usr
if(!(src in usr.mob_spell_list) && !(usr.mind && (src in usr.mind.spell_list)) && !(istype(as_living) && (src in as_living.abilities)))
message_admins("[key_name_admin(src)] clicked on an invalid proc_holder href! ([src])")
log_game("[key_name(src)] clicked on an invalid proc_holder href! ([src])")
return
Click()
/obj/effect/proc_holder/proc/InterceptClickOn(mob/living/caller, params, atom/A)
if(caller.ranged_ability != src || ranged_ability_user != caller) //I'm not actually sure how these would trigger, but, uh, safety, I guess?
to_chat(caller, "<span class='warning'><b>[caller.ranged_ability.name]</b> has been disabled.</span>")

212
html/statbrowser.html Normal file
View File

@@ -0,0 +1,212 @@
<!DOCTYPE html>
<html>
<head>
<title>Stat Browser</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body {
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 14px;
}
a {
color: black;
text-decoration: none
}
a:hover, .dark a:hover {
text-decoration: underline;
}
.dark a{
color: #a4bad6;
}
</style>
<script>
// browser passthrough code copy pasted here
if(document.addEventListener && window.location) { // hey maybe some bozo is still using mega-outdated IE
let anti_spam = []; // wow I wish I could use e.repeat but IE is dumb and doesn't have it.
document.addEventListener("keydown", function(e) {
if(e.target && (e.target.localName == "input" || e.target.localName == "textarea"))
return;
if(e.defaultPrevented)
return; // do e.preventDefault() to prevent this behavior.
if(e.which) {
if(!anti_spam[e.which]) {
anti_spam[e.which] = true;
let href = "?__keydown=" + e.which;
if(e.ctrlKey === false) href += "&ctrlKey=0"
else if(e.ctrlKey === true) href += "&ctrlKey=1"
window.location.href = href;
}
}
});
document.addEventListener("keyup", function(e) {
if(e.target && (e.target.localName == "input" || e.target.localName == "textarea"))
return;
if(e.defaultPrevented)
return;
if(e.which) {
anti_spam[e.which] = false;
let href = "?__keyup=" + e.which;
if(e.ctrlKey === false) href += "&ctrlKey=0"
else if(e.ctrlKey === true) href += "&ctrlKey=1"
window.location.href = href;
}
});
}
if(!Array.prototype.includes) {
Array.prototype.includes = function(thing) {
for(let i = 0; i < this.length; i++) {
if(this[i] == thing) return true;
}
return false;
}
}
let status_tab_parts = ["MC not initialized..."];
let current_tab = null;
let mc_tab_parts = [["MC not initialized...", ""]];
let href_token = null;
let spells = [];
let spell_tabs = [];
function update(global_data, ping_entry, other_entries) {
status_tab_parts = [ping_entry];
let parsed = JSON.parse(global_data);
for(let i = 0; i < parsed.length; i++) if(parsed[i] != null) status_tab_parts.push(parsed[i]);
parsed = JSON.parse(other_entries);
for(let i = 0; i < parsed.length; i++) if(parsed[i] != null) status_tab_parts.push(parsed[i]);
if(current_tab == "Status")
draw_status();
}
function update_mc(global_mc_data, coords_entry, ht) {
mc_tab_parts = JSON.parse(global_mc_data);
mc_tab_parts.splice(0,0,["Location:",coords_entry]);
href_token = ht;
if(current_tab == "MC")
draw_mc();
}
function update_spells(t, s) {
spell_tabs = JSON.parse(t);
let do_update = false;
if(spell_tabs.includes(current_tab)) {
window.location.href = "byond://winset?statbrowser.is-visible=true";
do_update = true;
}
if(s) {
spells = JSON.parse(s);
if(do_update) {
draw_spells(current_tab);
}
}
}
function tab_change(tab) {
if(tab == current_tab) return;
current_tab = tab
let spell_tabs_thingy = (spell_tabs.includes(tab));
if(tab == "Status") {
draw_status();
} else if(tab == "MC") {
draw_mc();
} else if(spell_tabs_thingy) {
draw_spells(tab)
} else {
document.body.textContent = "...";
}
if(tab == "Status" || tab == "MC" || spell_tabs_thingy) {
window.location.href = "byond://winset?statbrowser.is-visible=true";
} else {
window.location.href = "byond://winset?statbrowser.is-visible=false";
}
}
function draw_status() {
document.body.innerHTML = "";
for(let i = 0; i < status_tab_parts.length; i++) {
if(status_tab_parts[i].trim() == "") {
document.body.appendChild(document.createElement("br"));
} else {
let div = document.createElement("div");
div.textContent = status_tab_parts[i];
document.body.appendChild(div);
}
}
}
function draw_mc() {
document.body.innerHTML = "";
let table = document.createElement("table");
for(let i = 0; i < mc_tab_parts.length; i++) {
let part = mc_tab_parts[i];
let tr = document.createElement("tr");
let td1 = document.createElement("td");
td1.textContent = part[0];
let td2 = document.createElement("td");
if(part[2]) {
let a = document.createElement("a");
a.href = "?_src_=vars;admin_token=" + href_token + ";Vars=" + part[2];
a.textContent = part[1];
td2.appendChild(a);
} else {
td2.textContent = part[1];
}
tr.appendChild(td1);
tr.appendChild(td2);
table.appendChild(tr);
}
document.body.appendChild(table);
}
function draw_spells(cat) {
document.body.innerHTML = "";
let table = document.createElement("table");
for(let i = 0; i < spells.length; i++) {
let part = spells[i];
//if(part[0] != cat) continue;
let tr = document.createElement("tr");
let td1 = document.createElement("td");
td1.textContent = part[1];
let td2 = document.createElement("td");
if(part[3]) {
let a = document.createElement("a");
a.href = "?src=" + part[3] + ";click=1";
a.textContent = part[2];
td2.appendChild(a);
} else {
td2.textContent = part[2];
}
tr.appendChild(td1);
tr.appendChild(td2);
table.appendChild(tr);
}
document.body.appendChild(table);
}
function set_light_theme() {
document.body.style.backgroundColor = "white";
document.body.style.color = "black";
document.body.className = "";
}
function set_dark_theme() {
document.body.style.backgroundColor = "#171717";
document.body.style.color = "#a4bad6";
document.body.className = "dark";
}
window.addEventListener("load", function() {
if(!current_tab) {
tab_change("Status");
}
});
</script>
</head>
<body>
</body>
</html>

View File

@@ -312,6 +312,16 @@ window "statwindow"
anchor2 = 100,100
is-default = true
saved-params = ""
on-tab = ".output statbrowser:tab_change [[*]]"
elem "statbrowser"
type = BROWSER
pos = 6,24
size = 628x450
anchor1 = 0,0
anchor2 = 100,100
background-color = none
saved-params = ""
is-visible = false
window "Telecomms IDE"
elem "Telecomms IDE"

View File

@@ -288,6 +288,7 @@
#include "code\controllers\subsystem\server_maint.dm"
#include "code\controllers\subsystem\shuttle.dm"
#include "code\controllers\subsystem\spacedrift.dm"
#include "code\controllers\subsystem\statpanels.dm"
#include "code\controllers\subsystem\stickyban.dm"
#include "code\controllers\subsystem\sun.dm"
#include "code\controllers\subsystem\tgui.dm"

View File

@@ -1,12 +1,12 @@
/datum/game_mode
var/list/datum/mind/vampires = list()
/mob/living/carbon/human/Stat()
/mob/living/carbon/human/get_status_tab_items()
. = ..()
var/datum/antagonist/vampire/vamp = mind.has_antag_datum(/datum/antagonist/vampire)
if(vamp && statpanel("Status"))
stat("Total Blood", vamp.total_blood)
stat("Usable Blood", vamp.usable_blood)
if(vamp)
. += "Total Blood: [vamp.total_blood]"
. += "Usable Blood: [vamp.usable_blood]"
/mob/living/carbon/human/Life()
. = ..()

View File

@@ -95,8 +95,8 @@
/datum/objective/ascend/update_explanation_text()
explanation_text = "Ascend to your true form by use of the Ascendance ability. This may only be used with [SSticker.mode.required_thralls] or more collective thralls, while hatched, and is unlocked with the Collective Mind ability."
/mob/living/carbon/human/Stat()
/mob/living/carbon/human/get_status_tab_items()
. = ..()
if(statpanel("Status") && (dna && dna.species) && istype(dna.species, /datum/species/shadow/ling))
if((dna && dna.species) && istype(dna.species, /datum/species/shadow/ling))
var/datum/species/shadow/ling/SL = dna.species
stat("Shadowy Shield Charges", SL.shadow_charges)
. += "Shadowy Shield Charges: [SL.shadow_charges]"

View File

@@ -38,11 +38,10 @@
L.throw_at(get_edge_target_turf(L, get_dir(guardian, L)), 20, 4, guardian, TRUE)
next_rush = world.time + 3 SECONDS
/datum/guardian_ability/major/frenzy/Stat()
/datum/guardian_ability/major/frenzy/StatusTab()
. = ..()
if(statpanel("Status"))
if(next_rush > world.time)
stat(null, "Frenzy Charge Cooldown Remaining: [DisplayTimeText(next_rush - world.time)]")
if(next_rush > world.time)
. += "Frenzy Charge Cooldown Remaining: [DisplayTimeText(next_rush - world.time)]"
/obj/effect/proc_holder/spell/targeted/guardian/frenzy
name = "Teleport Behind"

View File

@@ -20,8 +20,7 @@
guardian.face_atom(hand_turf)
return ..()
/datum/guardian_ability/major/hand/Stat()
/datum/guardian_ability/major/hand/StatusTab()
. = ..()
if(statpanel("Status"))
if(next_hand > world.time)
stat(null, "THE HAND Cooldown Remaining: [DisplayTimeText(next_hand - world.time)]")
if(next_hand > world.time)
. += "THE HAND Cooldown Remaining: [DisplayTimeText(next_hand - world.time)]"

View File

@@ -235,20 +235,19 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
if(stats.ability)
stats.ability.Berserk()
/mob/living/simple_animal/hostile/guardian/Stat()
..()
if(statpanel("Status"))
if(summoner?.current)
var/resulthealth
if(iscarbon(summoner.current))
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.current.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.current.maxHealth)) * 100)
else
resulthealth = round((summoner.current.health / summoner.current.maxHealth) * 100, 0.5)
stat(null, "Summoner Health: [resulthealth]%")
if(cooldown >= world.time)
stat(null, "Manifest/Recall Cooldown Remaining: [DisplayTimeText(cooldown - world.time)]")
if(stats.ability)
stats.ability.Stat()
/mob/living/simple_animal/hostile/guardian/get_status_tab_items()
. = ..()
if(summoner?.current)
var/resulthealth
if(iscarbon(summoner.current))
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.current.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.current.maxHealth)) * 100)
else
resulthealth = round((summoner.current.health / summoner.current.maxHealth) * 100, 0.5)
. += "Summoner Health: [resulthealth]%"
if(cooldown >= world.time)
. += "Manifest/Recall Cooldown Remaining: [DisplayTimeText(cooldown - world.time)]"
if(stats.ability)
. += stats.ability.StatusTab()
/mob/living/simple_animal/hostile/guardian/Move() //Returns to summoner if they move out of range
pixel_x = initial(pixel_x)

View File

@@ -22,7 +22,8 @@
/datum/guardian_ability/proc/CanBuy()
return TRUE
/datum/guardian_ability/proc/Stat()
/datum/guardian_ability/proc/StatusTab()
return list()
// major abilities have a mode usually
/datum/guardian_ability/major

View File

@@ -293,15 +293,15 @@ GLOBAL_LIST_INIT(spacepods_list, list())
else //just delete the cabin gas, we're in space or some shit
qdel(removed)
/mob/Stat()
/mob/get_status_tab_items()
. = ..()
if(isspacepod(loc) && statpanel("Status"))
if(isspacepod(loc))
var/obj/spacepod/S = loc
stat(null)
stat(null, "Spacepod Charge: [S.cell ? "[round(S.cell.charge,0.1)]/[S.cell.maxcharge] KJ" : "NONE"]")
stat(null, "Spacepod Integrity: [round(S.obj_integrity,0.1)]/[S.max_integrity]")
stat(null, "Spacepod Velocity: [round(sqrt(S.velocity_x*S.velocity_x+S.velocity_y*S.velocity_y), 0.1)] m/s")
stat(null)
. += ""
. += "Spacepod Charge: [S.cell ? "[round(S.cell.charge,0.1)]/[S.cell.maxcharge] KJ" : "NONE"]"
. += "Spacepod Integrity: [round(S.obj_integrity,0.1)]/[S.max_integrity]"
. += "Spacepod Velocity: [round(sqrt(S.velocity_x*S.velocity_x+S.velocity_y*S.velocity_y), 0.1)] m/s"
. += ""
/obj/spacepod/ex_act(severity)
switch(severity)