Skip to content

Commit

Permalink
[MIRROR] Adds the message server key to the Chief Engineer's memories…
Browse files Browse the repository at this point in the history
…. [MDB IGNORE] (#25401) (#940)

* Adds the message server key to the Chief Engineer's memories. (#80063)

## About The Pull Request
Like the captain has innate knowledge of the golden safe code, the Chief
Engineer should know the daily key of the message server.

## Why It's Good For The Game
It's a perk of the job.

## Changelog

:cl:
add: Added the daily (roundstart) message server key to the Chief
Engineer's memories.
/:cl:

---------



* Adds the message server key to the Chief Engineer's memories.

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Ghom <[email protected]>
Co-authored-by: distributivgesetz <distributivgesetz93@ gmail.com>
  • Loading branch information
4 people authored Dec 3, 2023
1 parent 2493b39 commit 415f39b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
23 changes: 23 additions & 0 deletions code/datums/memory/key_memories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,26 @@
"[protagonist_name] being arrested by security for [crimes].",
"[protagonist_name] committing the crimes of [crimes].",
)

/datum/memory/key/message_server_key
var/decrypt_key

/datum/memory/key/message_server_key/New(
datum/mind/memorizer_mind,
atom/protagonist,
atom/deuteragonist,
atom/antagonist,
decrypt_key,
)
src.decrypt_key = decrypt_key
return ..()

/datum/memory/key/message_server_key/get_names()
return list("The daily message server key is [decrypt_key]. Keep it a secret from the clown.")

/datum/memory/key/message_server_key/get_starts()
return list(
"A sticky note attached to a monitor with [decrypt_key] written on it.",
"Poly the parrot screaming \"[decrypt_key]!\" over and over again.",
"[protagonist_name] spilling coffee over the message monitor while typing [decrypt_key].",
)
31 changes: 16 additions & 15 deletions code/game/machinery/telecomms/machines/message_server.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@

/obj/machinery/telecomms/message_server/Initialize(mapload)
. = ..()
if (!decryptkey)
decryptkey = generate_key()

if (calibrating)
calibrating += world.time
say("Calibrating... Estimated wait time: [rand(3, 9)] minutes.")
Expand All @@ -122,17 +119,6 @@
if(calibrating)
. += span_warning("It's still calibrating.")

/**
* Handles generating a key for the message server, returning it. Doesn't assign
* it in this proc, you have to do so yourself.
*/
/obj/machinery/telecomms/message_server/proc/generate_key()
var/generated_key
generated_key += pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le")
generated_key += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai")
generated_key += pick("1", "2", "3", "4", "5", "6", "7", "8", "9", "0")
return generated_key

/obj/machinery/telecomms/message_server/process()
. = ..()
if(calibrating && calibrating <= world.time)
Expand Down Expand Up @@ -172,9 +158,24 @@
id = "Messaging Server"
network = "tcommsat"
autolinkers = list("messaging")
decryptkey = null //random
calibrating = 0

GLOBAL_VAR(preset_station_message_server_key)

/obj/machinery/telecomms/message_server/preset/Initialize(mapload)
. = ..()
// Just in case there are multiple preset messageservers somehow once the CE arrives,
// we want those on the station to share the same preset default decrypt key shown in his memories.
var/is_on_station = is_station_level(z)
if(is_on_station && GLOB.preset_station_message_server_key)
decryptkey = GLOB.preset_station_message_server_key
return
//Generate a random password for the message server
decryptkey = pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le")
decryptkey += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai")
decryptkey += "[rand(0, 9)]"
if(is_on_station)
GLOB.preset_station_message_server_key = decryptkey

// Root messaging signal datum
/datum/signal/subspace/messaging
Expand Down
4 changes: 4 additions & 0 deletions code/modules/jobs/job_types/chief_engineer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
voice_of_god_power = 1.4 //Command staff has authority


/datum/job/chief_engineer/after_spawn(mob/living/spawned, client/player_client)
. = ..()
spawned.add_mob_memory(/datum/memory/key/message_server_key, decrypt_key = GLOB.preset_station_message_server_key)

/datum/job/chief_engineer/get_captaincy_announcement(mob/living/captain)
return "Due to staffing shortages, newly promoted Acting Captain [captain.real_name] on deck!"

Expand Down

0 comments on commit 415f39b

Please sign in to comment.