diff --git a/code/game/objects/items/tools/theft_tools.dm b/code/game/objects/items/tools/theft_tools.dm index b8dce57e7c3..fae7befdff1 100644 --- a/code/game/objects/items/tools/theft_tools.dm +++ b/code/game/objects/items/tools/theft_tools.dm @@ -33,7 +33,7 @@ if(cooldown < world.time - 60) cooldown = world.time flick(pulseicon, src) - radiation_pulse(src, max_range = 2, threshold = RAD_EXTREME_INSULATION) + radiation_pulse(get_turf(src), max_range = 2, threshold = RAD_EXTREME_INSULATION) /obj/item/nuke_core/suicide_act(mob/living/user) user.visible_message(span_suicide("[user] is rubbing [src] against [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!")) @@ -70,7 +70,7 @@ icon_state = "core_container_sealed" playsound(src, 'sound/items/deconstruct.ogg', 60, TRUE) if(ismob(loc)) - to_chat(loc, span_warning("[src] is permanently sealed, [core]'s radiation is contained.")) + to_chat(loc, span_warning("[src] is sealed, [core]'s radiation is contained.")) /obj/item/nuke_core_container/attackby(obj/item/nuke_core/core, mob/user) if(istype(core)) 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 10f92ce631d..807f0e6e690 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm @@ -124,10 +124,22 @@ GLOBAL_VAR(station_nuke_source) if(NUKESTATE_INTACT) if(istype(weapon, /obj/item/screwdriver/nuke)) to_chat(user, span_notice("You start removing [src]'s front panel's screws...")) - if(weapon.use_tool(src, user, 6 SECONDS, volume = 100)) - deconstruction_state = NUKESTATE_UNSCREWED - to_chat(user, span_notice("You remove the screws from [src]'s front panel.")) - update_appearance() + if(!weapon.use_tool(src, user, 6 SECONDS, volume = 100)) + return TRUE + deconstruction_state = NUKESTATE_UNSCREWED + to_chat(user, span_notice("You remove the screws from [src]'s front panel.")) + update_appearance() + return TRUE + + if(NUKESTATE_UNSCREWED) + if(istype(weapon, /obj/item/screwdriver/nuke)) + to_chat(user, span_notice("You start screwing [src]'s front panel back in...")) + if(!weapon.use_tool(src, user, 8 SECONDS, volume = 100)) + return TRUE + deconstruction_state = NUKESTATE_INTACT + to_chat(user, span_notice("You screw [src]'s front panel back into place.")) + deconstruction_state = NUKESTATE_INTACT + update_appearance() return TRUE if(NUKESTATE_PANEL_REMOVED) @@ -135,24 +147,26 @@ GLOBAL_VAR(station_nuke_source) if(!weapon.tool_start_check(user, amount = 1)) return TRUE to_chat(user, span_notice("You start cutting [src]'s inner plate...")) - if(weapon.use_tool(src, user, 8 SECONDS, volume=100)) - to_chat(user, span_notice("You cut [src]'s inner plate.")) - deconstruction_state = NUKESTATE_WELDED - update_appearance() + if(!weapon.use_tool(src, user, 8 SECONDS, volume=100)) + return TRUE + to_chat(user, span_notice("You cut [src]'s inner plate.")) + deconstruction_state = NUKESTATE_WELDED + update_appearance() return TRUE if(NUKESTATE_CORE_EXPOSED) if(istype(weapon, /obj/item/nuke_core_container)) var/obj/item/nuke_core_container/core_box = weapon to_chat(user, span_notice("You start loading the plutonium core into [core_box]...")) - if(do_after(user, 5 SECONDS, target = src, hidden = TRUE)) - if(core_box.load(core, user)) - to_chat(user, span_notice("You load the plutonium core into [core_box].")) - deconstruction_state = NUKESTATE_CORE_REMOVED - update_appearance() - core = null - else - to_chat(user, span_warning("You fail to load the plutonium core into [core_box]. [core_box] has already been used!")) + if(!do_after(user, 5 SECONDS, target = src, hidden = TRUE)) + return TRUE + if(core_box.load(core, user)) + to_chat(user, span_notice("You load the plutonium core into [core_box].")) + deconstruction_state = NUKESTATE_CORE_REMOVED + update_appearance() + core = null + else + to_chat(user, span_warning("You fail to load the plutonium core into [core_box]. [core_box] has already been used!")) return TRUE if(istype(weapon, /obj/item/stack/sheet/iron)) @@ -160,11 +174,37 @@ GLOBAL_VAR(station_nuke_source) return TRUE to_chat(user, span_notice("You begin repairing [src]'s inner metal plate...")) - if(weapon.use_tool(src, user, 10 SECONDS, amount = 20)) - to_chat(user, span_notice("You repair [src]'s inner metal plate. The radiation is contained.")) - deconstruction_state = NUKESTATE_PANEL_REMOVED - STOP_PROCESSING(SSobj, core) - update_appearance() + if(!weapon.use_tool(src, user, 10 SECONDS, amount = 20)) + return TRUE + to_chat(user, span_notice("You repair [src]'s inner metal plate. The radiation is contained.")) + deconstruction_state = NUKESTATE_PANEL_REMOVED + STOP_PROCESSING(SSobj, core) + update_appearance() + return TRUE + + if(NUKESTATE_CORE_REMOVED) + if(astype(weapon, /obj/item/nuke_core_container)?.core && !istype(weapon, /obj/item/nuke_core_container/supermatter)) + var/obj/item/nuke_core_container/core_box = weapon + to_chat(user, span_notice("You pry open [core_box] and begin placing [core_box.core] into [src]'s inner chamber...")) + if(!do_after(user, 15 SECONDS, src)) + return TRUE + core_box.core.forceMove(src) + core = core_box.core + to_chat(user, span_notice("You place [core_box.core] into [src]'s inner chamber.")) + deconstruction_state = NUKESTATE_CORE_EXPOSED + update_appearance() + core_box.icon_state = core_box::icon_state + core_box.core = null + return TRUE + if(istype(weapon, /obj/item/nuke_core) && !istype(weapon, /obj/item/nuke_core/supermatter_sliver)) + to_chat(user, span_notice("You begin placing [weapon] into [src]'s inner chamber...")) + if(!do_after(user, 6 SECONDS, src)) + return TRUE + weapon.forceMove(src) + core = weapon + to_chat(user, span_notice("You place [weapon] into [src]'s inner chamber.")) + deconstruction_state = NUKESTATE_CORE_EXPOSED + update_appearance() return TRUE return ..() @@ -173,22 +213,42 @@ GLOBAL_VAR(station_nuke_source) switch(deconstruction_state) if(NUKESTATE_UNSCREWED) to_chat(user, span_notice("You start removing [src]'s front panel...")) - if(tool.use_tool(src, user, 30, volume=100)) - to_chat(user, span_notice("You remove [src]'s front panel.")) - deconstruction_state = NUKESTATE_PANEL_REMOVED - update_appearance() + if(!tool.use_tool(src, user, 30, volume=100)) + return TRUE + to_chat(user, span_notice("You remove [src]'s front panel.")) + deconstruction_state = NUKESTATE_PANEL_REMOVED + update_appearance() return TRUE if(NUKESTATE_WELDED) to_chat(user, span_notice("You start prying off [src]'s inner plate...")) - if(tool.use_tool(src, user, 30, volume=100)) + if(!tool.use_tool(src, user, 30, volume=100)) + return TRUE + if(core) to_chat(user, span_notice("You pry off [src]'s inner plate. You can see the core's green glow!")) deconstruction_state = NUKESTATE_CORE_EXPOSED - update_appearance() START_PROCESSING(SSobj, core) + else + to_chat(user, span_notice("You pry off [src]'s inner plate. The inner chamber is empty, save for some beer stains.")) + deconstruction_state = NUKESTATE_CORE_REMOVED + update_appearance() + new /obj/item/stack/sheet/iron(loc, 15) + return TRUE + if(NUKESTATE_PANEL_REMOVED) + to_chat(user, span_notice("You start levering [src]'s inner panel back into place...")) + if(!tool.use_tool(src, user, 30, volume = 100)) + return TRUE + to_chat(user, span_notice("You lever [src]'s inner panel back into place.")) + deconstruction_state = NUKESTATE_UNSCREWED + update_appearance() return TRUE - return FALSE +/obj/machinery/nuclearbomb/attack_hand_secondary(mob/user, list/modifiers) + if(deconstruction_state != NUKESTATE_CORE_EXPOSED) + return ..() + to_chat(user, span_danger("You can't hold [core] with your bare hands!")) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + /obj/machinery/nuclearbomb/can_interact(mob/user) if(HAS_TRAIT(user, TRAIT_CAN_USE_NUKE)) return TRUE diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/beer_nuke.dm b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/beer_nuke.dm index 5f873c463b2..66798ae798c 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/beer_nuke.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/beer_nuke.dm @@ -32,13 +32,11 @@ weapon.interact_with_atom(keg, user) // redirect refillable containers to the keg, allowing them to be filled return TRUE // pretend we handled the attack, too. - if(istype(weapon, /obj/item/nuke_core_container)) - to_chat(user, span_notice("[src] has had its plutonium core removed as a part of being decommissioned.")) - return TRUE - return ..() /obj/machinery/nuclearbomb/beer/actually_explode() + if(core) + return ..() //Unblock roundend, we're not actually exploding. SSticker.roundend_check_paused = FALSE var/turf/bomb_location = get_turf(src) @@ -61,6 +59,8 @@ disarm_nuke() /obj/machinery/nuclearbomb/beer/really_actually_explode(detonation_status) + if(core) + return ..() //if it's always hooked in it'll override admin choices RegisterSignal(overflow_control, COMSIG_CREATED_ROUND_EVENT, PROC_REF(on_created_round_event)) disarm_nuke()