mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 16:44:43 +01:00
aa4dc56835
## About The Pull Request Removes Station-Time entirely Server Time is now NST (Nanotrasen Standard Time). SS13 takes place exactly 540 years in the future of the current day, so every second is 1 second in-game. Round Time is now PT (Pay-Time), how Nanotrasen keeps track of how long the current rotation of Employees has been working for. Telecomms uses NST due to its importance of being the communication to the blackbox. Autopsy report, clocks, scientific reports and requisitions use both timestamps due to them being more official documents that NT may need to know beyond just the current round (just for flavortext). Pretty much everything else (Det scanner, PDA, IC logs, Time-of-Death, AI law changes, Cyborg file downloading) uses PT PT <img width="305" height="217" alt="image" src="https://github.com/user-attachments/assets/cef73025-6292-4f9c-8565-197397bda2ca" /> <img width="168" height="59" alt="image" src="https://github.com/user-attachments/assets/a99db568-045d-45fc-8206-0d9a7b13c7d2" /> <img width="308" height="122" alt="image" src="https://github.com/user-attachments/assets/37ca6f17-8916-4af2-9c91-0f0707038ca5" /> https://github.com/user-attachments/assets/29445051-c98b-4af3-a657-812083aab91a Clock (Literate) <img width="748" height="292" alt="image" src="https://github.com/user-attachments/assets/c824e812-91b5-4737-858d-768336e9a7c4" /> Clock (Illiterate) <img width="446" height="94" alt="image" src="https://github.com/user-attachments/assets/90d5ea0d-eaff-4ced-aa31-ffdf0b4832a5" /> New paperwork time working properly <img width="311" height="190" alt="image" src="https://github.com/user-attachments/assets/6d048926-db61-4c91-893b-ce93e1ea7775" /> NST <img width="800" height="115" alt="image" src="https://github.com/user-attachments/assets/35ffde49-13c1-4ce7-ab24-858e48b608bd" /> <img width="1288" height="142" alt="image" src="https://github.com/user-attachments/assets/40c30d16-e0de-4efc-b460-9486eeb901d6" /> # Other changes 1. Circuit time checker will now get the value of the given input (Hour, Minute, Second) rather than the full dedisecond time converted into hour/minutes/seconds <img width="270" height="67" alt="image" src="https://github.com/user-attachments/assets/097440cc-1c45-447f-9976-18de7f9c722c" /> 2. Turns nightshift into a round event that'll last approximately 22 minutes 3. 12-hour pref (doesn't apply to the stat panel because it's global info) & removal of "TCT" time <img width="569" height="440" alt="image" src="https://github.com/user-attachments/assets/d39083b1-d248-41c0-9a1c-b2398ca203a7" /> 4. The chocolate pudding negative moodlet is now based on the server's IRL time. 5. Admins can now use ``class``, ``style`` and ``background`` (they were already given perms to use ``img`` so hiding background, which was removed to prevent image embedding, is pointless) 6. Also fixes ``year`` being off on localhost. ## Why It's Good For The Game Server Time is approximately 1s = 12s converted, not including it desyncing from lag (I believe?). This makes it pretty much impossible for people to actually use this as a unit of measurement for in-game actions. Different things also uses different timestamps which is a bit more confusing. The main change here is for accessibility and, hopefully, using time as a source of immersion. "20 minutes ago" is no longer OOC, they're just speaking in PT. There's no timezones in space, Nanotrasen Standard Time is the closest there is, but Pay Time is how NT considers when you get your paychecks, so it's what is more commonly used. It also fixes major inconsistencies between "IC time" and "Station time", things like breakfast moodlet was the first 15mins of the round despite the round starting like 7 hours in? Nukies with an L6 SAW firing down the halls was shooting like 1 bullet every 3 seconds (assuming 4 bullets per second), overall there was just a disconnect between how long time actually is in the universe. The secondary reason for this change (though it is what pushed me to actually get around to making this change) is the greater stat-panel removal. This hopes to lessen the dependence on the stat panel for station-time by making it easier to understand, and the end-goal I have is for this information to be limited to Admins & the AI (AI will get the IC version with the accurate year), so until that happens I would like to improve the use of station-time by making it consistent (for example, you should only care for PT for IC, which is also what your PDA displays), so that when it gets removed it won't leave players timeless. If you haven't already, and is interested in helping remove the stat panel, every entry that needs to be removed can be found here - https://hackmd.io/443_dE5lRWeEAp9bjGcKYw?view Closes https://github.com/tgstation/tgstation/issues/94988 ## Changelog 🆑 del: Removed Station Time, now we use NST (Nanotrasen Standard Time), which is IRL server time +540 years, and PT (Pay Time), the amount of time since the round has started. del: Station nightshift is now a Station event rather than being based on Server time. balance: Time circuit's Unit of Measure now tells the amount of time in hour/minute/seconds rather than giving the whole time translated to hours/minutes/seconds. qol: Added a 12-hour clock pref for people who prefer it. qol: Hovering over NST timestamps on official documents will now translate how much it is in PT/Shift Time. admin: Admins can now use style/class/background in their papercode. /🆑 --------- Co-authored-by: Isratosh <Isratosh@hotmail.com>
307 lines
12 KiB
Plaintext
307 lines
12 KiB
Plaintext
/obj/machinery/doppler_array
|
|
name = "tachyon-doppler array"
|
|
desc = "A highly precise directional sensor array which measures the release of quants from decaying tachyons. The doppler shifting of the mirror-image formed by these quants can reveal the size, location and temporal affects of energetic disturbances within a large radius ahead of the array.\n"
|
|
circuit = /obj/item/circuitboard/machine/doppler_array
|
|
icon = 'icons/obj/machines/research.dmi'
|
|
icon_state = "tdoppler"
|
|
base_icon_state = "tdoppler"
|
|
density = TRUE
|
|
verb_say = "states coldly"
|
|
var/cooldown = 10
|
|
var/next_announce = 0
|
|
var/max_dist = 150
|
|
/// Number which will be part of the name of the next record, increased by one for each already created record
|
|
var/record_number = 1
|
|
/// List of all explosion records in the form of /datum/data/tachyon_record
|
|
var/list/records = list()
|
|
/// Reference to a disk we are going to print to.
|
|
var/obj/item/disk/computer/inserted_disk
|
|
|
|
// Lighting system to better communicate the directions.
|
|
light_system = OVERLAY_LIGHT_DIRECTIONAL
|
|
light_range = 4
|
|
light_power = 1.5
|
|
light_color = COLOR_RED
|
|
|
|
/obj/machinery/doppler_array/Initialize(mapload)
|
|
. = ..()
|
|
RegisterSignal(SSdcs, COMSIG_GLOB_EXPLOSION, PROC_REF(sense_explosion))
|
|
RegisterSignal(src, COMSIG_MACHINERY_POWER_LOST, PROC_REF(update_doppler_light))
|
|
RegisterSignal(src, COMSIG_MACHINERY_POWER_RESTORED, PROC_REF(update_doppler_light))
|
|
update_doppler_light()
|
|
|
|
// Rotation determines the detectable direction.
|
|
AddElement(/datum/element/simple_rotation)
|
|
|
|
/datum/data/tachyon_record
|
|
name = "Log Recording"
|
|
var/timestamp
|
|
var/coordinates = ""
|
|
var/displacement = 0
|
|
var/factual_radius = list()
|
|
var/theory_radius = list()
|
|
/// Indexed to length 3 if filled properly. Should be an empty list otherwise.
|
|
var/reaction_results = list()
|
|
var/explosion_identifier
|
|
|
|
/obj/machinery/doppler_array/examine(mob/user)
|
|
. = ..()
|
|
. += span_notice("It is currently facing [dir2text(dir)]")
|
|
|
|
/obj/machinery/doppler_array/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
if(!istype(tool, /obj/item/disk/computer))
|
|
return NONE
|
|
eject_disk(user)
|
|
if(!user.transferItemToLoc(tool, src))
|
|
balloon_alert(user, "it's stuck to your hand!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
inserted_disk = tool
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/machinery/doppler_array/wrench_act(mob/living/user, obj/item/tool)
|
|
default_unfasten_wrench(user, tool)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/machinery/doppler_array/screwdriver_act(mob/living/user, obj/item/tool)
|
|
. = default_deconstruction_screwdriver(user, tool)
|
|
power_change()
|
|
return .
|
|
|
|
/obj/machinery/doppler_array/crowbar_act(mob/living/user, obj/item/tool)
|
|
return default_deconstruction_crowbar(user, tool)
|
|
|
|
/// Printing of a record into a disk.
|
|
/obj/machinery/doppler_array/proc/print(mob/user, datum/data/tachyon_record/record)
|
|
if(!record || !inserted_disk)
|
|
return
|
|
|
|
var/datum/computer_file/data/ordnance/explosive/record_data = new
|
|
record_data.filename = "Doppler Array " + record.name //Doppler Array Log Recording #x
|
|
record_data.explosion_record = record
|
|
record_data.possible_experiments = apply_experiments(record)
|
|
|
|
if(inserted_disk.add_file(record_data))
|
|
playsound(src, 'sound/machines/ping.ogg', 25)
|
|
else
|
|
playsound(src, 'sound/machines/terminal/terminal_error.ogg', 25)
|
|
|
|
/**
|
|
* Checks a specified tachyon record for fitting reactions, then returns a list with
|
|
* the experiment typepath as key and score as value.
|
|
* The score is the same for all explosive experiments (light radius).
|
|
*/
|
|
/obj/machinery/doppler_array/proc/apply_experiments(datum/data/tachyon_record/record)
|
|
var/list/passed_experiments = list()
|
|
var/list/record_reactions = record.reaction_results
|
|
|
|
var/list/radius_used = length(record.theory_radius) ? record.theory_radius : record.factual_radius
|
|
var/explosion_score = radius_used["shockwave_radius"]
|
|
if(!explosion_score) // Dont even bother.
|
|
return passed_experiments
|
|
|
|
/// Early return for explosions without proper reaction_results. We will append experiments that are always fair game.
|
|
if(!record_reactions.len)
|
|
for (var/datum/experiment/ordnance/explosive/experiment in SSresearch.ordnance_experiments)
|
|
if(experiment.allow_any_source)
|
|
passed_experiments += list(experiment.type = explosion_score)
|
|
return passed_experiments
|
|
|
|
for (var/datum/experiment/ordnance/explosive/experiment in SSresearch.ordnance_experiments)
|
|
var/list/experiment_reactions = experiment.required_reactions
|
|
/// The reactions in record.reaction_results that corresponds to the required_reactions list.
|
|
var/list/fitting_reactions = list()
|
|
/// The reactions in required_reactions list that are missing in record.reaction_results.
|
|
var/list/missing_reactions = list()
|
|
/// The reactions in record.reaction_results that are not present in required_reactions list.
|
|
var/list/extra_reactions = list()
|
|
|
|
for(var/reaction in experiment_reactions)
|
|
if(reaction in record_reactions[TANK_RESULTS_REACTION])
|
|
fitting_reactions += reaction
|
|
else
|
|
missing_reactions += reaction
|
|
|
|
for(var/reaction in record_reactions[TANK_RESULTS_REACTION])
|
|
if(!(reaction in fitting_reactions))
|
|
extra_reactions += reaction
|
|
|
|
// Check for extra reactions.
|
|
if(experiment.sanitized_reactions && extra_reactions.len)
|
|
continue
|
|
// Check for misc properties
|
|
if(experiment.sanitized_misc && length(record_reactions[TANK_RESULTS_MISC]))
|
|
continue
|
|
// Check for missing reactions for those who require all.
|
|
if(experiment.require_all && missing_reactions.len)
|
|
continue
|
|
// For those who only need one, check if there is actually one.
|
|
if(!experiment.require_all && experiment_reactions.len)
|
|
if(!fitting_reactions.len)
|
|
continue
|
|
|
|
// Suceeded all check, append to the returned list.
|
|
passed_experiments += list(experiment.type = explosion_score)
|
|
|
|
return passed_experiments
|
|
|
|
/// Sensing, recording, and broadcasting of explosion
|
|
/obj/machinery/doppler_array/proc/sense_explosion(datum/source, turf/epicenter, devastation_range, heavy_impact_range, light_impact_range,
|
|
took, orig_dev_range, orig_heavy_range, orig_light_range, explosion_cause, explosion_index)
|
|
SIGNAL_HANDLER
|
|
var/list/fetched_reaction_results = list()
|
|
|
|
if(istype(explosion_cause, /obj/item/tank))
|
|
var/obj/item/tank/exploding_tank = explosion_cause
|
|
fetched_reaction_results = exploding_tank.explosion_information()
|
|
|
|
if(machine_stat & NOPOWER)
|
|
return FALSE
|
|
var/turf/zone = get_turf(src)
|
|
if(!is_valid_z_level(zone, epicenter))
|
|
return FALSE
|
|
|
|
if(next_announce > world.time)
|
|
return FALSE
|
|
next_announce = world.time + cooldown
|
|
|
|
if((get_dist(epicenter, zone) > max_dist) || !(get_dir(zone, epicenter) & dir))
|
|
return FALSE
|
|
|
|
var/datum/data/tachyon_record/new_record = new /datum/data/tachyon_record()
|
|
new_record.name = "Log Recording #[record_number]"
|
|
new_record.timestamp = "[server_timestamp(ic_time = TRUE)] (PT: [round_timestamp()])"
|
|
new_record.coordinates = "[epicenter.x], [epicenter.y]"
|
|
new_record.displacement = took
|
|
new_record.factual_radius["epicenter_radius"] = devastation_range
|
|
new_record.factual_radius["outer_radius"] = heavy_impact_range
|
|
new_record.factual_radius["shockwave_radius"] = light_impact_range
|
|
new_record.reaction_results = fetched_reaction_results
|
|
new_record.explosion_identifier = explosion_index
|
|
|
|
var/list/messages = list("Explosive disturbance detected.",
|
|
"Epicenter at: grid ([epicenter.x], [epicenter.y]). Temporal displacement of tachyons: [took] seconds.",
|
|
"Factual: Epicenter radius: [devastation_range]. Outer radius: [heavy_impact_range]. Shockwave radius: [light_impact_range].",
|
|
)
|
|
|
|
// If the bomb was capped, say its theoretical size.
|
|
if(devastation_range < orig_dev_range || heavy_impact_range < orig_heavy_range || light_impact_range < orig_light_range)
|
|
messages += "Theoretical: Epicenter radius: [orig_dev_range]. Outer radius: [orig_heavy_range]. Shockwave radius: [orig_light_range]."
|
|
new_record.theory_radius["epicenter_radius"] = orig_dev_range
|
|
new_record.theory_radius["outer_radius"] = orig_heavy_range
|
|
new_record.theory_radius["shockwave_radius"] = orig_light_range
|
|
|
|
for(var/message in messages)
|
|
say(message)
|
|
|
|
record_number++
|
|
records += new_record
|
|
|
|
return TRUE
|
|
|
|
/obj/machinery/doppler_array/proc/eject_disk(mob/user)
|
|
if(!inserted_disk)
|
|
return FALSE
|
|
if(!user || !Adjacent(user))
|
|
inserted_disk.forceMove(drop_location())
|
|
else
|
|
user.put_in_hands(inserted_disk)
|
|
playsound(src, 'sound/machines/card_slide.ogg', 50)
|
|
return TRUE
|
|
|
|
/// We rely on exited to clear references.
|
|
/obj/machinery/doppler_array/Exited(atom/movable/gone, direction)
|
|
if(gone == inserted_disk)
|
|
inserted_disk = null
|
|
return ..()
|
|
|
|
/obj/machinery/doppler_array/powered()
|
|
if(panel_open)
|
|
return FALSE
|
|
return ..()
|
|
|
|
/obj/machinery/doppler_array/update_overlays()
|
|
. = ..()
|
|
if(panel_open)
|
|
. += mutable_appearance(icon, "[base_icon_state]_open")
|
|
else
|
|
. += mutable_appearance(icon,"[base_icon_state]_cable")
|
|
|
|
if(machine_stat & BROKEN) // Probably meant to be used on an indestructible doppler, but this is not implemented.
|
|
. += mutable_appearance(icon, "[base_icon_state]_screen-broken")
|
|
else if (machine_stat & NOPOWER)
|
|
. += mutable_appearance(icon, "[base_icon_state]_screen-off")
|
|
|
|
/obj/machinery/doppler_array/on_deconstruction(disassembled)
|
|
eject_disk()
|
|
. = ..()
|
|
|
|
/obj/machinery/doppler_array/Destroy()
|
|
inserted_disk = null
|
|
records.Cut() // We only want to clear the list itself, not delete its contents.
|
|
return ..()
|
|
|
|
/obj/machinery/doppler_array/proc/update_doppler_light()
|
|
SIGNAL_HANDLER
|
|
set_light_on(!(machine_stat & NOPOWER))
|
|
|
|
|
|
/obj/machinery/doppler_array/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
ui = new(user, src, "DopplerArray", name)
|
|
ui.open()
|
|
|
|
/obj/machinery/doppler_array/ui_data(mob/user)
|
|
var/list/data = list()
|
|
data["records"] = list()
|
|
data["disk"] = inserted_disk?.name
|
|
data["storage"] = "[inserted_disk?.used_capacity] / [inserted_disk?.max_capacity] GQ"
|
|
for(var/datum/data/tachyon_record/singular_record in records)
|
|
var/list/record_data = list(
|
|
"name" = singular_record.name,
|
|
"timestamp" = singular_record.timestamp,
|
|
"coordinates" = singular_record.coordinates,
|
|
"displacement" = singular_record.displacement,
|
|
"factual_epicenter_radius" = singular_record.factual_radius["epicenter_radius"],
|
|
"factual_outer_radius" = singular_record.factual_radius["outer_radius"],
|
|
"factual_shockwave_radius" = singular_record.factual_radius["shockwave_radius"],
|
|
"theory_epicenter_radius" = singular_record.theory_radius["epicenter_radius"],
|
|
"theory_outer_radius" = singular_record.theory_radius["outer_radius"],
|
|
"theory_shockwave_radius" = singular_record.theory_radius["shockwave_radius"],
|
|
"reaction_results" = list(),
|
|
"ref" = REF(singular_record)
|
|
)
|
|
|
|
var/list/reaction_data = singular_record.reaction_results
|
|
// Make sure the list is indexed first.
|
|
if(reaction_data.len)
|
|
for (var/path in reaction_data[TANK_RESULTS_REACTION])
|
|
var/datum/gas_reaction/reaction_path = path
|
|
record_data["reaction_results"] += initial(reaction_path.name)
|
|
if(TANK_MERGE_OVERPRESSURE in reaction_data[TANK_RESULTS_MISC])
|
|
record_data["reaction_results"] += "Tank overpressurized before reaction"
|
|
|
|
data["records"] += list(record_data)
|
|
return data
|
|
|
|
/obj/machinery/doppler_array/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
switch(action)
|
|
if("delete_record")
|
|
var/datum/data/tachyon_record/record = locate(params["ref"]) in records
|
|
if(!records || !(record in records))
|
|
return
|
|
records -= record
|
|
return TRUE
|
|
if("save_record")
|
|
var/datum/data/tachyon_record/record = locate(params["ref"]) in records
|
|
if(!records || !(record in records))
|
|
return
|
|
print(usr, record)
|
|
return TRUE
|
|
if("eject_disk")
|
|
eject_disk(usr)
|