From 88d876d3dc5425f802dee06fe7fad546e3c9b557 Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Thu, 4 Mar 2021 13:55:05 -0500
Subject: [PATCH] the rest of the fucking owl. Adds nuke core objective, fixes
---
code/game/gamemodes/nuclear/nuclearbomb.dm | 112 ++++++++++++++++--
code/game/gamemodes/objective.dm | 18 +--
code/game/gamemodes/steal_items.dm | 7 +-
code/game/objects/items/theft_items.dm | 49 ++++----
.../items/weapons/storage/uplink_kits.dm | 2 +-
5 files changed, 143 insertions(+), 45 deletions(-)
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index f57da2eabaf..036124fb10f 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -4,6 +4,11 @@
#define NUKE_SEALANT_OPEN 3
#define NUKE_UNWRENCHED 4
#define NUKE_MOBILE 5
+#define NUKE_CORE_EVERYTHING_FINE 6
+#define NUKE_CORE_PANEL_EXPOSED 7
+#define NUKE_CORE_PANEL_UNWELDED 8
+#define NUKE_CORE_FULLY_EXPOSED 9
+
GLOBAL_VAR(bomb_set)
@@ -25,25 +30,33 @@ GLOBAL_VAR(bomb_set)
var/safety = TRUE
var/obj/item/disk/nuclear/auth = null
var/removal_stage = NUKE_INTACT
+ var/obj/item/nuke_core/plutonium/core = null
var/lastentered
var/is_syndicate = FALSE
use_power = NO_POWER_USE
var/previous_level = ""
var/datum/wires/nuclearbomb/wires = null
+ ///The same state removal stage is, until someone opens the panel of the nuke. This way. we can have someone open the front of the nuke, while keep track of where in the world we are on the anchoring bolts.
+ var/anchor_stage = NUKE_INTACT
+ ///This is so we can check if the internal components are sealed up propperly, when the outer hatch is closed.
+ var/core_stage = NUKE_CORE_EVERYTHING_FINE
/obj/machinery/nuclearbomb/syndicate
is_syndicate = TRUE
-/obj/machinery/nuclearbomb/New()
- ..()
+/obj/machinery/nuclearbomb/Initialize()
+ . = ..()
r_code = rand(10000, 99999.0) // Creates a random code upon object spawn.
wires = new/datum/wires/nuclearbomb(src)
previous_level = get_security_level()
GLOB.poi_list |= src
+ core = new /obj/item/nuke_core/plutonium(src)
+ STOP_PROCESSING(SSobj, core) //Let us not irradiate the vault by default.
/obj/machinery/nuclearbomb/Destroy()
SStgui.close_uis(wires)
QDEL_NULL(wires)
+ QDEL_NULL(core)
GLOB.poi_list.Remove(src)
return ..()
@@ -68,16 +81,41 @@ GLOBAL_VAR(bomb_set)
else
to_chat(user, "You need to deploy [src] first.")
return
+ if(istype(O, /obj/item/stack/sheet/mineral/titanium) && removal_stage == NUKE_CORE_FULLY_EXPOSED)
+ if(do_after(user, 20, target = src))
+ var/obj/item/stack/S = O
+ if(!loc || !S || S.get_amount() < 10)
+ return
+ S.use(10)
+ user.visible_message("[user] repairs [src]'s inner core plate.", "You repair [src]'s inner core plate. The radiation is contained.")
+ removal_stage = NUKE_CORE_PANEL_UNWELDED
+ if(core)
+ STOP_PROCESSING(SSobj, core)
+ return
+ if(istype(O, /obj/item/stack/sheet/metal) && removal_stage == NUKE_CORE_PANEL_EXPOSED)
+ var/obj/item/stack/S = O
+ if(do_after(user, 20, target = src))
+ if(!loc || !S || S.get_amount() < 5)
+ return
+ S.use(10)
+ user.visible_message("[user] repairs [src]'s outer core plate.", "You repair [src]'s outer core plate.")
+ removal_stage = NUKE_CORE_EVERYTHING_FINE
+ return
+ if(istype(O, /obj/item/nuke_core/plutonium))
+ if(do_after(user, 20, target = src))
+ if(!user.unEquip(O))
+ to_chat(user, "The [O] is stuck to your hand!")
+ return
+ user.visible_message("[user] puts [O] back in [src].", "You put [O] back in [src].")
+ O.forceMove(src)
+ core = O
+
else if(istype(O, /obj/item/disk/plantgene))
to_chat(user, "You try to plant the disk, but despite rooting around, it won't fit! After you branch out to read the instructions, you find out where the problem stems from. You've been bamboo-zled, this isn't a nuclear disk at all!")
return
return ..()
/obj/machinery/nuclearbomb/crowbar_act(mob/user, obj/item/I)
- if(!anchored)
- return
- if(removal_stage != NUKE_UNWRENCHED && removal_stage != NUKE_COVER_OFF)
- return
. = TRUE
if(!I.tool_use_check(user, 0))
return
@@ -85,9 +123,23 @@ GLOBAL_VAR(bomb_set)
user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [I]...")
if(!I.use_tool(src, user, 15, volume = I.tool_volume) || removal_stage != NUKE_COVER_OFF)
return
- user.visible_message("[user] forces open the bolt covers on [src].", "You force open the bolt covers.")
+ user.visible_message("[user] forces open the bolt covers on [src].", ">You force open the bolt covers.")
removal_stage = NUKE_COVER_OPEN
- else
+ if(removal_stage == NUKE_CORE_EVERYTHING_FINE)
+ user.visible_message("[user] starts removing [src]'s outer core plate...", "You start removing [src]'s outer plate...")
+ if(!I.use_tool(src, user, 40, volume = I.tool_volume) || removal_stage != NUKE_CORE_EVERYTHING_FINE)
+ return
+ user.visible_message("[user] finishes removing [src]'s outer core plate.", "You finish removing [src]'s inner core plate.")
+ removal_stage = NUKE_CORE_PANEL_EXPOSED
+ if(removal_stage == NUKE_CORE_PANEL_UNWELDED)
+ user.visible_message("[user] starts removing [src]'s inner core plate...", "You start removing [src]'s inner plate...")
+ if(!I.use_tool(src, user, 80, volume = I.tool_volume) || removal_stage != NUKE_CORE_PANEL_UNWELDED)
+ return
+ user.visible_message("[user] finishes removing [src]'s inner core plate.", "You remove [src]'s inner core plate. You can see the core's green glow!")
+ removal_stage = NUKE_CORE_FULLY_EXPOSED
+ if(core)
+ START_PROCESSING(SSobj, core)
+ if(removal_stage == NUKE_UNWRENCHED)
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
if(!I.use_tool(src, user, 80, volume = I.tool_volume) || removal_stage != NUKE_UNWRENCHED)
return
@@ -121,15 +173,19 @@ GLOBAL_VAR(bomb_set)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
- if(auth)
+ if(auth || (istype(I, /obj/item/screwdriver/nuke)))
if(!panel_open)
panel_open = TRUE
overlays += image(icon, "npanel_open")
to_chat(user, "You unscrew the control panel of [src].")
+ anchor_stage = removal_stage
+ removal_stage = core_stage
else
panel_open = FALSE
overlays -= image(icon, "npanel_open")
to_chat(user, "You screw the control panel of [src] back on.")
+ core_stage = removal_stage
+ removal_stage = anchor_stage
else
if(!panel_open)
to_chat(user, "[src] emits a buzzing noise, the panel staying locked in.")
@@ -137,6 +193,8 @@ GLOBAL_VAR(bomb_set)
panel_open = FALSE
overlays -= image(icon, "npanel_open")
to_chat(user, "You screw the control panel of [src] back on.")
+ core_stage = removal_stage
+ removal_stage = anchor_stage
flick("nuclearbombc", src)
/obj/machinery/nuclearbomb/wirecutter_act(mob/user, obj/item/I)
@@ -149,8 +207,6 @@ GLOBAL_VAR(bomb_set)
/obj/machinery/nuclearbomb/welder_act(mob/user, obj/item/I)
. = TRUE
- if(removal_stage != NUKE_INTACT && removal_stage != NUKE_COVER_OPEN)
- return
if(!I.tool_use_check(user, 0))
return
if(removal_stage == NUKE_INTACT)
@@ -162,7 +218,19 @@ GLOBAL_VAR(bomb_set)
visible_message("[user] cuts through the bolt covers on [src].",\
"You cut through the bolt cover.")
removal_stage = NUKE_COVER_OFF
- else if(removal_stage == NUKE_COVER_OPEN)
+ if(removal_stage == NUKE_CORE_PANEL_UNWELDED)
+ user.visible_message("[user] starts welding [src]'s inner core plate...", "You start welding [src]'s inner core plate...")
+ if(!I.use_tool(src, user, 40, 5, volume = I.tool_volume) || removal_stage != NUKE_CORE_PANEL_UNWELDED)
+ return
+ user.visible_message("[user] finishes welding [src]'s inner core plate...", "You finish welding [src]'s inner core plate...")
+ removal_stage = NUKE_CORE_PANEL_EXPOSED
+ else if(removal_stage == NUKE_CORE_PANEL_EXPOSED)
+ user.visible_message("[user] starts unwelding [src]'s inner core plate...", "You start unwelding [src]'s inner core plate...")
+ if(!I.use_tool(src, user, 40, 5, volume = I.tool_volume) || removal_stage != NUKE_CORE_PANEL_EXPOSED)
+ return
+ user.visible_message("[user] finishes unwelding [src]'s inner core plate...", "You finish unwelding [src]'s inner core plate...")
+ removal_stage = NUKE_CORE_PANEL_UNWELDED
+ if(removal_stage == NUKE_COVER_OPEN)
visible_message("[user] starts cutting apart the anchoring system sealant on [src].",\
"You start cutting apart the anchoring system's sealant with [I]...",\
"You hear welding.")
@@ -177,7 +245,18 @@ GLOBAL_VAR(bomb_set)
/obj/machinery/nuclearbomb/attack_hand(mob/user as mob)
if(panel_open)
- wires.Interact(user)
+ if(removal_stage == NUKE_CORE_FULLY_EXPOSED && core)
+ if(timing) //removing the core is less risk then cutting wires, and doesnt take long, so we should not let crew do it while the nuke is armed. You can however get to it, without the special screwdriver, if you put the NAD in.
+ to_chat(user, "The [core] won't budge, metal clamps keep it in!")
+ return
+ user.visible_message("[user] starts to pull [core] out of the [src]!", "You start to pull [core] out of the [src]!")
+ if(do_after(user, 50, target = src))
+ user.visible_message("[user] pulls [core] out of the [src]!", "You pull [core] out of the [src]! Might want to put it somewhere safe.")
+ core.forceMove(loc)
+ core = null
+
+ else
+ wires.Interact(user)
else
ui_interact(user)
@@ -303,6 +382,9 @@ GLOBAL_VAR(bomb_set)
if(safety)
to_chat(usr, "The safety is still on.")
return
+ if(!core)
+ to_chat(usr, "The [src]'s screen blinks red! There is no plutonium core in the [src]!")
+ return
timing = !(timing)
if(timing)
if(!lighthack)
@@ -465,3 +547,7 @@ GLOBAL_VAR(bomb_set)
#undef NUKE_SEALANT_OPEN
#undef NUKE_UNWRENCHED
#undef NUKE_MOBILE
+#undef NUKE_CORE_EVERYTHING_FINE
+#undef NUKE_CORE_PANEL_EXPOSED
+#undef NUKE_CORE_PANEL_UNWELDED
+#undef NUKE_CORE_FULLY_EXPOSED
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 0abf8183429..126ec28a686 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -390,7 +390,9 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective)
if(length(O.protected_jobs))
explanation_text += "It may also be in the possession of the [english_list(O.protected_jobs, and_text = " or ")]."
if(istype(O, /datum/theft_objective/supermatter_sliver))
- give_supermatter_kit()
+ give_kit(/obj/item/storage/box/syndie_kit/supermatter)
+ if(istype(O, /datum/theft_objective/plutonium_core))
+ give_kit(/obj/item/storage/box/syndie_kit/nuke)
return
explanation_text = "Free Objective."
@@ -413,7 +415,9 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective)
steal_target = new new_target
explanation_text = "Steal [steal_target.name]."
if(istype(steal_target, /datum/theft_objective/supermatter_sliver))
- give_supermatter_kit()
+ give_kit(/obj/item/storage/box/syndie_kit/supermatter)
+ if(istype(steal_target, /datum/theft_objective/plutonium_core))
+ give_kit(/obj/item/storage/box/syndie_kit/nuke)
return steal_target
/datum/objective/steal/check_completion()
@@ -431,9 +435,9 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective)
if(I.type in steal_target.altitems)
return steal_target.check_special_completion(I)
-/datum/objective/steal/proc/give_supermatter_kit()
+/datum/objective/steal/proc/give_kit(obj/item/item_path)
var/mob/living/carbon/human/mob = owner.current
- var/I = new /obj/item/storage/box/syndie_kit/supermatter
+ var/I = new item_path
var/list/slots = list(
"backpack" = slot_in_backpack,
"left pocket" = slot_l_store,
@@ -443,10 +447,10 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective)
)
var/where = mob.equip_in_one_of_slots(I, slots)
if(where)
- to_chat(mob, "
In your [where] is a box containing items and instructions to help you obtain a sliver of the supermatter.
")
+ to_chat(mob, "
In your [where] is a box containing items and instructions to help you with your steal objective.
")
else
- to_chat(mob, "Unfortunately, you weren't able to get a supermatter sliver stealing kit. This is very bad and you should adminhelp immediately (press F1).")
- message_admins("[ADMIN_LOOKUPFLW(mob)] Failed to spawn with their supermatter sliver harvesting kit.")
+ to_chat(mob, "Unfortunately, you weren't able to get a stealing kit. This is very bad and you should adminhelp immediately (press F1).")
+ message_admins("[ADMIN_LOOKUPFLW(mob)] Failed to spawn with their [item_path] theft kit.")
/datum/objective/steal/exchange
martyr_compatible = 0
diff --git a/code/game/gamemodes/steal_items.dm b/code/game/gamemodes/steal_items.dm
index 3bae32f168a..974a029b0ee 100644
--- a/code/game/gamemodes/steal_items.dm
+++ b/code/game/gamemodes/steal_items.dm
@@ -139,11 +139,16 @@
location_override = "the Warden's Office"
/datum/theft_objective/supermatter_sliver
- name = "a supermatter shard"
+ name = "a supermatter sliver"
typepath = /obj/item/nuke_core/supermatter_sliver
protected_jobs = list("Chief Engineer", "Engineer", "Atmospheric Technician") //Unlike other steal objectives, all jobs in the department have easy access, and would not be noticed at all stealing this
location_override = "Engineering. You can use the box and instructions provided to harvest the sliver."
+/datum/theft_objective/plutonium_core
+ name = "the plutonium core from the stations nuclear device"
+ typepath = /obj/item/nuke_core/plutonium
+ location_override = "the Vault. You can use the box and instructions provided to remove the core, with some extra tools."
+
/datum/theft_objective/number
var/min=0
var/max=0
diff --git a/code/game/objects/items/theft_items.dm b/code/game/objects/items/theft_items.dm
index 98f65b844f0..d47932f3515 100644
--- a/code/game/objects/items/theft_items.dm
+++ b/code/game/objects/items/theft_items.dm
@@ -1,9 +1,9 @@
//Items for nuke theft, supermatter theft traitor objective
-// STEALING THE NUKE, this is disabled currently, as I don't think we need an objective to steal the nuclear device. The items work fine, just you wont be able to screw the nuke, get the core, nor does it have a core in it
+// STEALING THE NUKE
-//the nuke core - objective item
+//the nuke core, base item
/obj/item/nuke_core
name = "plutonium core"
desc = "Extremely radioactive. Wear goggles."
@@ -39,6 +39,8 @@
user.visible_message("[user] is rubbing [src] against [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!")
return TOXLOSS
+/obj/item/nuke_core/plutonium //The steal objective, so it doesnt mess with the SM sliver on pinpointers and objectives
+
//nuke core box, for carrying the core
/obj/item/nuke_core_container
name = "nuke core container"
@@ -46,20 +48,20 @@
icon = 'icons/obj/nuke_tools.dmi'
icon_state = "core_container_empty"
item_state = "metal"
- var/obj/item/nuke_core/core
+ var/obj/item/nuke_core/plutonium/core
/obj/item/nuke_core_container/Destroy()
QDEL_NULL(core)
return ..()
-/obj/item/nuke_core_container/proc/load(obj/item/nuke_core/ncore, mob/user)
+/obj/item/nuke_core_container/proc/load(obj/item/nuke_core/plutonium/ncore, mob/user)
if(core || !istype(ncore))
return FALSE
ncore.forceMove(src)
core = ncore
icon_state = "core_container_loaded"
to_chat(user, "Container is sealing...")
- addtimer(CALLBACK(src, .proc/seal), 50)
+ addtimer(CALLBACK(src, .proc/seal), 10 SECONDS)
return TRUE
/obj/item/nuke_core_container/proc/seal()
@@ -70,7 +72,7 @@
if(ismob(loc))
to_chat(loc, "[src] is permanently sealed, [core]'s radiation is contained.")
-/obj/item/nuke_core_container/attackby(obj/item/nuke_core/core, mob/user)
+/obj/item/nuke_core_container/attackby(obj/item/nuke_core/plutonium/core, mob/user)
if(istype(core))
if(!user.drop_item())
to_chat(user, "The [core] is stuck to your hand!")
@@ -91,17 +93,18 @@
random_color = FALSE
/obj/item/paper/guides/antag/nuke_instructions
- info = "How to break into a Nanotrasen self-destruct terminal and remove its plutonium core:
\
+ info = "How to break into a Nanotrasen nuclear device and remove its plutonium core:
\