Skip to content

Commit

Permalink
Alternative nuclear deployment method (#572)
Browse files Browse the repository at this point in the history
Co-authored-by: AndroBetel <[email protected]>
  • Loading branch information
BonniePandora and AndroBetel authored Nov 30, 2024
1 parent a708590 commit fd03103
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions code/game/machinery/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,87 @@ 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/Tile = get_step(user, user.dir)
var/blocked = FALSE
for(var/obj/Obj in Tile)
if(Obj.density)
blocked = TRUE
break
for(var/mob/Mob in Tile)
blocked = TRUE
break
if(istype(Tile, /turf/open))
var/turf/open/floor = Tile
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(Tile)
planted.update_icon()
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.

0 comments on commit fd03103

Please sign in to comment.