From 9acce89e2a2d65f7a4ac7fb1dec38d51af528ef3 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:07:52 +0200 Subject: [PATCH] Weapons Racks (#19338) Added weapons racks, can be locked/unlocked with an ID card. Added weapons racks sprites, from Wezzy. Refactored some circuitboard code, moved the defines, applied the defines, DMDocs. Moved mutable appearance appearance flag set to the mutable appearance file. Reorganized the Horizon armory with the weapons racks, moved things around, put down markers on lockers depending on the danger level of their content, reorganized content of the remaining lockers. Made weapons racks constructable with circuitboards. ![image](https://github.com/Aurorastation/Aurora.3/assets/65877598/8b4ec7ae-40c4-4cd7-b338-76120d468b90) ![image](https://github.com/Aurorastation/Aurora.3/assets/65877598/a69d1f85-c4b2-4643-af2b-6832e3ea2c43) ![image](https://github.com/Aurorastation/Aurora.3/assets/65877598/11c1afe4-0fa1-4708-8eb4-64e1f5594913) sound/items/metal_shutter.ogg - https://freesound.org/people/bruno.auzet/sounds/524695/ (CC0, sound was edited) --- aurorastation.dme | 4 +- code/__DEFINES/circuitboard.dm | 7 + code/__DEFINES/layers.dm | 1 - code/defines/mutable_appearance.dm | 3 + code/game/jobs/access.dm | 3 - .../game/machinery/computer/buildandrepair.dm | 2 +- code/game/machinery/constructable_frame.dm | 2 +- code/game/objects/buckling.dm | 9 - .../items/weapons/circuitboards/_defines.dm | 2 - .../weapons/circuitboards/circuitboard.dm | 8 +- .../circuitboards/machinery/biogenerator.dm | 2 +- .../circuitboards/machinery/chem_heater.dm | 2 +- .../circuitboards/machinery/cloning.dm | 4 +- .../circuitboards/machinery/commsantenna.dm | 2 +- .../circuitboards/machinery/mech_recharger.dm | 2 +- .../circuitboards/machinery/mining_drill.dm | 4 +- .../machinery/mining_machines.dm | 10 +- .../circuitboards/machinery/miscboards.dm | 38 +- .../circuitboards/machinery/portgen.dm | 2 +- .../weapons/circuitboards/machinery/power.dm | 6 +- .../machinery/recharge_station.dm | 2 +- .../circuitboards/machinery/research.dm | 18 +- .../circuitboards/machinery/shieldgen.dm | 6 +- .../weapons/circuitboards/machinery/ship.dm | 10 +- .../circuitboards/machinery/telecomms.dm | 2 +- .../circuitboards/machinery/trashcompactor.dm | 2 +- .../circuitboards/machinery/unary_atmos.dm | 2 +- .../circuitboards/structure/weapons_rack.dm | 8 + code/game/objects/objs.dm | 15 + code/game/objects/structures/weapons_rack.dm | 260 +++++++++++++ .../living/carbon/slime/slime_extractor.dm | 2 +- code/modules/power/crystal_agitator.dm | 2 +- code/modules/power/fusion/fusion_circuits.dm | 10 +- code/modules/power/rtg.dm | 2 +- code/modules/power/tesla/coil.dm | 4 +- html/changelogs/fluffyghost-weaponsrack.yml | 63 ++++ icons/obj/machinery/weapons_rack.dmi | Bin 0 -> 750 bytes maps/sccv_horizon/sccv_horizon-2_deck_2.dmm | 353 ++++++++++-------- sound/attributions.txt | 4 + sound/items/metal_shutter.ogg | Bin 0 -> 19452 bytes 40 files changed, 626 insertions(+), 252 deletions(-) create mode 100644 code/__DEFINES/circuitboard.dm delete mode 100644 code/game/objects/items/weapons/circuitboards/_defines.dm create mode 100644 code/game/objects/items/weapons/circuitboards/structure/weapons_rack.dm create mode 100644 code/game/objects/structures/weapons_rack.dm create mode 100644 html/changelogs/fluffyghost-weaponsrack.yml create mode 100644 icons/obj/machinery/weapons_rack.dmi create mode 100644 sound/items/metal_shutter.ogg diff --git a/aurorastation.dme b/aurorastation.dme index b25ad6cf997..9dbccccce3e 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -42,6 +42,7 @@ #include "code\__DEFINES\byond_compat.dm" #include "code\__DEFINES\callback.dm" #include "code\__DEFINES\chemistry.dm" +#include "code\__DEFINES\circuitboard.dm" #include "code\__DEFINES\color.dm" #include "code\__DEFINES\components.dm" #include "code\__DEFINES\construction.dm" @@ -1210,7 +1211,6 @@ #include "code\game\objects\items\weapons\traps.dm" #include "code\game\objects\items\weapons\vaurca_items.dm" #include "code\game\objects\items\weapons\weaponry.dm" -#include "code\game\objects\items\weapons\circuitboards\_defines.dm" #include "code\game\objects\items\weapons\circuitboards\circuitboard.dm" #include "code\game\objects\items\weapons\circuitboards\mecha.dm" #include "code\game\objects\items\weapons\circuitboards\rig.dm" @@ -1238,6 +1238,7 @@ #include "code\game\objects\items\weapons\circuitboards\machinery\trashcompactor.dm" #include "code\game\objects\items\weapons\circuitboards\machinery\trolley.dm" #include "code\game\objects\items\weapons\circuitboards\machinery\unary_atmos.dm" +#include "code\game\objects\items\weapons\circuitboards\structure\weapons_rack.dm" #include "code\game\objects\items\weapons\grenades\anti_photon_grenade.dm" #include "code\game\objects\items\weapons\grenades\chem_grenade.dm" #include "code\game\objects\items\weapons\grenades\dynamite.dm" @@ -1369,6 +1370,7 @@ #include "code\game\objects\structures\warp_drive.dm" #include "code\game\objects\structures\watercloset.dm" #include "code\game\objects\structures\weapon_rack.dm" +#include "code\game\objects\structures\weapons_rack.dm" #include "code\game\objects\structures\windoor_assembly.dm" #include "code\game\objects\structures\window.dm" #include "code\game\objects\structures\barricades\_barricade.dm" diff --git a/code/__DEFINES/circuitboard.dm b/code/__DEFINES/circuitboard.dm new file mode 100644 index 00000000000..2363a4c1fed --- /dev/null +++ b/code/__DEFINES/circuitboard.dm @@ -0,0 +1,7 @@ +/*########################## + Board types +##########################*/ + +#define BOARD_MACHINE "machine" +#define BOARD_COMPUTER "computer" +#define BOARD_OTHER "other" diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index ec6eb02639f..5d194a938d2 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -192,7 +192,6 @@ #define DEFAULT_RENDERER_APPEARANCE_FLAGS (PLANE_MASTER | NO_CLIENT_COLOR) /image/appearance_flags = DEFAULT_APPEARANCE_FLAGS -/mutable_appearance/appearance_flags = DEFAULT_APPEARANCE_FLAGS // Inherits /image but re docs, subject to change /atom/proc/hud_layerise() plane = HUD_PLANE diff --git a/code/defines/mutable_appearance.dm b/code/defines/mutable_appearance.dm index b29cdf51009..9c1ab3b381f 100644 --- a/code/defines/mutable_appearance.dm +++ b/code/defines/mutable_appearance.dm @@ -4,6 +4,9 @@ // Mutable appearances are children of images, just so you know. +/mutable_appearance + appearance_flags = DEFAULT_APPEARANCE_FLAGS //Bay shit + /mutable_appearance/New(mutable_appearance/to_copy) ..() if(!to_copy) diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 42a9ed25709..800af8b1062 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -1,8 +1,5 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -/obj/var/list/req_access -/obj/var/list/req_one_access - //returns 1 if this mob has sufficient access to use this object /obj/proc/allowed(mob/M) //check if it doesn't require any access at all diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 58375cdbe27..253526e9703 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -39,7 +39,7 @@ return TRUE if(istype(attacking_item, /obj/item/circuitboard) && !circuit) var/obj/item/circuitboard/B = attacking_item - if(B.board_type == "computer") + if(B.board_type == BOARD_COMPUTER) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) to_chat(user, SPAN_NOTICE("You place the circuit board inside the frame.")) src.icon_state = "1" diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 88748a47855..705563f73e4 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -108,7 +108,7 @@ if(CIRCUITBOARD_STATE) if(istype(attacking_item, /obj/item/circuitboard)) var/obj/item/circuitboard/B = attacking_item - if(B.board_type == "machine") + if(B.board_type == BOARD_MACHINE) playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, TRUE) to_chat(user, SPAN_NOTICE("You add the circuit board to the blueprint.")) circuit = attacking_item diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 8af26504299..15bae559e97 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -1,12 +1,3 @@ -/obj - var/list/can_buckle - var/buckle_movable = 0 - var/buckle_dir = 0 - var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1 - var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes - var/atom/movable/buckled = null - var/buckle_delay = 0 //How much extra time to buckle someone to this object. - /obj/attack_hand(mob/living/user) . = ..() if(buckled) diff --git a/code/game/objects/items/weapons/circuitboards/_defines.dm b/code/game/objects/items/weapons/circuitboards/_defines.dm deleted file mode 100644 index cb78f229cbc..00000000000 --- a/code/game/objects/items/weapons/circuitboards/_defines.dm +++ /dev/null @@ -1,2 +0,0 @@ -#define BOARD_MACHINE "machine" -#define BOARD_COMPUTER "computer" diff --git a/code/game/objects/items/weapons/circuitboards/circuitboard.dm b/code/game/objects/items/weapons/circuitboards/circuitboard.dm index 951b26c216b..d217e0e4fa1 100644 --- a/code/game/objects/items/weapons/circuitboards/circuitboard.dm +++ b/code/game/objects/items/weapons/circuitboards/circuitboard.dm @@ -18,7 +18,13 @@ throw_speed = 3 throw_range = 15 var/build_path - var/board_type = "computer" + + /** + * The type of board + * + * One of the BOARD_* defines, see `code\game\objects\items\weapons\circuitboards\_defines.dm` + */ + var/board_type = BOARD_COMPUTER var/list/req_components var/contain_parts = 1 diff --git a/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm b/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm index f8d238f271b..4360c0863bd 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/biogenerator name = T_BOARD("biogenerator") build_path = /obj/machinery/biogenerator - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 2) req_components = list( "/obj/item/stock_parts/matter_bin" = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/chem_heater.dm b/code/game/objects/items/weapons/circuitboards/machinery/chem_heater.dm index 22b079e79b1..a17d3134569 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/chem_heater.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/chem_heater.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/chem_heater name = T_BOARD("chem heater") build_path = /obj/machinery/chem_heater - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 1, TECH_BIO = 2) req_components = list( "/obj/item/stock_parts/manipulator" = 3 diff --git a/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm b/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm index cd29502c782..605d1de0d6c 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/clonepod name = T_BOARD("clone pod") build_path = /obj/machinery/clonepod - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 3, TECH_BIO = 3) req_components = list( "/obj/item/stack/cable_coil" = 2, @@ -16,7 +16,7 @@ /obj/item/circuitboard/clonescanner name = T_BOARD("cloning scanner") build_path = /obj/machinery/dna_scannernew - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 2, TECH_BIO = 2) req_components = list( "/obj/item/stock_parts/scanning_module" = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm b/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm index 0f20208e91f..4a877060bd1 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/bluespacerelay name = T_BOARD("bluespacerelay") build_path = /obj/machinery/bluespacerelay - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_BLUESPACE = 2, TECH_DATA = 2) req_components = list( "/obj/item/stack/cable_coil" = 30, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm b/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm index f6416f5f62e..5be97077b5e 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/mech_recharger.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/mech_recharger name = T_BOARD("mech recharger") build_path = /obj/machinery/mech_recharger - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 2, TECH_POWER = 2, TECH_ENGINEERING = 2) req_components = list( "/obj/item/stock_parts/capacitor" = 2, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm b/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm index b8b55abfe1e..9cc8b40cc56 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/miningdrill name = T_BOARD("mining drill head") build_path = /obj/machinery/mining/drill - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1) req_components = list( "/obj/item/stock_parts/capacitor" = 1, @@ -16,6 +16,6 @@ /obj/item/circuitboard/miningdrillbrace name = T_BOARD("mining drill brace") build_path = /obj/machinery/mining/brace - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1) req_components = list() diff --git a/code/game/objects/items/weapons/circuitboards/machinery/mining_machines.dm b/code/game/objects/items/weapons/circuitboards/machinery/mining_machines.dm index 32627f5ca99..aac195e00f2 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/mining_machines.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/mining_machines.dm @@ -3,7 +3,7 @@ desc = "The circuitboard for an ore processing machine." build_path = /obj/machinery/mineral/processing_unit origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 2, "/obj/item/stock_parts/scanning_module" = 1, @@ -16,7 +16,7 @@ desc = "The circuitboard for an ore redemption console." build_path = /obj/machinery/mineral/processing_unit_console origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/scanning_module" = 1, "/obj/item/stock_parts/console_screen" = 1 @@ -39,7 +39,7 @@ desc = "The circuitboard for an unloading machine." build_path = /obj/machinery/mineral/unloading_machine origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/manipulator" = 2 ) @@ -49,7 +49,7 @@ desc = "The circuitboard for a stacking machine." build_path = /obj/machinery/mineral/stacking_machine origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/manipulator" = 2 ) @@ -59,7 +59,7 @@ desc = "The circuitboard for an stacking machine console." build_path = /obj/machinery/mineral/stacking_unit_console origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/scanning_module" = 1, "/obj/item/stock_parts/console_screen" = 1 diff --git a/code/game/objects/items/weapons/circuitboards/machinery/miscboards.dm b/code/game/objects/items/weapons/circuitboards/machinery/miscboards.dm index 0e706ddfdae..a7b91df0eab 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/miscboards.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/miscboards.dm @@ -7,14 +7,14 @@ /obj/item/circuitboard/aicore name = T_BOARD("AI core") origin_tech = list(TECH_DATA = 4, TECH_BIO = 2) - board_type = "other" + board_type = BOARD_OTHER /obj/item/circuitboard/sleeper name = T_BOARD("Sleeper") desc = "The circuitboard for a sleeper." build_path = /obj/machinery/sleeper origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 2, "/obj/item/stock_parts/scanning_module" = 2, @@ -26,7 +26,7 @@ desc = "The circuitboard for a lifeform stasis unit." build_path = /obj/machinery/stasis_bed origin_tech = list(TECH_MAGNET = 4, TECH_ENGINEERING = 4, TECH_BIO = 4) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/micro_laser" = 1, "/obj/item/stock_parts/capacitor" = 2, @@ -39,7 +39,7 @@ desc = "The circuitboard for a cryo tube." build_path = /obj/machinery/atmospherics/unary/cryo_cell origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 3) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/scanning_module" = 2, "/obj/item/stock_parts/console_screen" = 1, @@ -52,7 +52,7 @@ desc = "The circuitboard for a body scanner machine." build_path = /obj/machinery/bodyscanner origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 1, "/obj/item/stock_parts/scanning_module" = 1, @@ -63,7 +63,7 @@ desc = "The circuitboard for a body scanner console." build_path = /obj/machinery/body_scanconsole origin_tech = list(TECH_DATA = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/scanning_module" = 2, "/obj/item/stock_parts/console_screen" = 1) @@ -73,7 +73,7 @@ desc = "The circuitboard for a body scanner console." build_path = /obj/machinery/requests_console origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 1, "/obj/item/stock_parts/console_screen" = 1) @@ -83,7 +83,7 @@ desc = "The circuitboard for a operation table." build_path = /obj/machinery/optable origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/scanning_module" = 1) @@ -92,7 +92,7 @@ desc = "The circuitboard for a smart fridge." build_path = /obj/machinery/smartfridge origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 3) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/manipulator" = 3) @@ -101,7 +101,7 @@ desc = "The circuitboard for an oven." build_path = /obj/machinery/appliance/cooker/oven origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 3, "/obj/item/stock_parts/scanning_module" = 1, @@ -112,7 +112,7 @@ desc = "The circuitboard for a deep fryer." build_path = /obj/machinery/appliance/cooker/fryer origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 3, "/obj/item/stock_parts/scanning_module" = 1, @@ -123,7 +123,7 @@ desc = "The circuitboard for a stove." build_path = /obj/machinery/appliance/cooker/stove origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 3, "/obj/item/stock_parts/scanning_module" = 1, @@ -134,7 +134,7 @@ desc = "The circuitboard for a cereal maker." build_path = /obj/machinery/appliance/mixer/cereal origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 3, "/obj/item/stock_parts/scanning_module" = 1, @@ -145,7 +145,7 @@ desc = "The circuitboard for a grill." build_path = /obj/machinery/appliance/cooker/grill origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 3) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 2, "/obj/item/stock_parts/micro_laser" = 1, @@ -157,7 +157,7 @@ desc = "The circuitboard for a candy machine." build_path = /obj/machinery/appliance/mixer/candy origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 3, "/obj/item/stock_parts/scanning_module" = 1, @@ -168,7 +168,7 @@ desc = "The circuitboard for a holopad." build_path = /obj/machinery/hologram/holopad origin_tech = list(TECH_MAGNET = 3, TECH_ENGINEERING = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/capacitor" = 2, "/obj/item/stock_parts/scanning_module" = 1) @@ -178,7 +178,7 @@ desc = "The circuitboard for a weapons analyzer." build_path = /obj/machinery/weapons_analyzer origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 4, TECH_COMBAT = 3) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/stock_parts/scanning_module" = 2, "/obj/item/stock_parts/capacitor" = 1, @@ -189,7 +189,7 @@ desc = "The circuitboard for an IV drip." build_path = /obj/machinery/iv_drip origin_tech = list(TECH_DATA = 1, TECH_BIO = 2) - board_type = "machine" + board_type = BOARD_MACHINE req_components = list( "/obj/item/reagent_containers/syringe" = 1, "/obj/item/stock_parts/matter_bin" = 1, @@ -198,7 +198,7 @@ /obj/item/circuitboard/oxyregenerator name = "circuit board (oxygen regenerator)" build_path = /obj/machinery/atmospherics/binary/oxyregenerator - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) req_components = list( "/obj/item/stock_parts/micro_laser" = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/portgen.dm b/code/game/objects/items/weapons/circuitboards/machinery/portgen.dm index f83be989d47..a9007efa412 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/portgen.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/portgen.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/portgen name = T_BOARD("portable generator") build_path = /obj/machinery/power/portgen/basic - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 3, TECH_POWER = 3, TECH_PHORON = 3, TECH_ENGINEERING = 3) req_components = list( "/obj/item/stock_parts/matter_bin" = 1, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/power.dm b/code/game/objects/items/weapons/circuitboards/machinery/power.dm index 21a2d059871..497af43ab32 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/power.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/power.dm @@ -5,14 +5,14 @@ /obj/item/circuitboard/smes name = T_BOARD("superconductive magnetic energy storage") build_path = /obj/machinery/power/smes/buildable - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_POWER = 6, TECH_ENGINEERING = 4) req_components = list("/obj/item/smes_coil" = 1, "/obj/item/stack/cable_coil" = 30) /obj/item/circuitboard/batteryrack name = T_BOARD("battery rack PSU") build_path = /obj/machinery/power/smes/batteryrack - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 2) req_components = list("/obj/item/cell" = 3) @@ -20,7 +20,7 @@ name = T_BOARD("makeshift PSU") desc = "An APC circuit repurposed into some power storage device controller." build_path = /obj/machinery/power/smes/batteryrack/makeshift - board_type = "machine" + board_type = BOARD_MACHINE req_components = list("/obj/item/cell" = 3) /obj/item/circuitboard/ghettosmes/attackby(obj/item/attacking_item, mob/user) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm b/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm index c34a93730a4..7de67b38f41 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/recharge_station name = T_BOARD("cyborg recharging station") build_path = /obj/machinery/recharge_station - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( "/obj/item/stack/cable_coil" = 5, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm index 8982b218374..b9e311b8a08 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/rdserver name = T_BOARD("R&D server") build_path = /obj/machinery/r_n_d/server - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 3) req_components = list( "/obj/item/stack/cable_coil" = 2, @@ -14,7 +14,7 @@ /obj/item/circuitboard/rdtechprocessor name = T_BOARD("R&D tech processor") build_path = /obj/machinery/r_n_d/tech_processor - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 3) req_components = list( "/obj/item/stack/cable_coil" = 2, @@ -24,7 +24,7 @@ /obj/item/circuitboard/destructive_analyzer name = T_BOARD("destructive analyzer") build_path = /obj/machinery/r_n_d/destructive_analyzer - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( "/obj/item/stock_parts/scanning_module" = 1, @@ -34,7 +34,7 @@ /obj/item/circuitboard/autolathe name = T_BOARD("autolathe") build_path = /obj/machinery/autolathe - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( "/obj/item/stock_parts/matter_bin" = 3, @@ -44,7 +44,7 @@ /obj/item/circuitboard/protolathe name = T_BOARD("protolathe") build_path = /obj/machinery/r_n_d/protolathe - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( "/obj/item/stock_parts/matter_bin" = 2, @@ -55,7 +55,7 @@ /obj/item/circuitboard/circuit_imprinter name = T_BOARD("circuit imprinter") build_path = /obj/machinery/r_n_d/circuit_imprinter - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) req_components = list( "/obj/item/stock_parts/matter_bin" = 1, @@ -65,7 +65,7 @@ /obj/item/circuitboard/mechfab name = "Circuit board (Exosuit Fabricator)" build_path = /obj/machinery/mecha_part_fabricator - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3) req_components = list( "/obj/item/stock_parts/matter_bin" = 2, @@ -76,7 +76,7 @@ /obj/item/circuitboard/telesci_pad name = T_BOARD("telepad") build_path = /obj/machinery/telepad - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 3, TECH_MATERIAL = 3, TECH_BLUESPACE = 4) req_components = list( "/obj/item/bluespace_crystal" = 2, @@ -87,7 +87,7 @@ /obj/item/circuitboard/ntnet_relay name = "Circuit board (NTNet Quantum Relay)" build_path = /obj/machinery/ntnet_relay - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 4) req_components = list( "/obj/item/stack/cable_coil" = 15) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm b/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm index 11bc289b2fc..aad50fc3ce5 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm @@ -4,7 +4,7 @@ /obj/item/circuitboard/shield_gen_ex name = T_BOARD("hull shield generator") - board_type = "machine" + board_type = BOARD_MACHINE build_path = /obj/machinery/shield_gen/external origin_tech = list(TECH_BLUESPACE = 4, TECH_PHORON = 3) req_components = list( @@ -17,7 +17,7 @@ /obj/item/circuitboard/shield_gen name = T_BOARD("bubble shield generator") - board_type = "machine" + board_type = BOARD_MACHINE build_path = /obj/machinery/shield_gen origin_tech = list(TECH_BLUESPACE = 4, TECH_PHORON = 3) req_components = list( @@ -30,7 +30,7 @@ /obj/item/circuitboard/shield_cap name = T_BOARD("shield capacitor") - board_type = "machine" + board_type = BOARD_MACHINE build_path = /obj/machinery/shield_capacitor origin_tech = list(TECH_MAGNET = 3, TECH_POWER = 4) req_components = list( diff --git a/code/game/objects/items/weapons/circuitboards/machinery/ship.dm b/code/game/objects/items/weapons/circuitboards/machinery/ship.dm index f8533a5830c..f04f750ca18 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/ship.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/ship.dm @@ -16,7 +16,7 @@ /obj/item/circuitboard/engine/ion name = T_BOARD("ion propulsion device") - board_type = "machine" + board_type = BOARD_MACHINE icon_state = "mcontroller" build_path = /obj/machinery/ion_engine origin_tech = list(TECH_POWER = 4, TECH_ENGINEERING = 3) @@ -27,7 +27,7 @@ /obj/item/circuitboard/engine/maneuvering name = T_BOARD("pulse-maneuvering device") - board_type = "machine" + board_type = BOARD_MACHINE icon_state = "mcontroller" build_path = /obj/machinery/maneuvering_engine origin_tech = list(TECH_POWER = 4, TECH_ENGINEERING = 3) @@ -40,7 +40,7 @@ //IFF Beacon /obj/item/circuitboard/iff_beacon name = T_BOARD("IFF transponder") - board_type = "machine" + board_type = BOARD_MACHINE icon_state = "mcontroller" build_path = /obj/machinery/iff_beacon origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4) @@ -53,7 +53,7 @@ //Sensors /obj/item/circuitboard/shipsensors name = T_BOARD("sensor suite") - board_type = "machine" + board_type = BOARD_MACHINE icon_state = "mcontroller" build_path = /obj/machinery/shipsensors origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 5, TECH_BLUESPACE = 3) @@ -68,7 +68,7 @@ /obj/item/circuitboard/shipsensors/weak name = T_BOARD("low-power sensor suite") - board_type = "machine" + board_type = BOARD_MACHINE icon_state = "mcontroller" build_path = /obj/machinery/shipsensors/weak origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 3, TECH_BLUESPACE = 1) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm b/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm index f8006b0045a..855a90e6d32 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm @@ -3,7 +3,7 @@ #endif /obj/item/circuitboard/telecomms - board_type = "machine" + board_type = BOARD_MACHINE /obj/item/circuitboard/telecomms/receiver name = T_BOARD("subspace receiver") diff --git a/code/game/objects/items/weapons/circuitboards/machinery/trashcompactor.dm b/code/game/objects/items/weapons/circuitboards/machinery/trashcompactor.dm index 54734bd2a7e..45f732310ba 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/trashcompactor.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/trashcompactor.dm @@ -5,7 +5,7 @@ /obj/item/circuitboard/crusher name = T_BOARD("crusher") build_path = /obj/machinery/crusher_base - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 1, TECH_MAGNET = 1, TECH_MATERIAL = 3) req_components = list( "/obj/item/stock_parts/matter_bin" = 4, diff --git a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm index 172344a798c..97fe1583d84 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm @@ -3,7 +3,7 @@ #endif /obj/item/circuitboard/unary_atmos - board_type = "machine" + board_type = BOARD_MACHINE var/machine_dir = SOUTH var/init_dirs = SOUTH diff --git a/code/game/objects/items/weapons/circuitboards/structure/weapons_rack.dm b/code/game/objects/items/weapons/circuitboards/structure/weapons_rack.dm new file mode 100644 index 00000000000..735dd276418 --- /dev/null +++ b/code/game/objects/items/weapons/circuitboards/structure/weapons_rack.dm @@ -0,0 +1,8 @@ +/obj/item/circuitboard/structure + name = "weapons rack" + build_path = /obj/structure/weapons_rack + board_type = BOARD_MACHINE + origin_tech = list(TECH_ENGINEERING = 2, TECH_MATERIAL = 2) + req_components = list( + "/obj/item/stock_parts/scanning_module" = 1, + "/obj/item/stock_parts/manipulator" = 1) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 7e4d3cb37ef..1706f44a9a7 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -42,6 +42,21 @@ var/surgerysound + /* START BUCKLING VARS */ + var/list/can_buckle + var/buckle_movable = 0 + var/buckle_dir = 0 + var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1 + var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes + var/atom/movable/buckled = null + var/buckle_delay = 0 //How much extra time to buckle someone to this object. + /* END BUCKLING VARS */ + + /* START ACCESS VARS */ + var/list/req_access + var/list/req_one_access + /* END ACCESS VARS */ + /obj/Destroy() STOP_PROCESSING(SSprocessing, src) unbuckle() diff --git a/code/game/objects/structures/weapons_rack.dm b/code/game/objects/structures/weapons_rack.dm new file mode 100644 index 00000000000..152a9024b81 --- /dev/null +++ b/code/game/objects/structures/weapons_rack.dm @@ -0,0 +1,260 @@ +/obj/structure/weapons_rack + name = "weapon rack" + desc = "A rack designed to store weapons." + icon = 'icons/obj/machinery/weapons_rack.dmi' + icon_state = "rack_base" + anchored = TRUE + density = TRUE + + ///The maximum number of weapons that can be stored in the rack + VAR_PRIVATE/max_weapons_loaded = 4 + + ///Boolean, if the rack is locked (no weapon can be added or removed) + VAR_PRIVATE/locked = FALSE + + ///Boolean, if the rack is forced open (eg. it was cut open, melted open or whatever) + VAR_PRIVATE/forced_open = FALSE + + VAR_PRIVATE/obj/effect/visual_holder + +/obj/structure/weapons_rack/Initialize(mapload) + ..() + visual_holder = new() + visual_holder.vis_flags |= VIS_INHERIT_ID + visual_holder.appearance_flags |= KEEP_TOGETHER|RESET_TRANSFORM + + //This is used to hide any stray pixels that the rifles could have, eg. for overboarding the rack sprite + var/mask_for_rifles_filter = filter(type="alpha", icon = icon(src.icon, "rack_mask")) + visual_holder.filters += mask_for_rifles_filter + + src.vis_contents += visual_holder + + return INITIALIZE_HINT_LATELOAD + +/obj/structure/weapons_rack/LateInitialize() + . = ..() + + for(var/obj/item/gun in get_turf(src)) + gun.forceMove(src) + + //This protects us from mapper mistakes + //don't worry, they will find a way to get this to bug out, just not this particular one + if(length(src.contents) > max_weapons_loaded) + stack_trace("Weapon rack at [src.x],[src.y],[src.z] is full and still find weapons to load on init in the turf!") + qdel(gun) + + if(length(req_one_access)) + locked = TRUE + + update_icon() + +/obj/structure/weapons_rack/Destroy() + QDEL_NULL(visual_holder) + + . = ..() + +/obj/structure/weapons_rack/attackby(obj/item/attacking_item, mob/user, params) + . = ..() + + //Hit with a gun, to add it to the rack + if(istype(attacking_item, /obj/item/gun)) + //No adding or removing weapons from the rack while locked + if(locked) + to_chat(user, SPAN_WARNING("The rack is locked.")) + return + + if(length(src.contents) >= max_weapons_loaded) + to_chat(user, SPAN_WARNING("The rack is full.")) + return + + if(!user.unEquip(attacking_item)) + return + + attacking_item.forceMove(src) + update_icon() + + //Hit with ID, to lock/unlock the rack + else if(istype(attacking_item, /obj/item/card/id)) + var/obj/item/card/id/identification_card = attacking_item + if(!forced_open && has_access(req_one_access = src.req_one_access, accesses = identification_card.access)) + balloon_alert_to_viewers("[user] [locked ? "unlocks" : "locks"] \the [src]!") + playsound(src, 'sound/items/metal_shutter.ogg', 50, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) + toggle_lock(user) + + else + to_chat(user, SPAN_WARNING("You lack the required access to operate this rack's lock, or the lock mechanism is broken.")) + + else if(locked && attacking_item.iswelder()) + var/obj/item/weldingtool/WT = attacking_item + + balloon_alert_to_viewers("[user] starts to cut through the lock on \the [src]!") + + if(WT.use_tool(src, user, 20 SECONDS, extra_checks = CALLBACK(src, PROC_REF(can_continue_opening)))) + //Last check because use_tool() is shitcoded + if(forced_open || !can_be_opened()) + return + toggle_lock(user) + forced_open = TRUE + + else + balloon_alert_to_viewers("[src] was unlocked while you was working on it!") + + +/obj/structure/weapons_rack/attack_hand(mob/living/user) + . = ..() + if(length(src.contents)) + //No adding or removing weapons from the rack while locked + if(locked) + to_chat(user, SPAN_WARNING("The rack is locked.")) + return + + //Build a list of options for the radial menu, based on our content + var/list/radial_options = list() + for(var/obj/item/gun/gun_in_rack in src.contents) + radial_options[gun_in_rack] = image(gun_in_rack.icon, gun_in_rack.icon_state) + + //Show the user the radial menu + var/obj/item/gun/rifle_to_take = show_radial_menu(user, src, radial_options, require_near = TRUE, tooltips = TRUE) + + //No choice was made, return + if(isnull(rifle_to_take)) + return + + //Assuming the rifle is still in the rack when the user chooses it, deliver the rifle + if(rifle_to_take in src.contents) + rifle_to_take.forceMove(get_turf(user)) + user.put_in_hands(rifle_to_take) + update_icon() + + else + to_chat(user, SPAN_WARNING("\The [rifle_to_take] is not in the rack anymore!")) + + +#define BASE_OFFSET_RIFLE_SLOT -1 +#define INTER_OFFSET_RIFLE_SLOT 7 +/obj/structure/weapons_rack/update_icon() + . = ..() + visual_holder.overlays.Cut() + ClearOverlays() + + for(var/i in 1 to length(src.contents)) + var/obj/item/gun/G = src.contents[i] + var/matrix/transform_matrix = matrix(G.transform) + + transform_matrix.Turn(-90) + transform_matrix.Scale(0.8, 0.8) + transform_matrix.Translate((((world.icon_size/2)+BASE_OFFSET_RIFLE_SLOT) - world.icon_size) + (i*INTER_OFFSET_RIFLE_SLOT), 0) + + //Why not the rifle itself you might ask? Because there's the safety icon on it + var/mutable_appearance/weapon_appearance = mutable_appearance(G.icon, G.icon_state, plane = src.plane, flags = G.appearance_flags, layer = G.layer) + weapon_appearance.transform = transform_matrix + + visual_holder.overlays += weapon_appearance + + if(locked) + AddOverlays(image(src.icon, "locked_overlay", layer = ABOVE_OBJ_LAYER)) + +#undef BASE_OFFSET_RIFLE_SLOT +#undef INTER_OFFSET_RIFLE_SLOT + +/obj/structure/weapons_rack/get_examine_text(mob/user, distance, is_adjacent, infix, suffix, get_extended) + . = ..() + + if(locate(/obj/item/gun) in src) + . += "
It contains:
" + for(var/obj/item/gun/G in src.contents) + . += "\A [G.name]" + + if(locked) + . += SPAN_WARNING("It is locked.") + +/obj/structure/weapons_rack/emag_act(remaining_charges, mob/user, emag_source) + . = ..() + + to_chat(user, SPAN_NOTICE("You start to fiddle with the electronic lock of \the [src].")) + if(do_after(user, 10 SECONDS, src, extra_checks = CALLBACK(src, PROC_REF(can_continue_opening)))) + to_chat(user, SPAN_NOTICE("You manage to unlock \the [src].")) + toggle_lock(user) + +/obj/structure/weapons_rack/ex_act(severity) + if(severity > 1 && can_be_opened()) + toggle_lock() + forced_open = TRUE + + if(severity > 2) + for(var/obj/item/gun/G in src.contents) + if(prob(10)) + //Uh oh, the munitions cooked in the gun! + fragem(get_turf(G), 4, 7, 3, 3, 10, 1, TRUE) + qdel(G) + else + throw_at_random(TRUE, 4, 7) + + . = ..() + +/obj/structure/weapons_rack/fire_act(exposed_temperature, exposed_volume) + . = ..() + + if(exposed_temperature > 1811) //Melting temperature of steel, in kelvin + //You melted the door + if(can_be_opened()) + if(prob(20)) + toggle_lock() + forced_open = TRUE + + else + var/picked = pick_weight(list("burn_weapon" = 2, "explode_ammos" = 10, "nothing" = 80)) + + //Burn down one of the guns + if(picked == "burn_weapon" && length(src.contents)) + var/obj/item/gun/G = pick(src.contents) + G.forceMove(get_turf(src)) + qdel(G) + + //Just some explosion effect + else if(picked == "explode_ammos") + INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(fragem), get_turf(src), 2, 3, 3, 3, 10, 1, TRUE) + + +/** + * Locks/unlocks the rack + * + * * user - A `/mob` that is unlocking the rack, optional + */ +/obj/structure/weapons_rack/proc/toggle_lock(mob/user, force_lock_state) + SHOULD_NOT_SLEEP(TRUE) + + if(user) + add_fibers(user) + add_fingerprint(user) + + locked = !locked + update_icon() + +/** + * Checks if the locker can be opened (NOT permissions, as in "did someone else already open it" kind of thing) + * + */ +/obj/structure/weapons_rack/proc/can_be_opened() + SHOULD_NOT_SLEEP(TRUE) + SHOULD_BE_PURE(TRUE) + + //Can't open it, it's forced open + if(forced_open) + return FALSE + + if(locked) + return TRUE + else + return FALSE + +/** + * Basically the inverse of `can_be_opened()`, because the `do_* / use_*` callbacks work the other way around + * + * Used only for callbacks, do not call directly + */ +/obj/structure/weapons_rack/proc/can_continue_opening() + SHOULD_NOT_SLEEP(TRUE) + SHOULD_BE_PURE(TRUE) + + return !can_be_opened() diff --git a/code/modules/mob/living/carbon/slime/slime_extractor.dm b/code/modules/mob/living/carbon/slime/slime_extractor.dm index bb632a0447d..34bb3538469 100644 --- a/code/modules/mob/living/carbon/slime/slime_extractor.dm +++ b/code/modules/mob/living/carbon/slime/slime_extractor.dm @@ -106,7 +106,7 @@ /obj/item/circuitboard/slime_extractor name = T_BOARD("slime extractor") build_path = "/obj/machinery/slime_extractor" - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_BIO = 2, TECH_ENGINEERING = 1, TECH_BLUESPACE = 1) req_components = list( "/obj/item/stock_parts/matter_bin" = 1, diff --git a/code/modules/power/crystal_agitator.dm b/code/modules/power/crystal_agitator.dm index 1bbb13add2a..ce4acc01c94 100644 --- a/code/modules/power/crystal_agitator.dm +++ b/code/modules/power/crystal_agitator.dm @@ -105,7 +105,7 @@ /obj/item/circuitboard/crystal_agitator name = T_BOARD("Crystal Agitator") build_path = /obj/machinery/power/crystal_agitator - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list( TECH_ENGINEERING = 3, TECH_DATA = 2, diff --git a/code/modules/power/fusion/fusion_circuits.dm b/code/modules/power/fusion/fusion_circuits.dm index 38173bc79e0..6d0a0501096 100644 --- a/code/modules/power/fusion/fusion_circuits.dm +++ b/code/modules/power/fusion/fusion_circuits.dm @@ -6,7 +6,7 @@ /obj/item/circuitboard/kinetic_harvester name = T_BOARD("kinetic harvester") build_path = /obj/machinery/kinetic_harvester - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 4, TECH_MATERIAL = 4) req_components = list( "/obj/item/stock_parts/manipulator/pico" = 2, @@ -18,7 +18,7 @@ /obj/item/circuitboard/fusion_fuel_compressor name = T_BOARD("fusion fuel compressor") build_path = /obj/machinery/fusion_fuel_compressor - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 4, TECH_MATERIAL = 4) req_components = list( "/obj/item/stock_parts/manipulator/pico" = 2, @@ -40,7 +40,7 @@ /obj/item/circuitboard/fusion_core name = T_BOARD("fusion core") build_path = /obj/machinery/power/fusion_core - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_BLUESPACE = 2, TECH_MAGNET = 4, TECH_POWER = 4) req_components = list( "/obj/item/stock_parts/manipulator/pico" = 2, @@ -53,7 +53,7 @@ /obj/item/circuitboard/fusion_injector name = T_BOARD("fusion fuel injector") build_path = /obj/machinery/fusion_fuel_injector - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 4, TECH_MATERIAL = 4) req_components = list( "/obj/item/stock_parts/manipulator/pico" = 2, @@ -66,7 +66,7 @@ /obj/item/circuitboard/gyrotron name = T_BOARD("gyrotron") build_path = /obj/machinery/power/emitter/gyrotron - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list(TECH_POWER = 4, TECH_ENGINEERING = 4) req_components = list( "/obj/item/stack/cable_coil" = 20, diff --git a/code/modules/power/rtg.dm b/code/modules/power/rtg.dm index be334cd036f..3d71bde12b3 100644 --- a/code/modules/power/rtg.dm +++ b/code/modules/power/rtg.dm @@ -79,7 +79,7 @@ /obj/item/circuitboard/rtg name = T_BOARD("radioisotope thermoelectric generator") build_path = /obj/machinery/power/rtg - board_type = "machine" + board_type = BOARD_MACHINE origin_tech = list( TECH_ENGINEERING = 3, TECH_DATA = 2, diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index 824c8c6e399..fca802887a9 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -106,7 +106,7 @@ build_path = /obj/machinery/power/tesla_coil origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) req_components = list("/obj/item/stock_parts/capacitor" = 1) - board_type = "machine" + board_type = BOARD_MACHINE /obj/item/circuitboard/grounding_rod name = "grounding rod circuitry" @@ -114,4 +114,4 @@ build_path = /obj/machinery/power/grounding_rod origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) req_components = list("/obj/item/stock_parts/capacitor" = 1) - board_type = "machine" + board_type = BOARD_MACHINE diff --git a/html/changelogs/fluffyghost-weaponsrack.yml b/html/changelogs/fluffyghost-weaponsrack.yml new file mode 100644 index 00000000000..96b2ea1b209 --- /dev/null +++ b/html/changelogs/fluffyghost-weaponsrack.yml @@ -0,0 +1,63 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost, Wezzy + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added weapons racks, can be locked/unlocked with an ID card." + - imageadd: "Added weapons racks sprites, from Wezzy." + - refactor: "Refactored some circuitboard code, moved the defines, applied the defines, DMDocs." + - refactor: "Moved mutable appearance appearance flag set to the mutable appearance file." + - qol: "Reorganized the Horizon armory with the weapons racks, moved things around, put down markers on lockers depending on the danger level of their content, reorganized content of the remaining lockers." + - rscadd: "Made weapons racks constructable with a circuitboards." diff --git a/icons/obj/machinery/weapons_rack.dmi b/icons/obj/machinery/weapons_rack.dmi new file mode 100644 index 0000000000000000000000000000000000000000..1dca9fa0bb14ef434972dbb62e26e4f9c08d5dcb GIT binary patch literal 750 zcmVV=-0C=2*%DoE0FcgO2Ip-=q+Fkrxvq*|$Xm6n$o1+P74J4uB-8*!05V!Y* zr^Tha+5x7wv`Q`^J)v>l?Mc0Ys~#GsBPlQ8;p;Y~ausManWs43xJX0Fg?v zO9V3K1BipPJ1W9gGNIq(bi~Ig~y*?TnYD;jk&r@5@$An@pKTx^;&Cf z38}^e0LW#sP_MP1x_=-v$eB$dvmhR?8k@^x$*ea81VS^BwcW8lgu6n z01!TtD_3ZJJHT&&aG?Dn$R(g5Tms>MOF%=o1i}HAfQE1hgaa-C4dD_92RfEO!~mH; zOZbpB;N|tywISMRgBD*c>I@$&j6u8?M^qbU{bpAO~a4=8%*<)C3PYO gP`b8Oh4vevPk0ZeY!?T{UjP6A07*qoM6N<$f`h