mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-09 16:12:17 +00:00
[MIRROR] Update lockpicks (#10200)
Co-authored-by: Killian <49700375+KillianKirilenko@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
7e0a556c09
commit
5c1e9f9193
@@ -1,4 +1,5 @@
|
||||
//For bypassing locked /obj/structure/simple_doors
|
||||
//now with added fence gate support
|
||||
|
||||
/obj/item/lockpick
|
||||
name = "set of lockpicks"
|
||||
@@ -30,6 +31,23 @@
|
||||
if(do_after(user, pick_time * D.lock_difficulty))
|
||||
to_chat(user, span_notice("Success!"))
|
||||
D.locked = FALSE
|
||||
if(istype(A, /obj/structure/fence/door))
|
||||
var/obj/structure/fence/door/D = A
|
||||
if(!D.locked) //you can pick your nose, but you can't pick an unlocked door
|
||||
to_chat(user, span_notice("\The [D] isn't locked."))
|
||||
return
|
||||
else if(D.lock_type != pick_type) //make sure our types match
|
||||
to_chat(user, span_warning("\The [src] can't pick \the [D]. Another tool might work?"))
|
||||
return
|
||||
else if(!D.can_pick) //make sure we're actually allowed to bypass it at all
|
||||
to_chat(user, span_warning("\The [D] can't be [pick_verb]ed."))
|
||||
return
|
||||
else //finally, we can assume that they do match
|
||||
to_chat(user, span_notice("You start to [pick_verb] the lock on \the [D]..."))
|
||||
playsound(src, D.keysound,100, 1)
|
||||
if(do_after(user, pick_time * D.lock_difficulty))
|
||||
to_chat(user, span_notice("Success!"))
|
||||
D.locked = FALSE
|
||||
else if(ishuman(A)) //you can pick your friends, and you can pick your nose, but you can't pick your friend's nose
|
||||
var/mob/living/carbon/human/H = A
|
||||
if(user.zone_sel.selecting == BP_HEAD)
|
||||
|
||||
@@ -270,6 +270,7 @@
|
||||
prob(1);/obj/item/beartrap,
|
||||
prob(1);/obj/item/handcuffs,
|
||||
prob(1);/obj/item/handcuffs/legcuffs,
|
||||
prob(1);/obj/item/lockpick,
|
||||
prob(2);/obj/item/reagent_containers/syringe/drugs,
|
||||
prob(1);/obj/item/reagent_containers/syringe/steroid)
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/fence/attackby(obj/item/W, mob/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(!cuttable)
|
||||
to_chat(user, span_warning("This section of the fence can't be cut."))
|
||||
@@ -122,6 +123,11 @@
|
||||
cuttable = FALSE
|
||||
var/open = FALSE
|
||||
var/locked = FALSE
|
||||
var/lock_id = null //does the door have an associated key?
|
||||
var/lock_type = "simple" //string matched to "pick_type" on /obj/item/lockpick
|
||||
var/can_pick = TRUE //can it be picked/bypassed?
|
||||
var/lock_difficulty = 1 //multiplier to picking/bypassing time
|
||||
var/keysound = 'sound/items/toolbelt_equip.ogg'
|
||||
|
||||
/obj/structure/fence/door/Initialize()
|
||||
update_door_status()
|
||||
@@ -144,6 +150,23 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/structure/fence/door/attackby(obj/item/W as obj, mob/user as mob)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(istype(W,/obj/item/simple_key))
|
||||
var/obj/item/simple_key/key = W
|
||||
if(open)
|
||||
to_chat(user,span_notice("\The [src] must be closed in order for you to lock it."))
|
||||
else if(key.key_id != src.lock_id)
|
||||
to_chat(user,span_warning("The [key] doesn't fit \the [src]'s lock!"))
|
||||
else if(key.key_id == src.lock_id)
|
||||
visible_message(span_notice("[user] [key.keyverb] \the [key] and [locked ? "unlocks" : "locks"] \the [src]."))
|
||||
locked = !locked
|
||||
playsound(src, keysound,100, 1)
|
||||
return
|
||||
else
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/structure/fence/door/proc/toggle(mob/user)
|
||||
switch(open)
|
||||
if(FALSE)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 669 B |
Reference in New Issue
Block a user