Adds the Nuclear training bomb, second try (#25352)

* Adds the Nuclear training bomb

* boxstation

* other maps

* moved camera

* missing cable

* last fixes

* delta, last fix

* Update code/datums/wires/nuclearbomb_wires.dm

Co-authored-by: Charlie Nolan <funnyman3595@gmail.com>
Signed-off-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* cyberiad missing floor

---------

Signed-off-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Charlie Nolan <funnyman3595@gmail.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Henri215
2024-05-14 12:53:00 +00:00
committed by GitHub
co-authored by Charlie Nolan Burzah
parent 69f20e250b
commit 9e04910ce6
17 changed files with 854 additions and 353 deletions
+50 -24
View File
@@ -1,11 +1,12 @@
/datum/wires/nuclearbomb
holder_type = /obj/machinery/nuclearbomb
labelled = TRUE
randomize = TRUE
wire_count = 7 // 3 actual, 4 duds.
wire_count = 5
proper_name = "Nuclear bomb"
/datum/wires/nuclearbomb/New(atom/_holder)
wires = list(WIRE_BOMB_LIGHT, WIRE_BOMB_TIMING, WIRE_BOMB_SAFETY)
wires = list(WIRE_NUKE_SAFETY, WIRE_NUKE_DETONATOR, WIRE_NUKE_DISARM, WIRE_NUKE_LIGHT, WIRE_NUKE_CONTROL)
return ..()
/datum/wires/nuclearbomb/interactable(mob/user)
@@ -18,39 +19,64 @@
. = ..()
var/obj/machinery/nuclearbomb/N = holder
. += "The device is [N.timing ? "shaking!" : "still."]"
. += "The device is [N.safety ? "quiet" : "whirring"]."
. += "The lights are [N.lighthack ? "static" : "functional"]."
. += "The control panel is [is_cut(WIRE_NUKE_CONTROL) ? "turned off" : "functional"]."
. += "The disarm controls are [is_cut(WIRE_NUKE_DISARM) || is_cut(WIRE_NUKE_CONTROL) ? "disabled" : "functional"]."
. += "The safety controls are [is_cut(WIRE_NUKE_SAFETY) || is_cut(WIRE_NUKE_CONTROL) ? "disabled" : "functional"]."
. += "The lights are [is_cut(WIRE_NUKE_LIGHT) ? "static" : "functional"]."
/datum/wires/nuclearbomb/on_pulse(wire)
var/obj/machinery/nuclearbomb/N = holder
switch(wire)
if(WIRE_BOMB_LIGHT)
N.lighthack = !N.lighthack
addtimer(CALLBACK(N, TYPE_PROC_REF(/obj/machinery/nuclearbomb, reset_lighthack_callback)), 10 SECONDS)
if(WIRE_NUKE_SAFETY)
if(!is_cut(WIRE_NUKE_CONTROL))
N.audible_message("<span class='notice'>The safety controls flicker.</span>", hearing_distance = 1)
if(WIRE_BOMB_TIMING)
if(WIRE_NUKE_DETONATOR)
if(N.timing)
message_admins("[key_name_admin(usr)] pulsed a nuclear bomb's detonation wire, causing it to explode (<A href='byond://?_src_=holder;adminplayerobservecoodjump=1;X=[holder.x];Y=[holder.y];Z=[holder.z]'>JMP</a>)")
if(!N.training)
message_admins("[key_name_admin(usr)] pulsed a nuclear bomb's detonator wire, causing it to explode (<a href='byond://?_src_=holder;adminplayerobservecoodjump=1;X=[holder.x];Y=[holder.y];Z=[holder.z]'>JMP</a>)")
N.explode()
else
N.audible_message("<span class='warning'>[N] whirrs ominously.</span>", hearing_distance = 1)
if(WIRE_BOMB_SAFETY)
N.safety = !N.safety
addtimer(CALLBACK(N, TYPE_PROC_REF(/obj/machinery/nuclearbomb, reset_safety_callback)), 10 SECONDS)
if(WIRE_NUKE_DISARM)
if(N.timing && is_cut(WIRE_NUKE_CONTROL))
if(!is_cut(WIRE_NUKE_LIGHT))
N.icon_state = N.sprite_prefix + "nuclearbomb1"
N.timing = FALSE
N.audible_message("<span class='boldnotice'>The timer on [N] stops!</span>", hearing_distance = 1)
N.update_icon(UPDATE_OVERLAYS)
if(!N.training)
GLOB.bomb_set = FALSE
if(!N.is_syndicate && !N.training)
SSsecurity_level.set_level(N.previous_level)
else if(N.timing && !is_cut(WIRE_NUKE_CONTROL))
N.audible_message("<span class='boldnotice'>The disarm controls flash with an error. You need to disable the control panel first!</span>", hearing_distance = 1)
else if(!is_cut(WIRE_NUKE_CONTROL))
N.audible_message("<span class='notice'>The disarm controls flicker.</span>", hearing_distance = 1)
if(WIRE_NUKE_LIGHT)
N.audible_message("<span class='notice'>The lights on [N] flicker.</span>", hearing_distance = 1)
flick(N.sprite_prefix + "nuclearbombc", N)
if(WIRE_NUKE_CONTROL)
N.audible_message("<span class='notice'>[N]'s control panel flickers.</span>", hearing_distance = 1)
/datum/wires/nuclearbomb/on_cut(wire, mend)
var/obj/machinery/nuclearbomb/N = holder
switch(wire)
if(WIRE_BOMB_SAFETY)
if(N.timing)
message_admins("[key_name_admin(usr)] cut a nuclear bomb's timing wire, causing it to explode (<A href='byond://?_src_=holder;adminplayerobservecoodjump=1;X=[holder.x];Y=[holder.y];Z=[holder.z]'>JMP</a>)")
if(WIRE_NUKE_DETONATOR)
if(N.timing && !mend)
if(!N.training)
message_admins("[key_name_admin(usr)] cut a nuclear bomb's detonator wire, causing it to explode (<a href='byond://?_src_=holder;adminplayerobservecoodjump=1;X=[holder.x];Y=[holder.y];Z=[holder.z]'>JMP</a>)")
N.explode()
if(WIRE_BOMB_TIMING)
if(!N.lighthack)
if(N.icon_state == "nuclearbomb2")
N.icon_state = "nuclearbomb1"
N.timing = FALSE
GLOB.bomb_set = FALSE
if(WIRE_BOMB_LIGHT)
N.lighthack = !N.lighthack
if(WIRE_NUKE_LIGHT)
if(!mend)
N.icon_state = N.sprite_prefix + "nuclearbomb0"
if(mend)
if(N.timing)
N.icon_state = N.sprite_prefix + "nuclearbomb2"
else
N.icon_state = N.sprite_prefix + "nuclearbomb1"
N.update_icon(UPDATE_OVERLAYS)
+4
View File
@@ -2,6 +2,8 @@
/datum/wires
/// TRUE if the wires will be different every time a new wire datum is created.
var/randomize = FALSE
/// TRUE if the wires are labelled for every user
var/labelled = FALSE
/// The atom the wires belong too. For example: an airlock.
var/atom/holder
/// The holder type; used to make sure that the holder is the correct type.
@@ -281,6 +283,8 @@
var/can_probably_see_wires = FALSE
var/obj/item/held_item = user.get_active_hand()
var/obj/item/offhand = user.get_inactive_hand()
if(labelled)
can_probably_see_wires = TRUE
if(istype(held_item) && HAS_TRAIT(held_item, TRAIT_SHOW_WIRE_INFO))
can_probably_see_wires = TRUE
if(istype(offhand) && HAS_TRAIT(offhand, TRAIT_SHOW_WIRE_INFO))