Adds alert to direction locking, minor refactor (#23445)

* Adds alert to direction locking, minor refactor

* use return
This commit is contained in:
dearmochi
2023-12-11 17:05:12 +00:00
committed by GitHub
parent e5910559a6
commit aaafb6be77
10 changed files with 71 additions and 30 deletions
+6 -8
View File
@@ -252,11 +252,9 @@
return
var/face_dir = get_cardinal_dir(src, A)
if(!face_dir || forced_look == face_dir || A == src)
forced_look = null
to_chat(src, "<span class='notice'>Cancelled direction lock.</span>")
clear_forced_look()
return
forced_look = face_dir
to_chat(src, "<span class='userdanger'>You are now facing [dir2text(forced_look)]. To cancel this, shift-middleclick yourself.</span>")
set_forced_look(A, FALSE)
/*
Middle shift-control-click
@@ -266,13 +264,13 @@
return
/mob/living/MiddleShiftControlClickOn(atom/A)
if(incapacitated())
return
var/face_uid = A.UID()
if(forced_look == face_uid || A == src)
forced_look = null
to_chat(src, "<span class='notice'>Cancelled direction lock.</span>")
clear_forced_look()
return
forced_look = face_uid
to_chat(src, "<span class='userdanger'>You are now facing [A]. To cancel this, shift-middleclick yourself.</span>")
set_forced_look(A, TRUE)
// In case of use break glass
/*
+10
View File
@@ -337,6 +337,16 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
var/mob/living/L = usr
return L.resist()
/obj/screen/alert/direction_lock
name = "Direction Lock"
desc = "You are facing only one direction, slowing your movement down. Click here to stop the direction lock."
icon_state = "direction_lock"
/obj/screen/alert/direction_lock/Click()
if(isliving(usr))
var/mob/living/L = usr
return L.clear_forced_look()
//Constructs
/obj/screen/alert/holy_fire
name = "Holy Fire"