diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 2dbd1929abe..07ec24e0106 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -125,11 +125,7 @@ // Ghosts -#define ui_ghost_jumptomob "SOUTH:6,WEST" -#define ui_ghost_orbit "SOUTH:6,WEST+1" -#define ui_ghost_reenter_corpse "SOUTH:6,WEST+2" -#define ui_ghost_teleport "SOUTH:6,WEST+3" -#define ui_ghost_toggle_darkness "SOUTH:6,WEST+11" -#define ui_ghost_toggle_ghostsee "SOUTH:6,WEST+12" -#define ui_ghost_toggle_inquisition "SOUTH:6,WEST+13" -#define ui_ghost_view_manifest "SOUTH:6,WEST+14" +#define ui_ghost_jumptomob "SOUTH:6,CENTER-2:16" +#define ui_ghost_orbit "SOUTH:6,CENTER-1:16" +#define ui_ghost_reenter_corpse "SOUTH:6,CENTER:16" +#define ui_ghost_teleport "SOUTH:6,CENTER+1:16" diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index 998312293c6..7c0c07275ff 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -35,39 +35,12 @@ var/mob/dead/observer/G = usr G.dead_tele() -/obj/screen/ghost/toggle_darkness - name = "Toggle Darkness" - icon_state = "toggle_darkness" - -/obj/screen/ghost/toggle_darkness/Click() - var/mob/dead/observer/G = usr - G.toggle_darkness() - -/obj/screen/ghost/toggle_ghostsee - name = "Toggle Ghost Vision" - icon_state = "toggle_ghostsee" - -/obj/screen/ghost/toggle_ghostsee/Click() - var/mob/dead/observer/G = usr - G.toggle_ghostsee() - -/obj/screen/ghost/toggle_inquisition - name = "Toggle Inquisitiveness" - icon_state = "toggle_inquisition" - -/obj/screen/ghost/toggle_inquisition/Click() - var/mob/dead/observer/G = usr - G.toggle_inquisition() - -/obj/screen/ghost/view_manifest - name = "View Manifest" - icon_state = "view_manifest" - -/obj/screen/ghost/view_manifest/Click() - var/mob/dead/observer/G = usr - G.view_manifest() - /datum/hud/proc/ghost_hud() + var/mob/dead/observer/G = mymob + if(!G.ghost_hud_enabled) + mymob.client.screen -= adding + return + adding = list() var/obj/screen/using @@ -88,21 +61,5 @@ using.screen_loc = ui_ghost_teleport adding += using - using = new /obj/screen/ghost/toggle_darkness() - using.screen_loc = ui_ghost_toggle_darkness - adding += using - - using = new /obj/screen/ghost/toggle_ghostsee() - using.screen_loc = ui_ghost_toggle_ghostsee - adding += using - - using = new /obj/screen/ghost/toggle_inquisition() - using.screen_loc = ui_ghost_toggle_inquisition - adding += using - - using = new /obj/screen/ghost/view_manifest() - using.screen_loc = ui_ghost_view_manifest - adding += using - mymob.client.screen += adding - return \ No newline at end of file + return diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 9c77aea036a..d452c21be90 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -1,5 +1,8 @@ /client/var/inquisitive_ghost = 1 -/mob/dead/observer/proc/toggle_inquisition() // warning: unexpected inquisition +/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) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 14753ccce26..57193da94b4 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -22,11 +22,13 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi var/image/ghostimage = null //this mobs ghost image, for deleting and stuff var/ghostvision = 1 //is the ghost able to see things humans can't? var/seedarkness = 1 + var/ghost_hud_enabled = 1 //did this ghost disable the on-screen HUD? /mob/dead/observer/New(mob/body) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF see_invisible = SEE_INVISIBLE_OBSERVER see_in_dark = 100 + verbs += /mob/dead/observer/proc/dead_tele stat = DEAD ghostimage = image(src.icon,src,src.icon_state) @@ -146,7 +148,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(isnum(G.dom_timer)) stat(null, "[G.name] Gang Takeover: [max(G.dom_timer, 0)]") -/mob/dead/observer/proc/reenter_corpse() +/mob/dead/observer/verb/reenter_corpse() + set category = "Ghost" + set name = "Re-enter Corpse" + if(!client) return if(!(mind && mind.current)) src << "You have no body." return @@ -167,10 +172,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp src << sound(sound) /mob/dead/observer/proc/dead_tele() + set category = "Ghost" + set name = "Teleport" + set desc= "Teleport to a location" + if(!istype(usr, /mob/dead/observer)) + usr << "Not when you're not dead!" + return + usr.verbs -= /mob/dead/observer/proc/dead_tele + spawn(30) + usr.verbs += /mob/dead/observer/proc/dead_tele var/A A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas - if(!istype(src, /mob/dead/observer)) - return var/area/thearea = A if(!thearea) return @@ -179,15 +191,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp L+=T if(!L || !L.len) - src << "No area available." + usr << "No area available." - loc = pick(L) + usr.loc = pick(L) + +/mob/dead/observer/verb/follow() + set category = "Ghost" + set name = "Orbit" // "Haunt" + set desc = "Follow and orbit a mob." -/mob/dead/observer/proc/follow() var/list/mobs = getmobs() var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs - if(!istype(src, /mob/dead/observer)) - return var/mob/target = mobs[input] ManualFollow(target) @@ -214,25 +228,31 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp pixel_y = 0 animate(src, pixel_y = 2, time = 10, loop = -1) -/mob/dead/observer/proc/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak - var/list/dest = list() //List of possible destinations (mobs) - var/target = null //Chosen target. +/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak + set category = "Ghost" + set name = "Jump to Mob" + set desc = "Teleport to a mob" - dest += getmobs() //Fill list, prompt user with list - target = input("Please, select a player!", "Jump to Mob", null, null) as null|anything in dest - if(!istype(src, /mob/dead/observer)) - return - if (!target)//Make sure we actually have a target - return - else - var/mob/M = dest[target] //Destination mob - var/mob/A = src //Source mob - var/turf/T = get_turf(M) //Turf of the destination mob + if(istype(usr, /mob/dead/observer)) //Make sure they're an observer! - if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. - A.loc = T + + var/list/dest = list() //List of possible destinations (mobs) + var/target = null //Chosen target. + + dest += getmobs() //Fill list, prompt user with list + target = input("Please, select a player!", "Jump to Mob", null, null) as null|anything in dest + + if (!target)//Make sure we actually have a target + return else - A << "This mob is not located in the game world." + var/mob/M = dest[target] //Destination mob + var/mob/A = src //Source mob + var/turf/T = get_turf(M) //Turf of the destination mob + + if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. + A.loc = T + else + A << "This mob is not located in the game world." /mob/dead/observer/verb/boo() set category = "Ghost" @@ -257,12 +277,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set hidden = 1 src << "You are dead! You have no mind to store memory!" -/mob/dead/observer/proc/toggle_ghostsee() +/mob/dead/observer/verb/toggle_ghostsee() + set name = "Toggle Ghost Vision" + set desc = "Toggles your ability to see things only ghosts can see, like other ghosts" + set category = "Ghost" ghostvision = !(ghostvision) updateghostsight() - src << "You [(ghostvision?"now":"no longer")] have ghost vision." + usr << "You [(ghostvision?"now":"no longer")] have ghost vision." -/mob/dead/observer/proc/toggle_darkness() +/mob/dead/observer/verb/toggle_darkness() + set name = "Toggle Darkness" + set category = "Ghost" seedarkness = !(seedarkness) updateghostsight() @@ -324,7 +349,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp usr.visible_message("[src] points to [A].") return 1 -/mob/dead/observer/proc/view_manifest() +/mob/dead/observer/verb/view_manifest() + set name = "View Crew Manifest" + set category = "Ghost" + var/dat dat += "