Small MC refactor (#20017)

* Small MC refactor

* Order fix

* Nabs tgstation/tgstation#27324

* Oops

* gnarg
This commit is contained in:
AffectedArc07
2023-01-18 12:06:24 -06:00
committed by GitHub
parent ea9e1969a4
commit 946fb4dff6
99 changed files with 337 additions and 465 deletions
+1 -1
View File
@@ -271,7 +271,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/ai/proc/ai_alerts()
var/list/dat = list("<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n")
dat += "<A HREF='?src=[UID()];mach_close=aialerts'>Close</A><BR><BR>"
var/list/list/temp_alarm_list = SSalarm.alarms.Copy()
var/list/list/temp_alarm_list = GLOB.alarm_manager.alarms.Copy()
for(var/cat in temp_alarm_list)
if(!(cat in alarms_listend_for))
continue
@@ -607,7 +607,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
/mob/living/silicon/robot/proc/robot_alerts()
var/list/dat = list()
var/list/list/temp_alarm_list = SSalarm.alarms.Copy()
var/list/list/temp_alarm_list = GLOB.alarm_manager.alarms.Copy()
for(var/cat in temp_alarm_list)
if(!(cat in alarms_listend_for))
continue
+2 -2
View File
@@ -46,8 +46,8 @@
..()
add_language("Galactic Common")
init_subsystems()
RegisterSignal(SSalarm, COMSIG_TRIGGERED_ALARM, PROC_REF(alarm_triggered))
RegisterSignal(SSalarm, COMSIG_CANCELLED_ALARM, PROC_REF(alarm_cancelled))
RegisterSignal(GLOB.alarm_manager, COMSIG_TRIGGERED_ALARM, PROC_REF(alarm_triggered))
RegisterSignal(GLOB.alarm_manager, COMSIG_CANCELLED_ALARM, PROC_REF(alarm_cancelled))
/mob/living/silicon/Initialize(mapload)
. = ..()
@@ -589,9 +589,6 @@ Difficulty: Medium
butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/sinew = 5, /obj/item/stack/sheet/bone = 30)
attack_action_types = list()
/mob/living/simple_animal/hostile/megafauna/dragon/lesser/grant_achievement(medaltype,scoretype)
return
/mob/living/simple_animal/hostile/megafauna/dragon/space_dragon
name = "space dragon"
maxHealth = 250
@@ -616,9 +613,6 @@ Difficulty: Medium
deathmessage = "screeches as its wings turn to dust and it collapses on the floor, life estinguished."
attack_action_types = list()
/mob/living/simple_animal/hostile/megafauna/dragon/space_dragon/grant_achievement(medaltype, scoretype)
return
/mob/living/simple_animal/hostile/megafauna/dragon/space_dragon/Initialize(mapload)
var/obj/effect/proc_holder/spell/aoe/repulse/spacedragon/repulse_action = new /obj/effect/proc_holder/spell/aoe/repulse/spacedragon(src)
repulse_action.action.Grant(src)
@@ -71,7 +71,6 @@
if(C && crusher_loot && C.total_damage >= maxHealth * 0.6)
spawn_crusher_loot()
if(!elimination) //used so the achievment only occurs for the last legion to die.
grant_achievement(medal_type,score_type)
SSblackbox.record_feedback("tally", "megafauna_kills", 1, "[initial(name)]")
return ..()
@@ -127,20 +126,6 @@
recovery_time = world.time + buffer_time
ranged_cooldown = world.time + buffer_time
/mob/living/simple_animal/hostile/megafauna/proc/grant_achievement(medaltype, scoretype, crusher_kill)
if(!medal_type || admin_spawned || !SSmedals.hub_enabled) //Don't award medals if the medal type isn't set
return FALSE
for(var/mob/living/L in view(7,src))
if(L.stat || !L.client)
continue
var/client/C = L.client
SSmedals.UnlockMedal("Boss [BOSS_KILL_MEDAL]", C)
SSmedals.UnlockMedal("[medaltype] [BOSS_KILL_MEDAL]", C)
SSmedals.SetScore(BOSS_SCORE, C, 1)
SSmedals.SetScore(score_type, C, 1)
return TRUE
/datum/action/innate/megafauna_attack
name = "Megafauna Attack"
icon_icon = 'icons/mob/actions/actions_animal.dmi'
+2 -2
View File
@@ -12,13 +12,13 @@
if(temp_admin.rights & R_MENTOR)
var/list/mentorcounter = staff_countup(R_MENTOR)
if(mentorcounter[1] == 0) // No active mentors
SSdiscord.send2discord_simple(DISCORD_WEBHOOK_MENTOR, "[key_name(src)] logged out - 0 active mentors, [mentorcounter[2]] non-mentor staff, [mentorcounter[3]] inactive mentors.")
GLOB.discord_manager.send2discord_simple(DISCORD_WEBHOOK_MENTOR, "[key_name(src)] logged out - 0 active mentors, [mentorcounter[2]] non-mentor staff, [mentorcounter[3]] inactive mentors.")
else if(temp_admin.rights & R_BAN)
message_admins("Admin logout: [key_name_admin(src)]")
var/list/admincounter = staff_countup(R_BAN)
if(admincounter[1] == 0) // No active admins
SSdiscord.send2discord_simple(DISCORD_WEBHOOK_ADMIN, "[key_name(src)] logged out - 0 active admins, [admincounter[2]] non-admin staff, [admincounter[3]] inactive staff.")
GLOB.discord_manager.send2discord_simple(DISCORD_WEBHOOK_ADMIN, "[key_name(src)] logged out - 0 active admins, [admincounter[2]] non-admin staff, [admincounter[3]] inactive staff.")
..()
update_morgue()
+37 -6
View File
@@ -978,8 +978,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
add_spell_to_statpanel(S)
// Allow admins + PR reviewers to VIEW the panel. Doesnt mean they can click things.
if(is_admin(src) || check_rights(R_VIEWRUNTIMES, FALSE))
if(statpanel("MC")) //looking at that panel
if((is_admin(src) || check_rights(R_VIEWRUNTIMES, FALSE)) && client?.prefs.toggles2 & PREFTOGGLE_2_MC_TABS)
// Below are checks to see which MC panel you are looking at
// Shows MC Metadata
if(statpanel("MC|M"))
stat("Info", "Showing MC metadata")
var/turf/T = get_turf(client.eye)
stat("Location:", COORD(T))
stat("CPU:", "[Master.formatcpu(world.cpu)]")
@@ -987,7 +991,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
stat("Instances:", "[num2text(world.contents.len, 10)]")
GLOB.stat_entry()
stat("Server Time:", time_stamp())
stat(null)
if(Master)
Master.stat_entry()
else
@@ -996,10 +999,38 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
Failsafe.stat_entry()
else
stat("Failsafe Controller:", "ERROR")
// Shows subsystems with SS_NO_FIRE
if(statpanel("MC|N"))
stat("Info", "Showing subsystems that do not fire")
if(Master)
stat(null)
for(var/datum/controller/subsystem/SS in Master.subsystems)
SS.stat_entry()
for(var/datum/controller/subsystem/SS as anything in Master.subsystems)
if(SS.flags & SS_NO_FIRE)
SS.stat_entry()
// Shows subsystems with the SS_CPUDISPLAY_LOW flag
if(statpanel("MC|L"))
stat("Info", "Showing subsystems marked as low intensity")
if(Master)
for(var/datum/controller/subsystem/SS as anything in Master.subsystems)
if((SS.cpu_display == SS_CPUDISPLAY_LOW) && !(SS.flags & SS_NO_FIRE))
SS.stat_entry()
// Shows subsystems with the SS_CPUDISPLAY_DEFAULT flag
if(statpanel("MC|D"))
stat("Info", "Showing subsystems marked as default intensity")
if(Master)
for(var/datum/controller/subsystem/SS as anything in Master.subsystems)
if((SS.cpu_display == SS_CPUDISPLAY_DEFAULT) && !(SS.flags & SS_NO_FIRE))
SS.stat_entry()
// Shows subsystems with the SS_CPUDISPLAY_HIGH flag
if(statpanel("MC|H"))
stat("Info", "Showing subsystems marked as high intensity")
if(Master)
for(var/datum/controller/subsystem/SS as anything in Master.subsystems)
if((SS.cpu_display == SS_CPUDISPLAY_HIGH) && !(SS.flags & SS_NO_FIRE))
SS.stat_entry()
statpanel("Status") // Switch to the Status panel again, for the sake of the lazy Stat procs