From 27be1f85a1172abc9a64fec08aea80aa7f3c64cb Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Sun, 23 Feb 2014 16:24:23 -0800 Subject: [PATCH] Ghosts now can shift-click to examine. (Fixes Redmine #93) Conflicts: code/_onclick/observer.dm --- code/_onclick/observer.dm | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 23d422b538b..bffc79dc0e2 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -1,15 +1,3 @@ -/client/var/inquisitive_ghost = 1 -/mob/dead/observer/verb/toggle_inquisition() // warning: unexpected inquisition - set name = "Toggle Inquisitiveness" - set desc = "Sets whether your ghost examines everything on click by default" - set category = "Ghost" - if(!client) return - client.inquisitive_ghost = !client.inquisitive_ghost - if(client.inquisitive_ghost) - src << "\blue You will now examine everything you click on." - else - src << "\blue You will no longer examine things you click on." - /mob/dead/observer/DblClickOn(var/atom/A, var/params) if(client.buildmode) build_click(src, client.buildmode, params, A) @@ -33,10 +21,16 @@ return if(world.time <= next_move) return next_move = world.time + 8 + + var/list/modifiers = params2list(params) + if(modifiers["shift"]) + ShiftClickOn(A) + return // You are responsible for checking config.ghost_interaction when you override this function // Not all of them require checking, see below A.attack_ghost(src) + // This is the ghost's follow verb with an argument /mob/dead/observer/proc/ManualFollow(var/atom/target) following = target @@ -58,6 +52,19 @@ sleep(15) following = null +// We don't need a fucking toggle. +/mob/dead/observer/ShiftClickOn(var/atom/A) + A.examine() + +/atom/proc/attack_ghost(mob/user as mob) + var/ghost_flags = 0 + if(ghost_read) + ghost_flags |= PERMIT_ALL + if(canGhostRead(user,src,ghost_flags)) + src.attack_ai(user) + else + src.examine() + // Oh by the way this didn't work with old click code which is why clicking shit didn't spam you /atom/proc/attack_ghost(mob/dead/observer/user as mob) if(user.client && user.client.inquisitive_ghost)