mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-11 07:04:01 +01:00
Unit Test rework & Master/Ticker update (#17912)
* Unit Test rework & Master/Ticker update * Fixes and working unit testing * Fixes * Test fixes and FA update * Fixed runtimes * Radio subsystem * move that glob wherever later * ident * CIBUILDING compile option * Fixed runtimes * Some changes to the workflow * CI Split * More split * Pathing * Linters and Annotators * ci dir fix * Missing undef fixed * Enable grep checks * More test conversions * More split * Correct file * Removes unneeded inputs * oop * More dependency changes * More conversions * Conversion fixes * Fixes * Some assert fixes * Corrects start gate * Converted some README.dms to README.mds * Removes duplicate proc * Removes unused defines * Example configs * fix dll access viol by double calling * Post-rebase fixes * Cleans up names global list * Undef restart counter * More code/game/ cleanup * Statpanel update * Skybox * add * Fix ticker * Roundend fix * Persistence dependency update * Reordering * Reordering * Reordering * Initstage fix * . * . * Reorder * Reorder * Circle * Mobs * Air * Test fix * CI Script Fix * Configs * More ticker stuff * This is now in 'reboot world' * Restart world announcements * no glob in PreInit * to define * Update * Removed old include * Make this file normal again * moved * test * shared unit testing objects * Updates batched_spritesheets and universal_icon * . * job data debug * rm that * init order * show us * . * i wonder * . * . * urg * do we not have a job ID? * . * rm sleep for now * updated rust-g linux binaries * binaries update 2 * binaries update 3 * testing something * change that * test something * . * . * . * locavar * test * move that * . * debug * don't run this test * strack trace it * cleaner * . * . * cras again * also comment this out * return to official rust g * Update robot_icons.dm * monitor the generation * . --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
+99
-77
@@ -625,29 +625,69 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////admins2.dm merge
|
||||
//i.e. buttons/verbs
|
||||
|
||||
#define REGULAR_RESTART "Regular Restart"
|
||||
#define REGULAR_RESTART_DELAYED "Regular Restart (with delay)"
|
||||
#define HARD_RESTART "Hard Restart (No Delay/Feedback Reason)"
|
||||
#define HARDEST_RESTART "Hardest Restart (No actions, just reboot)"
|
||||
#define TGS_RESTART "Server Restart (Kill and restart DD)"
|
||||
ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", "Server.Game")
|
||||
var/list/options = list(REGULAR_RESTART, REGULAR_RESTART_DELAYED, HARD_RESTART)
|
||||
|
||||
/datum/admins/proc/restart()
|
||||
set category = "Server.Game"
|
||||
set name = "Restart"
|
||||
set desc="Restarts the world"
|
||||
if (!check_rights_for(usr.client, R_HOLDER))
|
||||
// this option runs a codepath that can leak db connections because it skips subsystem (specifically SSdbcore) shutdown
|
||||
if(!SSdbcore.IsConnected())
|
||||
options += HARDEST_RESTART
|
||||
|
||||
if(world.TgsAvailable())
|
||||
options += TGS_RESTART;
|
||||
|
||||
if(SSticker.admin_delay_notice)
|
||||
if(alert(user, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") != "Yes")
|
||||
return FALSE
|
||||
|
||||
var/result = input(user, "Select reboot method", "World Reboot", options[1]) as null|anything in options
|
||||
if(isnull(result))
|
||||
return
|
||||
var/confirm = alert(usr, "Restart the game world?", "Restart", "Yes", "Cancel") // Not tgui_alert for safety
|
||||
if(!confirm || confirm == "Cancel")
|
||||
|
||||
feedback_add_details("admin_verb","R")
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
|
||||
var/init_by = "Initiated by [user.holder.fakekey ? "Admin" : user.key]."
|
||||
switch(result)
|
||||
if(REGULAR_RESTART)
|
||||
if(!user.is_localhost())
|
||||
if(alert(user, "Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart")
|
||||
return FALSE
|
||||
SSticker.Reboot(init_by, "admin reboot - by [user.key] [user.holder.fakekey ? "(stealth)" : ""]", 10)
|
||||
if(REGULAR_RESTART_DELAYED)
|
||||
var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null
|
||||
if(!delay)
|
||||
return FALSE
|
||||
if(!user.is_localhost())
|
||||
if(alert(user,"Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart")
|
||||
return FALSE
|
||||
SSticker.Reboot(init_by, "admin reboot - by [user.key] [user.holder.fakekey ? "(stealth)" : ""]", delay * 10)
|
||||
if(HARD_RESTART)
|
||||
to_chat(world, "World reboot - [init_by]")
|
||||
world.Reboot()
|
||||
if(HARDEST_RESTART)
|
||||
to_chat(world, "Hard world reboot - [init_by]")
|
||||
world.Reboot(fast_track = TRUE)
|
||||
if(TGS_RESTART)
|
||||
to_chat(world, "Server restart - [init_by]")
|
||||
world.TgsEndProcess()
|
||||
|
||||
#undef REGULAR_RESTART
|
||||
#undef REGULAR_RESTART_DELAYED
|
||||
#undef HARD_RESTART
|
||||
#undef HARDEST_RESTART
|
||||
#undef TGS_RESTART
|
||||
|
||||
ADMIN_VERB(cancel_reboot, R_SERVER, "Cancel Reboot", "Cancels a pending world reboot.", "Server.Game")
|
||||
if(!SSticker.cancel_reboot(user))
|
||||
return
|
||||
if(confirm == "Yes")
|
||||
to_world(span_danger("Restarting world!" ) + span_notice("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!"))
|
||||
log_admin("[key_name(usr)] initiated a reboot.")
|
||||
|
||||
feedback_set_details("end_error","admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
|
||||
feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
|
||||
sleep(50)
|
||||
world.Reboot()
|
||||
|
||||
log_admin("[key_name(user)] cancelled the pending world reboot.")
|
||||
message_admins("[key_name_admin(user)] cancelled the pending world reboot.")
|
||||
|
||||
/datum/admins/proc/announce()
|
||||
set category = "Admin.Chat"
|
||||
@@ -880,7 +920,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
if(!SSticker.start_immediately)
|
||||
SSticker.start_immediately = TRUE
|
||||
var/msg = ""
|
||||
if(SSticker.current_state == GAME_STATE_INIT)
|
||||
if(SSticker.current_state == GAME_STATE_STARTUP)
|
||||
msg = " (The server is still setting up, but the round will be started as soon as possible.)"
|
||||
log_admin("[key_name(usr)] has started the game.[msg]")
|
||||
message_admins(span_notice("[key_name_admin(usr)] has started the game.[msg]"))
|
||||
@@ -1017,24 +1057,6 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
message_admins(span_blue("Toggled reviving to [CONFIG_GET(flag/allow_admin_rev)]."))
|
||||
feedback_add_details("admin_verb","TAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/immreboot()
|
||||
set category = "Server.Game"
|
||||
set desc="Reboots the server post haste"
|
||||
set name="Immediate Reboot"
|
||||
if(!check_rights_for(usr.client, R_HOLDER)) return
|
||||
if(alert(usr, "Reboot server?","Reboot!","Yes","No") != "Yes") // Not tgui_alert for safety
|
||||
return
|
||||
to_world(span_filter_system("[span_red(span_bold("Rebooting world!"))] [span_blue("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!")]"))
|
||||
log_admin("[key_name(usr)] initiated an immediate reboot.")
|
||||
|
||||
feedback_set_details("end_error","immediate admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
|
||||
feedback_add_details("admin_verb","IR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
|
||||
world.Reboot()
|
||||
|
||||
/datum/admins/proc/unprison(var/mob/M in GLOB.mob_list)
|
||||
set category = "Admin.Moderation"
|
||||
set name = "Unprison"
|
||||
@@ -1052,7 +1074,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS
|
||||
|
||||
/proc/is_special_character(var/character) // returns 1 for special characters and 2 for heroes of gamemode
|
||||
if(!ticker || !ticker.mode)
|
||||
if(!SSticker|| !SSticker.mode)
|
||||
return 0
|
||||
var/datum/mind/M
|
||||
if (ismob(character))
|
||||
@@ -1062,8 +1084,8 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
M = character
|
||||
|
||||
if(M)
|
||||
if(ticker.mode.antag_templates && ticker.mode.antag_templates.len)
|
||||
for(var/datum/antagonist/antag in ticker.mode.antag_templates)
|
||||
if(SSticker.mode.antag_templates && SSticker.mode.antag_templates.len)
|
||||
for(var/datum/antagonist/antag in SSticker.mode.antag_templates)
|
||||
if(antag.is_antagonist(M))
|
||||
return 2
|
||||
if(M.special_role)
|
||||
@@ -1197,70 +1219,70 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
set desc = "Show the current round configuration."
|
||||
set name = "Show Game Mode"
|
||||
|
||||
if(!ticker || !ticker.mode)
|
||||
if(!SSticker|| !SSticker.mode)
|
||||
tgui_alert_async(usr, "Not before roundstart!", "Alert")
|
||||
return
|
||||
|
||||
var/out = span_large(span_bold("Current mode: [ticker.mode.name] (<a href='byond://?src=\ref[ticker.mode];[HrefToken()];debug_antag=self'>[ticker.mode.config_tag]</a>)")) + "<br/>"
|
||||
var/out = span_large(span_bold("Current mode: [SSticker.mode.name] (<a href='byond://?src=\ref[SSticker.mode];[HrefToken()];debug_antag=self'>[SSticker.mode.config_tag]</a>)")) + "<br/>"
|
||||
out += "<hr>"
|
||||
|
||||
if(ticker.mode.ert_disabled)
|
||||
out += span_bold("Emergency Response Teams:") + "<a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=ert'>disabled</a>"
|
||||
if(SSticker.mode.ert_disabled)
|
||||
out += span_bold("Emergency Response Teams:") + "<a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=ert'>disabled</a>"
|
||||
else
|
||||
out += span_bold("Emergency Response Teams:") + "<a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=ert'>enabled</a>"
|
||||
out += span_bold("Emergency Response Teams:") + "<a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=ert'>enabled</a>"
|
||||
out += "<br/>"
|
||||
|
||||
if(ticker.mode.deny_respawn)
|
||||
out += span_bold("Respawning:") + "<a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=respawn'>disallowed</a>"
|
||||
if(SSticker.mode.deny_respawn)
|
||||
out += span_bold("Respawning:") + "<a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=respawn'>disallowed</a>"
|
||||
else
|
||||
out += span_bold("Respawning:") + "<a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=respawn'>allowed</a>"
|
||||
out += span_bold("Respawning:") + "<a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=respawn'>allowed</a>"
|
||||
out += "<br/>"
|
||||
|
||||
out += span_bold("Shuttle delay multiplier:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=shuttle_delay'>[ticker.mode.shuttle_delay]</a><br/>"
|
||||
out += span_bold("Shuttle delay multiplier:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=shuttle_delay'>[SSticker.mode.shuttle_delay]</a><br/>"
|
||||
|
||||
if(ticker.mode.auto_recall_shuttle)
|
||||
out += span_bold("Shuttle auto-recall:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=shuttle_recall'>enabled</a>"
|
||||
if(SSticker.mode.auto_recall_shuttle)
|
||||
out += span_bold("Shuttle auto-recall:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=shuttle_recall'>enabled</a>"
|
||||
else
|
||||
out += span_bold("Shuttle auto-recall:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=shuttle_recall'>disabled</a>"
|
||||
out += span_bold("Shuttle auto-recall:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=shuttle_recall'>disabled</a>"
|
||||
out += "<br/><br/>"
|
||||
|
||||
if(ticker.mode.event_delay_mod_moderate)
|
||||
out += span_bold("Moderate event time modifier:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=event_modifier_moderate'>[ticker.mode.event_delay_mod_moderate]</a><br/>"
|
||||
if(SSticker.mode.event_delay_mod_moderate)
|
||||
out += span_bold("Moderate event time modifier:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=event_modifier_moderate'>[SSticker.mode.event_delay_mod_moderate]</a><br/>"
|
||||
else
|
||||
out += span_bold("Moderate event time modifier:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=event_modifier_moderate'>unset</a><br/>"
|
||||
out += span_bold("Moderate event time modifier:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=event_modifier_moderate'>unset</a><br/>"
|
||||
|
||||
if(ticker.mode.event_delay_mod_major)
|
||||
out += span_bold("Major event time modifier:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=event_modifier_severe'>[ticker.mode.event_delay_mod_major]</a><br/>"
|
||||
if(SSticker.mode.event_delay_mod_major)
|
||||
out += span_bold("Major event time modifier:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=event_modifier_severe'>[SSticker.mode.event_delay_mod_major]</a><br/>"
|
||||
else
|
||||
out += span_bold("Major event time modifier:") + " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=event_modifier_severe'>unset</a><br/>"
|
||||
out += span_bold("Major event time modifier:") + " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=event_modifier_severe'>unset</a><br/>"
|
||||
|
||||
out += "<hr>"
|
||||
|
||||
if(ticker.mode.antag_tags && ticker.mode.antag_tags.len)
|
||||
if(SSticker.mode.antag_tags && SSticker.mode.antag_tags.len)
|
||||
out += span_bold("Core antag templates:") + "</br>"
|
||||
for(var/antag_tag in ticker.mode.antag_tags)
|
||||
out += "<a href='byond://?src=\ref[ticker.mode];[HrefToken()];debug_antag=[antag_tag]'>[antag_tag]</a>.</br>"
|
||||
for(var/antag_tag in SSticker.mode.antag_tags)
|
||||
out += "<a href='byond://?src=\ref[SSticker.mode];[HrefToken()];debug_antag=[antag_tag]'>[antag_tag]</a>.</br>"
|
||||
|
||||
if(ticker.mode.round_autoantag)
|
||||
out += span_bold("Autotraitor <a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=autotraitor'>enabled</a>.")
|
||||
if(ticker.mode.antag_scaling_coeff > 0)
|
||||
out += " (scaling with <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=antag_scaling'>[ticker.mode.antag_scaling_coeff]</a>)"
|
||||
if(SSticker.mode.round_autoantag)
|
||||
out += span_bold("Autotraitor <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=autotraitor'>enabled</a>.")
|
||||
if(SSticker.mode.antag_scaling_coeff > 0)
|
||||
out += " (scaling with <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=antag_scaling'>[SSticker.mode.antag_scaling_coeff]</a>)"
|
||||
else
|
||||
out += " (not currently scaling, <a href='byond://?src=\ref[ticker.mode];[HrefToken()];set=antag_scaling'>set a coefficient</a>)"
|
||||
out += " (not currently scaling, <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];set=antag_scaling'>set a coefficient</a>)"
|
||||
out += "<br/>"
|
||||
else
|
||||
out += span_bold("Autotraitor <a href='byond://?src=\ref[ticker.mode];[HrefToken()];toggle=autotraitor'>disabled</a>.") + "<br/>"
|
||||
out += span_bold("Autotraitor <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];toggle=autotraitor'>disabled</a>.") + "<br/>"
|
||||
|
||||
out += span_bold("All antag ids:")
|
||||
if(ticker.mode.antag_templates && ticker.mode.antag_templates.len)
|
||||
for(var/datum/antagonist/antag in ticker.mode.antag_templates)
|
||||
if(SSticker.mode.antag_templates && SSticker.mode.antag_templates.len)
|
||||
for(var/datum/antagonist/antag in SSticker.mode.antag_templates)
|
||||
antag.update_current_antag_max()
|
||||
out += " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];debug_antag=[antag.id]'>[antag.id]</a>"
|
||||
out += " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];debug_antag=[antag.id]'>[antag.id]</a>"
|
||||
out += " ([antag.get_antag_count()]/[antag.cur_max]) "
|
||||
out += " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];remove_antag_type=[antag.id]'>\[-\]</a><br/>"
|
||||
out += " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];remove_antag_type=[antag.id]'>\[-\]</a><br/>"
|
||||
else
|
||||
out += " None."
|
||||
out += " <a href='byond://?src=\ref[ticker.mode];[HrefToken()];add_antag_type=1'>\[+\]</a><br/>"
|
||||
out += " <a href='byond://?src=\ref[SSticker.mode];[HrefToken()];add_antag_type=1'>\[+\]</a><br/>"
|
||||
|
||||
var/datum/browser/popup = new(owner, "edit_mode[src]", "Edit Game Mode")
|
||||
popup.set_content(out)
|
||||
@@ -1404,7 +1426,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
return
|
||||
|
||||
if(!ticker || !ticker.mode)
|
||||
if(!SSticker|| !SSticker.mode)
|
||||
to_chat(usr, "Mode has not started.")
|
||||
return
|
||||
|
||||
@@ -1428,12 +1450,12 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
return
|
||||
|
||||
if(!ticker || !ticker.mode)
|
||||
if(!SSticker|| !SSticker.mode)
|
||||
to_chat(usr, "Mode has not started.")
|
||||
return
|
||||
|
||||
log_and_message_admins("attempting to force mode autospawn.")
|
||||
ticker.mode.try_latespawn()
|
||||
SSticker.mode.try_latespawn()
|
||||
|
||||
/datum/admins/proc/paralyze_mob(mob/living/H as mob)
|
||||
set category = "Admin.Events"
|
||||
|
||||
@@ -213,7 +213,11 @@ GLOBAL_PROTECT(protected_ranks)
|
||||
|
||||
/// (Re)Loads the admin list.
|
||||
/// returns TRUE if database admins had to be loaded from the backup json
|
||||
/proc/load_admins(no_update)
|
||||
/proc/load_admins(no_update, initial = FALSE)
|
||||
if(!initial)
|
||||
if(!global.config.PreConfigReload())
|
||||
return
|
||||
|
||||
var/dbfail
|
||||
if(!CONFIG_GET(flag/admin_legacy_system) && !SSdbcore.Connect())
|
||||
message_admins("Failed to connect to database while loading admins. Loading from backup.")
|
||||
|
||||
@@ -18,7 +18,6 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/player_panel,
|
||||
/client/proc/hide_verbs, //hides all our adminverbs,
|
||||
/client/proc/hide_most_verbs, //hides all our hideable adminverbs,
|
||||
/client/proc/debug_variables, //allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify,
|
||||
/client/proc/cmd_check_new_players, //allows us to see every new player,
|
||||
/client/proc/toggle_view_range, //changes how far we can see,
|
||||
/client/proc/cmd_admin_pm_context, //right-click adminPM interface,
|
||||
@@ -103,7 +102,6 @@ var/list/admin_verbs_fun = list(
|
||||
/datum/admins/proc/cmd_admin_dress,
|
||||
/client/proc/drop_bomb,
|
||||
/client/proc/everyone_random,
|
||||
/client/proc/cinematic,
|
||||
/datum/admins/proc/toggle_aliens,
|
||||
/datum/admins/proc/toggle_space_ninja,
|
||||
/client/proc/cmd_admin_add_freeform_ai_law,
|
||||
@@ -152,12 +150,10 @@ var/list/admin_verbs_server = list(
|
||||
/client/proc/Set_Holiday,
|
||||
/client/proc/ToRban,
|
||||
/datum/admins/proc/startnow,
|
||||
/datum/admins/proc/restart,
|
||||
/datum/admins/proc/delay,
|
||||
/datum/admins/proc/toggleaban,
|
||||
/datum/admins/proc/togglepersistence,
|
||||
/client/proc/toggle_log_hrefs,
|
||||
/datum/admins/proc/immreboot,
|
||||
/client/proc/everyone_random,
|
||||
/datum/admins/proc/toggleAI,
|
||||
/client/proc/cmd_admin_delete, //delete an instance/object/mob/etc,
|
||||
@@ -194,7 +190,6 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/air_report,
|
||||
/client/proc/reload_admins,
|
||||
/client/proc/reload_eventMs,
|
||||
/datum/admins/proc/restart,
|
||||
/client/proc/print_random_map,
|
||||
/client/proc/create_random_map,
|
||||
/client/proc/apply_random_map,
|
||||
@@ -211,7 +206,6 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/player_panel,
|
||||
/client/proc/hide_verbs, //hides all our adminverbs,
|
||||
/client/proc/hide_most_verbs, //hides all our hideable adminverbs,
|
||||
/client/proc/debug_variables, //allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify,
|
||||
/client/proc/cmd_check_new_players, //allows us to see every new player,
|
||||
/datum/admins/proc/view_runtimes,
|
||||
// /client/proc/show_gm_status, //We don't use SSgame_master yet.
|
||||
@@ -254,7 +248,6 @@ var/list/admin_verbs_hideable = list(
|
||||
/client/proc/object_talk,
|
||||
/datum/admins/proc/cmd_admin_dress,
|
||||
/client/proc/drop_bomb,
|
||||
/client/proc/cinematic,
|
||||
/datum/admins/proc/toggle_aliens,
|
||||
/datum/admins/proc/toggle_space_ninja,
|
||||
/client/proc/cmd_admin_add_freeform_ai_law,
|
||||
@@ -266,11 +259,9 @@ var/list/admin_verbs_hideable = list(
|
||||
/client/proc/Set_Holiday,
|
||||
/client/proc/ToRban,
|
||||
/datum/admins/proc/startnow,
|
||||
/datum/admins/proc/restart,
|
||||
/datum/admins/proc/delay,
|
||||
/datum/admins/proc/toggleaban,
|
||||
/client/proc/toggle_log_hrefs,
|
||||
/datum/admins/proc/immreboot,
|
||||
/client/proc/everyone_random,
|
||||
/datum/admins/proc/toggleAI,
|
||||
/datum/admins/proc/adrev,
|
||||
@@ -299,14 +290,12 @@ var/list/admin_verbs_hideable = list(
|
||||
var/list/admin_verbs_mod = list(
|
||||
/client/proc/cmd_admin_pm_context, //right-click adminPM interface,
|
||||
/client/proc/cmd_admin_pm_panel, //admin-pm list,
|
||||
/client/proc/debug_variables, //allows us to -see- the variables of any instance in the game.,
|
||||
/datum/admins/proc/PlayerNotes,
|
||||
/client/proc/admin_ghost, //allows us to ghost/reenter body at will,
|
||||
/client/proc/player_panel_new, //shows an interface for all players, with links to various panels,
|
||||
/client/proc/player_panel,
|
||||
/client/proc/hide_verbs, //hides all our adminverbs,
|
||||
/client/proc/hide_most_verbs, //hides all our hideable adminverbs,
|
||||
/client/proc/debug_variables, //allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify,
|
||||
/client/proc/cmd_check_new_players, //allows us to see every new player,
|
||||
/datum/admins/proc/show_player_info,
|
||||
/datum/admins/proc/show_traitor_panel,
|
||||
@@ -332,12 +321,10 @@ var/list/admin_verbs_event_manager = list(
|
||||
/client/proc/player_panel,
|
||||
/client/proc/hide_verbs, //hides all our adminverbs,
|
||||
/client/proc/hide_most_verbs, //hides all our hideable adminverbs,
|
||||
/client/proc/debug_variables, //allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify,
|
||||
/client/proc/cmd_check_new_players, //allows us to see every new player,
|
||||
/datum/admins/proc/show_player_info,
|
||||
/client/proc/dsay,
|
||||
/client/proc/cmd_admin_subtle_message,
|
||||
/client/proc/debug_variables,
|
||||
/client/proc/check_antagonists,
|
||||
/client/proc/aooc,
|
||||
/datum/admins/proc/paralyze_mob,
|
||||
@@ -439,9 +426,7 @@ var/list/admin_verbs_event_manager = list(
|
||||
/datum/admins/proc/capture_map,
|
||||
/client/proc/Set_Holiday,
|
||||
/datum/admins/proc/startnow,
|
||||
/datum/admins/proc/restart,
|
||||
/datum/admins/proc/delay,
|
||||
/datum/admins/proc/immreboot,
|
||||
/client/proc/everyone_random,
|
||||
/client/proc/cmd_admin_delete, //delete an instance/object/mob/etc,
|
||||
/client/proc/cmd_debug_del_all,
|
||||
|
||||
@@ -390,7 +390,7 @@
|
||||
target.radio.syndie = 1
|
||||
target.module.channels += list("[selected_radio_channel]" = 1)
|
||||
target.radio.channels[selected_radio_channel] = target.module.channels[selected_radio_channel]
|
||||
target.radio.secure_radio_connections[selected_radio_channel] = radio_controller.add_object(target.radio, radiochannels[selected_radio_channel], RADIO_CHAT)
|
||||
target.radio.secure_radio_connections[selected_radio_channel] = SSradio.add_object(target.radio, radiochannels[selected_radio_channel], RADIO_CHAT)
|
||||
return TRUE
|
||||
if("rem_channel")
|
||||
var/selected_radio_channel = params["channel"]
|
||||
@@ -404,7 +404,7 @@
|
||||
target.radio.channels = list()
|
||||
for(var/n_chan in target.module.channels)
|
||||
target.radio.channels[n_chan] = target.module.channels[n_chan]
|
||||
radio_controller.remove_object(target.radio, radiochannels[selected_radio_channel])
|
||||
SSradio.remove_object(target.radio, radiochannels[selected_radio_channel])
|
||||
target.radio.secure_radio_connections -= selected_radio_channel
|
||||
return TRUE
|
||||
if("add_component")
|
||||
|
||||
@@ -390,9 +390,9 @@
|
||||
|
||||
|
||||
/datum/admins/proc/check_antagonists()
|
||||
if (ticker && ticker.current_state >= GAME_STATE_PLAYING)
|
||||
if (SSticker && SSticker.current_state >= GAME_STATE_PLAYING)
|
||||
var/dat = "<html><head><title>Round Status</title></head><body><h1>" + span_bold("Round Status") + "</h1>"
|
||||
dat += "Current Game Mode: " + span_bold("[ticker.mode.name]") + "<BR>"
|
||||
dat += "Current Game Mode: " + span_bold("[SSticker.mode.name]") + "<BR>"
|
||||
dat += "Round Duration: " + span_bold("[roundduration2text()]") + "<BR>"
|
||||
dat += span_bold("Emergency shuttle") + "<BR>"
|
||||
if (!emergency_shuttle.online())
|
||||
@@ -410,7 +410,7 @@
|
||||
if (emergency_shuttle.shuttle.moving_status == SHUTTLE_WARMUP)
|
||||
dat += "Launching now..."
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];[HrefToken()];delay_round_end=1'>[ticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
|
||||
dat += "<a href='byond://?src=\ref[src];[HrefToken()];delay_round_end=1'>[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
|
||||
dat += "<hr>"
|
||||
for(var/antag_type in GLOB.all_antag_types)
|
||||
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
|
||||
|
||||
+12
-12
@@ -25,7 +25,7 @@
|
||||
if(!CheckAdminHref(href, href_list))
|
||||
return
|
||||
|
||||
if(ticker.mode && ticker.mode.check_antagonists_topic(href, href_list))
|
||||
if(SSticker.mode && SSticker.mode.check_antagonists_topic(href, href_list))
|
||||
check_antagonists()
|
||||
return
|
||||
|
||||
@@ -66,13 +66,13 @@
|
||||
else if(href_list["call_shuttle"])
|
||||
if(!check_rights(R_ADMIN|R_EVENT)) return
|
||||
|
||||
if( ticker.mode.name == "blob" )
|
||||
if( SSticker.mode.name == "blob" )
|
||||
tgui_alert_async(usr, "You can't call the shuttle during blob!")
|
||||
return
|
||||
|
||||
switch(href_list["call_shuttle"])
|
||||
if("1")
|
||||
if ((!( ticker ) || !emergency_shuttle.location()))
|
||||
if ((!( SSticker ) || !emergency_shuttle.location()))
|
||||
return
|
||||
if (emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
@@ -80,7 +80,7 @@
|
||||
message_admins(span_blue("[key_name_admin(usr)] called the Emergency Shuttle to the station."), 1)
|
||||
|
||||
if("2")
|
||||
if (!( ticker ) || !emergency_shuttle.location())
|
||||
if (!( SSticker ) || !emergency_shuttle.location())
|
||||
return
|
||||
if (emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
@@ -119,9 +119,9 @@
|
||||
else if(href_list["delay_round_end"])
|
||||
if(!check_rights(R_SERVER)) return
|
||||
|
||||
ticker.delay_end = !ticker.delay_end
|
||||
log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins(span_blue("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"]."), 1)
|
||||
SSticker.delay_end = !SSticker.delay_end
|
||||
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins(span_blue("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"]."), 1)
|
||||
href_list["secretsadmin"] = "check_antagonist"
|
||||
|
||||
else if(href_list["simplemake"])
|
||||
@@ -832,7 +832,7 @@
|
||||
else if(href_list["c_mode"])
|
||||
if(!check_rights(R_ADMIN|R_EVENT)) return
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
if(SSticker && SSticker.mode)
|
||||
return tgui_alert_async(usr, "The game has already started.")
|
||||
var/dat = {"<B>What mode do you wish to play?</B><HR>"}
|
||||
for(var/mode in config.modes)
|
||||
@@ -845,7 +845,7 @@
|
||||
else if(href_list["f_secret"])
|
||||
if(!check_rights(R_ADMIN|R_EVENT)) return
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
if(SSticker && SSticker.mode)
|
||||
return tgui_alert_async(usr, "The game has already started.")
|
||||
if(GLOB.master_mode != "secret")
|
||||
return tgui_alert_async(usr, "The game mode has to be secret!")
|
||||
@@ -859,7 +859,7 @@
|
||||
else if(href_list["c_mode2"])
|
||||
if(!check_rights(R_ADMIN|R_SERVER|R_EVENT)) return
|
||||
|
||||
if (ticker && ticker.mode)
|
||||
if (SSticker && SSticker.mode)
|
||||
return tgui_alert_async(usr, "The game has already started.")
|
||||
GLOB.master_mode = href_list["c_mode2"]
|
||||
log_admin("[key_name(usr)] set the mode as [config.mode_names[GLOB.master_mode]].")
|
||||
@@ -872,7 +872,7 @@
|
||||
else if(href_list["f_secret2"])
|
||||
if(!check_rights(R_ADMIN|R_SERVER|R_EVENT)) return
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
if(SSticker && SSticker.mode)
|
||||
return tgui_alert_async(usr, "The game has already started.")
|
||||
if(GLOB.master_mode != "secret")
|
||||
return tgui_alert_async(usr, "The game mode has to be secret!")
|
||||
@@ -1495,7 +1495,7 @@
|
||||
else if(href_list["traitor"])
|
||||
if(!check_rights(R_ADMIN|R_MOD|R_EVENT)) return
|
||||
|
||||
if(!ticker || !ticker.mode)
|
||||
if(!SSticker|| !SSticker.mode)
|
||||
tgui_alert_async(usr, "The game hasn't started yet!")
|
||||
return
|
||||
|
||||
|
||||
@@ -1,28 +1,10 @@
|
||||
/client/proc/cinematic(var/cinematic as anything in list("explosion",null))
|
||||
set name = "Cinematic"
|
||||
set category = "Fun.Do Not"
|
||||
set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
|
||||
|
||||
if(!check_rights(R_FUN))
|
||||
ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", ADMIN_CATEGORY_FUN)
|
||||
var/datum/cinematic/choice = tgui_input_list(
|
||||
user,
|
||||
"Chose a cinematic to play to everyone in the server.",
|
||||
"Choose Cinematic",
|
||||
sortList(subtypesof(/datum/cinematic), GLOBAL_PROC_REF(cmp_typepaths_asc)),
|
||||
)
|
||||
if(!choice || !ispath(choice, /datum/cinematic))
|
||||
return
|
||||
|
||||
if(tgui_alert(usr, "Are you sure you want to run [cinematic]?","Confirmation",list("Yes","No")) != "Yes") return
|
||||
if(!ticker) return
|
||||
switch(cinematic)
|
||||
if("explosion")
|
||||
var/input = tgui_alert(usr, "The game will be over. Are you really sure?", "Confirmation", list("Continue","Cancel"))
|
||||
if(!input || input == "Cancel")
|
||||
return
|
||||
var/parameter = tgui_input_number(src,"station_missed = ?","Enter Parameter",0,1,0)
|
||||
var/override
|
||||
switch(parameter)
|
||||
if(1)
|
||||
override = tgui_input_list(src,"mode = ?","Enter Parameter", list("mercenary","no override"))
|
||||
if(0)
|
||||
override = tgui_input_list(src,"mode = ?","Enter Parameter", list("blob","mercenary","AI malfunction","no override"))
|
||||
ticker.station_explosion_cinematic(parameter,override)
|
||||
|
||||
log_admin("[key_name(src)] launched cinematic \"[cinematic]\"")
|
||||
message_admins("[key_name_admin(src)] launched cinematic \"[cinematic]\"", 1)
|
||||
|
||||
return
|
||||
play_cinematic(choice, world)
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
set category = "Fun.Event Kit"
|
||||
set name = "Make Robot"
|
||||
|
||||
if(!ticker)
|
||||
if(!SSticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
if(ishuman(M))
|
||||
@@ -112,7 +112,7 @@
|
||||
set category = "Fun.Event Kit"
|
||||
set name = "Make Simple Animal"
|
||||
|
||||
if(!ticker)
|
||||
if(!SSticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
set category = "Fun.Event Kit"
|
||||
set name = "Make Alien"
|
||||
|
||||
if(!ticker)
|
||||
if(!SSticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
if(ishuman(M))
|
||||
@@ -277,7 +277,7 @@
|
||||
set category = "Admin.Events"
|
||||
set name = "Grant Full Access"
|
||||
|
||||
if (!ticker)
|
||||
if (!SSticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
if (ishuman(M))
|
||||
@@ -610,7 +610,7 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct
|
||||
|
||||
// DNA2 - Admin Hax
|
||||
/client/proc/cmd_admin_toggle_block(var/mob/M,var/block)
|
||||
if(!ticker)
|
||||
if(!SSticker)
|
||||
tgui_alert_async(usr, "Wait until the game starts")
|
||||
return
|
||||
if(istype(M, /mob/living/carbon))
|
||||
|
||||
@@ -79,9 +79,9 @@
|
||||
set name = "Radio report"
|
||||
|
||||
var/output = "<b>Radio Report</b><hr>"
|
||||
for (var/fq in radio_controller.frequencies)
|
||||
for (var/fq in SSradio.frequencies)
|
||||
output += "<b>Freq: [fq]</b><br>"
|
||||
var/datum/radio_frequency/fqs = radio_controller.frequencies[fq]
|
||||
var/datum/radio_frequency/fqs = SSradio.frequencies[fq]
|
||||
if (!fqs)
|
||||
output += " <b>ERROR</b><br>"
|
||||
continue
|
||||
|
||||
@@ -867,7 +867,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
|
||||
set category = "Admin.Events"
|
||||
set name = "Call Shuttle"
|
||||
|
||||
if ((!( ticker ) || !emergency_shuttle.location()))
|
||||
if ((!( SSticker ) || !emergency_shuttle.location()))
|
||||
return
|
||||
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
@@ -876,7 +876,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
|
||||
if(confirm != "Yes") return
|
||||
|
||||
var/choice
|
||||
if(ticker.mode.auto_recall_shuttle)
|
||||
if(SSticker.mode.auto_recall_shuttle)
|
||||
choice = tgui_input_list(usr, "The shuttle will just return if you call it. Call anyway?", "Shuttle Call", list("Confirm", "Cancel"))
|
||||
if(choice == "Confirm")
|
||||
emergency_shuttle.auto_recall = 1 //enable auto-recall
|
||||
@@ -903,7 +903,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
|
||||
|
||||
if(tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return
|
||||
|
||||
if(!ticker || !emergency_shuttle.can_recall())
|
||||
if(!SSticker || !emergency_shuttle.can_recall())
|
||||
return
|
||||
|
||||
emergency_shuttle.recall()
|
||||
@@ -917,7 +917,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
|
||||
set category = "Admin.Events"
|
||||
set name = "Toggle Deny Shuttle"
|
||||
|
||||
if (!ticker)
|
||||
if (!SSticker)
|
||||
return
|
||||
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
@@ -944,12 +944,12 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
|
||||
|
||||
if(!check_rights(R_FUN)) return
|
||||
|
||||
if (ticker && ticker.mode)
|
||||
if (SSticker && SSticker.mode)
|
||||
to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!")
|
||||
return
|
||||
|
||||
if(ticker.random_players)
|
||||
ticker.random_players = 0
|
||||
if(CONFIG_GET(flag/force_random_names))
|
||||
CONFIG_SET(flag/force_random_names, FALSE)
|
||||
message_admins("Admin [key_name_admin(usr)] has disabled \"Everyone is Special\" mode.", 1)
|
||||
to_chat(usr, "Disabled.")
|
||||
return
|
||||
@@ -967,7 +967,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
|
||||
|
||||
to_chat(usr, "<i>Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet</i>.")
|
||||
|
||||
ticker.random_players = 1
|
||||
CONFIG_SET(flag/force_random_names, TRUE)
|
||||
feedback_add_details("admin_verb","MER") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ ADMIN_VERB(secrets, R_HOLDER, "Secrets", "Abuse harder than you ever have before
|
||||
if("show_traitors_and_objectives") // Not implemented in the UI
|
||||
holder.holder.check_antagonists()
|
||||
if("show_game_mode")
|
||||
if (ticker.mode) tgui_alert_async(holder, "The game mode is [ticker.mode.name]")
|
||||
if (SSticker.mode) tgui_alert_async(holder, "The game mode is [SSticker.mode.name]")
|
||||
else tgui_alert_async(holder, "For some reason there's a ticker, but not a game mode")
|
||||
|
||||
//Buttons for debug.
|
||||
|
||||
@@ -10,7 +10,7 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
if(!ticker)
|
||||
if(!SSticker)
|
||||
to_chat(usr, span_red("The game hasn't started yet!"))
|
||||
return
|
||||
|
||||
@@ -54,3 +54,153 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
|
||||
return
|
||||
|
||||
team.attempt_random_spawn()
|
||||
|
||||
//STRIKE TEAMS
|
||||
//Thanks to Kilakk for the admin-button portion of this code.
|
||||
|
||||
GLOBAL_VAR_INIT(send_emergency_team, 0) // Used for automagic response teams; 'admin_emergency_team' for admin-spawned response teams
|
||||
|
||||
GLOBAL_VAR_INIT(ert_base_chance, 10) // Default base chance. Will be incremented by increment ERT chance.
|
||||
GLOBAL_VAR(can_call_ert)
|
||||
GLOBAL_VAR_INIT(silent_ert, 0)
|
||||
|
||||
/client/proc/response_team()
|
||||
set name = "Dispatch Emergency Response Team"
|
||||
set category = "Fun.Event Kit"
|
||||
set desc = "Send an emergency response team to the station"
|
||||
|
||||
if(!check_rights_for(src, R_HOLDER))
|
||||
to_chat(usr, span_danger("Only administrators may use this command."))
|
||||
return
|
||||
if(!SSticker)
|
||||
to_chat(usr, span_danger("The game hasn't started yet!"))
|
||||
return
|
||||
if(SSticker.current_state == 1)
|
||||
to_chat(usr, span_danger("The round hasn't started yet!"))
|
||||
return
|
||||
if(GLOB.send_emergency_team)
|
||||
to_chat(usr, span_danger("[using_map.boss_name] has already dispatched an emergency response team!"))
|
||||
return
|
||||
if(tgui_alert(usr, "Do you want to dispatch an Emergency Response Team?","ERT",list("Yes","No")) != "Yes")
|
||||
return
|
||||
if(tgui_alert(usr, "Do you want this Response Team to be announced?","ERT",list("Yes","No")) != "Yes")
|
||||
GLOB.silent_ert = 1
|
||||
if(get_security_level() != "red") // Allow admins to reconsider if the alert level isn't Red
|
||||
if(tgui_alert(usr, "The station is not in red alert. Do you still want to dispatch a response team?","ERT",list("Yes","No")) != "Yes")
|
||||
return
|
||||
if(GLOB.send_emergency_team)
|
||||
to_chat(usr, span_danger("Looks like somebody beat you to it!"))
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(usr)] is dispatching an Emergency Response Team.", 1)
|
||||
admin_chat_message(message = "[key_name(usr)] is dispatching an Emergency Response Team", color = "#CC2222") //VOREStation Add
|
||||
log_admin("[key_name(usr)] used Dispatch Response Team.")
|
||||
trigger_armed_response_team(1)
|
||||
|
||||
/client/verb/JoinResponseTeam()
|
||||
|
||||
set name = "Join Response Team"
|
||||
set category = "IC.Event"
|
||||
|
||||
if(!MayRespawn(1))
|
||||
to_chat(usr, span_warning("You cannot join the response team at this time."))
|
||||
return
|
||||
|
||||
if(isobserver(usr) || isnewplayer(usr))
|
||||
if(!GLOB.send_emergency_team)
|
||||
to_chat(usr, "No emergency response team is currently being sent.")
|
||||
return
|
||||
if(jobban_isbanned(usr, JOB_SYNDICATE) || jobban_isbanned(usr, JOB_EMERGENCY_RESPONSE_TEAM) || jobban_isbanned(usr, JOB_SECURITY_OFFICER))
|
||||
to_chat(usr, span_danger("You are jobbanned from the emergency reponse team!"))
|
||||
return
|
||||
if(ert.current_antagonists.len >= ert.hard_cap)
|
||||
to_chat(usr, "The emergency response team is already full!")
|
||||
return
|
||||
ert.create_default(usr)
|
||||
else
|
||||
to_chat(usr, "You need to be an observer or new player to use this.")
|
||||
|
||||
// returns a number of dead players in %
|
||||
/proc/percentage_dead()
|
||||
var/total = 0
|
||||
var/deadcount = 0
|
||||
for(var/mob/living/carbon/human/H in GLOB.mob_list)
|
||||
if(H.client) // Monkeys and mice don't have a client, amirite?
|
||||
if(H.stat == 2) deadcount++
|
||||
total++
|
||||
|
||||
if(total == 0) return 0
|
||||
else return round(100 * deadcount / total)
|
||||
|
||||
// counts the number of antagonists in %
|
||||
/proc/percentage_antagonists()
|
||||
var/total = 0
|
||||
var/antagonists = 0
|
||||
for(var/mob/living/carbon/human/H in GLOB.mob_list)
|
||||
if(is_special_character(H) >= 1)
|
||||
antagonists++
|
||||
total++
|
||||
|
||||
if(total == 0) return 0
|
||||
else return round(100 * antagonists / total)
|
||||
|
||||
// Increments the ERT chance automatically, so that the later it is in the round,
|
||||
// the more likely an ERT is to be able to be called.
|
||||
/proc/increment_ert_chance()
|
||||
while(GLOB.send_emergency_team == 0) // There is no ERT at the time.
|
||||
if(get_security_level() == "green")
|
||||
GLOB.ert_base_chance += 1
|
||||
if(get_security_level() == "yellow")
|
||||
GLOB.ert_base_chance += 1
|
||||
if(get_security_level() == "violet")
|
||||
GLOB.ert_base_chance += 2
|
||||
if(get_security_level() == "orange")
|
||||
GLOB.ert_base_chance += 2
|
||||
if(get_security_level() == "blue")
|
||||
GLOB.ert_base_chance += 2
|
||||
if(get_security_level() == "red")
|
||||
GLOB.ert_base_chance += 3
|
||||
if(get_security_level() == "delta")
|
||||
GLOB.ert_base_chance += 10 // Need those big guns
|
||||
sleep(600 * 3) // Minute * Number of Minutes
|
||||
|
||||
|
||||
/proc/trigger_armed_response_team(var/force = 0)
|
||||
if(!GLOB.can_call_ert && !force)
|
||||
return
|
||||
if(GLOB.send_emergency_team)
|
||||
return
|
||||
|
||||
var/send_team_chance = GLOB.ert_base_chance // Is incremented by increment_ert_chance.
|
||||
send_team_chance += 2*percentage_dead() // the more people are dead, the higher the chance
|
||||
send_team_chance += percentage_antagonists() // the more antagonists, the higher the chance
|
||||
send_team_chance = min(send_team_chance, 100)
|
||||
|
||||
if(force) send_team_chance = 100
|
||||
|
||||
// there's only a certain chance a team will be sent
|
||||
if(!prob(send_team_chance))
|
||||
command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "[using_map.boss_name]")
|
||||
GLOB.can_call_ert = 0 // Only one call per round, ladies.
|
||||
return
|
||||
if(GLOB.silent_ert == 0)
|
||||
command_announcement.Announce("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "[using_map.boss_name]")
|
||||
|
||||
GLOB.can_call_ert = 0 // Only one call per round, gentleman.
|
||||
GLOB.send_emergency_team = 1
|
||||
consider_ert_load() //VOREStation Add
|
||||
|
||||
sleep(600 * 5)
|
||||
GLOB.send_emergency_team = 0 // Can no longer join the ERT.
|
||||
|
||||
GLOBAL_VAR(ert_loaded)
|
||||
|
||||
/proc/consider_ert_load()
|
||||
if(!GLOB.ert_loaded)
|
||||
GLOB.ert_loaded = TRUE
|
||||
var/datum/map_template/MT = SSmapping.map_templates["Special Area - ERT"]
|
||||
if(!istype(MT))
|
||||
error("ERT Area is not a valid map template!")
|
||||
else
|
||||
MT.load_new_z(centered = TRUE)
|
||||
log_and_message_admins("Loaded the ERT shuttle just now.")
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
//Based on the ERT setup
|
||||
|
||||
GLOBAL_VAR_INIT(send_beruang, 0)
|
||||
GLOBAL_VAR_INIT(can_call_traders, 1)
|
||||
|
||||
/client/proc/trader_ship()
|
||||
set name = "Dispatch Beruang Trader Ship"
|
||||
set category = "Fun.Event Kit"
|
||||
set desc = "Invite players to join the Beruang."
|
||||
|
||||
if(!holder)
|
||||
to_chat(usr, span_danger("Only administrators may use this command."))
|
||||
return
|
||||
if(!SSticker)
|
||||
to_chat(usr, span_danger("The game hasn't started yet!"))
|
||||
return
|
||||
if(SSticker.current_state == 1)
|
||||
to_chat(usr, span_danger("The round hasn't started yet!"))
|
||||
return
|
||||
if(GLOB.send_beruang)
|
||||
to_chat(usr, span_danger("The Beruang has already been sent this round!"))
|
||||
return
|
||||
if(tgui_alert(usr, "Do you want to dispatch the Beruang trade ship?","Trade Ship",list("Yes","No")) != "Yes")
|
||||
return
|
||||
if(get_security_level() == "red") // Allow admins to reconsider if the alert level is Red
|
||||
if(tgui_alert(usr, "The station is in red alert. Do you still want to send traders?","Trade Ship",list("Yes","No")) != "Yes")
|
||||
return
|
||||
if(GLOB.send_beruang)
|
||||
to_chat(usr, span_danger("Looks like somebody beat you to it!"))
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(usr)] is dispatching the Beruang.", 1)
|
||||
log_admin("[key_name(usr)] used Dispatch Beruang Trader Ship.")
|
||||
trigger_trader_visit()
|
||||
|
||||
/client/verb/JoinTraders()
|
||||
|
||||
set name = "Join Trader Visit"
|
||||
set category = "IC.Event"
|
||||
|
||||
if(!MayRespawn(1))
|
||||
to_chat(usr, span_warning("You cannot join the traders."))
|
||||
return
|
||||
|
||||
if(isobserver(usr) || isnewplayer(usr))
|
||||
if(!GLOB.send_beruang)
|
||||
to_chat(usr, "The Beruang is not currently heading to the station.")
|
||||
return
|
||||
if(traders.current_antagonists.len >= traders.hard_cap)
|
||||
to_chat(usr, "The number of trader slots is already full!")
|
||||
return
|
||||
traders.create_default(usr)
|
||||
else
|
||||
to_chat(usr, "You need to be an observer or new player to use this.")
|
||||
|
||||
/proc/trigger_trader_visit()
|
||||
if(!GLOB.can_call_traders)
|
||||
return
|
||||
if(GLOB.send_beruang)
|
||||
return
|
||||
|
||||
command_announcement.Announce("Incoming cargo hauler: Beruang (Reg: VRS 22EB1F11C2).", "[station_name()] Traffic Control")
|
||||
|
||||
GLOB.can_call_traders = 0 // Only one call per round.
|
||||
GLOB.send_beruang = 1
|
||||
consider_trader_load() //VOREStation Add
|
||||
|
||||
sleep(600 * 5)
|
||||
GLOB.send_beruang = 0 // Can no longer join the traders.
|
||||
|
||||
GLOBAL_VAR(trader_loaded)
|
||||
|
||||
/proc/consider_trader_load()
|
||||
if(!GLOB.trader_loaded)
|
||||
GLOB.trader_loaded = TRUE
|
||||
var/datum/map_template/MT = SSmapping.map_templates["Special Area - Salamander Trader"] //was: "Special Area - Trader"
|
||||
if(!istype(MT))
|
||||
error("Trader is not a valid map template!")
|
||||
else
|
||||
MT.load_new_z(centered = TRUE)
|
||||
log_and_message_admins("Loaded the trade shuttle just now.")
|
||||
@@ -2,21 +2,21 @@
|
||||
set category = "Fun.Event Kit"
|
||||
set name = "Create AI Triumvirate"
|
||||
|
||||
if(ticker.current_state > GAME_STATE_PREGAME)
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)
|
||||
to_chat(usr, "This option is currently only usable during pregame. This may change at a later date.")
|
||||
return
|
||||
|
||||
if(job_master && ticker)
|
||||
if(job_master && SSticker)
|
||||
var/datum/job/job = job_master.GetJob(JOB_AI)
|
||||
if(!job)
|
||||
to_chat(usr, "Unable to locate the AI job")
|
||||
return
|
||||
if(ticker.triai)
|
||||
ticker.triai = 0
|
||||
if(GLOB.triai)
|
||||
GLOB.triai = 0
|
||||
to_chat(usr, "Only one AI will be spawned at round start.")
|
||||
message_admins(span_blue("[key_name_admin(usr)] has toggled off triple AIs at round start."), 1)
|
||||
else
|
||||
ticker.triai = 1
|
||||
GLOB.triai = 1
|
||||
to_chat(usr, "There will be an AI Triumvirate at round start.")
|
||||
message_admins(span_blue("[key_name_admin(usr)] has toggled on triple AIs at round start."), 1)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user