[MIRROR] Brings the captain's safe off the wall, safes now save their contents (#26922)

* Brings the captain's safe off the wall, safes now save their contents (#81762)

## About The Pull Request

I originally was gonna make the captain's spare ID safe float in the air
if the wall under it was taken down, but it looked poor and was going
against the vision for wall items (and go against the wallening) so my
alternative proposition is this, taking the safe off the wall.
It's now a golden safe (like the one in the vault) but is interacted the
exact same, it's now just a thing on the floor rather than being on a
wall.
I'm not a spriter so I didn't give it a custom icon but if anyone wants
to they can feel free to add one, just a golden version of the regular
safe felt kinda eh.

I also added a wallframe version of the secure safe for when it is taken
down. It will conserve its contents and be permanently locked until put
back up. This doesn't apply to the new captain safe since it isn't a
wall item.

## Why It's Good For The Game

Closes https://github.com/tgstation/tgstation/issues/80588
Prevents people from cheesing the spare and/or it being too easy to
destroy.

## Changelog

🆑
fix: The captain's safe is no longer on the wall, therefore cannot be
cheesed by breaking the wall it sits on.
fix: Tearing down a wall that a safe is on now drops the safe with its
contents, rather than dropping the contents onto the floor. The safe's
contents cannot be interacted with while it's not on a wall.
/🆑

* Brings the captain's safe off the wall, safes now save their contents

* Kilostatiooon

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-04-03 18:06:11 +02:00
committed by GitHub
co-authored by John Willard Useroth
parent fc8034dd28
commit 1fe673c71c
10 changed files with 765 additions and 744 deletions
+3 -1
View File
@@ -41,6 +41,7 @@ FLOOR SAFES
/obj/structure/safe/Initialize(mapload)
. = ..()
update_appearance(UPDATE_ICON)
// Combination generation
for(var/iterating in 1 to number_of_tumblers)
tumblers.Add(rand(0, 99))
@@ -57,7 +58,8 @@ FLOOR SAFES
inserting_item.forceMove(src)
/obj/structure/safe/update_icon_state()
icon_state = "[initial(icon_state)][open ? "-open" : null]"
//uses the same icon as the captain's spare safe (therefore lockable storage) so keep it in line with that
icon_state = "[initial(icon_state)][open ? null : "_locked"]"
return ..()
/obj/structure/safe/attackby(obj/item/attacking_item, mob/user, params)
+44 -6
View File
@@ -1,3 +1,25 @@
/obj/item/wallframe/secure_safe
name = "secure safe frame"
desc = "A locked safe. It being unpowered prevents any access until placed back onto a wall."
icon = 'icons/obj/storage/storage.dmi'
icon_state = "wall_safe"
base_icon_state = "wall_safe"
result_path = /obj/structure/secure_safe
pixel_shift = 32
/obj/item/wallframe/secure_safe/Initialize(mapload)
. = ..()
create_storage(
max_specific_storage = WEIGHT_CLASS_GIGANTIC,
max_total_storage = 20,
)
atom_storage.locked = STORAGE_FULLY_LOCKED
/obj/item/wallframe/secure_safe/after_attach(obj/attached_to)
. = ..()
for(var/obj/item in contents)
item.forceMove(attached_to)
/**
* Wall safes
* Holds items and uses the lockable storage component
@@ -18,8 +40,17 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/secure_safe, 32)
. = ..()
//this will create the storage for us.
AddComponent(/datum/component/lockable_storage)
find_and_hang_on_wall()
PopulateContents()
if(!density)
find_and_hang_on_wall()
if(mapload)
PopulateContents()
/obj/structure/secure_safe/deconstruct(disassembled)
if(!density) //if we're a wall item, we'll drop a wall frame.
var/obj/item/wallframe/secure_safe/new_safe = new(get_turf(src))
for(var/obj/item in contents)
item.forceMove(new_safe)
return ..()
/obj/structure/secure_safe/proc/PopulateContents()
new /obj/item/paper(src)
@@ -42,12 +73,16 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/secure_safe, 32)
desc = "In case of emergency, do not break glass. All Captains and Acting Captains are provided with codes to access this safe. \
It is made out of the same material as the station's Black Box and is designed to resist all conventional weaponry. \
There appears to be a small amount of surface corrosion. It doesn't look like it could withstand much of an explosion.\
It remains quite flush against the wall, and there only seems to be enough room to fit something as slim as an ID card."
Due to the expensive material, it was made incredibly small to cut corners, leaving only enough room to fit something as slim as an ID card."
icon = 'icons/obj/structures.dmi'
icon_state = "safe"
base_icon_state = "safe"
armor_type = /datum/armor/safe_caps_spare
max_integrity = 300
color = "#ffdd33"
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/secure_safe/caps_spare, 32)
density = TRUE
anchored_tabletop_offset = 4
custom_materials = list(/datum/material/gold = SMALL_MATERIAL_AMOUNT)
material_flags = MATERIAL_EFFECTS | MATERIAL_COLOR
/datum/armor/safe_caps_spare
melee = 100
@@ -60,6 +95,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/secure_safe/caps_spare, 32)
/obj/structure/secure_safe/caps_spare/Initialize(mapload)
. = ..()
var/matrix/small_safe_transformation = new
small_safe_transformation.Scale(0.6)
transform = small_safe_transformation
atom_storage.set_holdable(/obj/item/card/id)
AddComponent(/datum/component/lockable_storage, \
lock_code = SSid_access.spare_id_safe_code, \