Directional Locking

This adds the ability to lock your mob towards facing either a certain
direction or a certain atom. Direction is done by shift-middleclick,
atom is done by shift-ctrl-middleclick.
This commit is contained in:
tigercat2000
2018-04-19 19:01:29 -08:00
parent 604f26f2ec
commit caccc13e82
4 changed files with 56 additions and 0 deletions
+20
View File
@@ -170,6 +170,15 @@
return 0
/mob/proc/Life()
if(forced_look)
if(!isnum(forced_look))
var/atom/A = locateUID(forced_look)
if(istype(A))
if(get_dist(src, A) > (client ? client.view : world.view))
forced_look = null
to_chat(src, "<span class='notice'>Your direction target has left your view, you are no longer facing anything.</span>")
return
setDir()
// handle_typing_indicator()
return
@@ -533,6 +542,17 @@ var/list/slot_equipment_priority = list( \
client.screen = list()
hud_used.show_hud(hud_used.hud_version)
/mob/setDir(new_dir)
if(forced_look)
if(isnum(forced_look))
dir = forced_look
else
var/atom/A = locateUID(forced_look)
if(istype(A))
dir = get_cardinal_dir(src, A)
return
. = ..()
/mob/proc/show_inv(mob/user)
user.set_machine(src)
var/dat = {"<table>