Re-adds the MOTD and adds mechanical support for ports of call. (#18570)

* Re-adds the message of the day.

* Re-adds the MOTD and adds mechanical support for ports of call.

* sddsds

* Destroy it all!

* incorrect info

* grammar and shit

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2024-03-07 00:06:45 +01:00
committed by GitHub
parent 4cacb6d066
commit c59b7fa6d4
15 changed files with 120 additions and 72 deletions
+1
View File
@@ -93,6 +93,7 @@ GLOBAL_LIST_INIT(reverse_dir, list( // reverse_dir[dir] = reverse of dir
41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21,
23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63
))
GLOBAL_LIST_INIT(all_days, list("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"))
GLOBAL_LIST_EMPTY(combatlog)
GLOBAL_PROTECT(lawchanges)
+2 -1
View File
@@ -35,7 +35,8 @@ SUBSYSTEM_DEF(statpanels)
"Round Time: [get_round_duration_formatted()]",
"Ship Time: [worldtime2text()]",
"Current Space Sector: [SSatlas.current_sector.name]",
"Last Transfer Vote: [GLOB.last_transfer_vote ? time2text(GLOB.last_transfer_vote, "hh:mm") : "Never"]"
"Last Transfer Vote: [GLOB.last_transfer_vote ? time2text(GLOB.last_transfer_vote, "hh:mm") : "Never"]",
"Next Port Visit: [SSatlas.current_sector.next_port_visit_string]"
)
if(eta_status)
global_data += eta_status
+7 -1
View File
@@ -9,6 +9,7 @@
*/
GLOBAL_DATUM_INIT(init, /datum/global_init, new)
GLOBAL_DATUM(config, /datum/configuration)
GLOBAL_VAR(motd)
GLOBAL_PROTECT(config)
/**
@@ -88,7 +89,9 @@ GLOBAL_PROTECT(config)
GLOB.href_logfile = file("data/logs/[GLOB.diary_date_string] hrefs.htm")
GLOB.diary = "data/logs/[GLOB.diary_date_string]_[GLOB.round_id].log"
log_startup()
GLOB.changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently
// Used for telling if the changelog has changed recently.
GLOB.changelog_hash = md5('html/changelog.html')
load_motd()
if(GLOB.config.logsettings["log_runtime"])
GLOB.diary_runtime = file("data/logs/_runtime/[GLOB.diary_date_string]-runtime.log")
@@ -518,4 +521,7 @@ var/list/world_api_rate_limit = list()
call_ext(dll, "auxtools_init")()
enable_debugging()
/world/proc/load_motd()
GLOB.motd = file2text("config/motd.txt")
#undef FAILED_DB_CONNECTION_CUTOFF
@@ -62,12 +62,6 @@
sector_hud_menu_sound = 'sound/effects/menu_click_heavy.ogg'
sector_hud_arrow = "menu_arrow"
/datum/space_sector/srandmarr/get_port_travel_time()
return "[rand(6, 12)] hours"
/datum/space_sector/srandmarr/generate_system_name()
return "S'rand'marr, and nearby points of interest"
/datum/space_sector/nrrahrahul
name = SECTOR_NRRAHRAHUL
description = "Hro'zamal is the second planet in the Nrrahrahul system. Formerly named Nrrahrahul Two, it was given the name Hro'zamal after the establishment of a permanent civilian \
@@ -64,6 +64,8 @@
guaranteed_exoplanets = list(/obj/effect/overmap/visitable/sector/exoplanet/konyang)
cargo_price_coef = list("nt" = 1.1, "hpi" = 0.7, "zhu" = 0.4, "een" = 1.0, "get" = 1.1, "arz" = 1.8, "blm" = 0.9, "iac" = 1.2, "zsc" = 1.8, "vfc" = 0.9, "bis" = 0.4, "xmg" = 0.7, "npi" = 0.8)
ports_of_call = list("the corporate district of Aoyama")
scheduled_port_visits = list("Thursday", "Sunday")
starlight_color = "#e2719b"
starlight_power = 2//placeholder
starlight_range = 4//placeholder
@@ -30,6 +30,17 @@
/// Lobby music overrides.
var/list/lobby_tracks
/// A list of the major ports in this sector.
/// Note that these are supposed to be visitable by the Horizon and its crew, so only put those there.
var/list/ports_of_call
/// The days of the next port visits. If null, port visits are disabled.
/// Must be a day found in the all_days list.
var/list/scheduled_port_visits = list("Sunday")
/// This variable holds the calculated time (integer) until port visit. Do not edit manually.
var/next_port_visit
/// This variable holds the string of time until port visit. Will be "in 1 day", "in 2 days", "today", etc. Do not edit manually.
var/next_port_visit_string
//vars used by the meteor random event
var/list/meteors_minor = list(
@@ -125,6 +136,23 @@
/datum/space_sector/proc/setup_current_sector()
SHOULD_CALL_PARENT(TRUE)
if(SSatlas.current_map.ports_of_call && length(scheduled_port_visits))
var/current_day_index = GLOB.all_days.Find(time2text(world.realtime, "Day"))
var/days_calculated = 0
// The main problem to consider here is that you have to loop around for two weeks to find all the days, basically.
// It could be Thursday with Wednesday as a port of call, for example.
while(!next_port_visit)
if(!(GLOB.all_days[current_day_index] in SSatlas.current_sector.scheduled_port_visits))
days_calculated++
current_day_index++
if(current_day_index > length(GLOB.all_days))
current_day_index = 1
continue
next_port_visit = current_day_index
break
next_port_visit_string = days_calculated == 0 ? "today" : days_calculated == 1 ? "in [days_calculated] day" : "in [days_calculated] days"
// For now, i've put processing to only happen if the sector has a radio station
// but if, in the future, you add more stuff for the processor to handle, feel free to move it out of the if block
if(length(lore_radio_stations))
@@ -178,12 +206,6 @@
/datum/space_sector/proc/get_chat_description()
return "<hr><div align='center'><hr1><B>Current Sector: [name]!</B></hr1><br><i>[description]</i><hr></div>"
/datum/space_sector/proc/get_port_travel_time()
return "[rand(1, 3)] days"
/datum/space_sector/proc/generate_system_name()
return "[pick("Miranda", "BNM", "Xavier", "GJ", "HD", "TC", "Melissa", "TC")][prob(10) ? " Eridani" : ""] [rand(100,999)][prob(10) ? " [pick(greek_letters)]" : ""]"
/// Returns a flat list of all possible away sites that can spawn in this sector.
/datum/space_sector/proc/possible_sites_in_sector()
var/list/away_sites = list()
-13
View File
@@ -236,19 +236,6 @@ var/list/localhost_addresses = list(
if ("webint")
src.open_webint()
// Handle the updating of MotD and Memo tabs upon click.
if ("updateHashes")
var/save = 0
if (href_list["#motd-tab"])
src.prefs.motd_hash = href_list["#motd-tab"]
save = 1
if (href_list["#memo-tab"])
src.prefs.memo_hash = href_list["#memo-tab"]
save = 1
if (save)
src.prefs.save_preferences()
return
if (href_list["view_jobban"])
@@ -7,8 +7,6 @@
S["default_slot"] >> pref.default_slot
S["toggles"] >> pref.toggles
S["sfx_toggles"] >> pref.sfx_toggles
S["motd_hash"] >> pref.motd_hash
S["memo_hash"] >> pref.memo_hash
S["toggles_secondary"] >> pref.toggles_secondary
/datum/category_item/player_setup_item/player_global/settings/save_preferences(var/savefile/S)
@@ -16,8 +14,6 @@
S["default_slot"] << pref.default_slot
S["toggles"] << pref.toggles
S["sfx_toggles"] << pref.sfx_toggles
S["motd_hash"] << pref.motd_hash
S["memo_hash"] << pref.memo_hash
S["toggles_secondary"] << pref.toggles_secondary
/datum/category_item/player_setup_item/player_global/settings/gather_load_query()
@@ -28,8 +24,6 @@
"current_character",
"toggles",
"sfx_toggles",
"lastmotd" = "motd_hash",
"lastmemo" = "memo_hash",
"toggles_secondary"
),
"args" = list("ckey")
@@ -60,8 +54,6 @@
"current_character" = pref.current_character,
"toggles" = pref.toggles,
"sfx_toggles" = pref.sfx_toggles,
"lastmotd" = pref.motd_hash,
"lastmemo" = pref.memo_hash,
"toggles_secondary" = pref.toggles_secondary
)
@@ -74,8 +66,6 @@
pref.default_slot = sanitize_integer(text2num(pref.default_slot), 1, GLOB.config.character_slots, initial(pref.default_slot))
pref.toggles = sanitize_integer(text2num(pref.toggles), 0, BITFIELDMAX, initial(pref.toggles))
pref.sfx_toggles = sanitize_integer(text2num(pref.sfx_toggles), 0, BITFIELDMAX, initial(pref.toggles))
pref.motd_hash = sanitize_text(pref.motd_hash, initial(pref.motd_hash))
pref.memo_hash = sanitize_text(pref.memo_hash, initial(pref.memo_hash))
pref.toggles_secondary = sanitize_integer(text2num(pref.toggles_secondary), 0, BITFIELDMAX, initial(pref.toggles_secondary))
/datum/category_item/player_setup_item/player_global/settings/content(mob/user)
-2
View File
@@ -33,8 +33,6 @@ var/list/preferences_datums = list()
var/tgui_inputs_swapped = FALSE
//Style for popup tooltips
var/tooltip_style = "Midnight"
var/motd_hash = "" //Hashes for the new server greeting window.
var/memo_hash = ""
//character preferences
var/real_name //our character's name
+10 -2
View File
@@ -6,8 +6,6 @@
update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying
to_chat(src, "<div class='info'>Game ID: <div class='danger'>[GLOB.round_id]</div></div>")
if(!mind)
mind = new /datum/mind(key)
mind.active = 1
@@ -18,3 +16,13 @@
GLOB.player_list |= src
client.playtitlemusic()
addtimer(CALLBACK(src, PROC_REF(show_lobby_info)), 5 SECONDS)
/mob/abstract/new_player/proc/show_lobby_info()
if(!client)
return
if(GLOB.motd)
to_chat(src, "<div class=\"motd\">[GLOB.motd]</div>")
to_chat(src, "<div class='info'>Game ID: </div><div class='danger'>[GLOB.round_id]</div>")
@@ -0,0 +1,43 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MattAtlas
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Ports of call and shore leave days are now mechanically represented in game. Available ports will be present on Bridge sensor reports. The same goes for the next port visit, which is also present on your Status panel."
- rscdel: "Removed now superfluous random jump info."
- rscadd: "Readded the MOTD."
+4
View File
@@ -57,6 +57,10 @@
var/bluespace_called_message
var/bluespace_recall_message
/// If this map has ports of call and refuels there. Crew are implied to be able to leave to these ports.
/// Ports of call are taken from the current map sector.
var/ports_of_call = FALSE
var/evac_controller_type = /datum/evacuation_controller
var/list/station_networks = list() // Camera networks that will show up on the console.
+10 -22
View File
@@ -98,6 +98,7 @@
rogue_drone_end_message = "The hostile drone swarm has left the ship's proximity."
rogue_drone_destroyed_message = "Sensors indicate the unidentified drone swarm has left the immediate proximity of the ship."
ports_of_call = TRUE
map_shuttles = list(
/datum/shuttle/autodock/ferry/lift/scc_ship/morgue,
@@ -149,26 +150,12 @@
if (horizon) //If the overmap is disabled, it's possible for there to be no Horizon.
var/list/space_things = list()
welcome_text += "Current Coordinates:<br /><b>[horizon.x]:[horizon.y]</b><br /><br>"
welcome_text += "Next system targeted for jump:<br /><b>[SSatlas.current_sector.generate_system_name()]</b><br /><br>"
var/last_visit
var/current_day = time2text(world.realtime, "Day")
switch(current_day)
if("Monday")
last_visit = "1 day ago"
if("Tuesday")
last_visit = "2 days ago"
if("Wednesday")
last_visit = "3 days ago"
if("Thursday")
last_visit = "4 days ago"
if("Friday")
last_visit = "5 days ago"
if("Saturday")
last_visit = "6 days ago"
if("Sunday")
last_visit = "1 week ago"
welcome_text += "Last port visit: <br><b>[last_visit]</b><br><br>"
welcome_text += "Travel time to nearest port:<br /><b>[SSatlas.current_sector.get_port_travel_time()]</b><br /><br>"
welcome_text += "Available Ports of Call: <b>[english_list(SSatlas.current_sector.ports_of_call, "none")]</b><br>"
if(SSatlas.current_sector.next_port_visit)
welcome_text += "Next Port Visit: <b>in [SSatlas.current_sector.next_port_visit] days</b><br>"
else
welcome_text += "<b>There is no port visit scheduled.</b><br><br>"
welcome_text += "<b>It is advised to inform crew of the available ports of call and the date of the next port visit.</b><br><br>"
welcome_text += "Scan results show the following points of interest:<br />"
for(var/zlevel in GLOB.map_sectors)
@@ -192,8 +179,9 @@
welcome_text += "<hr>"
post_comm_message("SCCV Horizon Sensor Readings", welcome_text)
priority_announcement.Announce(message = "Long-range sensor readings have been printed out at all communication consoles.")
post_comm_message("SCCV Horizon Sensor Report", welcome_text)
var/report = "The long-range sensor readings have been printed out at all communication consoles."
priority_announcement.Announce(message = report)
/datum/map/sccv_horizon/load_holodeck_programs()
// loads only if at least two engineers are present
@@ -196,8 +196,11 @@ a.popt {
/* MOTD */
.motd {
color: #a4bad6;
font-family: Verdana, sans-serif;
font-family: 'Times New Roman', Times, serif;
white-space: 'normal';
border: 1px solid #a4bad6;
margin: 0.5em;
padding: 0.5em 0.75em;
}
.motd h1,
.motd h2,
@@ -208,12 +211,7 @@ a.popt {
color: #a4bad6;
text-decoration: underline;
}
.vote {
color: #9933ff;
}
.alert {
color: #d82020;
}
.motd a,
.motd a:link,
.motd a:visited,
@@ -467,7 +465,10 @@ em {
font-weight: bold;
}
.alert {
color: #ff0000;
color: #d82020;
}
.vote {
color: #9933ff;
}
.emote {
@@ -215,8 +215,11 @@ a.popt {
.motd {
color: #a4bad6;
font-family: Verdana, sans-serif;
font-family: 'Times New Roman', Times, serif;
white-space: 'normal';
border: 1px solid #a4bad6;
margin: 0.5em;
padding: 0.5em 0.75em;
}
.motd h1,
.motd h2,