mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Generic Crew-Available Status Readout Module - Continued (#76117)
## About The Pull Request  continues and closes tgstation/tgstation#75708 - adds a generic status readout module that doesn't have a round timer or round ID display - the health analyzer's info display can now be toggled via a setting  - adds the generic status readout module to the advanced medical MODs node  - it has a death sound now yippee (sound and volume are vareditable. shoutouts to fikou for giving me a sound that was better) - ninjas still get the one with round timer/ID display ## Why It's Good For The Game it's a neat little module that tells you things about your spaceman that you might want to keep track of, like viruses and health and nutritional status ## Changelog 🆑 add: A really old data disk with the MOD module designs for the status readout was recovered, and has been haphazardly hotpatched into the research networks. add: Also, the status readout module now plays a sound on death. qol: The MODsuit health analyzer's info tab health readout can now be disabled in its settings. /🆑 --------- Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com> Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
co-authored by
Hatterhat
san7890
parent
13a9806260
commit
0d3558542f
@@ -166,6 +166,68 @@
|
||||
overlay_state_active = "module_jetpackadv_on"
|
||||
full_speed = TRUE
|
||||
|
||||
///Status Readout - Puts a lot of information including health, nutrition, fingerprints, temperature to the suit TGUI.
|
||||
/obj/item/mod/module/status_readout
|
||||
name = "MOD status readout module"
|
||||
desc = "A once-common module, this technology unfortunately went out of fashion in the safer regions of space; \
|
||||
and found new life in the research networks of the Periphery. This particular unit hooks into the suit's spine, \
|
||||
capable of capturing and displaying all possible biometric data of the wearer; sleep, nutrition, fitness, fingerprints, \
|
||||
and even useful information such as their overall health and wellness. The vitals monitor also comes with a speaker, loud enough \
|
||||
to alert anyone nearby that someone has, in fact, died."
|
||||
icon_state = "status"
|
||||
complexity = 1
|
||||
use_power_cost = DEFAULT_CHARGE_DRAIN * 0.1
|
||||
incompatible_modules = list(/obj/item/mod/module/status_readout)
|
||||
tgui_id = "status_readout"
|
||||
/// Does this show the round ID and shift time?
|
||||
var/show_time = FALSE
|
||||
/// Death sound. May or may not be funny. Vareditable at your own risk.
|
||||
var/death_sound = 'sound/effects/flatline3.ogg'
|
||||
/// Death sound volume. Please be responsible with this.
|
||||
var/death_sound_volume = 50
|
||||
|
||||
/obj/item/mod/module/status_readout/add_ui_data()
|
||||
. = ..()
|
||||
.["show_time"] = show_time
|
||||
.["statustime"] = station_time_timestamp()
|
||||
.["statusid"] = GLOB.round_id
|
||||
.["statushealth"] = mod.wearer?.health || 0
|
||||
.["statusmaxhealth"] = mod.wearer?.getMaxHealth() || 0
|
||||
.["statusbrute"] = mod.wearer?.getBruteLoss() || 0
|
||||
.["statusburn"] = mod.wearer?.getFireLoss() || 0
|
||||
.["statustoxin"] = mod.wearer?.getToxLoss() || 0
|
||||
.["statusoxy"] = mod.wearer?.getOxyLoss() || 0
|
||||
.["statustemp"] = mod.wearer?.bodytemperature || 0
|
||||
.["statusnutrition"] = mod.wearer?.nutrition || 0
|
||||
.["statusfingerprints"] = mod.wearer ? md5(mod.wearer.dna.unique_identity) : null
|
||||
.["statusdna"] = mod.wearer?.dna.unique_enzymes
|
||||
.["statusviruses"] = null
|
||||
if(!length(mod.wearer?.diseases))
|
||||
return .
|
||||
var/list/viruses = list()
|
||||
for(var/datum/disease/virus as anything in mod.wearer.diseases)
|
||||
var/list/virus_data = list()
|
||||
virus_data["name"] = virus.name
|
||||
virus_data["type"] = virus.spread_text
|
||||
virus_data["stage"] = virus.stage
|
||||
virus_data["maxstage"] = virus.max_stages
|
||||
virus_data["cure"] = virus.cure_text
|
||||
viruses += list(virus_data)
|
||||
.["statusviruses"] = viruses
|
||||
|
||||
return .
|
||||
|
||||
/obj/item/mod/module/status_readout/on_suit_activation()
|
||||
RegisterSignal(mod.wearer, COMSIG_LIVING_DEATH, PROC_REF(death_sound))
|
||||
|
||||
/obj/item/mod/module/status_readout/on_suit_deactivation(deleting)
|
||||
UnregisterSignal(mod.wearer, COMSIG_LIVING_DEATH)
|
||||
|
||||
/obj/item/mod/module/status_readout/proc/death_sound(mob/living/carbon/human/wearer)
|
||||
SIGNAL_HANDLER
|
||||
if(death_sound && death_sound_volume)
|
||||
playsound(wearer, death_sound, death_sound_volume, FALSE)
|
||||
|
||||
///Eating Apparatus - Lets the user eat/drink with the suit on.
|
||||
/obj/item/mod/module/mouthhole
|
||||
name = "MOD eating apparatus module"
|
||||
|
||||
Reference in New Issue
Block a user