From 912f689e51006d819085c1786c43cc48d2fcd3c9 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Tue, 18 Aug 2015 16:05:37 +0100 Subject: [PATCH] Diagonal, ctrl+dir, and alt+dir actions are now consistent with client.dir --- code/modules/mob/mob.dm | 16 ++++----- code/modules/mob/mob_movement.dm | 60 ++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2db05cedeb..e08fb82fb8 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -765,22 +765,22 @@ /mob/verb/eastface() set hidden = 1 - return facedir(EAST) + return facedir(client.client_dir(EAST)) /mob/verb/westface() set hidden = 1 - return facedir(WEST) + return facedir(client.client_dir(WEST)) /mob/verb/northface() set hidden = 1 - return facedir(NORTH) + return facedir(client.client_dir(NORTH)) /mob/verb/southface() set hidden = 1 - return facedir(SOUTH) + return facedir(client.client_dir(SOUTH)) //This might need a rename but it should replace the can this mob use things check @@ -1058,19 +1058,19 @@ mob/proc/yank_out_object() /mob/verb/northfaceperm() set hidden = 1 - set_face_dir(NORTH) + set_face_dir(client.client_dir(NORTH)) /mob/verb/southfaceperm() set hidden = 1 - set_face_dir(SOUTH) + set_face_dir(client.client_dir(SOUTH)) /mob/verb/eastfaceperm() set hidden = 1 - set_face_dir(EAST) + set_face_dir(client.client_dir(EAST)) /mob/verb/westfaceperm() set hidden = 1 - set_face_dir(WEST) + set_face_dir(client.client_dir(WEST)) /mob/proc/adjustEarDamage() return diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index bb333b82c5..8d6547d47b 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -27,35 +27,43 @@ ..() +/client/proc/client_dir(input) + return turn(input, dir2angle(dir)) + /client/Northeast() - swap_hand() - return - - -/client/Southeast() - attack_self() - return - - -/client/Southwest() - if(iscarbon(usr)) - var/mob/living/carbon/C = usr - C.toggle_throw_mode() - else - usr << "\red This mob type cannot throw items." - return - - + diagonal_action(NORTHEAST) /client/Northwest() - if(iscarbon(usr)) - var/mob/living/carbon/C = usr - if(!C.get_active_hand()) - usr << "\red You have nothing to drop in your hand." + diagonal_action(NORTHWEST) +/client/Southeast() + diagonal_action(SOUTHEAST) +/client/Southwest() + diagonal_action(SOUTHWEST) + +/client/proc/diagonal_action(direction) + switch(client_dir(direction)) + if(NORTHEAST) + swap_hand() + return + if(SOUTHEAST) + attack_self() + return + if(SOUTHWEST) + if(iscarbon(usr)) + var/mob/living/carbon/C = usr + C.toggle_throw_mode() + else + usr << "\red This mob type cannot throw items." + return + if(NORTHWEST) + if(iscarbon(usr)) + var/mob/living/carbon/C = usr + if(!C.get_active_hand()) + usr << "\red You have nothing to drop in your hand." + return + drop_item() + else + usr << "\red This mob type cannot drop items." return - drop_item() - else - usr << "\red This mob type cannot drop items." - return //This gets called when you press the delete button. /client/verb/delete_key_pressed()