From 40a96c2e94017914cf1d8776e0146e228bed0741 Mon Sep 17 00:00:00 2001 From: forest2001 <41653574+realforest2001@users.noreply.github.com> Date: Wed, 5 Jul 2023 13:54:25 +0100 Subject: [PATCH] Bioscan Logging & Efficiency Upgrades (#3755) # About the pull request Logs bioscans so I can ensure they're operating properly. This may not need to be full merged, but it won't hurt to do so. Also improves efficiency of the code. # Explain why it's good for the game # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: admin: Adds logs for bioscans successfully completing. /:cl: --------- Co-authored-by: harryob Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com> Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/game/bioscans.dm | 33 ++++++++++++++++++---------- code/modules/admin/tabs/event_tab.dm | 1 + 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 55422ad3b878..5f07b307751a 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -94,15 +94,19 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) var/marine_planet_location_string = "[marine_planet_location ? ", including one in [marine_planet_location]." : "."]" var/marine_ship_location_string = "[marine_ship_location ? ", including one in [marine_ship_location]." : "."]" + var/ghost_scan = SPAN_ALERT("[xenos_on_planet] xenos on planet, with [larva] larva.\n[xenos_on_ship] xenos on the ship.\n[marines_on_planet] humans on the planet.\n[marines_on_ship] humans on the ship.") + var/yautja_scan = SPAN_ALERT("[xenos_on_planet] serpents present in the hunting ground[xeno_planet_location_string], with [larva] larva.\n[xenos_on_ship] serpents present on the human ship[xeno_ship_location_string]\n[marines_on_planet] humans present in the hunting ground[marine_planet_location_string]\n[marines_on_ship] humans present on the human ship[marine_ship_location_string]") + log_game("BIOSCAN: A Yautja/Ghost bioscan has completed. [ghost_scan]") + //Announce the numbers to Yautja, they have good scanners for(var/mob/living/carbon/human/yautja as anything in GLOB.yautja_mob_list) to_chat(yautja, "

Bioscan complete

") - to_chat(yautja, SPAN_ALERT("[xenos_on_planet] serpents present in the hunting ground[xeno_planet_location_string], with [larva] larva.\n[xenos_on_ship] serpents present on the human ship[xeno_ship_location_string]\n[marines_on_planet] humans present in the hunting ground[marine_planet_location_string]\n[marines_on_ship] humans present on the human ship[marine_ship_location_string]")) + to_chat(yautja, yautja_scan) //Let the ghosts know what's up, they also get good numbers for(var/mob/dead/observer/ghost as anything in GLOB.observer_list) to_chat(ghost, "

Bioscan complete

") - to_chat(ghost, SPAN_ALERT("[xenos_on_planet] xenos on planet, with [larva] larva.\n[xenos_on_ship] xenos on the ship.\n[marines_on_planet] humans on the planet.\n[marines_on_ship] humans on the ship.")) + to_chat(ghost, ghost_scan) /// This will do something after Project ARES. @@ -117,15 +121,15 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) /// The announcement to all Humans. Slightly off for the planet and elsewhere, accurate for the ship. /datum/bioscan_data/proc/ares_bioscan(forced = FALSE, variance = 2) if(!forced && !can_ares_bioscan()) - message_admins("An ARES Bioscan has failed.") + message_admins("BIOSCAN: An ARES bioscan has failed.") return - //Adjust the randomness there so everyone gets the same thing var/fake_xenos_on_planet = max(0, xenos_on_planet + rand(-variance, variance)) - var/name = "[MAIN_AI_SYSTEM] Bioscan Status" var/input = "Bioscan complete.\n\nSensors indicate [xenos_on_ship_uncontained ? "[xenos_on_ship_uncontained]" : "no"] unknown lifeform signature[!xenos_on_ship_uncontained || xenos_on_ship_uncontained > 1 ? "s":""] present on the ship[xenos_on_ship_uncontained && xenos_ship_location ? ", including one in [xenos_ship_location]," : ""] and [fake_xenos_on_planet ? "approximately [fake_xenos_on_planet]" : "no"] signature[!fake_xenos_on_planet || fake_xenos_on_planet > 1 ? "s":""] located elsewhere[fake_xenos_on_planet && xenos_planet_location ? ", including one in [xenos_planet_location]":""]." + log_game("BIOSCAN: ARES bioscan completed. [input]") + var/datum/ares_link/link = GLOB.ares_link link.log_ares_bioscan(name, input) if(forced || (link.p_interface && !link.p_interface.inoperable())) @@ -135,13 +139,18 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) /datum/bioscan_data/proc/qm_bioscan(variance = 2) /// Adjust the randomness there so everyone gets the same thing var/fake_marines_on_ship = max(0, marines_on_ship + rand(-variance, variance)) + var/metalhive_hosts = "[fake_marines_on_ship ? "approximately [fake_marines_on_ship]":"no"]" + var/plural = "[!fake_marines_on_ship || fake_marines_on_ship > 1 ? "s":""]" + var/metalhive_location = "[fake_marines_on_ship && marine_ship_location?", including one in [marine_ship_location]," : ""]" + var/planet_hosts = "[marines_on_planet ? "[marines_on_planet]" : "none"]" + var/planet_location = "[marines_on_planet && marine_planet_location ? ", including one in [marine_planet_location]" : ""]" + + var/title = SPAN_XENOANNOUNCE("The Queen Mother reaches into your mind from worlds away.") + var/content = SPAN_XENOANNOUNCE("To my children and their Queen. I sense [metalhive_hosts] host[plural] in the metal hive [metalhive_location] and [planet_hosts] scattered elsewhere[planet_location].") + + log_game("BIOSCAN: Queen Mother bioscan completed. [content]") /// Shout it at everyone for(var/mob/current_mob as anything in GLOB.living_xeno_list) current_mob << sound(get_sfx("queen"), wait = 0, volume = 50) - to_chat(current_mob, SPAN_XENOANNOUNCE("The Queen Mother reaches into your mind from worlds away.")) - var/metalhive_hosts = "[fake_marines_on_ship ? "approximately [fake_marines_on_ship]":"no"]" - var/plural = "[!fake_marines_on_ship || fake_marines_on_ship > 1 ? "s":""]" - var/metalhive_location = "[fake_marines_on_ship&&marine_ship_location?", including one in [marine_ship_location],":""]" - var/planet_hosts = "[marines_on_planet ? "[marines_on_planet]" : "none"]" - var/planet_location = "[marines_on_planet && marine_planet_location ? ", including one in [marine_planet_location]" : ""]" - to_chat(current_mob, SPAN_XENOANNOUNCE("To my children and their Queen. I sense [metalhive_hosts] host[plural] in the metal hive [metalhive_location] and [planet_hosts] scattered elsewhere[planet_location].")) + to_chat(current_mob, title) + to_chat(current_mob, content) diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 86f54b510ccf..4effbf3b26cb 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -965,6 +965,7 @@ else var/faction = tgui_input_list(usr, "What faction do you wish to provide a bioscan for?", "Bioscan Faction", list("Xeno","Marine","Yautja"), 20 SECONDS) var/variance = tgui_input_number(usr, "How variable do you want the scan to be? (+ or - an amount from truth)", "Variance", 2, 10, 0, 20 SECONDS) + message_admins("BIOSCAN: [key_name(usr)] admin-triggered a bioscan for [faction].") GLOB.bioscan_data.get_scan_data() switch(faction) if("Xeno")