diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index da4192df25..5d6400886e 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -1,11 +1,16 @@ var/global/datum/getrev/revdata = new() /datum/getrev + var/branch var/revision var/date var/showinfo /datum/getrev/New() + var/list/head_branch = file2list(".git/HEAD", "\n") + if(head_branch.len) + branch = copytext(head_branch[1], 17) + var/list/head_log = file2list(".git/logs/HEAD", "\n") for(var/line=head_log.len, line>=1, line--) if(head_log[line]) @@ -18,7 +23,9 @@ var/global/datum/getrev/revdata = new() if(unix_time) date = unix2date(unix_time) break + world.log << "Running revision:" + world.log << branch world.log << date world.log << revision return @@ -29,7 +36,7 @@ client/verb/showrevinfo() set desc = "Check the current server code revision" if(revdata.revision) - src << "Server revision: [revdata.date]" + src << "Server revision: [revdata.branch] - [revdata.date]" if(config.githuburl) src << "[revdata.revision]" else diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 96bdae2336..e2b0ff6c7e 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -154,15 +154,20 @@ user << "The crate appears to be broken." return if(src.allowed(user)) - src.locked = !src.locked - for(var/mob/O in viewers(user, 3)) - if((O.client && !( O.blinded ))) - O << "The crate has been [locked ? null : "un"]locked by [user]." - overlays.Cut() - overlays += locked ? redlight : greenlight + set_locked(!locked, user) else user << "Access Denied" +/obj/structure/closet/crate/secure/proc/set_locked(var/newlocked, mob/user = null) + if(locked == newlocked) return + + locked = newlocked + if(user) + for(var/mob/O in viewers(user, 3)) + O.show_message( "The crate has been [locked ? null : "un"]locked by [user].", 1) + overlays.Cut() + overlays += locked ? redlight : greenlight + /obj/structure/closet/crate/secure/verb/verb_togglelock() set src in oview(1) // One square distance set category = "Object" diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm index 1f8a75bf71..11b90e28ea 100644 --- a/code/modules/mining/abandonedcrates.dm +++ b/code/modules/mining/abandonedcrates.dm @@ -4,8 +4,8 @@ icon_state = "securecrate" icon_opened = "securecrateopen" icon_closed = "securecrate" - var/code = null - var/lastattempt = null + var/list/code = list() + var/list/lastattempt = list() var/attempts = 10 var/codelen = 4 locked = 1 @@ -14,12 +14,12 @@ ..() var/list/digits = list("1", "2", "3", "4", "5", "6", "7", "8", "9", "0") - code = "" - for(var/i = 0, i < codelen, i++) - var/dig = pick(digits) - code += dig - digits -= dig // Player can enter codes with matching digits, but there are never matching digits in the answer + for(var/i in 1 to codelen) + code += pick(digits) + generate_loot() + +/obj/structure/closet/crate/secure/loot/proc/generate_loot() var/loot = rand(1, 100) switch(loot) if(1 to 5) // Common things go, 5% @@ -145,58 +145,60 @@ new/obj/item/clothing/head/bearpelt(src) /obj/structure/closet/crate/secure/loot/togglelock(mob/user as mob) - if(locked) - user << "The crate is locked with a Deca-code lock." - var/input = input(usr, "Enter [codelen] digits.", "Deca-Code Lock", "") as text - if(in_range(src, user)) - if (input == code) - user << "The crate unlocks!" - locked = 0 - overlays.Cut() - overlays += greenlight - else if (input == null || length(input) != codelen) - user << "You leave the crate alone." - else - user << "A red light flashes." - lastattempt = input - attempts-- - if (attempts == 0) - user << "The crate's anti-tamper system activates!" - var/turf/T = get_turf(src.loc) - explosion(T, 0, 0, 0, 1) - qdel(src) - return - else - user << "You attempt to interact with the device using a hand gesture, but it appears this crate is from before the DECANECT came out." - return + if(!locked) + return + + user << "The crate is locked with a Deca-code lock." + var/input = input(user, "Enter [codelen] digits.", "Deca-Code Lock", "") as text + if(!Adjacent(user)) + return + + if(input == null || length(input) != codelen) + user << "You leave the crate alone." + else if(check_input(input)) + user << "The crate unlocks!" + playsound(user, 'sound/machines/lockreset.ogg', 50, 1) + set_locked(0) else - return ..() + visible_message("A red light on \the [src]'s control panel flashes briefly.") + attempts-- + if (attempts == 0) + user << "The crate's anti-tamper system activates!" + var/turf/T = get_turf(src.loc) + explosion(T, 0, 0, 1, 2) + del(src) + +/obj/structure/closet/crate/secure/loot/proc/check_input(var/input) + if(length(input) != codelen) + return 0 + + . = 1 + lastattempt.Cut() + for(var/i in 1 to codelen) + var/guesschar = copytext(input, i, i+1) + lastattempt += guesschar + if(guesschar != code[i]) + . = 0 /obj/structure/closet/crate/secure/loot/attackby(obj/item/weapon/W as obj, mob/user as mob) if(locked) - if (istype(W, /obj/item/weapon/card/emag)) - user << "The crate unlocks!" - locked = 0 if (istype(W, /obj/item/device/multitool)) // Greetings Urist McProfessor, how about a nice game of cows and bulls? - user << "DECA-CODE LOCK REPORT:" + user << "DECA-CODE LOCK ANALYSIS:" if (attempts == 1) - user << "* Anti-Tamper Bomb will activate on next failed access attempt." + user << "* Anti-Tamper system will activate on the next failed access attempt." else - user << "* Anti-Tamper Bomb will activate after [src.attempts] failed access attempts." - if (lastattempt != null) - var/list/guess = list() + user << "* Anti-Tamper system will activate after [src.attempts] failed access attempts." + if(lastattempt.len) var/bulls = 0 var/cows = 0 - for(var/i = 1, i < codelen + 1, i++) - var/a = copytext(lastattempt, i, i+1) // Stuff the code into the list - guess += a - guess[a] = i - for(var/i in guess) // Go through list and count matches - var/a = findtext(code, i) - if(a == guess[i]) + + var/list/code_contents = code.Copy() + for(var/i in 1 to codelen) + if(lastattempt[i] == code[i]) ++bulls - else if(a) + else if(lastattempt[i] in code_contents) ++cows + code_contents -= lastattempt[i] user << "Last code attempt had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions." - else ..() - else ..() + return + ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 4b33818033..17fc2d8255 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -102,6 +102,7 @@ handle_stunned() handle_weakened() handle_paralysed() + update_canmove() handle_supernatural() //Movement diff --git a/html/changelog.html b/html/changelog.html index 8e35f57b96..b1fb843f98 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,17 @@ -->