[MIRROR] refactor: move status_display_bottom_text and fire_alarm_light_color to security level prototypes (#28766)

* refactor: move `status_display_bottom_text` and `fire_alarm_light_color` to security level prototypes

* modular alerts

* Update security_level_datums.dm

---------

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>
Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-07-11 19:46:28 +05:30
committed by GitHub
co-authored by Gaxeer SpaceLoveSs13
parent 47fe4a793a
commit 7b5c8d8dab
5 changed files with 26 additions and 64 deletions
+1 -21
View File
@@ -394,27 +394,7 @@ GLOBAL_VAR_INIT(cops_arrived, FALSE)
post_status(picture)
else
if(picture == "currentalert") // You cannot set Code Blue display during Code Red and similiar
switch(SSsecurity_level.get_current_level_as_number())
if(SEC_LEVEL_DELTA)
post_status("alert", "deltaalert")
if(SEC_LEVEL_RED)
post_status("alert", "redalert")
if(SEC_LEVEL_BLUE)
post_status("alert", "bluealert")
if(SEC_LEVEL_GREEN)
post_status("alert", "greenalert")
// SKYRAT EDIT ADD START - Alert Levels
if(SEC_LEVEL_VIOLET)
post_status("alert", "violetalert")
if(SEC_LEVEL_ORANGE)
post_status("alert", "orangealert")
if(SEC_LEVEL_AMBER)
post_status("alert", "amberalert")
if(SEC_LEVEL_EPSILON)
post_status("alert", "epsilonalert")
if(SEC_LEVEL_GAMMA)
post_status("alert", "gammaalert")
// SKYRAT EDIT ADD END - Alert Levels
post_status("alert", SSsecurity_level?.current_security_level?.status_display_icon_state || "greenalert")
else
post_status("alert", picture)
+1 -21
View File
@@ -179,27 +179,7 @@
var/current_level = SSsecurity_level.get_current_level_as_number()
. += mutable_appearance(icon, "fire_[current_level]")
. += emissive_appearance(icon, "fire_level_e", src, alpha = src.alpha)
switch(current_level)
if(SEC_LEVEL_GREEN)
set_light(l_color = LIGHT_COLOR_BLUEGREEN)
if(SEC_LEVEL_BLUE)
set_light(l_color = LIGHT_COLOR_ELECTRIC_CYAN)
if(SEC_LEVEL_RED)
set_light(l_color = LIGHT_COLOR_FLARE)
if(SEC_LEVEL_DELTA)
set_light(l_color = LIGHT_COLOR_INTENSE_RED)
//SKYRAT EDIT ADDITION BEGIN - ADDITIONAL ALERT LEVELS
if(SEC_LEVEL_VIOLET)
set_light(l_color = COLOR_VIOLET)
if(SEC_LEVEL_ORANGE)
set_light(l_color = LIGHT_COLOR_ORANGE)
if(SEC_LEVEL_AMBER)
set_light(l_color = LIGHT_COLOR_DIM_YELLOW)
if(SEC_LEVEL_EPSILON)
set_light(l_color = COLOR_ASSEMBLY_WHITE)
if(SEC_LEVEL_GAMMA)
set_light(l_color = COLOR_ASSEMBLY_PURPLE)
//SKYRAT EDIT ADDITION END
set_light(l_color = SSsecurity_level?.current_security_level?.fire_alarm_light_color || LIGHT_COLOR_BLUEGREEN)
else
. += mutable_appearance(icon, "fire_offstation")
. += emissive_appearance(icon, "fire_level_e", src, alpha = src.alpha)
@@ -59,27 +59,7 @@
post_status(picture)
else
if(picture == "currentalert") // You cannot set Code Blue display during Code Red and similiar
switch(SSsecurity_level.get_current_level_as_number())
if(SEC_LEVEL_DELTA)
post_status("alert", "deltaalert")
if(SEC_LEVEL_RED)
post_status("alert", "redalert")
if(SEC_LEVEL_BLUE)
post_status("alert", "bluealert")
if(SEC_LEVEL_GREEN)
post_status("alert", "greenalert")
// SKYRAT EDIT ADD START - Alert Levels
if(SEC_LEVEL_VIOLET)
post_status("alert", "violetalert")
if(SEC_LEVEL_ORANGE)
post_status("alert", "orangealert")
if(SEC_LEVEL_AMBER)
post_status("alert", "amberalert")
if(SEC_LEVEL_EPSILON)
post_status("alert", "epsilonalert")
if(SEC_LEVEL_GAMMA)
post_status("alert", "gammaalert")
// SKYRAT EDIT ADD END - Alert Levels
post_status("alert", SSsecurity_level?.current_security_level?.status_display_icon_state || "greenalert")
else
post_status("alert", picture)
@@ -13,6 +13,10 @@
var/announcement_color = "default"
/// The numerical level of this security level, see defines for more information.
var/number_level = -1
/// Icon state that will be displayed on displays during this security level
var/status_display_icon_state
/// The color of the fire alarm light set when changed to this security level
var/fire_alarm_light_color
/// The sound that we will play when this security level is set
var/sound
/// The looping sound that will be played while the security level is set
@@ -47,6 +51,8 @@
announcement_color = "green"
sound = 'sound/misc/notice2.ogg' // Friendly beep
number_level = SEC_LEVEL_GREEN
status_display_icon_state = "greenalert"
fire_alarm_light_color = LIGHT_COLOR_BLUEGREEN
lowering_to_configuration_key = /datum/config_entry/string/alert_green
shuttle_call_time_mod = ALERT_COEFF_GREEN
@@ -60,6 +66,8 @@
announcement_color = "blue"
sound = 'sound/misc/notice1.ogg' // Angry alarm
number_level = SEC_LEVEL_BLUE
status_display_icon_state = "bluealert"
fire_alarm_light_color = LIGHT_COLOR_ELECTRIC_CYAN
lowering_to_configuration_key = /datum/config_entry/string/alert_blue_downto
elevating_to_configuration_key = /datum/config_entry/string/alert_blue_upto
shuttle_call_time_mod = ALERT_COEFF_BLUE
@@ -74,6 +82,8 @@
announcement_color = "red"
sound = 'sound/misc/notice3.ogg' // More angry alarm
number_level = SEC_LEVEL_RED
status_display_icon_state = "redalert"
fire_alarm_light_color = LIGHT_COLOR_FLARE
lowering_to_configuration_key = /datum/config_entry/string/alert_red_downto
elevating_to_configuration_key = /datum/config_entry/string/alert_red_upto
shuttle_call_time_mod = ALERT_COEFF_RED
@@ -88,5 +98,7 @@
announcement_color = "purple"
sound = 'sound/misc/airraid.ogg' // Air alarm to signify importance
number_level = SEC_LEVEL_DELTA
status_display_icon_state = "deltaalert"
fire_alarm_light_color = LIGHT_COLOR_INTENSE_RED
elevating_to_configuration_key = /datum/config_entry/string/alert_delta
shuttle_call_time_mod = ALERT_COEFF_DELTA
@@ -29,6 +29,8 @@
name = "violet"
announcement_color = "purple"
number_level = SEC_LEVEL_VIOLET
status_display_icon_state = "violetalert"
fire_alarm_light_color = COLOR_VIOLET
lowering_to_configuration_key = /datum/config_entry/string/alert_violet_downto
elevating_to_configuration_key = /datum/config_entry/string/alert_violet_upto
sound = 'modular_skyrat/modules/alerts/sound/security_levels/violet.ogg'
@@ -43,6 +45,8 @@
name = "orange"
announcement_color = "orange"
number_level = SEC_LEVEL_ORANGE
status_display_icon_state = "orangealert"
fire_alarm_light_color = LIGHT_COLOR_ORANGE
lowering_to_configuration_key = /datum/config_entry/string/alert_orange_downto
elevating_to_configuration_key = /datum/config_entry/string/alert_orange_upto
sound = 'modular_skyrat/modules/alerts/sound/security_levels/orange.ogg'
@@ -58,6 +62,8 @@
name = "amber"
announcement_color = "yellow"
number_level = SEC_LEVEL_AMBER
status_display_icon_state = "amberalert"
fire_alarm_light_color = LIGHT_COLOR_DIM_YELLOW
lowering_to_configuration_key = /datum/config_entry/string/alert_amber_downto
elevating_to_configuration_key = /datum/config_entry/string/alert_amber_upto
sound = 'modular_skyrat/modules/alerts/sound/security_levels/amber.ogg'
@@ -72,6 +78,8 @@
name = "epsilon"
announcement_color = "grey"
number_level = SEC_LEVEL_EPSILON
status_display_icon_state = "epsilonalert"
fire_alarm_light_color = COLOR_ASSEMBLY_WHITE
lowering_to_configuration_key = /datum/config_entry/string/alert_epsilon_downto
elevating_to_configuration_key = /datum/config_entry/string/alert_epsilon_upto
sound = 'modular_skyrat/modules/alerts/sound/security_levels/epsilon.ogg'
@@ -81,12 +89,14 @@
/**
* Gamma
*
* XK-Class EOW Event
* XK-Class EOR Event
*/
/datum/security_level/gamma
name = "gamma"
announcement_color = "pink"
number_level = SEC_LEVEL_GAMMA
status_display_icon_state = "gammaalert"
fire_alarm_light_color = COLOR_ASSEMBLY_PURPLE
elevating_to_configuration_key = /datum/config_entry/string/alert_gamma
shuttle_call_time_mod = 0.25
sound = 'modular_skyrat/modules/alerts/sound/security_levels/gamma_alert.ogg'