From 8a6a71ffebc69821f4c67fa3fcd8e12bc3c0c5fa Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 1 Feb 2022 05:24:04 +0100 Subject: [PATCH] [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> --- .../structures/crates_lockers/crates.dm | 18 ++++++------------ code/modules/mining/abandoned_crates.dm | 8 +++++--- .../lavalandruin_code/elephantgraveyard.dm | 6 +++++- code/modules/unit_tests/closets.dm | 3 ++- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 12048eaeb72..b3642fc0b10 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -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) . = ..() diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index e97a6a79202..d707aae41f6 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -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) diff --git a/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm b/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm index c90b4eb7545..cf8df80b34f 100644 --- a/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm +++ b/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm @@ -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) diff --git a/code/modules/unit_tests/closets.dm b/code/modules/unit_tests/closets.dm index cf21716d8e6..2e3b18aa6f8 100644 --- a/code/modules/unit_tests/closets.dm +++ b/code/modules/unit_tests/closets.dm @@ -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]).")