mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Merge pull request #4533 from VOREStation/pol-mecha
Two interface QoL changes (closets and mechs)
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
#define MELEE 1
|
#define MELEE 1
|
||||||
#define RANGED 2
|
#define RANGED 2
|
||||||
|
|
||||||
|
|
||||||
/obj/mecha
|
/obj/mecha
|
||||||
name = "Mecha"
|
name = "Mecha"
|
||||||
desc = "Exosuit"
|
desc = "Exosuit"
|
||||||
@@ -1051,6 +1050,17 @@
|
|||||||
return
|
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()
|
/obj/mecha/verb/move_inside()
|
||||||
set category = "Object"
|
set category = "Object"
|
||||||
set name = "Enter Exosuit"
|
set name = "Enter Exosuit"
|
||||||
@@ -1060,17 +1070,17 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
if (usr.buckled)
|
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
|
return
|
||||||
|
|
||||||
src.log_message("[usr] tries to move in.")
|
src.log_message("[usr] tries to move in.")
|
||||||
if(iscarbon(usr))
|
if(iscarbon(usr))
|
||||||
var/mob/living/carbon/C = usr
|
var/mob/living/carbon/C = usr
|
||||||
if(C.handcuffed)
|
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
|
return
|
||||||
if (src.occupant)
|
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.")
|
src.log_append_to_last("Permission denied.")
|
||||||
return
|
return
|
||||||
/*
|
/*
|
||||||
@@ -1085,12 +1095,12 @@
|
|||||||
else if(src.operation_allowed(usr))
|
else if(src.operation_allowed(usr))
|
||||||
passed = 1
|
passed = 1
|
||||||
if(!passed)
|
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.")
|
src.log_append_to_last("Permission denied.")
|
||||||
return
|
return
|
||||||
for(var/mob/living/simple_animal/slime/M in range(1,usr))
|
for(var/mob/living/simple_animal/slime/M in range(1,usr))
|
||||||
if(M.victim == 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
|
return
|
||||||
// usr << "You start climbing into [src.name]"
|
// usr << "You start climbing into [src.name]"
|
||||||
|
|
||||||
@@ -1100,9 +1110,9 @@
|
|||||||
if(!src.occupant)
|
if(!src.occupant)
|
||||||
moved_inside(usr)
|
moved_inside(usr)
|
||||||
else if(src.occupant!=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
|
else
|
||||||
usr << "You stop entering the exosuit."
|
to_chat(usr,"You stop entering the exosuit.")
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/mecha/proc/moved_inside(var/mob/living/carbon/human/H as mob)
|
/obj/mecha/proc/moved_inside(var/mob/living/carbon/human/H as mob)
|
||||||
|
|||||||
@@ -127,12 +127,16 @@
|
|||||||
else
|
else
|
||||||
src.toggle(user)
|
src.toggle(user)
|
||||||
|
|
||||||
|
/obj/structure/closet/secure_closet/AltClick()
|
||||||
|
..()
|
||||||
|
verb_togglelock()
|
||||||
|
|
||||||
/obj/structure/closet/secure_closet/verb/verb_togglelock()
|
/obj/structure/closet/secure_closet/verb/verb_togglelock()
|
||||||
set src in oview(1) // One square distance
|
set src in oview(1) // One square distance
|
||||||
set category = "Object"
|
set category = "Object"
|
||||||
set name = "Toggle Lock"
|
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
|
return
|
||||||
|
|
||||||
if(ishuman(usr) || isrobot(usr))
|
if(ishuman(usr) || isrobot(usr))
|
||||||
|
|||||||
Reference in New Issue
Block a user