Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative nuclear deployment method #572

Merged
merged 10 commits into from
Nov 30, 2024
85 changes: 85 additions & 0 deletions code/game/machinery/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,88 @@ GLOBAL_VAR_INIT(bomb_set, FALSE)

decrypting = FALSE
announce_to_players()

/obj/structure/machinery/nuclearbomb/ADM
name = "\improper Tactical Atomic Demolition Munition"
desc = "Commonly referred to as a 'nuclear landmine' and colloquially as 'Heinz' for its cylindrical shape. The Mk-214 TADM is designed for discrete deployment in an area of operations to completely clear a several-mile radius around the blast point."
icon = 'icons/obj/items/marine-items.dmi'
icon_state = "adm"
pixel_x = 0
var/source_type = /obj/item/ADM

/obj/structure/machinery/nuclearbomb/ADM/attackby(obj/item/item, mob/user)
if(HAS_TRAIT(item, TRAIT_TOOL_MULTITOOL))
if(user.action_busy)
return
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_NOVICE))
to_chat(user, SPAN_WARNING("You do not know how to pack up [src] using a security tuner..."))
return
user.visible_message(SPAN_NOTICE("[user] starts packing up [src]."), \
SPAN_NOTICE("You begin packing up [src]..."))
playsound(loc, 'sound/items/Crowbar.ogg', 25, 1)
if(do_after(user, 5 SECONDS, INTERRUPT_NO_NEEDHAND, BUSY_ICON_FRIENDLY, src))
collapse(usr)
else
to_chat(user, SPAN_WARNING("You stop packing up [src]."))
return ..()

/obj/structure/machinery/nuclearbomb/ADM/proc/collapse(mob/living/carbon/human/user)
var/obj/item/ADM = new source_type(loc)
if(istype(user))
user.visible_message(SPAN_NOTICE("[user] packs up [src]."),
SPAN_NOTICE("You pack up [src]."))
user.put_in_active_hand(ADM)
qdel(src)

// ADM in hands
/obj/item/ADM
name = "Mk-214 Tactical Atomic Demolition Munition"
desc = "A packed-up TADM awaiting deployment to bring some serious pain. Includes the console and arming keys for the warhead."
w_class = SIZE_LARGE
flags_equip_slot = SLOT_BACK
flags_item = SMARTGUNNER_BACKPACK_OVERRIDE
icon_state = "admpacked"
item_state = "admpacked"
icon = 'icons/obj/items/marine-items.dmi'

/obj/item/ADM/attack_self(mob/user)
. = ..()

if(SSinterior.in_interior(user))
to_chat(usr, SPAN_WARNING("It's too cramped in here to deploy \a [src]."))
return
var/turf/T = get_step(user, user.dir)
BonniePandora marked this conversation as resolved.
Show resolved Hide resolved
var/blocked = FALSE
for(var/obj/O in T)
if(O.density)
AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
blocked = TRUE
break
for(var/mob/M in T)
blocked = TRUE
break
if(istype(T, /turf/open))
var/turf/open/floor = T
if(!floor.allow_construction)
to_chat(user, SPAN_WARNING("You cannot deploy \a [src] here, find a more secure surface!"))
return FALSE
else
blocked = TRUE
if(blocked)
to_chat(usr, SPAN_WARNING("You need a clear, open area to deploy \a [src], something is blocking the way in front of you!"))
return

if(usr.action_busy)
return
user.visible_message(SPAN_NOTICE("[user] begins deploying [src]."),
SPAN_NOTICE("You begin deploying [src]."))
playsound(loc, list('sound/handling/armorequip_1.ogg', 'sound/handling/armorequip_2.ogg'), 25, 1)
if(!do_after(user, 5 SECONDS, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
to_chat(user, SPAN_WARNING("You were interrupted."))
return
user.visible_message(SPAN_NOTICE("[user] has finished deploying [src]."),
SPAN_NOTICE("You finish deploying [src]."))

var/obj/structure/machinery/nuclearbomb/ADM/planted = new(user.loc)
BonniePandora marked this conversation as resolved.
Show resolved Hide resolved
planted.update_icon()
planted.forceMove(get_turf(T))
BonniePandora marked this conversation as resolved.
Show resolved Hide resolved
qdel(src)
Binary file modified icons/mob/humans/onmob/back.dmi
Binary file not shown.
Binary file modified icons/obj/items/marine-items.dmi
Binary file not shown.