The Crate Animatening, A.K.A. I hate Crate Trigonometry (#13339)

This commit is contained in:
Wowzewow (Wezzy)
2022-04-30 13:04:15 +08:00
committed by GitHub
parent 74db3d4d24
commit a65ef5cd26
91 changed files with 1250 additions and 2023 deletions

View File

@@ -12,6 +12,7 @@
#define CABLE_LAYER 2.44
#define ABOVE_CABLE_LAYER (CABLE_LAYER + 0.1)
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
#define BELOW_OBJ_LAYER 2.9
#define ABOVE_OBJ_LAYER 3.01
#define UNDERDOOR 3.09 //Just barely under a closed door.
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
@@ -46,4 +47,4 @@
#define BLOB_NODE_LAYER 4.12
#define BLOB_CORE_LAYER 4.13
#define CLICKCATCHER_PLANE -100
#define CLICKCATCHER_PLANE -100

View File

@@ -48,7 +48,7 @@ var/hadevent = 0
for (var/obj/structure/closet/secure_closet/brig/temp_closet in A)
temp_closet.locked = 0
temp_closet.icon_state = temp_closet.icon_closed
temp_closet.update_icon()
for (var/obj/machinery/door/airlock/security/temp_airlock in A)
spawn(0) temp_airlock.prison_open()

View File

@@ -109,7 +109,7 @@
if(C.broken) continue
if(C.opened && !C.close()) continue
C.locked = 1
C.icon_state = C.icon_locked
C.update_icon()
timing = 1
@@ -139,7 +139,7 @@
if(C.opened)
continue
C.locked = 0
C.icon_state = C.icon_closed
C.update_icon()
if(broadcast)
broadcast_security_hud_message("The timer for [id] has expired.", src)

View File

@@ -548,7 +548,7 @@
secondarytargets += L
/obj/machinery/porta_turret/proc/assess_and_assign_closet(var/obj/structure/closet/C, var/list/targets, var/list/secondarytargets)
if(is_type_in_list(C,list(/obj/structure/closet/statue,/obj/structure/closet/hydrant,/obj/structure/closet/walllocker)))
if(is_type_in_list(C,list(/obj/structure/closet/statue,/obj/structure/closet/walllocker/firecloset,/obj/structure/closet/walllocker)))
return
if(!lethal)
return

View File

@@ -1,33 +0,0 @@
/obj/structure/walllocker
name = "Wall Locker"
icon = 'icons/obj/lockwall.dmi'
icon_state = "emerg"
var/list/spawnitems = list()
anchored = 1
var/amount = 3 // spawns each items X times.
/obj/structure/walllocker/attack_hand(mob/user as mob)
if (istype(user, /mob/living/silicon/ai)) //Added by Strumpetplaya - AI shouldn't be able to
return //activate emergency lockers. This fixes that. (Does this make sense, the AI can't call attack_hand, can it? --Mloc)
if(!amount)
to_chat(usr, "It's empty..")
return
if(amount)
for(var/path in spawnitems)
new path(src.loc)
amount--
return
/obj/structure/walllocker/emerglocker
name = "Emergency Locker"
spawnitems = list(/obj/item/tank/emergency_oxygen,/obj/item/clothing/mask/breath,/obj/item/crowbar)
/obj/structure/walllocker/emerglocker/north
pixel_y = 32
dir = SOUTH
/obj/structure/walllocker/emerglocker/south
pixel_y = -32
dir = NORTH
/obj/structure/walllocker/emerglocker/west
pixel_x = -32
dir = WEST
/obj/structure/walllocker/emerglocker/east
pixel_x = 32
dir = EAST

View File

@@ -102,3 +102,10 @@
/obj/effect/overlay/temp/explosion/fast
icon_state = "explosionfast"
duration = 4
/obj/effect/overlay/closet_door
anchored = TRUE
plane = FLOAT_PLANE
layer = FLOAT_LAYER
vis_flags = VIS_INHERIT_ID
appearance_flags = KEEP_TOGETHER | LONG_GLIDE | PIXEL_SCALE

View File

@@ -57,8 +57,6 @@
desc = "Special air bubble designed to protect people inside of it from decompressed environments. Has an integrated cooling unit to preserve a stable temperature inside. Requires a power cell to operate."
icon = 'icons/obj/airbubble.dmi'
icon_state = "airbubble"
icon_closed = "airbubble"
icon_opened = "airbubble_open"
open_sound = 'sound/items/zip.ogg'
close_sound = 'sound/items/zip.ogg'
var/item_path = /obj/item/airbubble
@@ -157,7 +155,7 @@
dump_contents()
icon_state = icon_opened
update_icon()
opened = 1
playsound(loc, open_sound, 15, 1, -3)
density = 0
@@ -178,7 +176,7 @@
if(store_mobs)
stored_units += store_mobs(stored_units)
icon_state = icon_closed
update_icon()
opened = 0
playsound(loc, close_sound, 25, 0, -3)
@@ -225,10 +223,10 @@
bag.desc += " <span class='notice'>It appears to be poorly hand folded.</span>"
if(ripped)
bag.icon_state = "[icon_closed]_man_folded_ripped"
bag.icon_state = "[icon_state]_man_folded_ripped"
bag.desc += " <span class='danger'>It has hole in it! Maybe you shouldn't use it!</span>"
else
bag.icon_state = "[icon_closed]_man_folded"
bag.icon_state = "[icon_state]_man_folded"
qdel(src)
return
@@ -492,15 +490,13 @@
/obj/structure/closet/airbubble/update_icon()
cut_overlays()
if(opened)
icon_state = icon_opened
else if(ripped)
if(ripped)
name = "ripped air bubble"
icon_state = "[icon_closed]_ripped"
icon_state = "[icon_state]_ripped"
else
icon_state = icon_closed
icon_state = "[initial(icon_state)][opened ? "_open" : ""]"
if(zipped)
add_overlay("[icon_closed]_restrained")
add_overlay("[icon_state]_restrained")
add_overlay("pressure_[(use_internal_tank) ?("on") : ("off") ]")
// Process transfer of air from the tank. Handle if it is ripped open.
@@ -629,8 +625,5 @@
name = "air bubble"
desc = "Special air bubble designed to protect people inside of it from decompressed environments. Has an integrated cooling unit to preserve a stable temperature inside. Requires a power cell to operate. This does not seem like a regular color scheme."
icon_state = "airbubble_syndie"
icon_closed = "airbubble_syndie"
icon_closed = "airbubble_syndie"
icon_opened = "airbubble_syndie_open"
item_path = /obj/item/airbubble/syndie
syndie = TRUE

View File

@@ -50,16 +50,13 @@
name = "body bag"
desc = "A plastic bag designed for the storage and transportation of cadavers."
icon = 'icons/obj/bodybag.dmi'
icon_state = "bodybag_closed"
icon_closed = "bodybag_closed"
icon_opened = "bodybag_open"
icon_state = "bodybag"
open_sound = 'sound/items/zip.ogg'
close_sound = 'sound/items/zip.ogg'
density = 0
storage_capacity = 30
var/item_path = /obj/item/bodybag
var/contains_body = 0
var/shapely = TRUE
var/contains_body = FALSE
can_be_buckled = TRUE
/obj/structure/closet/body_bag/content_info(mob/user, content_size)
@@ -147,20 +144,16 @@
qdel(src)
/obj/structure/closet/body_bag/update_icon()
if(opened)
icon_state = icon_opened
else
if(contains_body > 0 && shapely)
icon_state = "bodybag_closed1"
else
icon_state = icon_closed
icon_state = "[initial(icon_state)][opened ? "_open" : "[contains_body ? "_occupied" : ""]"]"
/obj/structure/closet/body_bag/animate_door()
flick("[initial(icon_state)]_anim_[opened ? "open" : "close"]", src)
/obj/item/bodybag/cryobag
name = "stasis bag"
desc = "A folded, reusable bag designed to prevent additional damage to an occupant, especially useful if short on time or in \
a hostile enviroment."
icon = 'icons/obj/cryobag.dmi'
icon_state = "bodybag_folded"
icon_state = "stasis_folded"
origin_tech = list(TECH_BIO = 4)
deploy_type = /obj/structure/closet/body_bag/cryobag
var/stasis_power
@@ -173,11 +166,8 @@
name = "stasis bag"
desc = "A reusable plastic bag designed to prevent additional damage to an occupant, especially useful if short on time or in \
a hostile enviroment."
icon = 'icons/obj/cryobag.dmi'
icon_opened = "stasis_open"
icon_closed = "stasis_closed"
icon_state = "stasis"
item_path = /obj/item/bodybag/cryobag
shapely = FALSE
var/datum/gas_mixture/airtank
var/stasis_power = 20
@@ -209,7 +199,7 @@
/obj/structure/closet/body_bag/cryobag/update_icon()
..()
overlays.Cut()
var/image/I = image(icon, "indicator[opened]")
var/image/I = image(icon, "indicator")
I.appearance_flags = RESET_COLOR
var/maxstasis = initial(stasis_power)
if(stasis_power > 0.5 * maxstasis)
@@ -261,6 +251,6 @@
/obj/item/usedcryobag
name = "used stasis bag"
desc = "Pretty useless now.."
icon_state = "bodybag_used"
icon = 'icons/obj/cryobag.dmi'
desc = "Pretty useless now."
icon_state = "cryobag_used"
icon = 'icons/obj/bodybag.dmi'

View File

@@ -2,37 +2,62 @@
name = "closet"
desc = "It's a basic storage unit."
icon = 'icons/obj/closet.dmi'
icon_state = "closed"
density = 1
w_class = ITEMSIZE_HUGE
layer = OBJ_LAYER - 0.01
icon_state = "generic"
density = TRUE
build_amt = 2
var/icon_closed = "closed"
var/icon_opened = "open"
var/welded_overlay_state = "welded"
var/opened = 0
var/welded = 0
var/wall_mounted = 0 //never solid (You can always pass over it)
slowdown = 5
var/icon_door = null
var/icon_door_override = FALSE //override to have open overlay use icon different to its base's
var/icon_door_overlay = "" //handles secure locker overlays like the locking lights
var/secure = FALSE //secure locker or not. typically it shouldn't need lights if it's insecure
var/secure_lights = FALSE // whether to display secure lights when open.
var/opened = FALSE
var/welded = FALSE
var/locked = FALSE
var/broken = FALSE
var/large = TRUE // if you can shove people in it
var/canbemoved = FALSE // if it can be moved by people using the right tools. basically means if you can change the anchored var.
var/screwed = TRUE // if its screwed in place
var/wrenched = TRUE // if its wrenched down
var/wall_mounted = FALSE //never solid (You can always pass over it)
var/health = 100
var/breakout = 0 //if someone is currently breaking out. mutex
var/storage_capacity = 40 //Tying this to mob sizes was dumb
//This is so that someone can't pack hundreds of items in a locker/crate
//then open it in a populated area to crash clients.
//This is so that someone can't pack hundreds of items in a locker/crate then open it in a populated area to crash clients.
var/open_sound = 'sound/effects/closet_open.ogg'
var/close_sound = 'sound/effects/closet_close.ogg'
var/open_sound_volume = 35
var/close_sound_volume = 50
var/store_misc = 1
var/store_items = 1
var/store_mobs = 1
var/store_misc = TRUE
var/store_items = TRUE
var/store_mobs = TRUE
var/store_structure = FALSE
var/dense_when_open = FALSE
var/maximum_mob_size = 15
var/const/default_mob_size = 15
var/obj/item/closet_teleporter/linked_teleporter
slowdown = 5
var/double_doors = FALSE
var/obj/effect/overlay/closet_door/door_obj
var/obj/effect/overlay/closet_door/door_obj_alt
var/is_animating_door = FALSE
var/door_underlay = FALSE //used if you want to have an overlay below the door. used for guncabinets.
var/door_anim_squish = 0.12 // Multiplier on proc/get_door_transform. basically, how far you want this to swing out. value of 1 means the length of the door is unchanged (and will swing out of the tile), 0 means it will just slide back and forth.
var/door_anim_angle = 147
var/door_hinge = -6.5 // for closets, x away from the centre of the closet. typically good to add a 0.5 so it's centered on the edge of the closet.
var/door_hinge_alt = 6.5 // for closets with two doors. why a seperate var? because some closets may be weirdly shaped or something.
var/door_anim_time = 2.5 // set to 0 to make the door not animate at all
/obj/structure/closet/LateInitialize()
if (opened) // if closed, any item at the crate's loc is put in the contents
if(opened) // if closed, any item at the crate's loc is put in the contents
return
var/obj/I
for(I in loc)
@@ -49,8 +74,11 @@
storage_capacity = content_size + 5
/obj/structure/closet/Initialize(mapload)
..()
. = ..()
update_icon()
fill()
if(secure)
verbs += /obj/structure/closet/proc/verb_togglelock
return mapload ? INITIALIZE_HINT_LATELOAD : INITIALIZE_HINT_NORMAL
// Fill lockers with this.
@@ -96,14 +124,14 @@
return (!density)
/obj/structure/closet/proc/can_open()
if(welded)
if(welded || locked)
return 0
return 1
/obj/structure/closet/proc/can_close()
for(var/obj/structure/closet/closet in get_turf(src))
if(closet != src)
return 0
return 1
return 1
/obj/structure/closet/dump_contents()
@@ -123,16 +151,20 @@
/obj/structure/closet/proc/open()
if(opened)
return 0
if(!can_open())
return 0
dump_contents()
icon_state = icon_opened
if(climbable)
structure_shaken()
opened = TRUE
playsound(loc, open_sound, 25, 0, -3)
density = FALSE
dump_contents()
animate_door(FALSE)
if(double_doors)
animate_door_alt(FALSE)
update_icon()
playsound(loc, open_sound, open_sound_volume, 0, -3)
if(!dense_when_open)
density = FALSE
return 1
/obj/structure/closet/proc/close()
@@ -149,9 +181,14 @@
stored_units += store_items(stored_units)
if(store_mobs)
stored_units += store_mobs(stored_units)
icon_state = icon_closed
if(store_structure)
stored_units += store_structure(stored_units)
opened = FALSE
animate_door(TRUE)
if(double_doors)
animate_door_alt(TRUE)
update_icon()
if(linked_teleporter)
if(linked_teleporter.last_use + 600 > world.time)
return
@@ -162,11 +199,11 @@
if(did_teleport)
linked_teleporter.last_use = world.time
playsound(get_turf(src), close_sound, 25, 0, -3)
playsound(get_turf(src), close_sound, close_sound_volume, 0, -3)
density = initial(density)
return TRUE
//Cham Projector Exception
//Chem Projector Exception
/obj/structure/closet/proc/store_misc(var/stored_units)
var/added_units = 0
for(var/obj/effect/dummy/chameleon/AD in loc)
@@ -203,11 +240,25 @@
added_units += M.mob_size
return added_units
/obj/structure/closet/proc/store_structure(var/stored_units)
var/added_units = 0
for(var/obj/O in loc)
if((stored_units + added_units) > storage_capacity)
break
if(O.density || O.anchored || istype(O,/obj/structure/closet))
continue
if(istype(O, /obj/structure/bed))
var/obj/structure/bed/B = O
if(B.buckled)
continue
O.forceMove(src)
added_units++
return added_units
/obj/structure/closet/proc/toggle(mob/user as mob)
if(!(opened ? close() : open()))
to_chat(user, "<span class='notice'>It won't budge!</span>")
if(!(opened ? close(user) : open(user)))
to_chat(user, SPAN_WARNING("It won't budge!"))
return
update_icon()
return 1
/obj/structure/closet/ex_act(severity)
@@ -219,7 +270,7 @@
if(3)
health -= rand(30, 60)
if (health <= 0)
if(health <= 0)
for (var/atom/movable/A as mob|obj in src)
A.ex_act(severity + 1)
dump_contents()
@@ -259,40 +310,38 @@
CT.attached_closet = src
user.drop_from_inventory(CT, src)
return
if(W.isscrewdriver())
if(!linked_teleporter)
to_chat(user, SPAN_WARNING("There is nothing to remove with a screwdriver here."))
return
user.visible_message(SPAN_NOTICE("\The [user] starts detaching \the [linked_teleporter] from \the [src]..."), SPAN_NOTICE("You begin detaching \the [linked_teleporter] from \the [src]..."), range = 3)
if(do_after(user, 30, TRUE, src))
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [linked_teleporter] from \the [src]."), SPAN_NOTICE("You detach \the [linked_teleporter] from \the [src]."), range = 3)
linked_teleporter.attached_closet = null
user.put_in_hands(linked_teleporter)
linked_teleporter = null
return
if(opened)
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
return 0
if(W.isscrewdriver()) // Moved here so you can only detach linked teleporters when the door is open. So you can like unscrew and bolt the locker normally in most circumstances.
if(linked_teleporter)
user.visible_message(SPAN_NOTICE("\The [user] starts detaching \the [linked_teleporter] from \the [src]..."), SPAN_NOTICE("You begin detaching \the [linked_teleporter] from \the [src]..."), range = 3)
if(do_after(user, 30, TRUE, src))
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [linked_teleporter] from \the [src]."), SPAN_NOTICE("You detach \the [linked_teleporter] from \the [src]."), range = 3)
linked_teleporter.attached_closet = null
user.put_in_hands(linked_teleporter)
linked_teleporter = null
return
if(W.iswelder())
var/obj/item/weldingtool/WT = W
if(WT.isOn())
user.visible_message(
"<span class='warning'>[user] begins cutting [src] apart.</span>",
"<span class='notice'>You begin cutting [src] apart.</span>",
SPAN_WARNING("[user] begins cutting [src] apart."),
SPAN_NOTICE("You begin cutting [src] apart."),
"You hear a welding torch on metal."
)
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
if (!do_after(user, 2 SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_open)))
return
if(!WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return
else
user.visible_message(
"<span class='notice'>[src] has been cut apart by [user] with [WT].</span>",
"<span class='notice'>You cut apart [src] with [WT].</span>"
SPAN_NOTICE("[src] has been cut apart by [user] with [WT]."),
SPAN_NOTICE("You cut apart [src] with [WT].")
)
if(linked_teleporter)
linked_teleporter.forceMove(get_turf(src))
@@ -305,9 +354,9 @@
for(var/obj/item/I in LB.contents)
LB.remove_from_storage(I, T)
user.visible_message(
"<span class='notice'>[user] empties \the [LB] into \the [src].</span>",
"<span class='notice'>You empty \the [LB] into \the [src].</span>",
"<span class='notice'>You hear rustling of clothes.</span>"
SPAN_NOTICE("[user] empties \the [LB] into \the [src]."),
SPAN_NOTICE("You empty \the [LB] into \the [src]."),
SPAN_NOTICE("You hear rustling of clothes.")
)
return
if(!W.dropsafety())
@@ -324,35 +373,92 @@
var/obj/item/weldingtool/WT = W
if(WT.isOn())
user.visible_message(
"<span class='warning'>[user] begins welding [src] [welded ? "open" : "shut"].</span>",
"<span class='notice'>You begin welding [src] [welded ? "open" : "shut"].</span>",
SPAN_WARNING("[user] begins welding [src] [welded ? "open" : "shut"]."),
SPAN_NOTICE("You begin welding [src] [welded ? "open" : "shut"]."),
"You hear a welding torch on metal."
)
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
if (!do_after(user, 2/W.toolspeed SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_closed)))
return
if(!WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return
welded = !welded
update_icon()
user.visible_message(
"<span class='warning'>[src] has been [welded ? "welded shut" : "unwelded"] by [user].</span>",
"<span class='notice'>You weld [src] [!welded ? "open" : "shut"].</span>"
SPAN_WARNING("[src] has been [welded ? "welded shut" : "unwelded"] by [user]."),
SPAN_NOTICE("You weld [src] [!welded ? "open" : "shut"].")
)
else
attack_hand(user)
else if(W.isscrewdriver() && canbemoved)
if(screwed)
to_chat(user, SPAN_NOTICE("You start to unscrew \the [src] from the floor..."))
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 10/W.toolspeed SECONDS, act_target = src))
to_chat(user, SPAN_NOTICE("You unscrew the locker!"))
playsound(loc, W.usesound, 50, 1)
screwed = FALSE
else if(!screwed && wrenched)
to_chat(user, SPAN_NOTICE("You start to screw the \the [src] to the floor..."))
playsound(src, 'sound/items/welder.ogg', 80, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
to_chat(user, SPAN_NOTICE("You screw \the [src]!"))
playsound(loc, W.usesound, 50, 1)
screwed = TRUE
else if(W.iswrench() && canbemoved)
if(wrenched && !screwed)
to_chat(user, SPAN_NOTICE("You start to unfasten the bolts holding \the [src] in place..."))
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
to_chat(user, SPAN_NOTICE("You unfasten \the [src]'s bolts!"))
playsound(loc, W.usesound, 50, 1)
wrenched = FALSE
anchored = FALSE
else if(!wrenched)
to_chat(user, SPAN_NOTICE("You start to fasten the bolts holding the locker in place..."))
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
to_chat(user, SPAN_NOTICE("You fasten the \the [src]'s bolts!"))
playsound(loc, W.usesound, 50, 1)
wrenched = TRUE
anchored = TRUE
else if(istype(W, /obj/item/device/hand_labeler))
var/obj/item/device/hand_labeler/HL = W
if (HL.mode == 1)
if(HL.mode == 1)
return
else
attack_hand(user)
else if(istype(W,/obj/item/card/id) && secure)
togglelock(user)
// Secure locker cutting open stuff.
else if(!opened && secure)
if(!broken && istype(W,/obj/item/material/twohanded/chainsaw))
var/obj/item/material/twohanded/chainsaw/ChainSawVar = W
ChainSawVar.cutting = 1
user.visible_message(\
SPAN_DANGER("[user.name] starts cutting \the [src] with the [W]!"),\
SPAN_WARNING("You start cutting the [src]..."),\
SPAN_NOTICE("You hear a loud buzzing sound and metal grinding on metal...")\
)
if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, .proc/CanChainsaw, W)))
user.visible_message(\
SPAN_WARNING("[user.name] finishes cutting open \the [src] with the [W]."),\
SPAN_WARNING("You finish cutting open the [src]."),\
SPAN_NOTICE("You hear a metal clank and some sparks.")\
)
emag_act(INFINITY, user, SPAN_DANGER("\The [src] has been sliced open by [user] with \an [W]!"), SPAN_DANGER("You hear metal being sliced and sparks flying."))
ChainSawVar.cutting = 0
else if(istype(W, /obj/item/melee/energy/blade))//Attempt to cut open locker if locked
if(emag_act(INFINITY, user, SPAN_DANGER("\The [src] has been sliced open by [user] with \an [W]!"), SPAN_DANGER("You hear metal being sliced and sparks flying.")))
playsound(loc, 'sound/weapons/blade.ogg', 50, 1)
else
attack_hand(user)
else
attack_hand(user)
return
// helper procs for callbacks
/obj/structure/closet/proc/is_closed()
. = !opened
@@ -375,9 +481,17 @@
return
if(istype(O, /obj/structure/closet))
return
step_towards(O, loc)
if(user != O)
user.visible_message(SPAN_DANGER("<b>[user]</b> stuffs \the [O] into \the [src]!"), SPAN_NOTICE("You stuff \the [O] into \the [src]."), range = 3)
var/turf/T = get_turf(src)
if(ismob(O))
if(large)
user.visible_message(SPAN_DANGER("<b>[user]</b> stuffs \the [O] into \the [src]!"), SPAN_NOTICE("You stuff \the [O] into \the [src]."), range = 3)
O.forceMove(T)
close()
else
to_chat(user, SPAN_NOTICE("\The [src] is too small to stuff [O] into!"))
else
O.forceMove(T)
add_fingerprint(user)
return
@@ -390,11 +504,14 @@
return
if(!open())
to_chat(user, "<span class='notice'>It won't budge!</span>")
to_chat(user, SPAN_NOTICE("It won't budge!"))
/obj/structure/closet/attack_hand(mob/user as mob)
add_fingerprint(user)
return toggle(user)
if(locked)
togglelock(user)
else
toggle(user)
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
@@ -408,16 +525,114 @@
add_fingerprint(usr)
toggle(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
to_chat(usr, SPAN_WARNING("This mob type can't use this verb."))
/obj/structure/closet/update_icon()
if(!door_underlay)
cut_overlays()
/obj/structure/closet/update_icon()//Putting the welded stuff in update_icon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
cut_overlays()
if(!opened)
icon_state = icon_closed
layer = OBJ_LAYER
if(welded)
add_overlay(welded_overlay_state)
add_overlay("[icon_door_overlay]welded")
if(!is_animating_door)
if(icon_door)
add_overlay("[icon_door]_door")
if(double_doors)
add_overlay("[icon_door]_door_alt")
if(!icon_door)
add_overlay("[icon_state]_door")
if(double_doors)
add_overlay("[icon_state]_door_alt")
if(secure)
update_secure_overlays()
if(secure && secure_lights)
update_secure_overlays()
else if(opened)
layer = BELOW_OBJ_LAYER
if(!is_animating_door)
add_overlay("[icon_door_override ? icon_door : icon_state]_open")
if(secure && secure_lights)
update_secure_overlays()
/obj/structure/closet/proc/update_secure_overlays()
if(broken)
add_overlay("[icon_door_overlay]emag")
else
icon_state = icon_opened
if(locked)
add_overlay("[icon_door_overlay]locked")
else
add_overlay("[icon_door_overlay]unlocked")
/obj/structure/closet/proc/animate_door(var/closing = FALSE)
if(!door_anim_time)
return
if(!door_obj) door_obj = new
vis_contents |= door_obj
door_obj.icon = icon
door_obj.icon_state = "[icon_door || icon_state]_door"
is_animating_door = TRUE
var/num_steps = door_anim_time / world.tick_lag
for(var/I in 0 to num_steps)
var/angle = door_anim_angle * (closing ? 1 - (I/num_steps) : (I/num_steps))
var/matrix/M = get_door_transform(angle)
var/door_state = angle >= 90 ? "[icon_door_override ? icon_door : icon_state]_back" : "[icon_door || icon_state]_door"
var/door_layer = angle >= 90 ? FLOAT_LAYER : ABOVE_MOB_LAYER
if(I == 0)
door_obj.transform = M
door_obj.icon_state = door_state
door_obj.layer = door_layer
else if(I == 1)
animate(door_obj, transform = M, icon_state = door_state, layer = door_layer, time = world.tick_lag, flags = ANIMATION_END_NOW)
else
animate(transform = M, icon_state = door_state, layer = door_layer, time = world.tick_lag)
addtimer(CALLBACK(src,.proc/end_door_animation),door_anim_time,TIMER_UNIQUE|TIMER_OVERRIDE)
/obj/structure/closet/proc/end_door_animation()
is_animating_door = FALSE // comment this out and the line below to manually tweak the animation end state by fiddling with the door_anim vars to match the open door icon
vis_contents -= door_obj
update_icon()
compile_overlays(src)
/obj/structure/closet/proc/animate_door_alt(var/closing = FALSE)
if(!door_anim_time)
return
if(!door_obj_alt) door_obj_alt = new
vis_contents |= door_obj_alt
door_obj_alt.icon = icon
door_obj_alt.icon_state = "[icon_door || icon_state]_door_alt"
is_animating_door = TRUE
var/num_steps = door_anim_time / world.tick_lag
for(var/I in 0 to num_steps)
var/angle = door_anim_angle * (closing ? 1 - (I/num_steps) : (I/num_steps))
var/matrix/M = get_door_transform(angle, TRUE)
var/door_state = angle >= 90 ? "[icon_door_override ? icon_door : icon_state]_back_alt" : "[icon_door || icon_state]_door_alt"
var/door_layer = angle >= 90 ? FLOAT_LAYER : ABOVE_MOB_LAYER
if(I == 0)
door_obj_alt.transform = M
door_obj_alt.icon_state = door_state
door_obj_alt.layer = door_layer
else if(I == 1)
animate(door_obj_alt, transform = M, icon_state = door_state, layer = door_layer, time = world.tick_lag, flags = ANIMATION_END_NOW)
else
animate(transform = M, icon_state = door_state, layer = door_layer, time = world.tick_lag)
addtimer(CALLBACK(src,.proc/end_door_animation_alt),door_anim_time,TIMER_UNIQUE|TIMER_OVERRIDE)
/obj/structure/closet/proc/end_door_animation_alt()
is_animating_door = FALSE // comment this out and the line below to manually tweak the animation end state by fiddling with the door_anim vars to match the open door icon
vis_contents -= door_obj_alt
update_icon()
compile_overlays(src)
/obj/structure/closet/proc/get_door_transform(angle, var/inverse_hinge = FALSE)
var/matrix/M = matrix()
var/matrix_door_hinge = inverse_hinge ? door_hinge_alt : door_hinge
M.Translate(-matrix_door_hinge, 0)
M.Multiply(matrix(cos(angle), 0, 0, ((matrix_door_hinge >= 0) ? sin(angle) : -sin(angle)) * door_anim_squish, 1, 0)) // this matrix door hinge >= 0 check is for door hinges on the right, so they swing out instead of upwards
M.Translate(matrix_door_hinge, 0)
return M
/obj/structure/closet/hear_talk(mob/M as mob, text, verb, datum/language/speaking)
for (var/atom/A in src)
@@ -429,20 +644,22 @@
if(!damage || !wallbreaker)
return
user.do_attack_animation(src)
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")
visible_message(SPAN_DANGER("[user] [attack_message] the [src]!"))
dump_contents()
QDEL_IN(src, 1)
return 1
/obj/structure/closet/proc/req_breakout()
if(opened)
return 0 //Door's open... wait, why are you in it's contents then?
if(welded)
return 1 //closed but not welded...
if(breakout)
return -1 //Already breaking out.
return 0
if(!opened) //Door's open... wait, why are you in it's contents then?
if(locked)
if(welded)
return 2
else
return 1
if(breakout)
return -1 //Already breaking out.
else
return 0
/obj/structure/closet/proc/mob_breakout(var/mob/living/escapee)
@@ -458,8 +675,8 @@
//okay, so the closet is either welded or locked... resist!!!
escapee.next_move = world.time + 100
escapee.last_special = world.time + 100
to_chat(escapee, "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>")
visible_message(SPAN_DANGER("\The [src] begins to shake violently!"), SPAN_DANGER("You hear the sound of metal trashing around nearby."), intent_message = THUNK_SOUND)
to_chat(escapee, SPAN_WARNING("You lean on the back of \the [src] and start pushing the door open. (This will take about [breakout_time] minutes.)"))
visible_message(SPAN_DANGER("\The [src] begins to shake violently!"), SPAN_DANGER("You hear the sound of metal thrashing around nearby."), intent_message = THUNK_SOUND)
var/time = 6 * breakout_time * 2
@@ -494,16 +711,16 @@
//Well then break it!
breakout = 0
to_chat(escapee, "<span class='warning'>You successfully break out!</span>")
visible_message("<span class='danger'>\the [escapee] successfully broke out of \the [src]!</span>")
playsound(loc, 'sound/effects/grillehit.ogg', 100, 1)
break_open()
break_open(escapee)
shake_animation()
qdel(bar)
/obj/structure/closet/proc/break_open()
welded = 0
update_icon()
/obj/structure/closet/proc/break_open(mob/user)
if(secure && !broken)
to_chat(user, SPAN_WARNING("You successfully break out!"))
welded = FALSE
emag_act(INFINITY, user, SPAN_DANGER("\The [user] successfully breaks out of \the [src]!"), SPAN_DANGER("You hear the sound of metal being forced apart!"))
//Do this to prevent contents from being opened into nullspace (read: bluespace)
if(istype(loc, /obj/structure/bigDelivery))
var/obj/structure/bigDelivery/BD = loc

View File

@@ -1,31 +0,0 @@
/obj/structure/closet/coffin
name = "coffin"
desc = "It's a burial receptacle for the dearly departed."
icon_state = "coffin"
icon_closed = "coffin"
icon_opened = "coffin_open"
build_amt = 5
/obj/structure/closet/coffin/attackby(obj/item/W as obj, mob/user as mob)
if(opened)
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
return 0
if(!W.dropsafety())
return
if(W)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(istype(W, /obj/item/stack/packageWrap))
return
else
attack_hand(user)
return
/obj/structure/closet/coffin/update_icon()
if(!opened)
icon_state = icon_closed
else
icon_state = icon_opened

View File

@@ -2,5 +2,6 @@
name = "critter crate"
desc = "A crate which can sustain life for a while."
icon_state = "critter"
icon_opened = "critteropen"
icon_closed = "critter"
open_sound = 'sound/machines/wooden_closet_open.ogg'
close_sound = 'sound/machines/wooden_closet_close.ogg'
door_anim_time = 0

View File

@@ -1,8 +1,7 @@
/obj/structure/closet/athletic_mixed
name = "athletic wardrobe"
desc = "It's a storage unit for athletic wear."
icon_state = "mixed"
icon_closed = "mixed"
icon_door = "mixed"
/obj/structure/closet/athletic_mixed/fill()
new /obj/item/towel/random(src)
@@ -22,8 +21,6 @@
new /obj/item/clothing/shoes/swimmingfins(src)
new /obj/item/clothing/shoes/swimmingfins(src)
/obj/structure/closet/boxinggloves
name = "boxing gloves"
desc = "It's a storage unit for gloves for use in the boxing ring."
@@ -34,7 +31,6 @@
new /obj/item/clothing/gloves/boxing/yellow(src)
new /obj/item/clothing/gloves/boxing(src)
/obj/structure/closet/masks
name = "mask closet"
desc = "IT'S A STORAGE UNIT FOR FIGHTER MASKS OLE!"

View File

@@ -1,16 +1,14 @@
/obj/structure/closet/cabinet
name = "cabinet"
desc = "Old will forever be in fashion."
icon_state = "cabinet_closed"
icon_closed = "cabinet_closed"
icon_opened = "cabinet_open"
icon_state = "cabinet"
open_sound = 'sound/machines/wooden_closet_open.ogg'
close_sound = 'sound/machines/wooden_closet_close.ogg'
storage_capacity = 45 //such a big closet deserves a little more capacity
/obj/structure/closet/cabinet/update_icon()
if(!opened)
icon_state = icon_closed
else
icon_state = icon_opened
door_anim_angle = 160
door_anim_squish = 0.22
door_hinge_alt = 7.5
double_doors = TRUE
/obj/structure/closet/cabinet/attackby(obj/item/W as obj, mob/user as mob)
if(opened)
@@ -33,25 +31,15 @@
/obj/structure/closet/acloset
name = "strange closet"
desc = "It looks alien!"
icon_state = "acloset"
icon_closed = "acloset"
icon_opened = "aclosetopen"
icon_state = "decursed"
/obj/structure/closet/gimmick
name = "administrative supply closet"
desc = "It's a storage unit for things that have no right being here."
icon_state = "syndicate1"
icon_closed = "syndicate1"
icon_opened = "syndicate1open"
anchored = 0
/obj/structure/closet/gimmick/russian
name = "russian surplus closet"
desc = "It's a storage unit for Russian standard-issue surplus."
icon_state = "syndicate1"
icon_closed = "syndicate1"
icon_opened = "syndicate1open"
/obj/structure/closet/gimmick/russian/fill()
new /obj/item/clothing/head/ushanka/grey(src)
@@ -63,9 +51,6 @@
/obj/structure/closet/gimmick/tacticool
name = "tacticool gear closet"
desc = "It's a storage unit for Tacticool gear."
icon_state = "syndicate1"
icon_closed = "syndicate1"
icon_opened = "syndicate1open"
/obj/structure/closet/gimmick/tacticool/fill()
new /obj/item/clothing/glasses/eyepatch(src)
@@ -88,8 +73,6 @@
name = "\improper Thunderdome closet"
desc = "Everything you need!"
icon_state = "syndicate"
icon_closed = "syndicate"
icon_opened = "syndicateopen"
anchored = 1
/obj/structure/closet/thunderdome/tdred
@@ -118,8 +101,6 @@
/obj/structure/closet/thunderdome/tdgreen
name = "green-team Thunderdome closet"
icon_state = "syndicate1"
icon_closed = "syndicate1"
icon_opened = "syndicate1open"
/obj/structure/closet/thunderdome/tdgreen/fill()
new /obj/item/clothing/suit/armor/tdome/green(src)
@@ -142,7 +123,5 @@
new /obj/item/clothing/head/helmet/thunderdome(src)
/obj/structure/closet/skrell
icon_state = "skrell"
icon_closed = "skrell"
icon_opened = "skrellopen"
layer = OBJ_LAYER - 0.01
icon_state = "alien"
layer = BELOW_OBJ_LAYER

View File

@@ -11,8 +11,7 @@
/obj/structure/closet/gmcloset
name = "formal closet"
desc = "It's a storage unit for formal clothing."
icon_state = "black"
icon_closed = "black"
icon_door = "black"
/obj/structure/closet/gmcloset/fill()
new /obj/item/clothing/head/that(src)
@@ -39,8 +38,7 @@
/obj/structure/closet/chefcloset
name = "chef's closet"
desc = "It's a storage unit for foodservice garments."
icon_state = "black"
icon_closed = "black"
icon_door = "black"
/obj/structure/closet/chefcloset/fill()
new /obj/item/clothing/under/waiter(src)
@@ -64,9 +62,7 @@
/obj/structure/closet/jcloset
name = "custodial closet"
desc = "It's a storage unit for janitorial clothes and gear."
icon_state = "janitorial"
icon_closed = "janitorial"
icon_opened = "janitorialopen"
icon_door = "mixed"
/obj/structure/closet/jcloset/fill()
new /obj/item/clothing/under/rank/janitor/nt(src)
@@ -102,8 +98,7 @@
/obj/structure/closet/lawcloset
name = "legal closet"
desc = "It's a storage unit for courtroom apparel and items."
icon_state = "blue"
icon_closed = "blue"
icon_door = "blue"
/obj/structure/closet/lawcloset/fill()
new /obj/item/clothing/under/lawyer/black(src)

View File

@@ -2,24 +2,14 @@
name = "level-3 biohazard suit closet"
desc = "It's a storage unit for level-3 biohazard gear."
icon_state = "bio"
icon_closed = "bio"
icon_opened = "bioopen"
/obj/structure/closet/l3closet/general
icon_state = "bio_general"
icon_closed = "bio_general"
icon_opened = "bio_generalopen"
/obj/structure/closet/l3closet/general/fill()
new /obj/item/clothing/suit/bio_suit/general(src)
new /obj/item/clothing/head/bio_hood/general(src)
new /obj/item/clothing/mask/gas/half(src)
/obj/structure/closet/l3closet/virology
icon_state = "bio_virology"
icon_closed = "bio_virology"
icon_opened = "bio_virologyopen"
icon_state = "bio_viro"
/obj/structure/closet/l3closet/virology/fill()
new /obj/item/clothing/suit/bio_suit/virology(src)
@@ -29,9 +19,8 @@
/obj/structure/closet/l3closet/security
icon_state = "bio_security"
icon_closed = "bio_security"
icon_opened = "bio_securityopen"
icon_state = "bio_sec"
/obj/structure/closet/l3closet/security/fill()
new /obj/item/clothing/suit/bio_suit/security(src)
@@ -40,19 +29,14 @@
/obj/structure/closet/l3closet/janitor
icon_state = "bio_janitor"
icon_closed = "bio_janitor"
icon_opened = "bio_janitoropen"
icon_state = "bio_jan"
/obj/structure/closet/l3closet/janitor/fill()
new /obj/item/clothing/suit/bio_suit/janitor(src)
new /obj/item/clothing/head/bio_hood/janitor(src)
/obj/structure/closet/l3closet/scientist
icon_state = "bio_scientist"
icon_closed = "bio_scientist"
icon_opened = "bio_scientistopen"
/obj/structure/closet/l3closet/scientist/fill()
new /obj/item/clothing/suit/bio_suit/scientist(src)

View File

@@ -1,8 +1,6 @@
/obj/structure/closet/malf/suits
desc = "It's a storage unit for operational gear."
icon_state = "syndicate"
icon_closed = "syndicate"
icon_opened = "syndicateopen"
/obj/structure/closet/malf/suits/fill()
new /obj/item/tank/jetpack/void(src)

View File

@@ -1,16 +1,18 @@
/obj/structure/closet/secure_closet/bar
/obj/structure/closet/secure_closet/cabinet
icon_state = "cabinet"
open_sound = 'sound/machines/wooden_closet_open.ogg'
close_sound = 'sound/machines/wooden_closet_close.ogg'
door_anim_angle = 160
door_anim_squish = 0.22
door_hinge_alt = 7.5
double_doors = TRUE
/obj/structure/closet/secure_closet/cabinet/bar
name = "booze closet"
req_access = list(access_bar)
icon_state = "cabinetdetective_locked"
icon_closed = "cabinetdetective"
icon_locked = "cabinetdetective_locked"
icon_opened = "cabinetdetective_open"
icon_broken = "cabinetdetective_broken"
icon_off = "cabinetdetective_broken"
storage_capacity = 45 //such a big closet deserves a little more capacity
/obj/structure/closet/secure_closet/bar/fill()
/obj/structure/closet/secure_closet/cabinet/bar/fill()
new /obj/item/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/reagent_containers/food/drinks/bottle/small/beer( src )
@@ -21,15 +23,3 @@
new /obj/item/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/reagent_containers/food/drinks/bottle/small/beer( src )
/obj/structure/closet/secure_closet/bar/update_icon()
if(broken)
icon_state = icon_broken
else
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
else
icon_state = icon_opened

View File

@@ -1,12 +1,7 @@
/obj/structure/closet/secure_closet/hangartech
name = "hangar technician's locker"
req_access = list(access_cargo)
icon_state = "securecargo1"
icon_closed = "securecargo"
icon_locked = "securecargo1"
icon_opened = "securecargoopen"
icon_broken = "securecargobroken"
icon_off = "securecargooff"
icon_state = "cargo"
/obj/structure/closet/secure_closet/hangartech/fill()
..()
@@ -24,12 +19,7 @@
/obj/structure/closet/secure_closet/operation_manager
name = "operation manager's locker"
req_access = list(access_qm)
icon_state = "secureqm1"
icon_closed = "secureqm"
icon_locked = "secureqm1"
icon_opened = "secureqmopen"
icon_broken = "secureqmbroken"
icon_off = "secureqmoff"
icon_state = "qm"
/obj/structure/closet/secure_closet/operation_manager/fill()
new /obj/item/clothing/under/rank/operations_manager(src)

View File

@@ -1,12 +1,7 @@
/obj/structure/closet/secure_closet/engineering_chief
name = "chief engineer's locker"
req_access = list(access_ce)
icon_state = "securece1"
icon_closed = "securece"
icon_locked = "securece1"
icon_opened = "secureceopen"
icon_broken = "securecebroken"
icon_off = "secureceoff"
icon_state = "ce"
/obj/structure/closet/secure_closet/engineering_chief/fill()
if(prob(50))
@@ -39,12 +34,7 @@
/obj/structure/closet/secure_closet/engineering_chief2
name = "chief engineer's attire"
req_access = list(access_ce)
icon_state = "securece1"
icon_closed = "securece"
icon_locked = "securece1"
icon_opened = "secureceopen"
icon_broken = "securecebroken"
icon_off = "secureceoff"
icon_state = "ce"
/obj/structure/closet/secure_closet/engineering_chief2/fill()
new /obj/item/storage/backpack/industrial(src)
@@ -60,12 +50,8 @@
/obj/structure/closet/secure_closet/engineering_electrical
name = "electrical supplies"
req_access = list(access_engine_equip)
icon_state = "secureengelec1"
icon_closed = "secureengelec"
icon_locked = "secureengelec1"
icon_opened = "toolclosetopen"
icon_broken = "secureengelecbroken"
icon_off = "secureengelecoff"
icon_state = "eng"
icon_door = "eng_elec"
/obj/structure/closet/secure_closet/engineering_electrical/fill()
new /obj/item/clothing/gloves/yellow(src)
@@ -85,12 +71,8 @@
/obj/structure/closet/secure_closet/engineering_welding
name = "welding supplies"
req_access = list(access_construction)
icon_state = "secureengweld1"
icon_closed = "secureengweld"
icon_locked = "secureengweld1"
icon_opened = "toolclosetopen"
icon_broken = "secureengweldbroken"
icon_off = "secureengweldoff"
icon_state = "eng"
icon_door = "eng_weld"
/obj/structure/closet/secure_closet/engineering_welding/fill()
new /obj/item/clothing/head/welding(src)
@@ -106,12 +88,7 @@
/obj/structure/closet/secure_closet/engineering_personal
name = "engineer's locker"
req_access = list(access_engine_equip)
icon_state = "secureeng1"
icon_closed = "secureeng"
icon_locked = "secureeng1"
icon_opened = "secureengopen"
icon_broken = "secureengbroken"
icon_off = "secureengoff"
icon_state = "eng_secure"
/obj/structure/closet/secure_closet/engineering_personal/fill()
if(prob(50))
@@ -131,12 +108,7 @@
/obj/structure/closet/secure_closet/atmos_personal
name = "atmospheric technician's locker"
req_access = list(access_atmospherics)
icon_state = "secureatm1"
icon_closed = "secureatm"
icon_locked = "secureatm1"
icon_opened = "secureatmopen"
icon_broken = "secureatmbroken"
icon_off = "secureatmoff"
icon_state = "atmos"
/obj/structure/closet/secure_closet/atmos_personal/fill()
if(prob(50))

View File

@@ -1,16 +1,7 @@
/obj/structure/closet/secure_closet/freezer
/obj/structure/closet/secure_closet/freezer/update_icon()
if(broken)
icon_state = icon_broken
else
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
else
icon_state = icon_opened
icon_state = "freezer"
door_anim_squish = 0.22
door_anim_angle = 123
/obj/structure/closet/secure_closet/freezer/kitchen
name = "kitchen cabinet"
@@ -27,12 +18,6 @@
/obj/structure/closet/secure_closet/freezer/meat
name = "meat fridge"
icon_state = "fridge1"
icon_closed = "fridge"
icon_locked = "fridge1"
icon_opened = "fridgeopen"
icon_broken = "fridgebroken"
icon_off = "fridge1"
/obj/structure/closet/secure_closet/freezer/meat/fill()
..()
@@ -55,12 +40,6 @@
/obj/structure/closet/secure_closet/freezer/fridge
name = "refrigerator"
icon_state = "fridge1"
icon_closed = "fridge"
icon_locked = "fridge1"
icon_opened = "fridgeopen"
icon_broken = "fridgebroken"
icon_off = "fridge1"
/obj/structure/closet/secure_closet/freezer/fridge/fill()
..()
@@ -74,12 +53,7 @@
/obj/structure/closet/secure_closet/freezer/money
name = "freezer"
icon_state = "fridge1"
icon_closed = "fridge"
icon_locked = "fridge1"
icon_opened = "fridgeopen"
icon_broken = "fridgebroken"
icon_off = "fridge1"
desc = "This contains cold hard cash."
req_access = list(access_heads_vault)
/obj/structure/closet/secure_closet/freezer/money/fill()

View File

@@ -3,14 +3,13 @@
req_access = list(access_armory)
icon = 'icons/obj/guncabinet.dmi'
icon_state = "base"
icon_off ="base"
icon_broken ="base"
icon_locked ="base"
icon_closed ="base"
icon_opened = "base"
anchored = 1
canbemoved = 1
anchored = TRUE
canbemoved = TRUE
door_underlay = TRUE
door_anim_squish = 0.12
door_anim_angle = 119
door_hinge = -9.5
/obj/structure/closet/secure_closet/guncabinet/Initialize()
..()
@@ -26,32 +25,24 @@
/obj/structure/closet/secure_closet/guncabinet/update_icon()
cut_overlays()
if(opened)
add_overlay("door_open")
else
var/lazors = 0
var/shottas = 0
for (var/obj/item/gun/G in contents)
if (istype(G, /obj/item/gun/energy))
lazors++
if (istype(G, /obj/item/gun/projectile/))
shottas++
if (lazors || shottas)
for (var/i = 0 to 2)
if (lazors > 0 && (shottas <= 0 || prob(50)))
lazors--
add_overlay("laser[i]")
else if (shottas > 0)
shottas--
add_overlay("projectile[i]")
var/lazors = 0
var/shottas = 0
for (var/obj/item/gun/G in contents)
if (istype(G, /obj/item/gun/energy))
lazors++
if (istype(G, /obj/item/gun/projectile/))
shottas++
if (lazors || shottas)
for (var/i = 0 to 2)
if (lazors > 0 && (shottas <= 0 || prob(50)))
lazors--
add_overlay("laser[i]")
else if (shottas > 0)
shottas--
add_overlay("projectile[i]")
. = ..()
add_overlay("door")
if(welded)
add_overlay(welded_overlay_state)
if(broken)
add_overlay("broken")
else if (locked)
add_overlay("locked")
else
add_overlay("open")
/obj/structure/closet/secure_closet/guncabinet/sci
name = "science gun cabinet"
req_access = list(access_tox_storage)
icon_state = "sci"

View File

@@ -1,12 +1,7 @@
/obj/structure/closet/secure_closet/hydroponics
name = "botanist's locker"
req_access = list(access_hydroponics)
icon_state = "hydrosecure1"
icon_closed = "hydrosecure"
icon_locked = "hydrosecure1"
icon_opened = "hydrosecureopen"
icon_broken = "hydrosecurebroken"
icon_off = "hydrosecureoff"
icon_state = "hydro"
/obj/structure/closet/secure_closet/hydroponics/fill()
..()
@@ -29,12 +24,7 @@
/obj/structure/closet/secure_closet/xenobotany
name = "xenobotanist's locker"
req_access = list(access_xenobiology)
icon_state = "xenobotsecure1"
icon_closed = "xenobotsecure"
icon_locked = "xenobotsecure1"
icon_opened = "xenobotsecureopen"
icon_broken = "xenobotsecurebroken"
icon_off = "xenobotsecureoff"
icon_state = "xenobot"
/obj/structure/closet/secure_closet/xenobotany/fill()
..()

View File

@@ -1,13 +1,7 @@
/obj/structure/closet/secure_closet/medical1
name = "medicine closet"
desc = "Filled with medical junk."
icon_state = "medical1"
icon_closed = "medical"
icon_locked = "medical1"
icon_opened = "medicalopen"
icon_broken = "medicalbroken"
icon_off = "medicaloff"
welded_overlay_state = "welded_wallcloset"
icon_state = "med"
req_access = list(access_medical_equip)
/obj/structure/closet/secure_closet/medical1/fill()
@@ -25,12 +19,7 @@
/obj/structure/closet/secure_closet/medical2
name = "anesthetics closet"
desc = "Used to knock people out."
icon_state = "medical1"
icon_closed = "medical"
icon_locked = "medical1"
icon_opened = "medicalopen"
icon_broken = "medicalbroken"
icon_off = "medicaloff"
icon_state = "med"
req_access = list(access_surgery)
/obj/structure/closet/secure_closet/medical2/fill()
@@ -44,12 +33,7 @@
/obj/structure/closet/secure_closet/medical3
name = "medical equipment locker"
req_access = list(access_medical_equip)
icon_state = "securemed1"
icon_closed = "securemed"
icon_locked = "securemed1"
icon_opened = "securemedopen"
icon_broken = "securemedbroken"
icon_off = "securemedoff"
icon_state = "med"
/obj/structure/closet/secure_closet/medical3/fill()
if(prob(50))
@@ -92,12 +76,7 @@
name = "first responder's locker"
desc = "An immobile, card-locked storage unit containing all the necessary equipment for a first responder."
req_access = list(access_first_responder)
icon_state = "securemed1"
icon_closed = "securemed"
icon_locked = "securemed1"
icon_opened = "securemedopen"
icon_broken = "securemedbroken"
icon_off = "securemedoff"
icon_state = "med"
/obj/structure/closet/secure_closet/medical_fr/fill()
..()
@@ -130,12 +109,7 @@
/obj/structure/closet/secure_closet/CMO
name = "chief medical officer's locker"
req_access = list(access_cmo)
icon_state = "cmosecure1"
icon_closed = "cmosecure"
icon_locked = "cmosecure1"
icon_opened = "cmosecureopen"
icon_broken = "cmosecurebroken"
icon_off = "cmosecureoff"
icon_state = "cmo"
/obj/structure/closet/secure_closet/CMO/fill()
if(prob(50))
@@ -162,12 +136,7 @@
/obj/structure/closet/secure_closet/CMO2
name = "chief medical officer's attire"
req_access = list(access_cmo)
icon_state = "cmosecure1"
icon_closed = "cmosecure"
icon_locked = "cmosecure1"
icon_opened = "cmosecureopen"
icon_broken = "cmosecurebroken"
icon_off = "cmosecureoff"
icon_state = "cmo"
/obj/structure/closet/secure_closet/CMO2/fill()
new /obj/item/storage/backpack/medic(src)
@@ -201,12 +170,8 @@
/obj/structure/closet/secure_closet/chemical
name = "chemistry equipment closet"
desc = "Contains equipment useful to chemists."
icon_state = "medical1"
icon_closed = "medical"
icon_locked = "medical1"
icon_opened = "medicalopen"
icon_broken = "medicalbroken"
icon_off = "medicaloff"
icon_state = "med"
icon_door = "chemical"
req_access = list(access_pharmacy)
/obj/structure/closet/secure_closet/chemical/fill()
@@ -223,18 +188,3 @@
new /obj/item/storage/box/beakers(src)
new /obj/item/storage/bag/chemistry(src)
new /obj/item/storage/bag/chemistry(src)
/obj/structure/closet/secure_closet/medical_wall
name = "first aid closet"
desc = "It's a secure wall-mounted storage unit for first aid supplies."
icon_state = "medical_wall_locked"
icon_closed = "medical_wall_unlocked"
icon_locked = "medical_wall_locked"
icon_opened = "medical_wall_open"
icon_broken = "medical_wall_spark"
icon_off = "medical_wall_off"
store_mobs = FALSE
anchored = 1
density = 0
wall_mounted = 1
req_access = list(access_medical_equip)

View File

@@ -24,24 +24,13 @@
/obj/structure/closet/secure_closet/personal/cabinet
icon_state = "cabinetdetective_locked"
icon_closed = "cabinetdetective"
icon_locked = "cabinetdetective_locked"
icon_opened = "cabinetdetective_open"
icon_broken = "cabinetdetective_broken"
icon_off = "cabinetdetective_broken"
/obj/structure/closet/secure_closet/personal/cabinet/update_icon()
if(broken)
icon_state = icon_broken
else
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
else
icon_state = icon_opened
icon_state = "cabinet"
open_sound = 'sound/machines/wooden_closet_open.ogg'
close_sound = 'sound/machines/wooden_closet_close.ogg'
door_anim_angle = 160
door_anim_squish = 0.22
door_hinge_alt = 7.5
double_doors = TRUE
/obj/structure/closet/secure_closet/personal/cabinet/fill()
new /obj/item/storage/backpack/satchel/withwallet(src)
@@ -69,8 +58,7 @@
if(allowed(user) || !registered_name || (istype(I) && (registered_name == I.registered_name)))
//they can open all lockers, or nobody owns this, or they own this locker
locked = !( locked )
if(locked) icon_state = icon_locked
else icon_state = icon_closed
update_icon()
if(!registered_name)
registered_name = I.registered_name
@@ -92,7 +80,7 @@
broken = 1
locked = 0
desc = "It appears to be broken."
icon_state = icon_broken
update_icon()
if(visual_feedback)
visible_message("<span class='warning'>[visual_feedback]</span>", "<span class='warning'>[audible_feedback]</span>")
return 1
@@ -114,7 +102,7 @@
if(!close())
return
locked = 1
icon_state = icon_locked
update_icon()
registered_name = null
desc = "It's a secure locker for personnel. The first card swiped gains control."
return

View File

@@ -1,12 +1,7 @@
/obj/structure/closet/secure_closet/scientist
name = "scientist's locker"
req_access = list(access_tox_storage)
icon_state = "secureres1"
icon_closed = "secureres"
icon_locked = "secureres1"
icon_opened = "secureresopen"
icon_broken = "secureresbroken"
icon_off = "secureresoff"
icon_state = "science"
/obj/structure/closet/secure_closet/scientist/fill()
new /obj/item/clothing/under/rank/scientist(src)
@@ -21,12 +16,7 @@
/obj/structure/closet/secure_closet/RD
name = "research director's locker"
req_access = list(access_rd)
icon_state = "rdsecure1"
icon_closed = "rdsecure"
icon_locked = "rdsecure1"
icon_opened = "rdsecureopen"
icon_broken = "rdsecurebroken"
icon_off = "rdsecureoff"
icon_state = "rd"
/obj/structure/closet/secure_closet/RD/fill()
new /obj/item/clothing/suit/bio_suit/scientist(src)
@@ -50,12 +40,7 @@
/obj/structure/closet/secure_closet/RD2
name = "research director's attire"
req_access = list(access_rd)
icon_state = "rdsecure1"
icon_closed = "rdsecure"
icon_locked = "rdsecure1"
icon_opened = "rdsecureopen"
icon_broken = "rdsecurebroken"
icon_off = "rdsecureoff"
icon_state = "rd"
/obj/structure/closet/secure_closet/RD2/fill()
new /obj/item/clothing/under/rank/research_director(src)

View File

@@ -1,57 +0,0 @@
/obj/structure/closet/secure_closet/sciguncabinet
name = "science gun cabinet"
req_access = list(access_tox_storage)
icon = 'icons/obj/sciguncabinet.dmi'
icon_state = "base"
icon_off ="base"
icon_broken ="base"
icon_locked ="base"
icon_closed ="base"
icon_opened = "base"
anchored = 1
canbemoved = 1
/obj/structure/closet/secure_closet/sciguncabinet/Initialize()
..()
return INITIALIZE_HINT_LATELOAD
/obj/structure/closet/secure_closet/sciguncabinet/LateInitialize()
..()
update_icon()
/obj/structure/closet/secure_closet/sciguncabinet/toggle()
..()
update_icon()
/obj/structure/closet/secure_closet/sciguncabinet/update_icon()
cut_overlays()
if(opened)
add_overlay("door_open")
else
var/lazors = 0
var/shottas = 0
for (var/obj/item/gun/G in contents)
if (istype(G, /obj/item/gun/energy))
lazors++
if (istype(G, /obj/item/gun/projectile/))
shottas++
if (lazors || shottas)
for (var/i = 0 to 2)
if (lazors > 0 && (shottas <= 0 || prob(50)))
lazors--
add_overlay("laser[i]")
else if (shottas > 0)
shottas--
add_overlay("projectile[i]")
add_overlay("door")
if(welded)
add_overlay(welded_overlay_state)
if(broken)
add_overlay("broken")
else if (locked)
add_overlay("locked")
else
add_overlay("open")

View File

@@ -2,38 +2,16 @@
name = "secure locker"
desc = "It's an immobile card-locked storage unit."
icon = 'icons/obj/closet.dmi'
icon_state = "secure1"
density = 1
opened = 0
anchored = 0
var/locked = 1
var/broken = 0
var/large = 1
icon_closed = "secure"
var/icon_locked = "secure1"
icon_opened = "secureopen"
var/icon_broken = "securebroken"
var/icon_off = "secureoff"
var/canbemoved = 0 // if it can be moved by people using the right tools
var/screwed = 1 // if its screwed in place
var/wrenched = 1 // if its wrenched down
wall_mounted = 0 //never solid (You can always pass over it)
icon_state = "secure"
secure = TRUE
opened = FALSE
anchored = FALSE
locked = TRUE
health = 200
/obj/structure/closet/secure_closet/can_open()
if(locked)
return 0
return ..()
/obj/structure/closet/secure_closet/close()
if(..())
if(broken)
icon_state = icon_off
return 1
else
return 0
/obj/structure/closet/secure_closet/emp_act(severity)
/obj/structure/closet/emp_act(severity)
if(!secure)
return
for(var/obj/O in src)
O.emp_act(severity)
if(!broken)
@@ -48,237 +26,64 @@
req_access += pick(get_all_station_access())
..()
/obj/structure/closet/secure_closet/proc/togglelock(mob/user as mob)
if(opened)
to_chat(user, "<span class='notice'>Close the locker first.</span>")
return
if(broken)
to_chat(user, "<span class='warning'>The locker appears to be broken.</span>")
return
if(user.loc == src)
to_chat(user, "<span class='notice'>You can't reach the lock from inside.</span>")
return
if(allowed(user))
locked = !locked
for(var/mob/O in viewers(user, 3))
if((O.client && !( O.blinded )))
to_chat(O, "<span class='notice'>The locker has been [locked ? null : "un"]locked by [user].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>Access Denied</span>")
/obj/structure/closet/secure_closet/AltClick(mob/user)
. = ..()
/obj/structure/closet/proc/togglelock(mob/user as mob, silent)
if(use_check_and_message(user))
return
if(secure)
if(opened)
to_chat(user, SPAN_NOTICE("Close \the [src] first."))
return
if(broken)
to_chat(user, SPAN_WARNING("\The [src] is broken!"))
return
if(user.loc == src)
to_chat(user, SPAN_NOTICE("You can't reach the lock from inside."))
return
if(allowed(user))
if(iscarbon(user))
add_fingerprint(user)
locked = !locked
user.visible_message(SPAN_NOTICE("[user] [locked ? null : "un"]locks \the [src]."),
SPAN_NOTICE("You [locked ? null : "un"]lock \the [src]."))
update_icon()
else if(!silent)
to_chat(user, SPAN_NOTICE("Access Denied."))
/obj/structure/closet/AltClick(mob/user)
. = ..()
togglelock(user)
/obj/structure/closet/secure_closet/proc/CanChainsaw(var/obj/item/material/twohanded/chainsaw/ChainSawVar)
/obj/structure/closet/proc/CanChainsaw(var/obj/item/material/twohanded/chainsaw/ChainSawVar) // Wow, this is like, a real-life fossil.
return (ChainSawVar.powered && !opened && !broken)
/obj/structure/closet/secure_closet/attackby(obj/item/W as obj, mob/user as mob)
if(opened)
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
if(large)
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
else
to_chat(user, "<span class='notice'>The locker is too small to stuff [G.affecting] into!</span>")
if(W.iswelder())
var/obj/item/weldingtool/WT = W
if(WT.isOn())
user.visible_message(
"<span class='warning'>[user] begins cutting [src] apart.</span>",
"<span class='notice'>You begin cutting [src] apart.</span>",
"You hear a welding torch on metal."
)
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
if (!do_after(user, 2/W.toolspeed SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_open)))
return
if(!WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
return
else
new /obj/item/stack/material/steel(loc)
user.visible_message(
"<span class='notice'>[src] has been cut apart by [user] with [WT].</span>",
"<span class='notice'>You cut apart [src] with [WT].</span>"
)
qdel(src)
return
else if(isrobot(user))
return
else if(W.loc != user) // This should stop mounted modules ending up outside the module.
return
if(W)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(W.isscrewdriver() && canbemoved)
if(screwed)
to_chat(user, "<span class='notice'>You start to unscrew the locker from the floor...</span>")
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 10/W.toolspeed SECONDS, act_target = src))
to_chat(user, "<span class='notice'>You unscrew the locker!</span>")
playsound(loc, W.usesound, 50, 1)
screwed = 0
else if(!screwed && wrenched)
to_chat(user, "<span class='notice'>You start to screw the locker to the floor...</span>")
playsound(src, 'sound/items/welder.ogg', 80, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
to_chat(user, "<span class='notice'>You screw the locker!</span>")
playsound(loc, W.usesound, 50, 1)
screwed = 1
else if(W.iswrench() && canbemoved)
if(wrenched && !screwed)
to_chat(user, "<span class='notice'>You start to unfasten the bolts holding the locker in place...</span>")
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
to_chat(user, "<span class='notice'>You unfasten the locker's bolts!</span>")
playsound(loc, W.usesound, 50, 1)
wrenched = 0
anchored = 0
else if(!wrenched)
to_chat(user, "<span class='notice'>You start to fasten the bolts holding the locker in place...</span>")
playsound(loc, W.usesound, 50, 1)
if (do_after(user, 15/W.toolspeed SECONDS, act_target = src))
to_chat(user, "<span class='notice'>You fasten the locker's bolts!</span>")
playsound(loc, W.usesound, 50, 1)
wrenched = 1
anchored = 1
else if(istype(W, /obj/item/device/hand_labeler))
var/obj/item/device/hand_labeler/HL = W
if (HL.mode == 1)
return
else
togglelock(user)
else if(!opened)
if(!broken && istype(W,/obj/item/material/twohanded/chainsaw))
var/obj/item/material/twohanded/chainsaw/ChainSawVar = W
ChainSawVar.cutting = 1
user.visible_message(\
"<span class='danger'>[user.name] starts cutting the [src] with the [W]!</span>",\
"<span class='warning'>You start cutting the [src]...</span>",\
"<span class='notice'>You hear a loud buzzing sound and metal grinding on metal...</span>"\
)
if(do_after(user, ChainSawVar.opendelay SECONDS, act_target = user, extra_checks = CALLBACK(src, .proc/CanChainsaw, W)))
user.visible_message(\
"<span class='warning'>[user.name] finishes cutting open the [src] with the [W].</span>",\
"<span class='warning'>You finish cutting open the [src].</span>",\
"<span class='notice'>You hear a metal clank and some sparks.</span>"\
)
emag_act(INFINITY, user, "<span class='danger'>The locker has been sliced open by [user] with \an [W]</span>!", "<span class='danger'>You hear metal being sliced and sparks flying.</span>")
spark(src, 5)
ChainSawVar.cutting = 0
else if(istype(W, /obj/item/melee/energy/blade))//Attempt to cut open locker if locked
if(emag_act(INFINITY, user, "<span class='danger'>The locker has been sliced open by [user] with \an [W]</span>!", "<span class='danger'>You hear metal being sliced and sparks flying.</span>"))
spark(src, 5)
playsound(loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(loc, /decl/sound_category/spark_sound, 50, 1)
else if(W.iswelder())
var/obj/item/weldingtool/WT = W
if(WT.isOn())
user.visible_message(
"<span class='warning'>[user] begins welding [src] [welded ? "open" : "shut"].</span>",
"<span class='notice'>You begin welding [src] [welded ? "open" : "shut"].</span>",
"You hear a welding torch on metal."
)
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
if (!do_after(user, 2 SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_closed)))
return
if(!WT.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
return
welded = !welded
update_icon()
user.visible_message(
"<span class='warning'>[src] has been [welded ? "welded shut" : "unwelded"] by [user].</span>",
"<span class='notice'>You weld [src] [!welded ? "open" : "shut"].</span>"
)
else
togglelock(user)
else if(istype(W, /obj/item/ducttape))
return
else
togglelock(user)//Attempt to lock locker if closed
/obj/structure/closet/secure_closet/emag_act(var/remaining_charges, var/mob/user, var/emag_source, var/visual_feedback = "", var/audible_feedback = "")
/obj/structure/closet/emag_act(var/remaining_charges, var/mob/user, var/emag_source, var/visual_feedback = "", var/audible_feedback = "")
if(!broken)
broken = 1
locked = 0
desc = "It appears to be broken."
icon_state = icon_off
flick(icon_broken, src)
spark(src, 5)
desc += " It appears to be broken."
add_overlay("[icon_door_overlay]sparking")
CUT_OVERLAY_IN("[icon_door_overlay]sparking", 6)
playsound(loc, /decl/sound_category/spark_sound, 60, 1)
broken = TRUE
locked = FALSE
update_icon()
if(visual_feedback)
visible_message(visual_feedback, audible_feedback)
else if(user && emag_source)
visible_message("<span class='warning'>\The [src] has been broken by \the [user] with \an [emag_source]!</span>", "You hear a faint electrical spark.")
visible_message(SPAN_WARNING("\The [src] has been broken by \the [user] with \an [emag_source]!"), "You hear a faint electrical spark.")
else
visible_message("<span class='warning'>\The [src] sparks and breaks open!</span>", "You hear a faint electrical spark.")
visible_message(SPAN_WARNING("\The [src] sparks and breaks open!"), "You hear a faint electrical spark.")
return 1
/obj/structure/closet/secure_closet/attack_hand(mob/user as mob)
add_fingerprint(user)
if(locked)
togglelock(user)
else
toggle(user)
/obj/structure/closet/secure_closet/verb/verb_togglelock()
/obj/structure/closet/proc/verb_togglelock()
set src in oview(1) // One square distance
set category = "Object"
set name = "Toggle Lock"
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr))
add_fingerprint(usr)
togglelock(usr)
else if(istype(usr, /mob/living/silicon/robot) && Adjacent(usr))
togglelock(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/secure_closet/update_icon()//Putting the welded stuff in update_icon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
cut_overlays()
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
if(welded)
add_overlay(welded_overlay_state)
else
icon_state = icon_opened
/obj/structure/closet/secure_closet/req_breakout()
if(!opened && locked)
if (welded)
return 2
else
return 1
else
return ..() //It's a secure closet, but isn't locked.
/obj/structure/closet/secure_closet/break_open()
desc += " It appears to be broken."
icon_state = icon_off
spawn()
flick(icon_broken, src)
sleep(10)
flick(icon_broken, src)
sleep(10)
broken = 1
welded = 0
locked = 0
update_icon()
//Do this to prevent contents from being opened into nullspace (read: bluespace)
if(istype(loc, /obj/structure/bigDelivery))
var/obj/structure/bigDelivery/BD = loc
BD.unwrap()
open()
to_chat(usr, SPAN_WARNING("This mob type can't use this verb."))

View File

@@ -1,12 +1,7 @@
/obj/structure/closet/secure_closet/captains
name = "captain's locker"
req_access = list(access_captain)
icon_state = "capsecure1"
icon_closed = "capsecure"
icon_locked = "capsecure1"
icon_opened = "capsecureopen"
icon_broken = "capsecurebroken"
icon_off = "capsecureoff"
icon_state = "cap"
/obj/structure/closet/secure_closet/captains/fill()
// Backpack
@@ -33,12 +28,7 @@
/obj/structure/closet/secure_closet/captains2
name = "captain's attire"
req_access = list(access_captain)
icon_state = "capsecure1"
icon_closed = "capsecure"
icon_locked = "capsecure1"
icon_opened = "capsecureopen"
icon_broken = "capsecurebroken"
icon_off = "capsecureoff"
icon_state = "cap"
/obj/structure/closet/secure_closet/captains2/fill()
new /obj/item/storage/backpack/captain(src)
@@ -58,12 +48,8 @@
/obj/structure/closet/secure_closet/xo
name = "executive officer's locker"
req_access = list(access_hop)
icon_state = "hopsecure1"
icon_closed = "hopsecure"
icon_locked = "hopsecure1"
icon_opened = "hopsecureopen"
icon_broken = "hopsecurebroken"
icon_off = "hopsecureoff"
icon_state = "sec"
icon_door = "hop"
/obj/structure/closet/secure_closet/xo/fill()
..()
@@ -89,12 +75,8 @@
/obj/structure/closet/secure_closet/xo2
name = "executive officer's attire"
req_access = list(access_hop)
icon_state = "hopsecure1"
icon_closed = "hopsecure"
icon_locked = "hopsecure1"
icon_opened = "hopsecureopen"
icon_broken = "hopsecurebroken"
icon_off = "hopsecureoff"
icon_state = "sec"
icon_door = "hop"
/obj/structure/closet/secure_closet/xo2/fill()
..()
@@ -109,12 +91,7 @@
/obj/structure/closet/secure_closet/hos
name = "head of security's locker"
req_access = list(access_hos)
icon_state = "hossecure1"
icon_closed = "hossecure"
icon_locked = "hossecure1"
icon_opened = "hossecureopen"
icon_broken = "hossecurebroken"
icon_off = "hossecureoff"
icon_state = "hos"
/obj/structure/closet/secure_closet/hos/fill()
..()
@@ -158,12 +135,7 @@
/obj/structure/closet/secure_closet/hos2
name = "head of security's attire"
req_access = list(access_hos)
icon_state = "hossecure1"
icon_closed = "hossecure"
icon_locked = "hossecure1"
icon_opened = "hossecureopen"
icon_broken = "hossecurebroken"
icon_off = "hossecureoff"
icon_state = "hos"
/obj/structure/closet/secure_closet/hos2/fill()
//Appearance
@@ -189,12 +161,7 @@
/obj/structure/closet/secure_closet/warden
name = "warden's locker"
req_access = list(access_armory)
icon_state = "wardensecure1"
icon_closed = "wardensecure"
icon_locked = "wardensecure1"
icon_opened = "wardensecureopen"
icon_broken = "wardensecurebroken"
icon_off = "wardensecureoff"
icon_state = "warden"
/obj/structure/closet/secure_closet/warden/fill()
//Supply
@@ -234,12 +201,8 @@
/obj/structure/closet/secure_closet/security_cadet
name = "security cadet's locker"
req_access = list(access_security)
icon_state = "seccadet1"
icon_closed = "seccadet"
icon_locked = "seccadet1"
icon_opened = "seccadetopen"
icon_broken = "seccadetbroken"
icon_off = "seccadetoff"
icon_state = "sec"
icon_door = "seccadet"
/obj/structure/closet/secure_closet/security_cadet/fill()
//Appearance
@@ -267,12 +230,7 @@
/obj/structure/closet/secure_closet/security
name = "security officer's locker"
req_access = list(access_brig)
icon_state = "sec1"
icon_closed = "sec"
icon_locked = "sec1"
icon_opened = "secopen"
icon_broken = "secbroken"
icon_off = "secoff"
icon_state = "sec"
/obj/structure/closet/secure_closet/security/fill()
//Appearance
@@ -307,12 +265,7 @@
/obj/structure/closet/secure_closet/investigator
name = "investigator's locker"
req_access = list(access_forensics_lockers)
icon_state = "sec1"
icon_closed = "sec"
icon_locked = "sec1"
icon_opened = "secopen"
icon_broken = "secbroken"
icon_off = "secoff"
icon_state = "sec"
/obj/structure/closet/secure_closet/investigator/fill()
//Appearance
@@ -387,42 +340,11 @@
new /obj/item/pen (src)
new /obj/item/storage/briefcase(src)
/obj/structure/closet/secure_closet/wall
name = "wall locker"
req_access = list(access_security)
icon = 'icons/obj/walllocker.dmi'
icon_state = "wall-locker1"
density = 1
icon_closed = "wall-locker"
icon_locked = "wall-locker1"
icon_opened = "wall-lockeropen"
icon_broken = "wall-lockerbroken"
icon_off = "wall-lockeroff"
//too small to put a man in
large = 0
/obj/structure/closet/secure_closet/wall/update_icon()
if(broken)
icon_state = icon_broken
else
if(!opened)
if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
else
icon_state = icon_opened
/obj/structure/closet/secure_closet/bridge_crew
name = "bridge crew's locker"
req_access = list(access_bridge_crew)
icon_state = "hopsecure1"
icon_closed = "hopsecure"
icon_locked = "hopsecure1"
icon_opened = "hopsecureopen"
icon_broken = "hopsecurebroken"
icon_off = "hopsecureoff"
icon_state = "sec"
icon_door = "hop"
/obj/structure/closet/secure_closet/bridge_crew/fill()
..()
@@ -436,12 +358,8 @@
/obj/structure/closet/secure_closet/pilot
name = "pilot's locker"
req_access = list(access_bridge_crew)
icon_state = "hopsecure1"
icon_closed = "hopsecure"
icon_locked = "hopsecure1"
icon_opened = "hopsecureopen"
icon_broken = "hopsecurebroken"
icon_off = "hopsecureoff"
icon_state = "sec"
icon_door = "hop"
/obj/structure/closet/secure_closet/pilot/fill()
..()
@@ -451,4 +369,4 @@
new /obj/item/device/radio/headset/headset_com/alt(src)
new /obj/item/clothing/head/helmet/pilot(src)
new /obj/item/device/radio/off(src)
new /obj/item/device/gps(src)
new /obj/item/device/gps(src)

View File

@@ -3,8 +3,6 @@
name = "sol navy uniform closet"
desc = "It's a storage unit for Sol Alliance navy uniforms."
icon_state = "syndicate1"
icon_closed = "syndicate1"
icon_opened = "syndicate1open"
/obj/structure/closet/sol/navy/fill()
..()
@@ -81,12 +79,7 @@
/obj/structure/closet/secure_closet/soll_officer
name = "sol alliance officer locker"
req_access = list(access_captain)
icon_state = "capsecure1"
icon_closed = "capsecure"
icon_locked = "capsecure1"
icon_opened = "capsecureopen"
icon_broken = "capsecurebroken"
icon_off = "capsecureoff"
icon_state = "cap"
/obj/structure/closet/secure_closet/soll_officer/fill()
..()

View File

@@ -2,9 +2,6 @@
name = "armory closet"
desc = "Why is this here?"
icon_state = "syndicate"
icon_closed = "syndicate"
icon_opened = "syndicateopen"
/obj/structure/closet/syndicate/personal
desc = "It's a storage unit for operative gear."
@@ -22,7 +19,6 @@
new /obj/item/shield/energy(src)
new /obj/item/clothing/shoes/magboots(src)
/obj/structure/closet/syndicate/suit
desc = "It's a storage unit for voidsuits."
@@ -35,7 +31,6 @@
new /obj/item/airbubble/syndie(src)
new /obj/item/airbubble/syndie(src)
/obj/structure/closet/syndicate/nuclear
desc = "It's a storage unit for nuclear-operative gear."

View File

@@ -16,8 +16,6 @@
name = "emergency closet"
desc = "It's a storage unit for emergency breathmasks and o2 tanks."
icon_state = "emergency"
icon_closed = "emergency"
icon_opened = "emergencyopen"
/obj/structure/closet/emcloset/fill()
switch (pickweight(list("small" = 50, "aid" = 20, "tank" = 10, "seal" = 10, "all" = 10)))
@@ -79,15 +77,29 @@
new /obj/item/tank/oxygen(src)
new /obj/item/clothing/mask/gas(src)
/obj/structure/closet/emcloset/offworlder
name = "offworlder supplies"
desc = "It's a storage unit for offworlder breathing apparatus."
/obj/structure/closet/emcloset/offworlder/fill()
new /obj/item/rig/light/offworlder
new /obj/item/rig/light/offworlder
new /obj/item/rig/light/offworlder
new /obj/item/clothing/accessory/offworlder/bracer
new /obj/item/clothing/accessory/offworlder/bracer
new /obj/item/clothing/accessory/offworlder/bracer
new /obj/item/storage/pill_bottle/rmt
new /obj/item/storage/pill_bottle/rmt
new /obj/item/storage/pill_bottle/rmt
new /obj/item/clothing/mask/offworlder
/*
* Fire Closet
*/
/obj/structure/closet/firecloset
name = "fire-safety closet"
desc = "It's a storage unit for fire-fighting supplies."
icon_state = "firecloset"
icon_closed = "firecloset"
icon_opened = "fireclosetopen"
icon_state = "fire"
/obj/structure/closet/firecloset/fill()
new /obj/item/clothing/head/hardhat/firefighter(src)
@@ -113,9 +125,8 @@
/obj/structure/closet/toolcloset
name = "tool closet"
desc = "It's a storage unit for tools."
icon_state = "toolcloset"
icon_closed = "toolcloset"
icon_opened = "toolclosetopen"
icon_state = "eng"
icon_door = "eng_tool"
/obj/structure/closet/toolcloset/fill()
if(prob(40))
@@ -151,6 +162,8 @@
if(prob(40))
new /obj/item/clothing/head/hardhat(src)
/obj/structure/closet/toolcloset/empty/fill()
/*
* Radiation Closet
@@ -158,9 +171,8 @@
/obj/structure/closet/radiation
name = "radiation suit closet"
desc = "It's a storage unit for rad-protective suits."
icon_state = "radsuitcloset"
icon_opened = "toolclosetopen"
icon_closed = "radsuitcloset"
icon_state = "eng"
icon_door = "eng_rad"
/obj/structure/closet/radiation/fill()
for(var/i = 1 to 2)
@@ -176,9 +188,7 @@
/obj/structure/closet/bombcloset
name = "\improper EOD closet"
desc = "It's a storage unit for explosive-defusal equipment."
icon_state = "bombsuit"
icon_closed = "bombsuit"
icon_opened = "bombsuitopen"
icon_state = "bomb"
/obj/structure/closet/bombcloset/fill()
new /obj/item/clothing/suit/bomb_suit(src)
@@ -187,12 +197,10 @@
new /obj/item/clothing/head/bomb_hood(src)
new /obj/item/wirecutters/bomb(src)
/obj/structure/closet/bombclosetsecurity
/obj/structure/closet/bombclosetsecurity // Why the hell is this different? And this is like, only used ONCE! Madness, I tell you.
name = "\improper EOD closet"
desc = "It's a storage unit for the security department's explosive-defusal equipment."
icon_state = "bombsuitsec"
icon_closed = "bombsuitsec"
icon_opened = "bombsuitsecopen"
icon_state = "bombsec"
/obj/structure/closet/bombclosetsecurity/fill()
new /obj/item/clothing/suit/bomb_suit/security(src)
@@ -200,42 +208,3 @@
new /obj/item/clothing/shoes/brown(src)
new /obj/item/clothing/head/bomb_hood/security(src)
new /obj/item/wirecutters/bomb(src)
/*
* Hydrant
*/
/obj/structure/closet/hydrant //wall mounted fire closet
name = "fire-safety closet"
desc = "It's a storage unit for fire-fighting supplies."
icon_state = "hydrant"
icon_closed = "hydrant"
icon_opened = "hydrant_open"
welded_overlay_state = "welded_wallcloset"
anchored = 1
density = 0
wall_mounted = 1
/obj/structure/closet/hydrant/fill()
new /obj/item/clothing/head/hardhat/firefighter(src)
new /obj/item/clothing/suit/fire(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/device/flashlight(src)
new /obj/item/tank/oxygen/red(src)
new /obj/item/extinguisher(src)
if (prob(25))
new /obj/item/ladder_mobile(src)
/*
* First Aid
*/
/obj/structure/closet/medical_wall //wall mounted medical closet
name = "first-aid closet"
desc = "It's wall-mounted storage unit for first aid supplies."
icon_state = "medical_wall"
icon_closed = "medical_wall"
icon_opened = "medical_wall_open"
welded_overlay_state = "welded_wallcloset"
anchored = 1
density = 0
wall_mounted = 1

View File

@@ -2,22 +2,25 @@
//not sure if there's an immediate place for secure wall lockers, but i'm sure the players will think of something
/obj/structure/closet/walllocker
name = "wall locker"
desc = "A wall mounted storage locker."
name = "Wall Locker"
icon = 'icons/obj/walllocker.dmi'
icon_state = "wall-locker"
icon_state = "walllocker" //...man, how OLD is this $#!?
door_anim_angle = 108
door_anim_squish = 0.26
door_hinge = 9.5
door_anim_time = 2.7
store_mobs = FALSE
density = FALSE
anchored = TRUE
store_mobs = FALSE
icon_closed = "wall-locker"
icon_opened = "wall-lockeropen"
wall_mounted = TRUE
/obj/structure/closet/walllocker/emerglocker
name = "emergency locker"
desc = "A wall mounted locker with emergency supplies."
icon_state = "emerg"
icon_closed = "emerg"
icon_opened = "emerg-open"
store_mobs = FALSE
door_anim_time = 0
/obj/structure/closet/walllocker/emerglocker/fill()
for(var/i = 1 to 3)
@@ -41,3 +44,31 @@
/obj/structure/closet/walllocker/emerglocker/east
pixel_x = 32
dir = EAST
/obj/structure/closet/walllocker/firecloset //wall mounted fire closet
name = "fire-safety closet"
desc = "It's a storage unit for fire-fighting supplies."
icon_state = "hydrant"
/obj/structure/closet/walllocker/firecloset/fill()
new /obj/item/clothing/head/hardhat/firefighter(src)
new /obj/item/clothing/suit/fire(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/device/flashlight(src)
new /obj/item/tank/oxygen/red(src)
new /obj/item/extinguisher(src)
if (prob(25))
new /obj/item/ladder_mobile(src)
/obj/structure/closet/walllocker/medical //wall mounted medical closet
name = "first-aid closet"
desc = "It's wall-mounted storage unit for first aid supplies."
icon_state = "medical_wall"
/obj/structure/closet/walllocker/medical/secure
desc = "It's a secure wall-mounted storage unit for first aid supplies."
icon_door = "medical_wall_secure"
icon_door_override = TRUE
secure = TRUE
req_access = list(access_medical_equip)

View File

@@ -1,13 +1,11 @@
/obj/structure/closet/wardrobe
name = "wardrobe"
desc = "It's a storage unit for standard-issue attire."
icon_state = "blue"
icon_closed = "blue"
icon_door = "blue"
/obj/structure/closet/wardrobe/red
name = "security wardrobe"
icon_state = "blue"
icon_closed = "blue"
icon_door = "blue"
/obj/structure/closet/wardrobe/red/fill()
..()
@@ -43,8 +41,7 @@
/obj/structure/closet/wardrobe/pink
name = "pink wardrobe"
icon_state = "pink"
icon_closed = "pink"
icon_door = "pink"
/obj/structure/closet/wardrobe/pink/fill()
..()
@@ -58,8 +55,7 @@
/obj/structure/closet/wardrobe/black
name = "black wardrobe"
icon_state = "black"
icon_closed = "black"
icon_door = "black"
/obj/structure/closet/wardrobe/black/fill()
..()
@@ -78,8 +74,7 @@
/obj/structure/closet/wardrobe/chaplain_black
name = "chapel wardrobe"
desc = "It's a storage unit for approved religious attire."
icon_state = "black"
icon_closed = "black"
icon_door = "black"
/obj/structure/closet/wardrobe/chaplain_black/fill()
..()
@@ -100,8 +95,7 @@
/obj/structure/closet/wardrobe/green
name = "green wardrobe"
icon_state = "green"
icon_closed = "green"
icon_door = "green"
/obj/structure/closet/wardrobe/green/fill()
..()
@@ -115,8 +109,7 @@
/obj/structure/closet/wardrobe/xenos
name = "xenos wardrobe"
icon_state = "green"
icon_closed = "green"
icon_door = "green"
/obj/structure/closet/wardrobe/xenos/fill()
..()
@@ -133,8 +126,7 @@
/obj/structure/closet/wardrobe/orange
name = "prison wardrobe"
desc = "It's a storage unit for regulation prisoner attire."
icon_state = "orange"
icon_closed = "orange"
icon_door = "orange"
/obj/structure/closet/wardrobe/orange/fill()
..()
@@ -149,8 +141,7 @@
/obj/structure/closet/wardrobe/yellow
name = "yellow wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
icon_door = "yellow"
/obj/structure/closet/wardrobe/yellow/fill()
..()
@@ -165,8 +156,7 @@
/obj/structure/closet/wardrobe/atmospherics_yellow
name = "atmospherics wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
icon_door = "yellow"
/obj/structure/closet/wardrobe/atmospherics_yellow/fill()
..()
@@ -193,8 +183,7 @@
/obj/structure/closet/wardrobe/engineering_yellow
name = "engineering wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
icon_door = "yellow"
/obj/structure/closet/wardrobe/engineering_yellow/fill()
..()
@@ -220,8 +209,7 @@
/obj/structure/closet/wardrobe/white
name = "white wardrobe"
icon_state = "white"
icon_closed = "white"
icon_door = "white"
/obj/structure/closet/wardrobe/white/fill()
..()
@@ -236,8 +224,7 @@
/obj/structure/closet/wardrobe/pjs
name = "pajama wardrobe"
icon_state = "white"
icon_closed = "white"
icon_door = "white"
/obj/structure/closet/wardrobe/pjs/fill()
..()
@@ -254,8 +241,7 @@
/obj/structure/closet/wardrobe/science_white
name = "science wardrobe"
icon_state = "white"
icon_closed = "white"
icon_door = "white"
/obj/structure/closet/wardrobe/toxins_white/fill()
..()
@@ -276,11 +262,9 @@
new /obj/item/clothing/head/bandana/science(src)
return
/obj/structure/closet/wardrobe/machinist
name = "Machinist wardrobe"
icon_state = "black"
icon_closed = "black"
name = "machinist wardrobe"
icon_door = "black"
/obj/structure/closet/wardrobe/robotics_black/fill()
..()
@@ -297,8 +281,7 @@
/obj/structure/closet/wardrobe/pharmacy_white
name = "pharmacy wardrobe"
icon_state = "white"
icon_closed = "white"
icon_door = "white"
/obj/structure/closet/wardrobe/pharmacy_white/fill()
..()
@@ -311,11 +294,9 @@
new /obj/item/clothing/suit/storage/toggle/labcoat/pharmacist(src)
return
/obj/structure/closet/wardrobe/virology_white
name = "virology wardrobe"
icon_state = "white"
icon_closed = "white"
icon_door = "white"
/obj/structure/closet/wardrobe/virology_white/fill()
..()
@@ -328,8 +309,7 @@
/obj/structure/closet/wardrobe/medic_white
name = "medical wardrobe"
icon_state = "white"
icon_closed = "white"
icon_door = "white"
/obj/structure/closet/wardrobe/medic_white/fill()
..()
@@ -351,8 +331,7 @@
/obj/structure/closet/wardrobe/grey
name = "grey wardrobe"
icon_state = "grey"
icon_closed = "grey"
icon_door = "grey"
/obj/structure/closet/wardrobe/grey/fill()
..()
@@ -373,8 +352,7 @@
/obj/structure/closet/wardrobe/mixed
name = "mixed wardrobe"
icon_state = "mixed"
icon_closed = "mixed"
icon_door = "mixed"
/obj/structure/closet/wardrobe/mixed/fill()
..()
@@ -396,8 +374,6 @@
/obj/structure/closet/wardrobe/tactical
name = "tactical equipment"
icon_state = "syndicate1"
icon_closed = "syndicate1"
icon_opened = "syndicate1open"
/obj/structure/closet/wardrobe/tactical/fill()
..()
@@ -413,8 +389,7 @@
/obj/structure/closet/wardrobe/suit
name = "suit locker"
icon_state = "mixed"
icon_closed = "mixed"
icon_door = "mixed"
/obj/structure/closet/wardrobe/suit/fill()
..()

View File

@@ -5,139 +5,81 @@
/obj/structure/closet/crate
name = "crate"
desc = "A rectangular steel crate."
icon = 'icons/obj/storage.dmi'
icon = 'icons/obj/crate.dmi'
icon_state = "crate"
icon_opened = "crateopen"
icon_closed = "crate"
climbable = 1
climbable = TRUE
build_amt = 10
var/rigged = 0
var/tablestatus = 0
slowdown = 0
open_sound = 'sound/machines/crate_open.ogg'
close_sound = 'sound/machines/crate_close.ogg'
open_sound_volume = 35
close_sound_volume = 50
store_structure = TRUE
dense_when_open = TRUE
door_anim_squish = 0.30
door_anim_time = 3
door_anim_angle = 140
door_hinge = 3.5
var/tablestatus = 0
var/azimuth_angle_2 = 180 //in this context the azimuth angle for over 90 degree
var/radius_2 = 1.35
var/static/list/animation_math //assoc list with pre calculated values
/obj/structure/closet/crate/can_open()
if (tablestatus != UNDER_TABLE)//Can't be opened while under a table
return 1
return 0
if(tablestatus == UNDER_TABLE)//Can't be opened while under a table
return 0
. = ..()
/obj/structure/closet/crate/can_close()
return 1
/obj/structure/closet/crate/open()
if(opened)
return 0
if(!can_open())
return 0
if(rigged && locate(/obj/item/device/radio/electropack) in src)
if(isliving(usr))
var/mob/living/L = usr
var/touchy_hand
if(L.hand)
touchy_hand = BP_R_HAND
else
touchy_hand = BP_L_HAND
if(L.electrocute_act(17, src, ground_zero = touchy_hand))
spark(src, 5, alldirs)
if(L.stunned)
return 2
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
for(var/obj/O in src)
O.forceMove(get_turf(src))
if(climbable)
structure_shaken()
for (var/mob/M in src)
M.forceMove(get_turf(src))
if (M.stat == CONSCIOUS)
M.visible_message(SPAN_DANGER("\The [M.name] bursts out of the [src]!"), SPAN_DANGER("You burst out of the [src]!"))
else
M.visible_message(SPAN_DANGER("\The [M.name] tumbles out of the [src]!"))
icon_state = icon_opened
opened = 1
pass_flags = 0
return 1
/obj/structure/closet/crate/close()
if(!opened)
return 0
if(!can_close())
return 0
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
var/itemcount = 0
for(var/obj/O in get_turf(src))
if(itemcount >= storage_capacity)
break
if(O.density || O.anchored || istype(O,/obj/structure/closet))
continue
if(istype(O, /obj/structure/bed)) //This is only necessary because of rollerbeds and swivel chairs.
var/obj/structure/bed/B = O
if(B.buckled)
continue
O.forceMove(src)
itemcount++
icon_state = icon_closed
opened = 0
return 1
/obj/structure/closet/crate/attackby(obj/item/W as obj, mob/user as mob)
if(opened)
return ..()
else if(istype(W, /obj/item/stack/packageWrap))
/obj/structure/closet/crate/animate_door(var/closing = FALSE)
if(!door_anim_time)
return
else if(W.iscoil())
var/obj/item/stack/cable_coil/C = W
if(rigged)
to_chat(user, "<span class='notice'>[src] is already rigged!</span>")
return
if (C.use(1))
to_chat(user, "<span class='notice'>You rig [src].</span>")
rigged = 1
return
else if(istype(W, /obj/item/device/radio/electropack))
if(rigged)
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
user.drop_from_inventory(W,src)
return
else if(W.iswirecutter())
if(rigged)
to_chat(user, "<span class='notice'>You cut away the wiring.</span>")
playsound(loc, 'sound/items/wirecutter.ogg', 100, 1)
rigged = 0
return
else if(istype(W, /obj/item/device/hand_labeler))
var/obj/item/device/hand_labeler/HL = W
if (HL.mode == 1)
return
if(!door_obj) door_obj = new
if(animation_math == null) //checks if there is already a list for animation_math if not creates one to avoid runtimes
animation_math = new/list()
if(!door_anim_time == 0 && !animation_math["[door_anim_time]-[door_anim_angle]-[azimuth_angle_2]-[radius_2]-[door_hinge]"])
animation_list()
vis_contents |= door_obj
door_obj.icon = icon
door_obj.icon_state = "[icon_door || icon_state]_door"
is_animating_door = TRUE
var/num_steps = door_anim_time / world.tick_lag
var/list/animation_math_list = animation_math["[door_anim_time]-[door_anim_angle]-[azimuth_angle_2]-[radius_2]-[door_hinge]"]
for(var/I in 0 to num_steps)
var/door_state = I == (closing ? num_steps : 0) ? "[icon_door || icon_state]_door" : animation_math_list[closing ? 2 * num_steps - I : num_steps + I] <= 0 ? "[icon_door_override ? icon_door : icon_state]_back" : "[icon_door || icon_state]_door"
var/door_layer = I == (closing ? num_steps : 0) ? ABOVE_MOB_LAYER : animation_math_list[closing ? 2 * num_steps - I : num_steps + I] <= 0 ? FLOAT_LAYER : ABOVE_MOB_LAYER
var/matrix/M = get_door_transform(I == (closing ? num_steps : 0) ? 0 : animation_math_list[closing ? num_steps - I : I], I == (closing ? num_steps : 0) ? 1 : animation_math_list[closing ? 2 * num_steps - I : num_steps + I])
if(I == 0)
door_obj.transform = M
door_obj.icon_state = door_state
door_obj.layer = door_layer
else if(I == 1)
animate(door_obj, transform = M, icon_state = door_state, layer = door_layer, time = world.tick_lag, flags = ANIMATION_END_NOW)
else
attack_hand(user)
else return attack_hand(user)
animate(transform = M, icon_state = door_state, layer = door_layer, time = world.tick_lag)
addtimer(CALLBACK(src,.proc/end_door_animation),door_anim_time,TIMER_UNIQUE|TIMER_OVERRIDE)
/obj/structure/closet/crate/ex_act(severity)
switch(severity)
if(1)
health -= rand(120, 240)
if(2)
health -= rand(60, 120)
if(3)
health -= rand(30, 60)
/obj/structure/closet/crate/get_door_transform(crateanim_1, crateanim_2)
var/matrix/M = matrix()
M.Translate(0, -door_hinge)
M.Multiply(matrix(1, crateanim_1, 0, 0, crateanim_2, 0))
M.Translate(0, door_hinge)
return M
if (health <= 0)
for (var/atom/movable/A as mob|obj in src)
A.forceMove(loc)
if (prob(50) && severity > 1)//Higher chance of breaking contents
A.ex_act(severity-1)
else
A.ex_act(severity)
qdel(src)
/obj/structure/closet/crate/proc/animation_list() //pre calculates a list of values for the crate animation cause byond not like math
var/num_steps_1 = door_anim_time / world.tick_lag
var/list/new_animation_math_sublist[num_steps_1 * 2]
for(var/I in 1 to num_steps_1) //loop to save the animation values into the lists
var/angle_1 = door_anim_angle * (I / num_steps_1)
var/polar_angle = abs(arcsin(cos(angle_1)))
var/azimuth_angle = angle_1 >= 90 ? azimuth_angle_2 : 0
var/radius_cr = angle_1 >= 90 ? radius_2 : 1
new_animation_math_sublist[I] = -sin(polar_angle) * sin(azimuth_angle) * radius_cr
new_animation_math_sublist[num_steps_1 + I] = cos(azimuth_angle) * sin(polar_angle) * radius_cr
animation_math["[door_anim_time]-[door_anim_angle]-[azimuth_angle_2]-[radius_2]-[door_hinge]"] = new_animation_math_sublist
/*
==========================
@@ -169,8 +111,8 @@
set_tablestatus(FALSE)
/obj/structure/closet/crate/toggle(var/mob/user)
if (!opened && tablestatus == UNDER_TABLE)
to_chat(user, SPAN_WARNING("You can't open that while the lid is obstructed!"))
if(!opened && tablestatus == UNDER_TABLE)
to_chat(user, SPAN_WARNING("You can't open \the [src] while the lid is obstructed!"))
return FALSE
else
return ..()
@@ -250,150 +192,49 @@
=====================
*/
/obj/structure/closet/crate/secure
name = "secure crate"
desc = "A secure crate."
name = "Secure crate"
icon_state = "securecrate"
icon_opened = "securecrateopen"
icon_closed = "securecrate"
var/redlight = "securecrater"
var/greenlight = "securecrateg"
var/sparks = "securecratesparks"
var/emag = "securecrateemag"
var/broken = 0
var/locked = 1
icon_state = "secure_crate"
secure = TRUE
secure_lights = TRUE
health = 200
/obj/structure/closet/crate/secure/Initialize()
. = ..()
if(locked)
cut_overlays()
add_overlay(redlight)
else
cut_overlays()
add_overlay(greenlight)
/obj/structure/closet/crate/secure/can_open()
if (..())
return !locked
/obj/structure/closet/crate/secure/proc/togglelock(mob/user as mob)
if(opened)
to_chat(user, "<span class='notice'>Close the crate first.</span>")
return
if(broken)
to_chat(user, "<span class='warning'>The crate appears to be broken.</span>")
return
if(allowed(user))
set_locked(!locked, user)
return 1
else
to_chat(user, "<span class='notice'>Access Denied</span>")
/obj/structure/closet/crate/secure/proc/set_locked(var/newlocked, mob/user = null)
if(locked == newlocked) return
locked = newlocked
if(user)
for(var/mob/O in viewers(user, 3))
O.show_message( "<span class='notice'>The crate has been [locked ? null : "un"]locked by [user].</span>", 1)
cut_overlays()
add_overlay(locked ? redlight : greenlight)
/obj/structure/closet/crate/secure/verb/verb_togglelock()
set src in oview(1) // One square distance
set category = "Object"
set name = "Toggle Lock"
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr) || isrobot(usr))
add_fingerprint(usr)
togglelock(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/crate/secure/attack_hand(mob/user as mob)
add_fingerprint(user)
if(locked)
return togglelock(user)
else
return toggle(user)
/obj/structure/closet/crate/secure/attackby(obj/item/W as obj, mob/user as mob)
if(is_type_in_list(W, list(/obj/item/stack/packageWrap, /obj/item/stack/cable_coil, /obj/item/device/radio/electropack, /obj/item/wirecutters)))
return ..()
if(istype(W, /obj/item/melee/energy/blade))
emag_act(INFINITY, user)
if(istype(W, /obj/item/device/hand_labeler))
var/obj/item/device/hand_labeler/HL = W
if (HL.mode == 1)
return
else if(!opened)
togglelock(user)
return
else if(!opened)
togglelock(user)
return
return ..()
/obj/structure/closet/crate/secure/emag_act(var/remaining_charges, var/mob/user)
if(!broken)
cut_overlays()
add_overlay(emag)
add_overlay(sparks)
CUT_OVERLAY_IN(sparks, 6)
playsound(loc, /decl/sound_category/spark_sound, 60, 1)
locked = 0
broken = 1
to_chat(user, "<span class='notice'>You unlock \the [src].</span>")
return 1
/obj/structure/closet/crate/secure/emp_act(severity)
for(var/obj/O in src)
O.emp_act(severity)
if(!broken && !opened && prob(50/severity))
if(!locked)
locked = 1
cut_overlays()
add_overlay(redlight)
else
cut_overlays()
add_overlay(emag)
add_overlay(sparks)
CUT_OVERLAY_IN(sparks, 6)
playsound(loc, 'sound/effects/sparks4.ogg', 75, 1)
locked = 0
if(!opened && prob(20/severity))
if(!locked)
open()
else
req_access = list()
req_access += pick(get_all_station_access())
..()
/obj/structure/closet/crate/plastic
name = "plastic crate"
desc = "A rectangular plastic crate."
icon_state = "plasticcrate"
icon_opened = "plasticcrateopen"
icon_closed = "plasticcrate"
icon_state = "plastic_crate"
/obj/structure/closet/crate/coffin
name = "coffin"
desc = "It's a burial receptacle for the dearly departed."
icon_state = "coffin"
build_amt = 5
open_sound = 'sound/machines/wooden_closet_open.ogg'
close_sound = 'sound/machines/wooden_closet_close.ogg'
open_sound_volume = 25
close_sound_volume = 50
door_anim_angle = 140
azimuth_angle_2 = 180
door_anim_time = 5
door_hinge = 5
/obj/structure/closet/crate/internals
name = "internals crate"
desc = "A internals crate."
icon_state = "o2crate"
icon_opened = "o2crateopen"
icon_closed = "o2crate"
icon_state = "o2_crate"
/obj/structure/closet/crate/trashcart
name = "trash cart"
desc = "A heavy, metal trashcart with wheels."
icon_state = "trashcart"
icon_opened = "trashcartopen"
icon_closed = "trashcart"
door_hinge = 2.5
/obj/structure/closet/crate/miningcart
desc = "A mining cart. This one doesn't work on rails, but has to be dragged."
name = "mining cart"
icon_state = "miningcart"
door_hinge = 2.5
/*these aren't needed anymore
/obj/structure/closet/crate/hat
@@ -414,16 +255,14 @@
/obj/structure/closet/crate/medical
name = "medical crate"
desc = "A medical crate."
icon_state = "medicalcrate"
icon_opened = "medicalcrateopen"
icon_closed = "medicalcrate"
icon_state = "medical_crate"
/obj/structure/closet/crate/rfd
name = "\improper RFD C-Class crate"
desc = "A crate with a Rapid-Fabrication-Device C-Class."
icon_state = "crate"
icon_opened = "crateopen"
icon_closed = "crate"
icon_state = "eng_tool"
icon_door_override = TRUE
icon_door = "eng"
/obj/structure/closet/crate/rfd/fill()
new /obj/item/rfd_ammo(src)
@@ -433,6 +272,9 @@
/obj/structure/closet/crate/solar
name = "solar pack crate"
icon_state = "eng_elec"
icon_door_override = TRUE
icon_door = "eng"
/obj/structure/closet/crate/solar/fill()
new /obj/item/solar_assembly(src)
@@ -464,8 +306,7 @@
name = "freezer"
desc = "A freezer."
icon_state = "freezer"
icon_opened = "freezeropen"
icon_closed = "freezer"
door_hinge = 4.5
var/target_temp = T0C - 40
var/cooling_power = 40
@@ -495,31 +336,34 @@
name = "large bin"
desc = "A large bin."
icon_state = "largebin"
icon_opened = "largebinopen"
icon_closed = "largebin"
/obj/structure/closet/crate/drop
name = "drop crate"
desc = "A large, sturdy crate meant for airdrops."
icon_state = "dropcrate"
icon_opened = "dropcrate-open"
icon_closed = "dropcrate"
icon_state = "drop_crate"
door_hinge = 0.5
/obj/structure/closet/crate/drop/grey
name = "drop crate"
desc = "A large, sturdy crate meant for airdrops."
icon_state = "dropcrate-grey"
icon_opened = "dropcrate-grey-open"
icon_closed = "dropcrate-grey"
icon_state = "drop_crate-grey"
door_hinge = 0.5
/obj/structure/closet/crate/radiation
/obj/structure/closet/crate/tool
name = "tool crate"
desc = "It's a crate for storing tools."
icon_state = "eng_tool"
icon_door_override = TRUE
icon_door = "eng"
/obj/structure/closet/crate/rad
name = "radioactive gear crate"
desc = "A crate with a radiation sign on it."
icon_state = "radiation"
icon_opened = "radiationopen"
icon_closed = "radiation"
icon_state = "eng_rad"
icon_door_override = TRUE
icon_door = "eng"
/obj/structure/closet/crate/radiation/fill()
/obj/structure/closet/crate/rad/gear/fill()
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
@@ -529,70 +373,86 @@
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
/obj/structure/closet/crate/elec
name = "electrical supplies crate"
desc = "It's a crate for storing electrical equipment."
icon_state = "eng_elec"
icon_door_override = TRUE
icon_door = "eng"
/obj/structure/closet/crate/weld
name = "welding supplies crate"
desc = "It's a crate for storing welding tools."
icon_state = "eng_weld"
icon_door_override = TRUE
icon_door = "eng"
/obj/structure/closet/crate/secure/aimodules
name = "AI modules crate"
desc = "A secure crate full of AI modules."
icon_state = "science_crate"
req_access = list(access_cent_specops)
/obj/structure/closet/crate/secure/aimodules/fill()
for(var/moduletype in subtypesof(/obj/item/aiModule))
new moduletype(src)
/obj/structure/closet/crate/weapon
name = "weapons crate"
desc = "A weapons crate."
icon_state = "syndi_crate" //haha this pun was totally worth it.
/obj/structure/closet/crate/weapon/alt
icon_state = "syndi_crate1"
/obj/structure/closet/crate/secure/weapon
name = "weapons crate"
desc = "A secure weapons crate."
icon_state = "weaponcrate"
icon_opened = "weaponcrateopen"
icon_closed = "weaponcrate"
icon_state = "syndi_secure_crate"
icon_door_override = TRUE
icon_door = "syndi_crate"
/obj/structure/closet/crate/secure/weapon/alt
icon_state = "syndi_secure_crate1"
icon_door = "syndi_crate1"
/obj/structure/closet/crate/secure/legion
name = "foreign legion supply crate"
desc = "A secure supply crate, It carries the insignia of the Tau Ceti Foreign Legion. It appears quite scuffed."
icon_state = "tcflcrate"
icon_opened = "tcflcrateopen"
icon_closed = "tcflcrate"
icon_state = "tcfl_crate"
req_access = list(access_legion)
/obj/structure/closet/crate/secure/phoron
name = "phoron crate"
desc = "A secure phoron crate."
icon_state = "phoroncrate"
icon_opened = "phoroncrateopen"
icon_closed = "phoroncrate"
icon_state = "phoron_crate"
open_sound = 'sound/machines/wooden_closet_open.ogg'
close_sound = 'sound/machines/wooden_closet_close.ogg'
/obj/structure/closet/crate/secure/gear
name = "gear crate"
desc = "A secure gear crate."
icon_state = "secgearcrate"
icon_opened = "secgearcrateopen"
icon_closed = "secgearcrate"
icon_state = "secgear_crate"
/obj/structure/closet/crate/secure/hydrosec
name = "secure hydroponics crate"
desc = "A crate with a lock on it, painted in the scheme of the station's botanists."
icon_state = "hydrosecurecrate"
icon_opened = "hydrosecurecrateopen"
icon_closed = "hydrosecurecrate"
icon_state = "hydro_secure_crate"
/obj/structure/closet/crate/secure/bin
name = "secure bin"
desc = "A secure bin."
icon_state = "largebins"
icon_opened = "largebinsopen"
icon_closed = "largebins"
redlight = "largebinr"
greenlight = "largebing"
sparks = "largebinsparks"
emag = "largebinemag"
icon_door_overlay = "largebin"
icon_door_override = TRUE
icon_door = "largebin"
/obj/structure/closet/crate/large
name = "large crate"
desc = "A hefty metal crate."
icon = 'icons/obj/storage.dmi'
icon_state = "largemetal"
icon_opened = "largemetalopen"
icon_closed = "largemetal"
health = 200
door_anim_time = 0
/obj/structure/closet/crate/large/close()
. = ..()
@@ -615,13 +475,11 @@
/obj/structure/closet/crate/secure/large
name = "large crate"
desc = "A hefty metal crate with an electronic locking system."
icon = 'icons/obj/storage.dmi'
icon_state = "largemetal"
icon_opened = "largemetalopen"
icon_closed = "largemetal"
redlight = "largemetalr"
greenlight = "largemetalg"
icon_door_overlay = "largemetal"
health = 400
secure_lights = FALSE
door_anim_time = 0
/obj/structure/closet/crate/secure/large/close()
. = ..()
@@ -641,19 +499,10 @@
break
return
//fluff variant
/obj/structure/closet/crate/secure/large/reinforced
desc = "A hefty, reinforced metal crate with an electronic locking system."
icon_state = "largermetal"
icon_opened = "largermetalopen"
icon_closed = "largermetal"
/obj/structure/closet/crate/hydroponics
name = "hydroponics crate"
desc = "All you need to destroy those pesky weeds and pests."
icon_state = "hydrocrate"
icon_opened = "hydrocrateopen"
icon_closed = "hydrocrate"
icon_state = "hydro_crate"
/obj/structure/closet/crate/hydroponics/prespawned
//This exists so the prespawned hydro crates spawn with their contents.
@@ -675,33 +524,10 @@
//Quantity of spawns is number of discrete selections from the loot lists, default 10
/obj/structure/closet/crate/loot
name = "unusual container"
desc = "A mysterious container of unknown origins. What mysteries lie within?"
var/rarity = 1
var/quantity = 10
var/list/spawntypes
//The crate chooses its icon randomly from a number of noticeable options.
//None of these are the standard grey crate sprite, and a few are currently unused ingame
//This ensures that people stumbling across a lootbox will notice it's different and investigate
var/list/iconchoices = list(
"radiation" = "radiationopen",
"o2crate" = "o2crateopen",
"freezer" = "freezeropen",
"weaponcrate" = "weaponcrateopen",
"largebins" = "largebinsopen",
"phoroncrate" = "phoroncrateopen",
"trashcart" = "trashcartopen",
"critter" = "critteropen",
"largemetal" = "largemetalopen",
"medicalcrate" = "medicalcrateopen",
"tcflcrate" = "tcflcrateopen",
"necrocrate" = "necrocrateopen",
"zenghucrate" = "zenghucrateopen",
"hephcrate" = "hephcrateopen"
)
/obj/structure/closet/crate/loot/Initialize(mapload)
. = ..()
@@ -711,12 +537,19 @@
"3" = (100 - ((STOCK_RARE_PROB * rarity) + (STOCK_UNCOMMON_PROB * rarity)))
)
icon_closed = pick(iconchoices)
icon_opened = iconchoices[icon_closed]
update_icon()
for (var/i in 1 to quantity)
var/icontype = pick(typesof(/obj/structure/closet/crate) - typesof(/obj/structure/closet/crate/secure/gear_loadout))
var/obj/structure/closet/crate/C = new icontype(src.loc)
C.name = "unusual container"
C.desc = "A mysterious container of unknown origins. What mysteries lie within?"
if(C.secure)
C.secure = FALSE
C.update_icon()
for(var/i in 1 to quantity)
var/newtype = get_spawntype()
call(newtype)(src)
call(newtype)(C)
qdel(src)
/obj/structure/closet/crate/loot/proc/get_spawntype()
var/stocktype = pickweight(spawntypes)
@@ -731,6 +564,7 @@
/obj/structure/closet/crate/extinguisher_cartridges
name = "crate of extinguisher cartridges"
desc = "Contains a dozen empty extinguisher cartridges."
icon_state = "fire"
/obj/structure/closet/crate/extinguisher_cartridges/fill()
for(var/a = 1 to 12)
@@ -739,10 +573,7 @@
/obj/structure/closet/crate/autakh
name = "aut'akh crate"
desc = "Contains a number of limbs and augmentations created by the Aut'akh Commune."
icon = 'icons/obj/storage.dmi'
icon_state = "autakh_crate"
icon_opened = "autakh_crateopen"
icon_closed = "autakh_crate"
/obj/structure/closet/crate/autakh/fill()
new /obj/item/organ/external/arm/right/autakh(src)
@@ -765,3 +596,9 @@
new /obj/item/organ/external/hand/right/autakh/tool/mining(src)
new /obj/item/organ/external/hand/right/autakh/medical(src)
new /obj/item/organ/external/hand/right/autakh/security(src)
/obj/structure/closet/crate/security
name = "security crate"
desc = "A secure security crate. Secure."
icon_state = "security_crate"
secure = TRUE

View File

@@ -6,30 +6,26 @@
/obj/structure/closet/crate/gear_loadout/hephaestus
desc = "A sturdy crate with Hephaestus Industries branding."
name = "hephaestus drop crate"
icon_state = "hephcrate"
icon_opened = "hephcrateopen"
icon_closed = "hephcrate"
icon_state = "heph_crate"
door_hinge = 0.5
/obj/structure/closet/crate/gear_loadout/zenghu
desc = "A sturdy crate with Zeng-Hu Pharmaceuticals branding."
name = "zeng-hu drop crate"
icon_state = "zenghucrate"
icon_opened = "zenghucrateopen"
icon_closed = "zenghucrate"
icon_state = "zenghu_crate"
door_hinge = 0.5
/obj/structure/closet/crate/gear_loadout/einstein
desc = "A sturdy crate with Einstein Engines branding."
name = "einstein drop crate"
icon_state = "einsteincrate"
icon_opened = "einsteincrateopen"
icon_closed = "einsteincrate"
icon_state = "einstein_crate"
door_hinge = 0.5
/obj/structure/closet/crate/gear_loadout/zavodskoi
desc = "A sturdy crate with Zavodskoi Interstellar branding."
name = "zavodskoi interstellar drop crate"
icon_state = "necrocrate"
icon_opened = "necrocrateopen"
icon_closed = "necrocrate"
icon_state = "necro_crate"
door_hinge = 0.5
/obj/structure/closet/crate/secure/gear_loadout/coalition/fill()
new /obj/item/rig/gunslinger/equipped(src)
@@ -469,4 +465,4 @@
new /obj/item/clothing/accessory/holster/armpit/brown(src)
new /obj/item/gun/projectile/pistol(src)
new /obj/item/ammo_magazine/mc9mm(src)
new /obj/item/ammo_magazine/mc9mm(src)
new /obj/item/ammo_magazine/mc9mm(src)

View File

@@ -3,10 +3,10 @@
desc = "A hefty wooden crate."
icon = 'icons/obj/storage.dmi'
icon_state = "densecrate"
density = 1
density = TRUE
/obj/structure/largecrate/attack_hand(mob/user as mob)
to_chat(user, "<span class='notice'>You need a crowbar to pry this open!</span>")
to_chat(user, SPAN_NOTICE("You need a crowbar to pry this open!"))
return
/obj/structure/largecrate/attackby(obj/item/W as obj, mob/user as mob)
@@ -15,9 +15,9 @@
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
if(AM.simulated) AM.forceMove(T)
user.visible_message("<span class='notice'>[user] pries \the [src] open.</span>", \
"<span class='notice'>You pry open \the [src].</span>", \
"<span class='notice'>You hear splitting wood.</span>")
user.visible_message(SPAN_NOTICE("[user] pries \the [src] open."), \
SPAN_NOTICE("You pry open \the [src]."), \
SPAN_NOTICE("You hear splitting wood."))
for(var/obj/vehicle/V in T.contents)
if(V)
V.unload(user)
@@ -96,4 +96,4 @@
/obj/structure/largecrate/animal/hakhma
name = "hakhma crate"
held_type = /mob/living/simple_animal/hakhma
held_type = /mob/living/simple_animal/hakhma

View File

@@ -215,7 +215,7 @@
return
playsound(src.loc, W.usesound, 100, 1)
if(anchored)
user.visible_message("<b>[user]</b> begins unsecuring the airlock assembly from the floor.", \
SPAN_NOTICE("You start unsecuring the airlock assembly from the floor."))
@@ -411,4 +411,4 @@
#undef STATE_UNWIRED
#undef STATE_WIRED
#undef STATE_ELECTRONICS_INSTALLED
#undef STATE_ELECTRONICS_INSTALLED

View File

@@ -9,7 +9,7 @@
icon_state = "cart"
anchored = 0
density = 1
climbable = 1
climbable = TRUE
flags = OPENCONTAINER
build_amt = 15
//copypaste sorry

View File

@@ -118,7 +118,7 @@
icon_state = "pit0"
/obj/structure/pit/closed/grave/Initialize()
var/obj/structure/closet/coffin/C = new(src.loc)
var/obj/structure/closet/crate/coffin/C = new(src.loc)
var/obj/effect/decal/remains/human/bones = new(C)
bones.layer = BELOW_MOB_LAYER
var/obj/structure/gravemarker/random/R = new(src.loc)
@@ -149,7 +149,7 @@
/obj/structure/gravemarker/random/proc/generate()
icon_state = pick("wood","cross")
var/nam = random_name(MALE, SPECIES_HUMAN)
message = "Here lies [nam]."
@@ -163,4 +163,4 @@
if(istype(W,/obj/item/pen))
var/msg = sanitize(input(user, "What should it say?", "Grave marker", message) as text|null)
if(msg)
message = msg
message = msg

View File

@@ -8,9 +8,14 @@
name = "underwear wardrobe"
desc = "Holds item of clothing you shouldn't be showing off in the hallways."
icon = 'icons/obj/closet.dmi'
icon_state = "cabinet_closed"
icon_state = "cabinet"
density = 1
/obj/structure/undies_wardrobe/Initialize(mapload)
. = ..()
add_overlay("cabinet_door")
add_overlay("cabinet_door_alt")
/obj/structure/undies_wardrobe/attack_hand(var/mob/user)
if(!human_who_can_use_underwear(user))
to_chat(user, "<span class='warning'>Sadly there's nothing in here for you to wear.</span>")

View File

@@ -3,7 +3,7 @@
icon = 'icons/obj/battle_monsters/furniture.dmi'
anchored = 1
density = 1
climbable = 1
climbable = TRUE
throwpass = 1
/obj/structure/dueling_table/no_collide

View File

@@ -92,7 +92,7 @@
reward_high = 3000
required_count = 3
random_count = 1
wanted_types = list(/obj/structure/closet/coffin, /obj/item/material/urn)
wanted_types = list(/obj/structure/closet/crate/coffin, /obj/item/material/urn)
/datum/bounty/item/engineer/pap
name = "Portable Air Pumps"

View File

@@ -29,7 +29,7 @@
/datum/export/large/crate/coffin
cost = 250//50 wooden crates cost 2000 points, and you can make 10 coffins in seconds with those planks. Each coffin selling for 250 means you can make a net gain of 500 points for wasting your time making coffins.
unit_name = "coffin"
export_types = list(/obj/structure/closet/coffin)
export_types = list(/obj/structure/closet/crate/coffin)
/datum/export/large/reagent_dispenser
cost = 100 // +0-400 depending on amount of reagents left

View File

@@ -308,12 +308,6 @@ STOCK_ITEM_UNCOMMON(laserscalpel, 1.3)
STOCK_ITEM_UNCOMMON(electropack, 1)
new /obj/item/device/radio/electropack(L)
if(istype(L, /obj/structure/closet/crate) && prob(40))
var/obj/structure/closet/crate/cr = L
cr.rigged = TRUE
//Boobytrapped crate, will electrocute when you attempt to open it
//Can be disarmed with wirecutters or ignored with insulated gloves
STOCK_ITEM_UNCOMMON(randomhide, 0.5)
var/obj/item/stack/material/animalhide/spawn_hide = pick(typesof(/obj/item/stack/material/animalhide))
new spawn_hide(L, rand(5, 50))

View File

@@ -121,8 +121,7 @@
/obj/structure/closet/lasertag
name = "red laser tag equipment"
desc = "It's a storage unit for laser tag equipment."
icon_state = "red"
icon_closed = "red"
icon_door = "red"
var/helmet_path = /obj/item/clothing/head/helmet/riot/laser_tag
var/armor_path = /obj/item/clothing/suit/armor/riot/laser_tag
var/gun_path = /obj/item/gun/energy/lasertag/red
@@ -137,8 +136,7 @@
/obj/structure/closet/lasertag/blue
name = "blue laser tag equipment"
icon_state = "blue"
icon_closed = "blue"
icon_door = "blue"
helmet_path = /obj/item/clothing/head/helmet/riot/laser_tag/blue
armor_path = /obj/item/clothing/suit/armor/riot/laser_tag/blue
gun_path = /obj/item/gun/energy/lasertag/blue
gun_path = /obj/item/gun/energy/lasertag/blue

View File

@@ -158,7 +158,7 @@
new /datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20),
new /datum/stack_recipe("wooden chair", /obj/structure/bed/stool/chair/wood, BUILD_AMT, time = 10, one_per_turf = 1, on_floor = 1),
new /datum/stack_recipe("crossbow frame", /obj/item/crossbowframe, 5, time = 25, one_per_turf = 0, on_floor = 0),
new /datum/stack_recipe("coffin", /obj/structure/closet/coffin, BUILD_AMT, time = 15, one_per_turf = 1, on_floor = 1),
new /datum/stack_recipe("coffin", /obj/structure/closet/crate/coffin, BUILD_AMT, time = 15, one_per_turf = 1, on_floor = 1),
new /datum/stack_recipe("rifle stock", /obj/item/stock, 10, time = 25, one_per_turf = 0, on_floor = 0),
new /datum/stack_recipe("beehive assembly", /obj/item/beehive_assembly, 4),
new /datum/stack_recipe("beehive frame", /obj/item/honey_frame, 1),

View File

@@ -1,9 +1,6 @@
/obj/structure/closet/crate/secure/loot
name = "abandoned crate"
desc = "What could be inside?"
icon_state = "securecrate"
icon_opened = "securecrateopen"
icon_closed = "securecrate"
var/list/code = list()
var/list/lastattempt = list()
var/attempts = 15
@@ -162,7 +159,8 @@
else if(check_input(input))
to_chat(user, SPAN_NOTICE("The crate unlocks!"))
playsound(user, 'sound/machines/lockreset.ogg', 50, 1)
set_locked(FALSE)
locked = FALSE
update_icon()
else
visible_message(SPAN_WARNING("A red light on \the [src]'s control panel flashes briefly."))
attempts--

View File

@@ -2,12 +2,7 @@
/obj/structure/closet/secure_closet/miner
name = "shaft miner locker"
icon_state = "miningsec1"
icon_closed = "miningsec"
icon_locked = "miningsec1"
icon_opened = "miningsecopen"
icon_broken = "miningsecbroken"
icon_off = "miningsecoff"
icon_state = "mining"
req_access = list(access_mining)
/obj/structure/closet/secure_closet/miner/fill()

View File

@@ -62,12 +62,7 @@
/obj/structure/closet/secure_closet/xenoarchaeologist
name = "xenoarchaeologist locker"
req_access = list(access_tox_storage)
icon_state = "secureres1"
icon_closed = "secureres"
icon_locked = "secureres1"
icon_opened = "secureresopen"
icon_broken = "secureresbroken"
icon_off = "secureresoff"
icon_state = "science"
/obj/structure/closet/secure_closet/xenoarchaeologist/fill()
new /obj/item/clothing/under/rank/scientist(src)
@@ -81,9 +76,8 @@
/obj/structure/closet/excavation
name = "excavation tools"
icon_state = "toolcloset"
icon_closed = "toolcloset"
icon_opened = "toolclosetopen"
icon_state = "eng"
icon_door = "eng_tool"
/obj/structure/closet/excavation/fill()
new /obj/item/storage/belt/archaeology(src)

View File

@@ -85,7 +85,7 @@
set_dir(direction)
if(dir != NORTH)
layer = 5
climbable = 0 //flipping tables allows them to be used as makeshift barriers
climbable = FALSE //flipping tables allows them to be used as makeshift barriers
flipped = 1
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
@@ -114,4 +114,4 @@
update_connections(1)
update_icon()
return 1
return 1

View File

@@ -5,7 +5,7 @@
desc = "It's a table, for putting things on. Or standing on, if you really want to."
density = 1
anchored = 1
climbable = 1
climbable = TRUE
layer = LAYER_TABLE
throwpass = 1
var/flipped = 0

View File

@@ -1,69 +0,0 @@
#define UNDERSCORE_OR_NULL(target) "[target ? "[target]_" : ""]"
/datum/unit_test/hardsuit_sprite_test
name = "Hardsuit Sprite Test"
/datum/unit_test/hardsuit_sprite_test/start_test()
for(var/rig_path in subtypesof(/obj/item/rig))
var/obj/item/rig/R = new rig_path
var/list/rig_states = icon_states(R.icon)
if(!(R.icon_state in rig_states))
fail("[R.name]'s module icon_state isn't in its icon file.")
if(!("[R.icon_state]_ba" in rig_states))
fail("[R.name]'s on-back module icon_state isn't in its icon file.")
var/list/species_to_check = list("") // blank means default, human
if(length(R.icon_supported_species_tags))
species_to_check += R.icon_supported_species_tags
if(R.helm_type)
if(!("[R.icon_state]_helmet" in rig_states))
fail("[R.name]'s helmet icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_helmet" in rig_states))
fail("[R.name]'s sealed helmet icon_state isn't in its icon file.")
if(R.suit_type)
if(!("[R.icon_state]_suit" in rig_states))
fail("[R.name]'s suit icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_suit" in rig_states))
fail("[R.name]'s sealed suit icon_state isn't in its icon file.")
if(R.glove_type)
if(!("[R.icon_state]_gloves" in rig_states))
fail("[R.name]'s gloves icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_gloves" in rig_states))
fail("[R.name]'s sealed gloves icon_state isn't in its icon file.")
if(R.boot_type)
if(!("[R.icon_state]_shoes" in rig_states))
fail("[R.name]'s shoes icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_shoes" in rig_states))
fail("[R.name]'s sealed shoes icon_state isn't in its icon file.")
for(var/short in species_to_check)
short = UNDERSCORE_OR_NULL(short)
if(R.helm_type)
if(!("[short][R.icon_state]_he" in rig_states))
fail("[short] [R.name]'s helmet item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_he" in rig_states))
fail("[short] [R.name]'s sealed helmet item_state isn't in its icon file.")
if(R.suit_type)
if(!("[short][R.icon_state]_su" in rig_states))
fail("[short] [R.name]'s suit item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_su" in rig_states))
fail("[short] [R.name]'s sealed suit item_state isn't in its icon file.")
if(R.glove_type)
if(!("[short][R.icon_state]_gl" in rig_states))
fail("[short] [R.name]'s gloves item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_gl" in rig_states))
fail("[short] [R.name]'s sealed gloves item_state isn't in its icon file.")
if(R.boot_type)
if(!("[short][R.icon_state]_sh" in rig_states))
fail("[short] [R.name]'s shoes item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_sh" in rig_states))
fail("[short] [R.name]'s sealed shoes item_state isn't in its icon file.")
if(!reported)
pass("All hardsuits have their correct sprites.")
return TRUE
#undef UNDERSCORE_OR_NULL

View File

@@ -0,0 +1,203 @@
/datum/unit_test/icon_test
name = "ICON STATE template"
/datum/unit_test/icon_test/closets
name = "CLOSET template"
// Matches logic in /obj/structure/closet/update_icons()
var/list/closet_state_suffixes = list(
"nothing" = "",
"opened" = "_open",
"broken" = "_broken",
"door" = "_door",
"back" = "_back",
"locked" = "locked",
"unlocked" = "unlocked",
"off" = "off",
"emag" = "emag"
)
/datum/unit_test/icon_test/closets/closets_shall_have_valid_icons_for_each_state
name = "ICON STATES: Closets shall have valid icons for each state"
/datum/unit_test/icon_test/closets/closets_shall_have_valid_icons_for_each_state/start_test()
var/missing_states = 0
var/list/closet_paths = typesof(/obj/structure/closet)
// If any closet types and their subtypes should be excluded from this test, include them here. Make sure they are covered by their own test.
var/list/exclude_closets = list(
/obj/structure/closet/airbubble,
/obj/structure/closet/body_bag,
/obj/structure/closet/secure_closet/guncabinet,
/obj/structure/closet/statue
)
for(var/exclude in exclude_closets)
for(var/exclude_type in typesof(exclude))
closet_paths -= exclude_type
var/list/closet_dmis = list()
for(var/path in closet_paths)
var/obj/structure/closet/closet_path = path
closet_dmis |= initial(closet_path.icon)
var/list/closet_states = list()
for(var/dmi in closet_dmis)
closet_states += icon_states(dmi)
var/state
for(var/path in closet_paths)
var/obj/structure/closet/closet_path = path
state = initial(closet_path.icon_state)
// Base icon state
if(!(state in closet_states))
missing_states += 1
log_unit_test("icon_state [state] missing for [initial(closet_path.name)] -- ([closet_path])")
// Non-animated door states
if(!initial(closet_path.is_animating_door))
// Door icon
if(initial(closet_path.icon_door))
state = "[initial(closet_path.icon_door)][closet_state_suffixes["door"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Door icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
else
state = "[initial(closet_path.icon_state)][closet_state_suffixes["door"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Door icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
// Secure closet icon overlays
if(initial(closet_path.secure))
// Emagged
state = "[initial(closet_path.icon_door_overlay)][closet_state_suffixes["emag"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Emag'd icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
// Locked
state = "[initial(closet_path.icon_door_overlay)][closet_state_suffixes["locked"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Locked icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
// Unlocked
state = "[initial(closet_path.icon_door_overlay)][closet_state_suffixes["unlocked"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Unlocked icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
// Opened
if(initial(closet_path.icon_door_override))
state = "[initial(closet_path.icon_door)][closet_state_suffixes["opened"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Opened icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
else
state = "[initial(closet_path.icon_state)][closet_state_suffixes["opened"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Opened icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
// Animated Door
else
state = "[initial(closet_path.icon_door) || initial(closet_path.icon_state)][closet_state_suffixes["door"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Animated door icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
state = "[initial(closet_path.icon_door) || initial(closet_path.icon_state)][closet_state_suffixes["back"]]"
if(!(state in closet_states))
missing_states += 1
log_unit_test("Animated door icon [state] missing for [initial(closet_path.name)] -- ([closet_path])")
if(missing_states)
fail("[missing_states] closet icon state\s [missing_states == 1 ? "is" : "are"] missing.")
else
pass("All related closet icon states exist.")
return TRUE
/datum/unit_test/icon_test/closets/mapped_closets_shall_have_invalid_icon_states
name = "ICON STATES: Mapped closets shall not have altered icon states"
/datum/unit_test/icon_test/closets/mapped_closets_shall_have_invalid_icon_states/start_test()
var/invalid_states = 0
var/checked_closets = 0
for(var/obj/structure/closet/C in world)
checked_closets++
var/list/valid_icon_states = list()
for(var/closet_suffix in closet_state_suffixes)
valid_icon_states |= "[initial(C.icon_state)][closet_state_suffixes[closet_suffix]]"
if(C.icon_state in valid_icon_states)
continue
invalid_states++
log_unit_test("Mapped closet [C] at [C.x], [C.y], [C.z] had an invalid icon_state defined: [C.icon_state]!")
if(invalid_states)
fail("Found [invalid_states] / [checked_closets] mapped closets with invalid mapped icon states!")
else
pass("All mapped closets had valid icon states.")
return TRUE
#define UNDERSCORE_OR_NULL(target) "[target ? "[target]_" : ""]"
/datum/unit_test/icon_test/hardsuit_sprite_test
name = "ICON STATES: Hardsuit Sprite Test"
/datum/unit_test/icon_test/hardsuit_sprite_test/start_test()
for(var/rig_path in subtypesof(/obj/item/rig))
var/obj/item/rig/R = new rig_path
var/list/rig_states = icon_states(R.icon)
if(!(R.icon_state in rig_states))
fail("[R.name]'s module icon_state isn't in its icon file.")
if(!("[R.icon_state]_ba" in rig_states))
fail("[R.name]'s on-back module icon_state isn't in its icon file.")
var/list/species_to_check = list("") // blank means default, human
if(length(R.icon_supported_species_tags))
species_to_check += R.icon_supported_species_tags
if(R.helm_type)
if(!("[R.icon_state]_helmet" in rig_states))
fail("[R.name]'s helmet icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_helmet" in rig_states))
fail("[R.name]'s sealed helmet icon_state isn't in its icon file.")
if(R.suit_type)
if(!("[R.icon_state]_suit" in rig_states))
fail("[R.name]'s suit icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_suit" in rig_states))
fail("[R.name]'s sealed suit icon_state isn't in its icon file.")
if(R.glove_type)
if(!("[R.icon_state]_gloves" in rig_states))
fail("[R.name]'s gloves icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_gloves" in rig_states))
fail("[R.name]'s sealed gloves icon_state isn't in its icon file.")
if(R.boot_type)
if(!("[R.icon_state]_shoes" in rig_states))
fail("[R.name]'s shoes icon_state isn't in its icon file.")
if(!("[R.icon_state]_sealed_shoes" in rig_states))
fail("[R.name]'s sealed shoes icon_state isn't in its icon file.")
for(var/short in species_to_check)
short = UNDERSCORE_OR_NULL(short)
if(R.helm_type)
if(!("[short][R.icon_state]_he" in rig_states))
fail("[short] [R.name]'s helmet item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_he" in rig_states))
fail("[short] [R.name]'s sealed helmet item_state isn't in its icon file.")
if(R.suit_type)
if(!("[short][R.icon_state]_su" in rig_states))
fail("[short] [R.name]'s suit item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_su" in rig_states))
fail("[short] [R.name]'s sealed suit item_state isn't in its icon file.")
if(R.glove_type)
if(!("[short][R.icon_state]_gl" in rig_states))
fail("[short] [R.name]'s gloves item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_gl" in rig_states))
fail("[short] [R.name]'s sealed gloves item_state isn't in its icon file.")
if(R.boot_type)
if(!("[short][R.icon_state]_sh" in rig_states))
fail("[short] [R.name]'s shoes item_state isn't in its icon file.")
if(!("[short][R.icon_state]_sealed_sh" in rig_states))
fail("[short] [R.name]'s sealed shoes item_state isn't in its icon file.")
if(!reported)
pass("All hardsuits have their correct sprites.")
return TRUE
#undef UNDERSCORE_OR_NULL