Skip to content

Commit

Permalink
add: stealthbox (#3673)
Browse files Browse the repository at this point in the history
  • Loading branch information
NuSanya authored Oct 25, 2023
1 parent e13cbe1 commit 1698052
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/datums/uplink_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,13 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
cost = 12
surplus = 90

/datum/uplink_item/implants/stealthbox
name = "Stealth Implant"
desc = "An implant injected into the body, and later activated manually to deploy a box, fully hiding you in the surroundings. Can be used indefinitely"
reference = "SB"
item = /obj/item/implanter/stealth
cost = 8

// Cybernetics
/datum/uplink_item/cyber_implants
category = "Cybernetic Implants"
Expand Down
100 changes: 100 additions & 0 deletions code/game/objects/items/weapons/implants/implant_stealth.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/obj/item/implanter/stealth
name = "implanter (stealth)"

/obj/item/implanter/stealth/New()
imp = new /obj/item/implant/agent_box(src)
..()

/obj/item/implantcase/stealth
name = "implant case - 'Stealth Box'"
desc = "A glass case containing a stealth box implant."

/obj/item/implantcase/stealth/New()
imp = new /obj/item/implant/agent_box(src)
..()

/obj/item/implant/agent_box
name = "Deploy Box"
desc = "Find inner peace, here, in the box."
icon_state = "deploy_box"
item_color = "r"
origin_tech = "materials=6;bluespace=4;magnets=4;syndicate=2"
// type of box this spawns
var/boxtype = /obj/structure/closet/cardboard/agent
COOLDOWN_DECLARE(box_cooldown)

/obj/item/implant/agent_box/activate()
if(imp_in.IsParalyzed() || imp_in.IsStunned() || imp_in.IsWeakened() || imp_in.restrained())
return
if(istype(imp_in.loc, /obj/structure/closet/cardboard/agent))
var/obj/structure/closet/cardboard/agent/box = imp_in.loc
if(box.open())
imp_in.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
return
//Box closing from here on out.
if(!isturf(imp_in.loc)) //Don't let the player use this to escape mechs/welded closets.
to_chat(imp_in, span_warning("You need more space to activate this implant!"))
return
if(!COOLDOWN_FINISHED(src, box_cooldown))
return
COOLDOWN_START(src, box_cooldown, 10 SECONDS)
var/box = new boxtype(imp_in.drop_location())
imp_in.forceMove(box)
imp_in.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)

/obj/item/implant/ui_action_click()
activate()

// the box.
/obj/structure/closet/cardboard/agent
name = "inconspicious box"
desc = "It's so normal that you didn't notice it before."
icon_state = "agentbox"
max_integrity = 1
material_drop = null

/obj/structure/closet/cardboard/agent/Initialize(mapload)
. = ..()
go_invisible()

/obj/structure/closet/cardboard/agent/proc/go_invisible()
animate(src, alpha = 0, time = 20)

/obj/structure/closet/cardboard/agent/after_open(mob/living/user)
. = ..()
qdel(src)

/obj/structure/closet/cardboard/agent/process()
alpha = max(0, alpha - 50)

/obj/structure/closet/cardboard/agent/proc/reveal()
alpha = 255
addtimer(CALLBACK(src, PROC_REF(go_invisible)), 10, TIMER_OVERRIDE|TIMER_UNIQUE)

/obj/structure/closet/cardboard/agent/Bump(atom/A)
. = ..()
if(isliving(A))
reveal()

/obj/structure/closet/cardboard/agent/Bumped(atom/movable/A)
. = ..()
if(isliving(A))
reveal()

/obj/structure/closet/cardboard/agent/open()
if(opened || !can_open())
return 0
if(!egged)
var/mob/living/Snake = null
for(var/mob/living/L in src.contents)
Snake = L
break
if(Snake)
var/list/alerted = viewers(7,src)
if(alerted)
for(var/mob/living/L in alerted)
if(!L.stat)
L.do_alert_animation(L)
egged = 1
alerted << sound('sound/misc/mgs_sound.ogg')
..()
5 changes: 5 additions & 0 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@
else
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
density = 0
after_open()
return TRUE

///Proc to override for effects after opening a door
/obj/structure/closet/proc/after_open(mob/living/user, force = FALSE)
return

/obj/structure/closet/proc/close()
if(!opened || !can_close())
return FALSE
Expand Down
Binary file modified icons/obj/cardboard_boxes.dmi
Binary file not shown.
Binary file modified icons/obj/implants.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@
#include "code\game\objects\items\weapons\implants\implant_krav_maga.dm"
#include "code\game\objects\items\weapons\implants\implant_mindshield.dm"
#include "code\game\objects\items\weapons\implants\implant_misc.dm"
#include "code\game\objects\items\weapons\implants\implant_stealth.dm"
#include "code\game\objects\items\weapons\implants\implant_storage.dm"
#include "code\game\objects\items\weapons\implants\implant_track.dm"
#include "code\game\objects\items\weapons\implants\implant_traitor.dm"
Expand Down
Binary file added sound/misc/box_deploy.ogg
Binary file not shown.
Binary file added sound/misc/mgs_sound.ogg
Binary file not shown.

0 comments on commit 1698052

Please sign in to comment.