mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 09:05:11 +01:00
[MIRROR] Fixing a number of issues with burial mounds and abandoned crates. [MDB IGNORE] (#11197)
* Fixing a number of issues with burial mounds and abandoned crates. (#64482) Ok, I'm fixing a few issues with certain crates, namely the abandoned one and the burial mound: An oversight with the skittish trait letting players dive into burial mounds, which are technically a subtype of crates. A runtime that made abandoned crates not update their lock lights when unlocked (the togglelock call was missing the user arg). This one was my fault. An oversight with abandoned crates not resetting the number of attempts left and not nulling the last attempted code when re-locked. Idem. Burial mounds somehow getting lock lights overlays. Also i'm taking this opportunity to make the closets unit test not early return at the first encountered failure (at the time I made it I didn't know TEST_ASSERT & co would early return on failure) since we want this unit test to finish looping through all non-blacklisted closets. * Fixing a number of issues with burial mounds and abandoned crates. Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -33,18 +33,6 @@
|
||||
QDEL_NULL(manifest)
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/update_overlays()
|
||||
. = ..()
|
||||
if(broken)
|
||||
. += "securecrateemag"
|
||||
return
|
||||
if(locked)
|
||||
. += "securecrater"
|
||||
return
|
||||
if(secure)
|
||||
. += "securecrateg"
|
||||
return
|
||||
|
||||
/obj/structure/closet/crate/CanAllowThrough(atom/movable/mover, border_dir)
|
||||
. = ..()
|
||||
if(!istype(mover, /obj/structure/closet))
|
||||
@@ -63,6 +51,12 @@
|
||||
. = new_overlays
|
||||
if(manifest)
|
||||
. += "manifest"
|
||||
if(broken)
|
||||
. += "securecrateemag"
|
||||
else if(locked)
|
||||
. += "securecrater"
|
||||
else if(secure)
|
||||
. += "securecrateg"
|
||||
|
||||
/obj/structure/closet/crate/attack_hand(mob/user, list/modifiers)
|
||||
. = ..()
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
if(locked)
|
||||
to_chat(user, span_notice("The crate is locked with a Deca-code lock."))
|
||||
var/input = input(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") as text|null
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
if(user.canUseTopic(src, BE_CLOSE) && locked)
|
||||
var/list/sanitised = list()
|
||||
var/sanitycheck = TRUE
|
||||
var/char = ""
|
||||
@@ -43,7 +43,6 @@
|
||||
if(sanitised[i] == sanitised[j])
|
||||
sanitycheck = FALSE //if a digit is repeated, reject the input
|
||||
if(input == code)
|
||||
to_chat(user, span_notice("The crate unlocks!"))
|
||||
if(!spawned_loot)
|
||||
spawn_loot()
|
||||
tamperproof = 0 // set explosion chance to zero, so we dont accidently hit it with a multitool and instantly die
|
||||
@@ -109,7 +108,10 @@
|
||||
if(!locked)
|
||||
. = ..()
|
||||
if(locked)
|
||||
tamperproof = initial(tamperproof) //reset the anti-tampering when the lock is re-enabled.
|
||||
//reset the anti-tampering, number of attempts and last attempt when the lock is re-enabled.
|
||||
tamperproof = initial(tamperproof)
|
||||
attempts = initial(attempts)
|
||||
lastattempt = null
|
||||
return
|
||||
if(tamperproof)
|
||||
boom(user)
|
||||
|
||||
@@ -122,7 +122,8 @@
|
||||
anchorable = FALSE
|
||||
anchored = TRUE
|
||||
locked = TRUE
|
||||
breakout_time = 900
|
||||
divable = FALSE //As funny as it may be, it would make little sense how you got yourself inside it in first place.
|
||||
breakout_time = 90 SECONDS
|
||||
open_sound = 'sound/effects/shovel_dig.ogg'
|
||||
close_sound = 'sound/effects/shovel_dig.ogg'
|
||||
cutting_tool = /obj/item/shovel
|
||||
@@ -162,6 +163,9 @@
|
||||
else
|
||||
to_chat(user, span_notice("The grave has already been dug up."))
|
||||
|
||||
/obj/structure/closet/crate/grave/closet_update_overlays(list/new_overlays)
|
||||
return
|
||||
|
||||
/obj/structure/closet/crate/grave/tool_interact(obj/item/S, mob/living/carbon/user)
|
||||
if(!user.combat_mode) //checks to attempt to dig the grave, must be done with combat mode off only.
|
||||
if(!opened)
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
for(var/closet_type in all_closets)
|
||||
var/obj/structure/closet/closet = allocate(closet_type)
|
||||
var/contents_len = length(closet.contents)
|
||||
TEST_ASSERT(contents_len <= closet.storage_capacity, "Initial Contents of [closet.type] ([contents_len]) exceed its storage capacity ([closet.storage_capacity]).")
|
||||
if(contents_len > closet.storage_capacity)
|
||||
Fail("Initial Contents of [closet.type] ([contents_len]) exceed its storage capacity ([closet.storage_capacity]).")
|
||||
|
||||
Reference in New Issue
Block a user