Skip to content

Commit

Permalink
Bioscan Logging & Efficiency Upgrades (#3755)
Browse files Browse the repository at this point in the history
# 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.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
admin: Adds logs for bioscans successfully completing.
/:cl:

---------

Co-authored-by: harryob <[email protected]>
Co-authored-by: Zonespace <[email protected]>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
4 people committed Jul 5, 2023
1 parent 6b2e796 commit 40a96c2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
33 changes: 21 additions & 12 deletions code/game/bioscans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<h2 class='alert'>Bioscan complete</h2>")
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, "<h2 class='alert'>Bioscan complete</h2>")
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.
Expand All @@ -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()))
Expand All @@ -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)
1 change: 1 addition & 0 deletions code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 40a96c2

Please sign in to comment.