diff --git a/code/__DEFINES/nuclear_bomb.dm b/code/__DEFINES/nuclear_bomb.dm index fecd9ef0611..7e1707ea780 100644 --- a/code/__DEFINES/nuclear_bomb.dm +++ b/code/__DEFINES/nuclear_bomb.dm @@ -1,23 +1,39 @@ // Nuclear bomb de/construction status +///Pristine condition, no tampering has occurred yet #define NUKESTATE_INTACT 5 +///Front panel has been unscrewed #define NUKESTATE_UNSCREWED 4 +///Front panel has been removed with a crowbar, exposing the reinforced cover #define NUKESTATE_PANEL_REMOVED 3 +///Reinforced cover has been welded, preparing it for removal #define NUKESTATE_WELDED 2 +///Reinforced cover has been removed with a crowbar, revealing the core #define NUKESTATE_CORE_EXPOSED 1 +///Nuke core removed with the special kit #define NUKESTATE_CORE_REMOVED 0 // Nuclear bomb UI modes +///Device is locked and is awaiting the disk for further operations (additionally shows time left if armed) #define NUKEUI_AWAIT_DISK 0 +///Device is awaiting activation codes input #define NUKEUI_AWAIT_CODE 1 +///Device is awaiting timer input #define NUKEUI_AWAIT_TIMER 2 +///Device is awaiting confirmation of arming process and shows the time set #define NUKEUI_AWAIT_ARM 3 +///Device is counting down to setting off the charge #define NUKEUI_TIMING 4 +///Device is setting off the charge, aka `proc/actually_explode()` #define NUKEUI_EXPLODED 5 // Nuclear bomb states +///Device has not received activation codes and no timer have been set, all lights are off #define NUKE_OFF_LOCKED 0 +///Device has received activation codes and the timer is set; awaiting arming and the safety warning lights are on #define NUKE_OFF_UNLOCKED 1 +///Device is counting down to setting off the charge, red lights are on #define NUKE_ON_TIMING 2 +///Device is setting off the charge, aka `proc/actually_explode()`, red lights are blinking fast #define NUKE_ON_EXPLODING 3 // Nuclear bomb detonation statuses diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm index 3214232648b..7445b20cb90 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm @@ -74,10 +74,31 @@ GLOBAL_VAR(station_nuke_source) /obj/machinery/nuclearbomb/examine(mob/user) . = ..() - if(exploding) - . += span_bolddanger("It is in the process of exploding. Perhaps reviewing your affairs is in order.") - if(timing) - . += span_danger("There are [get_time_left()] seconds until detonation.") + switch(deconstruction_state) + if(NUKESTATE_UNSCREWED) + . += span_notice("The front panel has been unscrewed and can be pried open.") + if(NUKESTATE_PANEL_REMOVED) + . += span_notice("The inner plate is exposed and can be cut with a welding tool.") + if(NUKESTATE_WELDED) + . += span_notice("The inner plate has been cut through and can be pried off.") + if(NUKESTATE_CORE_EXPOSED) + . += span_danger("The inner chamber is exposed, revealing [core] to the outside!") + . += span_notice("The damaged inner plate covering the inner chamber can be replaced with some iron.") + if(NUKESTATE_CORE_REMOVED) + . += span_notice("The inner chamber is exposed, but is empty.") + if(NUKESTATE_INTACT) + . += span_notice("The front panel is secured.") + + switch(get_nuke_state()) + if(NUKE_OFF_LOCKED) + . += span_notice("The device is awaiting activation codes.") + if(NUKE_OFF_UNLOCKED) + . += span_notice("The device is set and is ready for arming the detonation countdown.") + if(NUKE_ON_TIMING) + . += span_danger("There are [get_time_left()] seconds until detonation.") + if(NUKE_ON_EXPLODING) + . += span_bolddanger("It is in the process of exploding. Perhaps reviewing your affairs is in order.") + /// Checks if the disk inserted is a real nuke disk or not. /obj/machinery/nuclearbomb/proc/disk_check(obj/item/disk/nuclear/inserted_disk) @@ -225,12 +246,11 @@ GLOBAL_VAR(station_nuke_source) if(NUKESTATE_CORE_REMOVED) interior = "core-removed" if(NUKESTATE_INTACT) - return + interior = null switch(get_nuke_state()) if(NUKE_OFF_LOCKED) - lights = "" - return + lights = null if(NUKE_OFF_UNLOCKED) lights = "lights-safety" if(NUKE_ON_TIMING) @@ -425,11 +445,12 @@ GLOBAL_VAR(station_nuke_source) // We're safe now, so stop any ongoing timers if(safety) if(timing) + timing = FALSE disarm_nuke() - timing = FALSE detonation_timer = null countdown.stop() + update_appearance(UPDATE_OVERLAYS) //only the lights overlay are affected by safety /// Arms the nuke, or disarms it if it's already active. /obj/machinery/nuclearbomb/proc/toggle_nuke_armed()