mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Nuke resprite revival (#20888)
* nuclear revive * stage fixes * allows for the core to show while panel is closed * adds blob nuke * oops merge failure * sirryan review * grammar fix in comment
This commit is contained in:
@@ -14,7 +14,7 @@ GLOBAL_VAR(bomb_set)
|
||||
/obj/machinery/nuclearbomb
|
||||
name = "\improper Nuclear Fission Explosive"
|
||||
desc = "Uh oh. RUN!!!!"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon = 'icons/obj/nuclearbomb.dmi'
|
||||
icon_state = "nuclearbomb0"
|
||||
density = TRUE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
@@ -23,13 +23,21 @@ GLOBAL_VAR(bomb_set)
|
||||
power_state = NO_POWER_USE
|
||||
requires_power = FALSE
|
||||
|
||||
/// Are our bolts *supposed* to be in the floor, may not actually cause anchoring if the bolts are cut
|
||||
var/extended = TRUE
|
||||
/// If true, prevents the lights on the nuke
|
||||
var/lighthack = FALSE
|
||||
/// Countdown to boom
|
||||
var/timeleft = 120
|
||||
/// Are we counting down?
|
||||
var/timing = FALSE
|
||||
/// Have we gone boom yet?
|
||||
var/exploded = FALSE
|
||||
/// Random code between 10000 and 99999
|
||||
var/r_code = "ADMIN"
|
||||
/// Code entered by user
|
||||
var/code
|
||||
/// Is the most recently inputted code correct?
|
||||
var/yes_code = FALSE
|
||||
var/safety = TRUE
|
||||
var/obj/item/disk/nuclear/auth = null
|
||||
@@ -65,6 +73,7 @@ GLOBAL_VAR(bomb_set)
|
||||
GLOB.poi_list |= src
|
||||
core = new /obj/item/nuke_core/plutonium(src)
|
||||
STOP_PROCESSING(SSobj, core) //Let us not irradiate the vault by default.
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/nuclearbomb/Destroy()
|
||||
SStgui.close_uis(wires)
|
||||
@@ -115,7 +124,22 @@ GLOBAL_VAR(bomb_set)
|
||||
set_light(1, LIGHTING_MINIMUM_POWER)
|
||||
|
||||
if(panel_open)
|
||||
. += "npanel_open"
|
||||
. += "hackpanel_open"
|
||||
|
||||
if(anchored) // Using anchored due to removal_stage deanchoring having multiple steps
|
||||
. += "nukebolts"
|
||||
|
||||
// Selected stage lets us show the open core, even if the front panel is closed
|
||||
var/selected_stage = removal_stage
|
||||
if(removal_stage < NUKE_CORE_EVERYTHING_FINE) // Because we need to show the core
|
||||
selected_stage = core_stage
|
||||
switch(selected_stage)
|
||||
if(NUKE_CORE_PANEL_EXPOSED)
|
||||
. += "nukecore1"
|
||||
if(NUKE_CORE_PANEL_UNWELDED)
|
||||
. += "nukecore2"
|
||||
if(NUKE_CORE_FULLY_EXPOSED)
|
||||
. += core ? "nukecore3" : "nukecore4"
|
||||
|
||||
/obj/machinery/nuclearbomb/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
if(istype(O, /obj/item/disk/nuclear))
|
||||
@@ -144,6 +168,7 @@ GLOBAL_VAR(bomb_set)
|
||||
removal_stage = NUKE_CORE_PANEL_UNWELDED
|
||||
if(core)
|
||||
STOP_PROCESSING(SSobj, core)
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
return
|
||||
if(istype(O, /obj/item/stack/sheet/metal) && removal_stage == NUKE_CORE_PANEL_EXPOSED)
|
||||
var/obj/item/stack/S = O
|
||||
@@ -157,6 +182,7 @@ GLOBAL_VAR(bomb_set)
|
||||
user.visible_message("<span class='notice'>[user] repairs [src]'s outer core plate.</span>", \
|
||||
"<span class='notice'>You repair [src]'s outer core plate.</span>")
|
||||
removal_stage = NUKE_CORE_EVERYTHING_FINE
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
return
|
||||
if(istype(O, /obj/item/nuke_core/plutonium) && removal_stage == NUKE_CORE_FULLY_EXPOSED)
|
||||
if(do_after(user, 2 SECONDS, target = src))
|
||||
@@ -208,6 +234,7 @@ GLOBAL_VAR(bomb_set)
|
||||
user.visible_message("[user] crowbars [src] off of the anchors. It can now be moved.", "You jam the crowbar under the nuclear device and lift it off its anchors. You can now move it!")
|
||||
anchored = FALSE
|
||||
removal_stage = NUKE_MOBILE
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/nuclearbomb/wrench_act(mob/user, obj/item/I)
|
||||
if(!anchored)
|
||||
@@ -222,6 +249,7 @@ GLOBAL_VAR(bomb_set)
|
||||
return
|
||||
user.visible_message("[user] unwrenches the anchoring bolts on [src].", "You unwrench the anchoring bolts.")
|
||||
removal_stage = NUKE_UNWRENCHED
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/nuclearbomb/multitool_act(mob/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
@@ -303,6 +331,7 @@ GLOBAL_VAR(bomb_set)
|
||||
visible_message("<span class='notice'>[user] cuts apart the anchoring system sealant on [src].</span>",\
|
||||
"<span class='notice'>You cut apart the anchoring system's sealant.</span></span>")
|
||||
removal_stage = NUKE_SEALANT_OPEN
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/nuclearbomb/attack_ghost(mob/user as mob)
|
||||
attack_hand(user)
|
||||
@@ -320,6 +349,7 @@ GLOBAL_VAR(bomb_set)
|
||||
user.visible_message("<span class='notice'>[user] pulls [core] out of [src]!</span>", "<span class='notice'>You pull [core] out of [src]! Might want to put it somewhere safe.</span>")
|
||||
core.forceMove(loc)
|
||||
core = null
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
@@ -374,7 +404,7 @@ GLOBAL_VAR(bomb_set)
|
||||
if(!lighthack)
|
||||
flick("nuclearbombc", src)
|
||||
icon_state = "nuclearbomb1"
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
extended = TRUE
|
||||
return
|
||||
if("auth")
|
||||
@@ -413,6 +443,7 @@ GLOBAL_VAR(bomb_set)
|
||||
if("toggle_anchor")
|
||||
if(removal_stage == NUKE_MOBILE)
|
||||
anchored = FALSE
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
visible_message("<span class='warning'>[src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.</span>")
|
||||
return
|
||||
|
||||
@@ -425,6 +456,7 @@ GLOBAL_VAR(bomb_set)
|
||||
return
|
||||
|
||||
anchored = !(anchored)
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
if(anchored)
|
||||
visible_message("<span class='warning'>With a steely snap, bolts slide out of [src] and anchor it to the flooring.</span>")
|
||||
return
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
desc = "One of the more successful achievements of the Nanotrasen Corporate Warfare Division, their nuclear fission explosives are renowned for being cheap\
|
||||
to produce and devestatingly effective. Signs explain that though this is just a model, every Nanotrasen station is equipped with one, just in case. \
|
||||
All Captains carefully guard the disk needed to detonate them - at least, the sign says they do. There seems to be a tap on the back."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon = 'icons/obj/nuclearbomb.dmi'
|
||||
icon_state = "nuclearbomb0"
|
||||
anchored = TRUE
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user