Borg locker verb fix. (#17408)

This commit is contained in:
Dragonkiller93
2022-03-09 05:13:22 -08:00
committed by GitHub
parent 137338f4dd
commit 6eeb6a1504
3 changed files with 38 additions and 38 deletions
@@ -292,11 +292,11 @@
if(usr.incapacitated())
return
if(ishuman(usr))
if(ishuman(usr) || isrobot(usr))
add_fingerprint(usr)
toggle(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
return
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
if(!opened)
@@ -90,11 +90,11 @@
if(usr.incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr))
if(ishuman(usr)||isrobot(usr))
add_fingerprint(usr)
togglelock(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
return
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/secure_closet/update_overlays() //Putting the welded stuff in update_overlays() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
cut_overlays()
@@ -28,9 +28,9 @@
return TRUE
/obj/structure/closet/crate/open(by_hand = FALSE)
if(src.opened)
if(opened)
return FALSE
if(!src.can_open())
if(!can_open())
return FALSE
if(by_hand)
@@ -54,7 +54,7 @@
for(var/mob/M in src) //Mobs
M.forceMove(loc)
icon_state = icon_opened
src.opened = TRUE
opened = TRUE
if(climbable)
structure_shaken()
@@ -62,9 +62,9 @@
return TRUE
/obj/structure/closet/crate/close()
if(!src.opened)
if(!opened)
return FALSE
if(!src.can_close())
if(!can_close())
return FALSE
playsound(loc, close_sound, close_sound_volume, TRUE, -3)
@@ -82,7 +82,7 @@
itemcount++
icon_state = icon_closed
src.opened = FALSE
opened = FALSE
return TRUE
/obj/structure/closet/crate/attackby(obj/item/W, mob/user, params)
@@ -133,7 +133,7 @@
/obj/structure/closet/crate/attack_hand(mob/user)
if(manifest)
to_chat(user, "<span class='notice'>You tear the manifest off of the crate.</span>")
playsound(src.loc, 'sound/items/poster_ripped.ogg', 75, 1)
playsound(loc, 'sound/items/poster_ripped.ogg', 75, TRUE)
manifest.forceMove(loc)
if(ishuman(user))
user.put_in_hands(manifest)
@@ -147,15 +147,15 @@
if(L.electrocute_act(17, src))
do_sparks(5, 1, src)
return
src.add_fingerprint(user)
src.toggle(user, by_hand = TRUE)
add_fingerprint(user)
toggle(user, by_hand = TRUE)
// Called when a crate is delivered by MULE at a location, for notifying purposes
/obj/structure/closet/crate/proc/notifyRecipient(destination)
var/list/msg = list("[capitalize(name)] has arrived at [destination].")
if(destination in announce_beacons)
for(var/obj/machinery/requests_console/D in GLOB.allRequestConsoles)
if(D.department in src.announce_beacons[destination])
if(D.department in announce_beacons[destination])
D.createMessage(name, "Your Crate has Arrived!", msg, 1)
/obj/structure/closet/crate/secure
@@ -208,14 +208,14 @@
return !locked
/obj/structure/closet/crate/secure/proc/togglelock(mob/user)
if(src.opened)
if(opened)
to_chat(user, "<span class='notice'>Close the crate first.</span>")
return
if(src.broken)
if(broken)
to_chat(user, "<span class='warning'>The crate appears to be broken.</span>")
return
if(src.allowed(user))
src.locked = !src.locked
if(allowed(user))
locked = !locked
visible_message("<span class='notice'>The crate has been [locked ? null : "un"]locked by [user].</span>")
update_icon()
else
@@ -229,16 +229,16 @@
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr))
src.add_fingerprint(usr)
src.togglelock(usr)
else
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
if(ishuman(usr) || isrobot(usr))
add_fingerprint(usr)
togglelock(usr)
return
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/crate/secure/attack_hand(mob/user)
if(manifest)
to_chat(user, "<span class='notice'>You tear the manifest off of the crate.</span>")
playsound(src.loc, 'sound/items/poster_ripped.ogg', 75, 1)
playsound(loc, 'sound/items/poster_ripped.ogg', 75, 1)
manifest.forceMove(loc)
if(ishuman(user))
user.put_in_hands(manifest)
@@ -246,9 +246,9 @@
update_icon()
return
if(locked)
src.togglelock(user)
togglelock(user)
else
src.toggle(user, by_hand = TRUE)
toggle(user, by_hand = TRUE)
/obj/structure/closet/crate/secure/closed_item_click(mob/user)
togglelock(user)
@@ -258,8 +258,8 @@
overlays += sparks
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
playsound(src.loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
src.locked = 0
src.broken = 1
locked = FALSE
broken = TRUE
update_icon()
to_chat(user, "<span class='notice'>You unlock \the [src].</span>")
@@ -268,19 +268,19 @@
O.emp_act(severity)
if(!broken && !opened && prob(50/severity))
if(!locked)
src.locked = 1
locked = TRUE
else
overlays += sparks
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
src.locked = 0
locked = FALSE
update_icon()
if(!opened && prob(20/severity))
if(!locked)
open()
else
src.req_access = list()
src.req_access += pick(get_all_accesses())
req_access = list()
req_access += pick(get_all_accesses())
..()
/obj/structure/closet/crate/plastic
@@ -457,7 +457,7 @@
. = ..()
if(.)//we can hold up to one large item
var/found = 0
for(var/obj/structure/S in src.loc)
for(var/obj/structure/S in loc)
if(S == src)
continue
if(!S.anchored)
@@ -465,7 +465,7 @@
S.forceMove(src)
break
if(!found)
for(var/obj/machinery/M in src.loc)
for(var/obj/machinery/M in loc)
if(!M.anchored)
M.forceMove(src)
break
@@ -483,7 +483,7 @@
. = ..()
if(.)//we can hold up to one large item
var/found = 0
for(var/obj/structure/S in src.loc)
for(var/obj/structure/S in loc)
if(S == src)
continue
if(!S.anchored)
@@ -491,7 +491,7 @@
S.forceMove(src)
break
if(!found)
for(var/obj/machinery/M in src.loc)
for(var/obj/machinery/M in loc)
if(!M.anchored)
M.forceMove(src)
break