diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 24a2442faeb..e3d423130e5 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -154,6 +154,12 @@ #define ui_bot_radio "EAST-1:28,SOUTH:7" #define ui_bot_pull "EAST-2:26,SOUTH:7" +//Ghosts +#define ui_ghost_jumptomob "SOUTH:6,CENTER-2:24" +#define ui_ghost_orbit "SOUTH:6,CENTER-1:24" +#define ui_ghost_reenter_corpse "SOUTH:6,CENTER:24" +#define ui_ghost_teleport "SOUTH:6,CENTER+1:24" + //HUD styles. Please ensure HUD_VERSIONS is the same as the maximum index. Index order defines how they are cycled in F12. #define HUD_STYLE_STANDARD 1 #define HUD_STYLE_REDUCED 2 diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm new file mode 100644 index 00000000000..4e92395f4cc --- /dev/null +++ b/code/_onclick/hud/ghost.dm @@ -0,0 +1,61 @@ +/mob/dead/observer/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/ghost(src) + +/obj/screen/ghost + icon = 'icons/mob/screen_ghost.dmi' + +/obj/screen/ghost/MouseEntered() + flick(icon_state + "_anim", src) + +/obj/screen/ghost/jumptomob + name = "Jump to mob" + icon_state = "jumptomob" + +/obj/screen/ghost/jumptomob/Click() + var/mob/dead/observer/G = usr + G.jumptomob() + +/obj/screen/ghost/orbit + name = "Orbit" + icon_state = "orbit" + +/obj/screen/ghost/orbit/Click() + var/mob/dead/observer/G = usr + G.follow() + +/obj/screen/ghost/reenter_corpse + name = "Re-enter corpse" + icon_state = "reenter_corpse" + +/obj/screen/ghost/reenter_corpse/Click() + var/mob/dead/observer/G = usr + G.reenter_corpse() + +/obj/screen/ghost/teleport + name = "Teleport" + icon_state = "teleport" + +/obj/screen/ghost/teleport/Click() + var/mob/dead/observer/G = usr + G.dead_tele() + +/datum/hud/ghost/New(mob/owner) + ..() + var/obj/screen/using + + using = new /obj/screen/ghost/jumptomob() + using.screen_loc = ui_ghost_jumptomob + static_inventory += using + + using = new /obj/screen/ghost/orbit() + using.screen_loc = ui_ghost_orbit + static_inventory += using + + using = new /obj/screen/ghost/reenter_corpse() + using.screen_loc = ui_ghost_reenter_corpse + static_inventory += using + + using = new /obj/screen/ghost/teleport() + using.screen_loc = ui_ghost_teleport + static_inventory += using diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 21835e5412d..db59a79ec21 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -388,7 +388,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(usr, "AntagHud Toggled OFF") M.antagHUD = 0 -/mob/dead/observer/proc/dead_tele(A in ghostteleportlocs) +/mob/dead/observer/proc/dead_tele() set category = "Ghost" set name = "Teleport" set desc= "Teleport to a location" @@ -401,6 +401,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp spawn(30) usr.verbs += /mob/dead/observer/proc/dead_tele + var/area/A = input("Area to jump to", "BOOYEA") as null|anything in ghostteleportlocs var/area/thearea = ghostteleportlocs[A] if(!thearea) return @@ -414,13 +415,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp usr.forceMove(pick(L)) following = null -/mob/dead/observer/verb/follow(input in getmobs()) +/mob/dead/observer/verb/follow() set category = "Ghost" set name = "Orbit" // "Haunt" set desc = "Follow and orbit a mob." - var/target = getmobs()[input] - if(!target) return + var/list/mobs = getpois(skip_mindless=1) + var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs + var/mob/target = mobs[input] ManualFollow(target) // This is the ghost's follow verb with an argument @@ -488,24 +490,29 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp update_following() return ..() -/mob/dead/observer/verb/jumptomob(target in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak +/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" - if(istype(usr, /mob/dead/observer)) //Make sure they're an observer! + if(isobserver(usr)) //Make sure they're an observer! + var/list/dest = list() //List of possible destinations (mobs) + var/target = null //Chosen target. - if(!target)//Make sure we actually have a target + dest += getpois(mobs_only=1) //Fill list, prompt user with list + target = input("Please, select a mob!", "Jump to Mob", null, null) as null|anything in dest + + if(!target) //Make sure we actually have a target return else - var/mob/M = getmobs()[target] //Destination mob + 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. - forceMove(T) - following = null + A.forceMove(T) else - to_chat(src, "This mob is not located in the game world.") + to_chat(A, "This mob is not located in the game world.") /* Now a spell. See spells.dm diff --git a/icons/mob/screen_ghost.dmi b/icons/mob/screen_ghost.dmi new file mode 100644 index 00000000000..6519d00aa97 Binary files /dev/null and b/icons/mob/screen_ghost.dmi differ diff --git a/paradise.dme b/paradise.dme index 6af001e03b0..7cae5370239 100644 --- a/paradise.dme +++ b/paradise.dme @@ -137,6 +137,7 @@ #include "code\_onclick\hud\constructs.dm" #include "code\_onclick\hud\devil.dm" #include "code\_onclick\hud\fullscreen.dm" +#include "code\_onclick\hud\ghost.dm" #include "code\_onclick\hud\guardian.dm" #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm"