From eba855d423ae4d60ec56c0b421fdab400d5e230b Mon Sep 17 00:00:00 2001 From: NanakoAC Date: Tue, 2 Aug 2016 19:46:57 +0100 Subject: [PATCH] Fixes #643 (#649) --- .../structures/crates_lockers/closets.dm | 23 +++++++----- .../closets/secure/secure_closets.dm | 12 +++++- html/changelogs/Nanako-Lockers.yml | 37 +++++++++++++++++++ 3 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 html/changelogs/Nanako-Lockers.yml diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 08a2a5af237..ad56019e61a 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -343,28 +343,33 @@ return 1 /obj/structure/closet/proc/req_breakout() - if(breakout) - return 0 //Already breaking out. + if(opened) return 0 //Door's open... wait, why are you in it's contents then? - if(!welded) - return 0 //closed but not welded... - return 1 + if(welded) + return 1 //closed but not welded... + if(breakout) + return -1 //Already breaking out. + return 0 /obj/structure/closet/proc/mob_breakout(var/mob/living/escapee) - var/breakout_time = 2 //2 minutes by default - if(!req_breakout()) + //Improved by nanako + //Now it actually works, also locker breakout time stacks with locking and welding + //This means secure lockers are more useful for imprisoning people + var/breakout_time = 1.5 * req_breakout()//1.5 minutes if locked or welded, 3 minutes if both + if(breakout_time <= 0) return + + //okay, so the closet is either welded or locked... resist!!! escapee.next_move = world.time + 100 escapee.last_special = world.time + 100 escapee << "You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)" - visible_message("The [src] begins to shake violently!") - breakout = 1 //can't think of a better way to do this right now. + breakout = 1 for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2 playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1) animate_shake() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index a802596cba7..ab482b699d3 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -118,6 +118,8 @@ if(ishuman(usr)) src.add_fingerprint(usr) src.togglelock(usr) + else if(istype(usr, /mob/living/silicon/robot) && Adjacent(usr)) + src.togglelock(usr) else usr << "This mob type can't use this verb." @@ -135,8 +137,13 @@ /obj/structure/closet/secure_closet/req_breakout() - if(!opened && locked) return 1 - return ..() //It's a secure closet, but isn't locked. + 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." @@ -147,6 +154,7 @@ 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) diff --git a/html/changelogs/Nanako-Lockers.yml b/html/changelogs/Nanako-Lockers.yml new file mode 100644 index 00000000000..298da7f09c2 --- /dev/null +++ b/html/changelogs/Nanako-Lockers.yml @@ -0,0 +1,37 @@ +################################ +# 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 +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Nanako + +# 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, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Resisting out of lockers now works properly" + - tweak: "Breaking out of a locker which is welded AND locked takes longer than if it's only one of those two."