Skip to content

Commit

Permalink
Add information message to a sec level announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzianishchyts committed Jan 25, 2025
1 parent bd52717 commit 29c02c7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions modular_ss220/balance/_balance.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "code/access/access.dm"
#include "code/events/blob.dm"
#include "code/events/security_level.dm"
#include "code/items/projectiles.dm"
#include "code/items/radio.dm"
#include "code/items/storage/surgical_tray.dm"
Expand Down
34 changes: 34 additions & 0 deletions modular_ss220/balance/code/events/security_level.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/datum/security_level
/// Tells if every crew member will be allowed to talk on the common frequency.
var/grants_common_channel_access = FALSE

/datum/security_level/gamma
grants_common_channel_access = TRUE

/datum/security_level/epsilon
grants_common_channel_access = TRUE

/datum/security_level/delta
grants_common_channel_access = TRUE

/datum/controller/subsystem/security_level/announce_security_level(datum/security_level/selected_level)
var/message
var/title
var/sound
var/sound2 = selected_level.ai_announcement_sound

if(selected_level.number_level > current_security_level.number_level)
message = selected_level.elevating_to_announcement_text
title = selected_level.elevating_to_announcement_title
sound = selected_level.elevating_to_sound
else
message = selected_level.lowering_to_announcement_text
title = selected_level.lowering_to_announcement_title
sound = selected_level.lowering_to_sound

if(selected_level.grants_common_channel_access && !current_security_level.grants_common_channel_access)
message += " Ограничения на пользование общим каналом связи сняты."
else if(!selected_level.grants_common_channel_access && current_security_level.grants_common_channel_access)
message += " Ограничения на пользование общим каналом связи восстановлены."

GLOB.security_announcement.Announce(message, title, new_sound = sound, new_sound2 = sound2)

0 comments on commit 29c02c7

Please sign in to comment.