mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* update icon and update appearance * update name * fixes * Removes double parent calls from many things * More fixes * minor fixes * fuck * A! * general annoyances in this PR * going in specific fixes * remove remaining update icons and hud fixes * Mass replace update icon with update icon state/overlays * compile * push my work so far * goes back on things I broke * a * goes through like 80 more cases * going through more update icons * compile again * thank you tattax * Goes through the remaining update icon * fix CI cries * Fixes cigs, canisters and guncases * Fixes airlock unres sides * Fixes the flash * Fixes cryo cells * gun fix * Egun fixes * fixes mini eguns * Update energy.dm * Fixes MMIs * Fixes security level interface * Fixes cigar cases * Bow & Critter crate fixes * Fixes signalers * Fix canisters again * re-adds blinking red * Fixes solar panels * Fixes cryogenics (and forced standing) * Update cryo.dm * sechailer fix * Maybe fixes pitch black roundstart APCs * Update apc.dm * yet another egun fix * Fixes plasmamen helmets among other stuff * Fixes canisters for good * Fixes booze dispensers * Fixes new icon updates people added * Probably fixes ballistic guns * i give up lol
55 lines
2.2 KiB
Plaintext
55 lines
2.2 KiB
Plaintext
#define COMMUNICATION_COOLDOWN 300
|
|
#define COMMUNICATION_COOLDOWN_AI 300
|
|
|
|
SUBSYSTEM_DEF(communications)
|
|
name = "Communications"
|
|
flags = SS_NO_INIT | SS_NO_FIRE
|
|
|
|
var/silicon_message_cooldown
|
|
var/nonsilicon_message_cooldown
|
|
var/last_voice_announce_open = 0
|
|
|
|
/datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon)
|
|
if(is_silicon && silicon_message_cooldown > world.time)
|
|
. = FALSE
|
|
else if(!is_silicon && nonsilicon_message_cooldown > world.time)
|
|
. = FALSE
|
|
else
|
|
. = TRUE
|
|
|
|
/datum/controller/subsystem/communications/proc/make_announcement(mob/living/user, is_silicon, input)
|
|
if(!can_announce(user, is_silicon))
|
|
return FALSE
|
|
var/pretty_input = replacetext(input, "\n", " ")
|
|
if(isnotpretty(pretty_input))
|
|
to_chat(user, "<span class='notice'>Your fingers slip. <a href='https://forums.yogstation.net/help/rules/#rule-0_1'>See rule 0.1</a>.</span>")
|
|
var/log_message = "[key_name(user)] just tripped a pretty filter: '[input]'."
|
|
message_admins(log_message)
|
|
log_say(log_message)
|
|
return FALSE
|
|
if(is_silicon)
|
|
minor_announce(html_decode(input),"[user.name] Announces:")
|
|
silicon_message_cooldown = world.time + COMMUNICATION_COOLDOWN_AI
|
|
else
|
|
priority_announce(html_decode(user.treat_message(input)), null, 'sound/misc/announce.ogg', "Captain", has_important_message = TRUE)
|
|
nonsilicon_message_cooldown = world.time + COMMUNICATION_COOLDOWN
|
|
user.log_talk(input, LOG_SAY, tag="priority announcement")
|
|
message_admins("[ADMIN_LOOKUPFLW(user)] has made a priority announcement.")
|
|
|
|
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
|
|
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
|
if(!(C.stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
|
|
if(unique)
|
|
C.add_message(sending)
|
|
else //We copy the message for each console, answers and deletions won't be shared
|
|
var/datum/comm_message/M = new(sending.title,sending.content,sending.possible_answers.Copy())
|
|
C.add_message(M)
|
|
if(print)
|
|
var/obj/item/paper/P = new /obj/item/paper(C.loc)
|
|
P.name = "paper - '[sending.title]'"
|
|
P.info = sending.content
|
|
P.update_appearance(UPDATE_ICON)
|
|
|
|
#undef COMMUNICATION_COOLDOWN
|
|
#undef COMMUNICATION_COOLDOWN_AI
|