Two interface QoL changes (closets and mechs)

This commit is contained in:
Arokha Sieyes
2018-01-14 03:58:15 -05:00
parent cd298b1575
commit 1f595cd59a
2 changed files with 23 additions and 9 deletions

View File

@@ -7,7 +7,6 @@
#define MELEE 1
#define RANGED 2
/obj/mecha
name = "Mecha"
desc = "Exosuit"
@@ -1051,6 +1050,17 @@
return
/obj/mecha/MouseDrop_T(mob/O, mob/user as mob)
//Humans can pilot mechs.
if(!ishuman(O))
return
//Can't put other people into mechs (can comment this out if you want that to be possible)
if(O != user)
return
move_inside()
/obj/mecha/verb/move_inside()
set category = "Object"
set name = "Enter Exosuit"
@@ -1060,17 +1070,17 @@
return
if (usr.buckled)
usr << "<span class='warning'>You can't climb into the exosuit while buckled!</span>"
to_chat(usr,"<span class='warning'>You can't climb into the exosuit while buckled!</span>")
return
src.log_message("[usr] tries to move in.")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
if(C.handcuffed)
usr << "<span class='danger'>Kinda hard to climb in while handcuffed don't you think?</span>"
to_chat(usr,"<span class='danger'>Kinda hard to climb in while handcuffed don't you think?</span>")
return
if (src.occupant)
usr << "<span class='danger'>The [src.name] is already occupied!</span>"
to_chat(usr,"<span class='danger'>The [src.name] is already occupied!</span>")
src.log_append_to_last("Permission denied.")
return
/*
@@ -1085,12 +1095,12 @@
else if(src.operation_allowed(usr))
passed = 1
if(!passed)
usr << "<span class='warning'>Access denied</span>"
to_chat(usr,"<span class='warning'>Access denied</span>")
src.log_append_to_last("Permission denied.")
return
for(var/mob/living/simple_animal/slime/M in range(1,usr))
if(M.victim == usr)
usr << "You're too busy getting your life sucked out of you."
to_chat(usr,"You're too busy getting your life sucked out of you.")
return
// usr << "You start climbing into [src.name]"
@@ -1100,9 +1110,9 @@
if(!src.occupant)
moved_inside(usr)
else if(src.occupant!=usr)
usr << "[src.occupant] was faster. Try better next time, loser."
to_chat(usr,"[src.occupant] was faster. Try better next time, loser.")
else
usr << "You stop entering the exosuit."
to_chat(usr,"You stop entering the exosuit.")
return
/obj/mecha/proc/moved_inside(var/mob/living/carbon/human/H as mob)

View File

@@ -127,12 +127,16 @@
else
src.toggle(user)
/obj/structure/closet/secure_closet/AltClick()
..()
verb_togglelock()
/obj/structure/closet/secure_closet/verb/verb_togglelock()
set src in oview(1) // One square distance
set category = "Object"
set name = "Toggle Lock"
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr) || isrobot(usr))