mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Ghost settings UI (#91370)
## About The Pull Request This is part of my ongoing project to remove the Stat panel which you can read/contribute to here: https://hackmd.io/443_dE5lRWeEAp9bjGcKYw Replaces the pAI button at the bottom of Ghost's HUD with a new button for Ghost settings Default look  With fun verbs (admin only, the 2 buttons at the top right), No body, and lag switches on (disables T-Ray and Zooming)  The ghost icon next to "re-enter body" is the DNR button, which requires double click. Extra view is now easier to understand, 0 is "default", anything more is extra vision you get. Goes to 3 for regular users, 7 for BYOND members. Removes the "Ghost" tab from the stat panel entirely, this replaces it. ## Why It's Good For The Game The Ghost tab of the stat panel is filled with barely functional stuff, like "Jump to Mob" which allows you to jump to "oranges ear" which teleports you to nullspace, or the 4 different jump to verbs for different things which is irrelevant from the Orbit menu and the many improvements it got over the years, and even the Notifications panel, which seems pretty useful, but because it's delegated to a small button filled with the rest of these it gets entirely drowned out. This puts all the important things in front of the user at the click of a button, meant to be easy to navigate and giving important information first. ## Changelog 🆑 add: Added a 'Ghost settings' button, taking the spot of the pAI candidate button and replacing the "Ghost" tab of the Stat panel. This button contains buttons pertinent to your time as an Observer. /🆑
This commit is contained in:
@@ -297,10 +297,6 @@
|
||||
/mob/dead/new_player/proc/ViewManifest()
|
||||
if(!client)
|
||||
return
|
||||
if(world.time < client.crew_manifest_delay)
|
||||
return
|
||||
client.crew_manifest_delay = world.time + (1 SECONDS)
|
||||
|
||||
GLOB.manifest.ui_interact(src)
|
||||
|
||||
/mob/dead/new_player/Move()
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
GLOBAL_DATUM_INIT(ghost_menu, /datum/ghost_menu, new)
|
||||
|
||||
/datum/ghost_menu
|
||||
///Static assoc list of all types of lightings ghosts can use & names shown in the UI.
|
||||
var/static/list/ghost_lightings = list(
|
||||
"[LIGHTING_CUTOFF_VISIBLE]" = "Mob Vision",
|
||||
"[LIGHTING_CUTOFF_MEDIUM]" = "Slight Night Vision",
|
||||
"[LIGHTING_CUTOFF_HIGH]" = "Night Vision",
|
||||
"[LIGHTING_CUTOFF_FULLBRIGHT]" = "Fullbright",
|
||||
)
|
||||
|
||||
/datum/ghost_menu/ui_state(mob/user)
|
||||
return GLOB.observer_state
|
||||
|
||||
/datum/ghost_menu/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if (!ui)
|
||||
ui = new(user, src, "GhostMenu")
|
||||
ui.open()
|
||||
|
||||
/datum/ghost_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
var/mob/dead/observer/dead_user = ui.user
|
||||
switch(action)
|
||||
if("DNR")
|
||||
dead_user.stay_dead()
|
||||
return TRUE
|
||||
if("return_to_body")
|
||||
dead_user.reenter_corpse()
|
||||
return TRUE
|
||||
if("restore_appearance")
|
||||
restore_ghost_appearance(dead_user)
|
||||
return TRUE
|
||||
if("change_notification")
|
||||
var/key = params["key"]
|
||||
if(key && islist(GLOB.poll_ignore[key]))
|
||||
GLOB.poll_ignore[key] ^= list(dead_user.ckey)
|
||||
return TRUE
|
||||
if("turn_all_on")
|
||||
for(var/key in GLOB.poll_ignore)
|
||||
GLOB.poll_ignore[key] &= ~list(dead_user.ckey)
|
||||
return TRUE
|
||||
if("turn_all_off")
|
||||
for(var/key in GLOB.poll_ignore)
|
||||
GLOB.poll_ignore[key] |= list(dead_user.ckey)
|
||||
return TRUE
|
||||
if("signup_pai")
|
||||
SSpai.recruit_window(dead_user)
|
||||
return TRUE
|
||||
if("tray_scan")
|
||||
tray_view(dead_user)
|
||||
return TRUE
|
||||
if("darkness")
|
||||
var/darkness_type = params["darkness_level"]
|
||||
if(isnull(darkness_type))
|
||||
return FALSE
|
||||
for(var/lighting_types in ghost_lightings)
|
||||
if(darkness_type != ghost_lightings[lighting_types])
|
||||
continue
|
||||
toggle_darkness(dead_user, lighting_types)
|
||||
return TRUE
|
||||
if("toggle_visibility")
|
||||
var/to_toggle = params["toggling"]
|
||||
if(!(to_toggle in ALL_GHOST_FLAGS))
|
||||
return
|
||||
toggle_hud_type(dead_user, to_toggle)
|
||||
return TRUE
|
||||
if("crew_manifest")
|
||||
GLOB.manifest.ui_interact(dead_user)
|
||||
return TRUE
|
||||
if("view_range")
|
||||
var/setting_to = text2num(params["new_view_range"]) + GHOST_MIN_VIEW_RANGE
|
||||
if(!isnum(setting_to))
|
||||
return FALSE
|
||||
set_view(dead_user, setting_to)
|
||||
return TRUE
|
||||
if("boo")
|
||||
if(!dead_user.fun_verbs)
|
||||
return FALSE
|
||||
dead_user.boo()
|
||||
return TRUE
|
||||
if("possess")
|
||||
if(!dead_user.fun_verbs)
|
||||
return FALSE
|
||||
dead_user.possess()
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/datum/ghost_menu/ui_data(mob/dead/observer/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["can_boo"] = COOLDOWN_FINISHED(user, bootime)
|
||||
data["has_fun"] = user.fun_verbs
|
||||
data["body_name"] = user.can_reenter_corpse ? user.mind.current.real_name : FALSE
|
||||
data["current_darkness"] = ghost_lightings["[user.lighting_cutoff]"]
|
||||
data["notification_data"] = list()
|
||||
for(var/key in GLOB.poll_ignore_desc)
|
||||
data["notification_data"] += list(list(
|
||||
"key" = key,
|
||||
"enabled" = !!(user.ckey in GLOB.poll_ignore[key]),
|
||||
"desc" = GLOB.poll_ignore_desc[key],
|
||||
))
|
||||
|
||||
data["hud_info"] = list(
|
||||
list(
|
||||
"name" = "Data HUDs",
|
||||
"enabled" = (user.ghost_hud_flags & GHOST_DATA_HUDS),
|
||||
"flag" = GHOST_DATA_HUDS,
|
||||
"tooltip" = "Grants you Med/Sec/Diag HUDs.",
|
||||
),
|
||||
list(
|
||||
"name" = "Ghost Vision",
|
||||
"enabled" = (user.ghost_hud_flags & GHOST_VISION),
|
||||
"flag" = GHOST_VISION,
|
||||
"tooltip" = "Allows you to see ghost-only things (ex: smuggler satchels, countdowns, camera eyes).",
|
||||
),
|
||||
list(
|
||||
"name" = "Health Scanner",
|
||||
"enabled" = (user.ghost_hud_flags & GHOST_HEALTH),
|
||||
"flag" = GHOST_HEALTH,
|
||||
"tooltip" = "Allows you to perform a health scan by clicking on someone.",
|
||||
),
|
||||
list(
|
||||
"name" = "Chemical Scanner",
|
||||
"enabled" = (user.ghost_hud_flags & GHOST_CHEM),
|
||||
"flag" = GHOST_CHEM,
|
||||
"tooltip" = "Allows you to perform a chemical scan by clicking on someone.",
|
||||
),
|
||||
list(
|
||||
"name" = "Gas Scanner",
|
||||
"enabled" = (user.ghost_hud_flags & GHOST_GAS),
|
||||
"flag" = GHOST_GAS,
|
||||
"tooltip" = "Allows you to perform a gas scan by clicking on a tile/atmos machine.",
|
||||
),
|
||||
)
|
||||
|
||||
return data
|
||||
|
||||
/datum/ghost_menu/ui_static_data(mob/dead/observer/user)
|
||||
var/list/data = list()
|
||||
data["max_extra_view"] = (user.client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT) - GHOST_MIN_VIEW_RANGE
|
||||
data["darkness_levels"] = list()
|
||||
for(var/level in ghost_lightings)
|
||||
data["darkness_levels"] += ghost_lightings[level]
|
||||
data["lag_switch_on"] = !!(SSlag_switch.measures[DISABLE_GHOST_ZOOM_TRAY] && !user.client?.holder)
|
||||
return data
|
||||
|
||||
/datum/ghost_menu/proc/tray_view(mob/dead/observer/user)
|
||||
if(SSlag_switch.measures[DISABLE_GHOST_ZOOM_TRAY] && !user.client?.holder)
|
||||
to_chat(user, span_notice("That verb is currently globally disabled."))
|
||||
return
|
||||
t_ray_scan(user)
|
||||
|
||||
/datum/ghost_menu/proc/toggle_darkness(mob/dead/observer/user, darkness_type)
|
||||
if(user.lighting_cutoff == darkness_type)
|
||||
return
|
||||
user.lighting_cutoff = text2num(darkness_type)
|
||||
user.update_sight()
|
||||
|
||||
/datum/ghost_menu/proc/toggle_hud_type(mob/dead/observer/user, hud_type)
|
||||
user.ghost_hud_flags ^= hud_type
|
||||
//special aftereffects for specific flags.
|
||||
switch(hud_type)
|
||||
if(GHOST_VISION)
|
||||
user.update_sight()
|
||||
if(GHOST_DATA_HUDS)
|
||||
if(user.ghost_hud_flags & GHOST_DATA_HUDS)
|
||||
user.show_data_huds()
|
||||
else
|
||||
user.remove_data_huds()
|
||||
|
||||
/datum/ghost_menu/proc/restore_ghost_appearance(mob/dead/observer/user)
|
||||
user.set_ghost_appearance()
|
||||
if(!user.client?.prefs)
|
||||
return
|
||||
var/real_name_pref = user.client.prefs.read_preference(/datum/preference/name/real_name)
|
||||
user.deadchat_name = real_name_pref
|
||||
if(user.mind)
|
||||
user.mind.ghostname = real_name_pref
|
||||
user.name = real_name_pref
|
||||
|
||||
/datum/ghost_menu/proc/set_view(mob/dead/observer/user, new_view)
|
||||
if(SSlag_switch.measures[DISABLE_GHOST_ZOOM_TRAY] && !user.client?.holder)
|
||||
to_chat(user, span_notice("That verb is currently globally disabled."))
|
||||
return TRUE
|
||||
var/max_view = user.client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
if(max_view >= new_view && new_view < GHOST_MIN_VIEW_RANGE)
|
||||
return TRUE
|
||||
user.client.view_size.setTo(round(new_view, 1) - GHOST_MIN_VIEW_RANGE)
|
||||
@@ -1,50 +0,0 @@
|
||||
/mob/dead/observer/verb/show_notificationprefs()
|
||||
set category = "Ghost"
|
||||
set name = "Notification preferences"
|
||||
set desc = "Notification preferences"
|
||||
|
||||
var/datum/notificationpanel/panel = new(usr)
|
||||
|
||||
panel.ui_interact(usr)
|
||||
|
||||
/datum/notificationpanel
|
||||
var/client/user
|
||||
|
||||
/datum/notificationpanel/New(user)
|
||||
if (ismob(user))
|
||||
var/mob/M = user
|
||||
if (!M.client)
|
||||
CRASH("Ghost role notification panel attempted to open to a mob without a client")
|
||||
src.user = M.client
|
||||
else
|
||||
src.user = user
|
||||
|
||||
/datum/notificationpanel/ui_state(mob/user)
|
||||
return GLOB.observer_state
|
||||
|
||||
/datum/notificationpanel/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "NotificationPreferences")
|
||||
ui.open()
|
||||
|
||||
/datum/notificationpanel/ui_data(mob/user)
|
||||
. = list()
|
||||
.["ignore"] = list()
|
||||
for(var/key in GLOB.poll_ignore_desc)
|
||||
.["ignore"] += list(list(
|
||||
"key" = key,
|
||||
"enabled" = (user.ckey in GLOB.poll_ignore[key]),
|
||||
"desc" = GLOB.poll_ignore_desc[key]
|
||||
))
|
||||
|
||||
/datum/notificationpanel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
switch (action)
|
||||
if ("toggle_ignore")
|
||||
var/key = params["key"]
|
||||
if (key && islist(GLOB.poll_ignore[key]))
|
||||
GLOB.poll_ignore[key] ^= list(user.ckey)
|
||||
. = TRUE
|
||||
@@ -22,20 +22,24 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
light_on = FALSE
|
||||
shift_to_open_context_menu = FALSE
|
||||
var/can_reenter_corpse
|
||||
var/bootime = 0
|
||||
var/started_as_observer //This variable is set to 1 when you enter the game as an observer.
|
||||
//If you died in the game and are a ghost - this will remain as null.
|
||||
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
|
||||
var/atom/movable/following = null
|
||||
var/fun_verbs = 0
|
||||
|
||||
///The time between being able to use boo(), if fun_verbs is TRUE.
|
||||
COOLDOWN_DECLARE(bootime)
|
||||
///Boolean on whether this ghost has access to 'fun' verbs in the ghost menu.
|
||||
var/fun_verbs = FALSE
|
||||
|
||||
var/image/ghostimage_default = null //this mobs ghost image without accessories and dirs
|
||||
var/image/ghostimage_simple = null //this mob with the simple white ghost sprite
|
||||
var/ghostvision = 1 //is the ghost able to see things humans can't?
|
||||
var/mob/observetarget = null //The target mob that the ghost is observing. Used as a reference in logout()
|
||||
var/data_huds_on = 0 //Are data HUDs currently enabled?
|
||||
var/health_scan = FALSE //Are health scans currently enabled?
|
||||
var/chem_scan = FALSE //Are chem scans currently enabled?
|
||||
var/gas_scan = FALSE //Are gas scans currently enabled?
|
||||
|
||||
///Flags of huds the ghost currently has enabled, data huds & ghost vision by default.
|
||||
///Selection: GHOST_DATA_HUDS | GHOST_VISION | GHOST_HEALTH | GHOST_CHEM | GHOST_GAS
|
||||
var/ghost_hud_flags = GHOST_DATA_HUDS | GHOST_VISION
|
||||
///The shape the ghost will make while orbiting mobs.
|
||||
var/ghost_orbit = GHOST_ORBIT_CIRCLE
|
||||
|
||||
//These variables store hair data if the ghost originates from a species with head and/or facial hair.
|
||||
@@ -72,12 +76,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
/mob/dead/observer/Initialize(mapload)
|
||||
set_invisibility(GLOB.observer_default_invisibility)
|
||||
|
||||
add_verb(src, list(
|
||||
/mob/dead/observer/proc/dead_tele,
|
||||
/mob/dead/observer/proc/open_spawners_menu,
|
||||
/mob/dead/observer/proc/tray_view,
|
||||
/mob/dead/observer/proc/open_minigames_menu))
|
||||
|
||||
if(icon_state in GLOB.ghost_forms_with_directions_list)
|
||||
ghostimage_default = image(src.icon,src,src.icon_state + "_nodir")
|
||||
else
|
||||
@@ -133,10 +131,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
name ||= generate_random_mob_name(FALSE)
|
||||
real_name = name
|
||||
|
||||
if(!fun_verbs)
|
||||
remove_verb(src, /mob/dead/observer/verb/boo)
|
||||
remove_verb(src, /mob/dead/observer/verb/possess)
|
||||
|
||||
AddElement(/datum/element/movetype_handler)
|
||||
|
||||
add_to_dead_mob_list()
|
||||
@@ -149,7 +143,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
grant_all_languages()
|
||||
setup_hud_traits()
|
||||
show_data_huds()
|
||||
data_huds_on = 1
|
||||
|
||||
SSpoints_of_interest.make_point_of_interest(src)
|
||||
ADD_TRAIT(src, TRAIT_HEAR_THROUGH_DARKNESS, ref(src))
|
||||
@@ -165,7 +158,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_atom_colour)), 1 SECONDS)
|
||||
|
||||
/mob/dead/observer/Destroy()
|
||||
if(data_huds_on)
|
||||
if(ghost_hud_flags & GHOST_DATA_HUDS)
|
||||
remove_data_huds()
|
||||
|
||||
// Update our old body's medhud since we're abandoning it
|
||||
@@ -368,9 +361,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(new_area != ambience_tracked_area)
|
||||
update_ambience_area(new_area)
|
||||
|
||||
/mob/dead/observer/verb/reenter_corpse()
|
||||
set category = "Ghost"
|
||||
set name = "Re-enter Corpse"
|
||||
/mob/dead/observer/proc/reenter_corpse()
|
||||
if(!client)
|
||||
return
|
||||
if(!mind || QDELETED(mind.current))
|
||||
@@ -390,19 +381,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
mind.current.client.init_verbs()
|
||||
return TRUE
|
||||
|
||||
/mob/dead/observer/verb/stay_dead()
|
||||
set category = "Ghost"
|
||||
set name = "Do Not Resuscitate"
|
||||
if(!client)
|
||||
return
|
||||
/mob/dead/observer/proc/stay_dead()
|
||||
if(!can_reenter_corpse)
|
||||
to_chat(usr, span_warning("You're already stuck out of your body!"))
|
||||
return FALSE
|
||||
|
||||
var/response = tgui_alert(usr, "Are you sure you want to prevent (almost) all means of resuscitation? This cannot be undone.", "Are you sure you want to stay dead?", list("DNR","Save Me"))
|
||||
if(response != "DNR")
|
||||
return
|
||||
|
||||
can_reenter_corpse = FALSE
|
||||
var/mob/living/current_mob = mind.current
|
||||
if(istype(current_mob))
|
||||
@@ -441,9 +424,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
SEND_SOUND(src, sound(sound))
|
||||
|
||||
/mob/dead/observer/proc/dead_tele()
|
||||
set category = "Ghost"
|
||||
set name = "Teleport"
|
||||
set desc= "Teleport to a location"
|
||||
if(!isobserver(usr))
|
||||
to_chat(usr, span_warning("Not when you're not dead!"))
|
||||
return
|
||||
@@ -469,13 +449,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
usr.abstract_move(pick(L))
|
||||
|
||||
/mob/dead/observer/verb/follow()
|
||||
set category = "Ghost"
|
||||
set name = "Orbit" // "Haunt"
|
||||
set desc = "Follow and orbit a mob."
|
||||
|
||||
GLOB.orbit_menu.show(src)
|
||||
|
||||
// This is the ghost's follow verb with an argument
|
||||
/mob/dead/observer/proc/ManualFollow(atom/movable/target)
|
||||
if (!istype(target) || (is_secret_level(target.z) && !client?.holder))
|
||||
@@ -513,57 +486,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if (!isnull(client) && !isnull(client.eye))
|
||||
reset_perspective(null)
|
||||
|
||||
/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(!isobserver(usr)) //Make sure they're an observer!
|
||||
return
|
||||
|
||||
var/list/possible_destinations = SSpoints_of_interest.get_mob_pois()
|
||||
var/target = null
|
||||
|
||||
target = tgui_input_list(usr, "Please, select a player!", "Jump to Mob", possible_destinations)
|
||||
if(isnull(target))
|
||||
return
|
||||
if (!isobserver(usr))
|
||||
return
|
||||
|
||||
var/mob/destination_mob = possible_destinations[target] //Destination mob
|
||||
|
||||
// During the break between opening the input menu and selecting our target, has this become an invalid option?
|
||||
if(!SSpoints_of_interest.is_valid_poi(destination_mob))
|
||||
return
|
||||
|
||||
var/mob/source_mob = src //Source mob
|
||||
var/turf/destination_turf = get_turf(destination_mob) //Turf of the destination mob
|
||||
|
||||
if(isturf(destination_turf))
|
||||
source_mob.abstract_move(destination_turf)
|
||||
else
|
||||
to_chat(source_mob, span_danger("This mob is not located in the game world."))
|
||||
|
||||
/mob/dead/observer/verb/change_view_range()
|
||||
set category = "Ghost"
|
||||
set name = "View Range"
|
||||
set desc = "Change your view range."
|
||||
|
||||
if(SSlag_switch.measures[DISABLE_GHOST_ZOOM_TRAY] && !client?.holder)
|
||||
to_chat(usr, span_notice("That verb is currently globally disabled."))
|
||||
return
|
||||
|
||||
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
if(client.view_size.getView() == client.view_size.default)
|
||||
var/list/views = list()
|
||||
for(var/i in 7 to max_view)
|
||||
views |= i
|
||||
var/new_view = tgui_input_list(usr, "New view", "Modify view range", views)
|
||||
if(new_view)
|
||||
client.view_size.setTo(clamp(new_view, 7, max_view) - 7)
|
||||
else
|
||||
client.view_size.resetToDefault()
|
||||
|
||||
/mob/dead/observer/verb/add_view_range(input as num)
|
||||
set name = "Add View Range"
|
||||
set hidden = TRUE
|
||||
@@ -574,49 +496,21 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
if(input)
|
||||
client.rescale_view(input, 0, ((max_view*2)+1) - 15)
|
||||
client.rescale_view(input, 0, ((max_view * 2) + 1) - 15)
|
||||
|
||||
/mob/dead/observer/verb/boo()
|
||||
set category = "Ghost"
|
||||
set name = "Boo!"
|
||||
set desc= "Scare your crew members because of boredom!"
|
||||
|
||||
if(bootime > world.time)
|
||||
/mob/dead/observer/proc/boo()
|
||||
if(!COOLDOWN_FINISHED(src, bootime))
|
||||
return
|
||||
var/obj/machinery/light/L = locate(/obj/machinery/light) in view(1, src)
|
||||
if(L?.flicker())
|
||||
bootime = world.time + 600
|
||||
COOLDOWN_START(src, bootime, 60 SECONDS)
|
||||
//Maybe in the future we can add more <i>spooky</i> code here!
|
||||
|
||||
|
||||
/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)
|
||||
update_sight()
|
||||
to_chat(usr, span_boldnotice("You [(ghostvision?"now":"no longer")] have ghost vision."))
|
||||
|
||||
/mob/dead/observer/verb/toggle_darkness()
|
||||
set name = "Toggle Darkness"
|
||||
set category = "Ghost"
|
||||
switch(lighting_cutoff)
|
||||
if (LIGHTING_CUTOFF_VISIBLE)
|
||||
lighting_cutoff = LIGHTING_CUTOFF_MEDIUM
|
||||
if (LIGHTING_CUTOFF_MEDIUM)
|
||||
lighting_cutoff = LIGHTING_CUTOFF_HIGH
|
||||
if (LIGHTING_CUTOFF_HIGH)
|
||||
lighting_cutoff = LIGHTING_CUTOFF_FULLBRIGHT
|
||||
else
|
||||
lighting_cutoff = LIGHTING_CUTOFF_VISIBLE
|
||||
|
||||
update_sight()
|
||||
|
||||
/mob/dead/observer/update_sight()
|
||||
if(client)
|
||||
ghost_others = client.prefs.read_preference(/datum/preference/choiced/ghost_others) //A quick update just in case this setting was changed right before calling the proc
|
||||
|
||||
if (!ghostvision)
|
||||
if(!(ghost_hud_flags & GHOST_VISION))
|
||||
set_invis_see(SEE_INVISIBLE_LIVING)
|
||||
else
|
||||
set_invis_see(SEE_INVISIBLE_OBSERVER)
|
||||
@@ -643,7 +537,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client?.images -= GLOB.ghost_images_simple
|
||||
lastsetting = client?.prefs.read_preference(/datum/preference/choiced/ghost_others)
|
||||
if(!ghostvision)
|
||||
if(!(ghost_hud_flags & GHOST_VISION))
|
||||
return
|
||||
if(lastsetting != GHOST_OTHERS_THEIR_SETTING)
|
||||
switch(lastsetting)
|
||||
@@ -652,11 +546,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client?.images |= (GLOB.ghost_images_simple-ghostimage_simple)
|
||||
|
||||
/mob/dead/observer/verb/possess()
|
||||
set category = "Ghost"
|
||||
set name = "Possess!"
|
||||
set desc= "Take over the body of a mindless creature!"
|
||||
|
||||
/mob/dead/observer/proc/possess()
|
||||
var/list/possessible = list()
|
||||
for(var/mob/living/L in GLOB.alive_mob_list)
|
||||
if(istype(L,/mob/living/carbon/human/dummy) || !get_turf(L)) //Haha no.
|
||||
@@ -690,18 +580,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
visible_message(span_deadsay("<b>[src]</b> points to [pointed_at]."))
|
||||
|
||||
/mob/dead/observer/verb/view_manifest()
|
||||
set name = "View Crew Manifest"
|
||||
set category = "Ghost"
|
||||
|
||||
if(!client)
|
||||
return
|
||||
if(world.time < client.crew_manifest_delay)
|
||||
return
|
||||
client.crew_manifest_delay = world.time + (1 SECONDS)
|
||||
|
||||
GLOB.manifest.ui_interact(src)
|
||||
|
||||
//this is called when a ghost is drag clicked to something.
|
||||
/mob/dead/observer/mouse_drop_dragged(atom/over, mob/user)
|
||||
if (isobserver(user) && user.client.holder && (isliving(over) || iseyemob(over)))
|
||||
@@ -768,70 +646,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/proc/remove_data_huds()
|
||||
remove_traits(observer_hud_traits, REF(src))
|
||||
|
||||
/mob/dead/observer/verb/toggle_data_huds()
|
||||
set name = "Toggle Sec/Med/Diag HUD"
|
||||
set desc = "Toggles whether you see medical/security/diagnostic HUDs"
|
||||
set category = "Ghost"
|
||||
|
||||
if(data_huds_on) //remove old huds
|
||||
remove_data_huds()
|
||||
to_chat(src, span_notice("Data HUDs disabled."))
|
||||
data_huds_on = 0
|
||||
else
|
||||
show_data_huds()
|
||||
to_chat(src, span_notice("Data HUDs enabled."))
|
||||
data_huds_on = 1
|
||||
|
||||
/mob/dead/observer/verb/toggle_health_scan()
|
||||
set name = "Toggle Health Scan"
|
||||
set desc = "Toggles whether you health-scan living beings on click"
|
||||
set category = "Ghost"
|
||||
|
||||
if(health_scan) //remove old huds
|
||||
to_chat(src, span_notice("Health scan disabled."))
|
||||
health_scan = FALSE
|
||||
else
|
||||
to_chat(src, span_notice("Health scan enabled."))
|
||||
health_scan = TRUE
|
||||
|
||||
/mob/dead/observer/verb/toggle_chem_scan()
|
||||
set name = "Toggle Chem Scan"
|
||||
set desc = "Toggles whether you scan living beings for chemicals and addictions on click"
|
||||
set category = "Ghost"
|
||||
|
||||
if(chem_scan) //remove old huds
|
||||
to_chat(src, span_notice("Chem scan disabled."))
|
||||
chem_scan = FALSE
|
||||
else
|
||||
to_chat(src, span_notice("Chem scan enabled."))
|
||||
chem_scan = TRUE
|
||||
|
||||
/mob/dead/observer/verb/toggle_gas_scan()
|
||||
set name = "Toggle Gas Scan"
|
||||
set desc = "Toggles whether you analyze gas contents on click"
|
||||
set category = "Ghost"
|
||||
|
||||
if(gas_scan)
|
||||
to_chat(src, span_notice("Gas scan disabled."))
|
||||
gas_scan = FALSE
|
||||
else
|
||||
to_chat(src, span_notice("Gas scan enabled."))
|
||||
gas_scan = TRUE
|
||||
|
||||
/mob/dead/observer/verb/restore_ghost_appearance()
|
||||
set name = "Restore Ghost Character"
|
||||
set desc = "Sets your deadchat name and ghost appearance to your \
|
||||
roundstart character."
|
||||
set category = "Ghost"
|
||||
|
||||
set_ghost_appearance()
|
||||
if(client?.prefs)
|
||||
var/real_name = client.prefs.read_preference(/datum/preference/name/real_name)
|
||||
deadchat_name = real_name
|
||||
if(mind)
|
||||
mind.ghostname = real_name
|
||||
name = real_name
|
||||
|
||||
/mob/dead/observer/proc/set_ghost_appearance()
|
||||
if(!client?.prefs)
|
||||
return
|
||||
@@ -868,13 +682,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(NAMEOF(src, icon_state))
|
||||
ghostimage_default.icon_state = icon_state
|
||||
ghostimage_simple.icon_state = icon_state
|
||||
if(NAMEOF(src, fun_verbs))
|
||||
if(fun_verbs)
|
||||
add_verb(src, /mob/dead/observer/verb/boo)
|
||||
add_verb(src, /mob/dead/observer/verb/possess)
|
||||
else
|
||||
remove_verb(src, /mob/dead/observer/verb/boo)
|
||||
remove_verb(src, /mob/dead/observer/verb/possess)
|
||||
if(NAMEOF(src, invisibility))
|
||||
set_invisibility(invisibility) // updates light
|
||||
|
||||
/mob/dead/observer/reset_perspective(atom/A)
|
||||
if(client)
|
||||
@@ -898,37 +707,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
hide_other_mob_action_buttons(target)
|
||||
LAZYREMOVE(target.observers, src)
|
||||
|
||||
/mob/dead/observer/verb/observe()
|
||||
set name = "Observe"
|
||||
set category = "Ghost"
|
||||
|
||||
if(!isobserver(usr) || HAS_TRAIT(src, TRAIT_NO_OBSERVE)) //Make sure they're an observer!
|
||||
return
|
||||
|
||||
reset_perspective(null)
|
||||
|
||||
var/list/possible_destinations = SSpoints_of_interest.get_mob_pois()
|
||||
var/target = null
|
||||
|
||||
target = tgui_input_list(usr, "Please, select a player!", "Jump to Mob", possible_destinations)
|
||||
if(isnull(target))
|
||||
return
|
||||
if (!isobserver(usr))
|
||||
return
|
||||
|
||||
reset_perspective(null) // Reset again for sanity
|
||||
|
||||
var/mob/chosen_target = possible_destinations[target]
|
||||
|
||||
// During the break between opening the input menu and selecting our target, has this become an invalid option?
|
||||
if(!SSpoints_of_interest.is_valid_poi(chosen_target))
|
||||
return
|
||||
|
||||
if (chosen_target == usr)
|
||||
return
|
||||
|
||||
do_observe(chosen_target)
|
||||
|
||||
/mob/dead/observer/proc/do_observe(mob/mob_eye)
|
||||
if(isnewplayer(mob_eye))
|
||||
stack_trace("/mob/dead/new_player: \[[mob_eye]\] is being observed by [key_name(src)]. This should never happen and has been blocked.")
|
||||
@@ -965,37 +743,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
else
|
||||
set_sight(initial(sight))
|
||||
|
||||
/mob/dead/observer/verb/register_pai_candidate()
|
||||
set category = "Ghost"
|
||||
set name = "pAI Setup"
|
||||
set desc = "Upload a fragment of your personality to the global pAI databanks"
|
||||
|
||||
register_pai()
|
||||
|
||||
/mob/dead/observer/proc/register_pai()
|
||||
if(isobserver(src))
|
||||
SSpai.recruit_window(src)
|
||||
else
|
||||
to_chat(usr, span_warning("Can't become a pAI candidate while not dead!"))
|
||||
|
||||
/mob/dead/observer/verb/mafia_game_signup()
|
||||
set category = "Ghost"
|
||||
set name = "Signup for Mafia"
|
||||
set desc = "Sign up for a game of Mafia to pass the time while dead."
|
||||
|
||||
mafia_signup()
|
||||
|
||||
/mob/dead/observer/proc/mafia_signup()
|
||||
if(!client)
|
||||
return
|
||||
if(!isobserver(src))
|
||||
to_chat(usr, span_warning("You must be a ghost to join mafia!"))
|
||||
return
|
||||
var/datum/mafia_controller/game = GLOB.mafia_game //this needs to change if you want multiple mafia games up at once.
|
||||
if(!game)
|
||||
game = create_mafia_game()
|
||||
game.ui_interact(usr)
|
||||
|
||||
/mob/dead/observer/AltClickOn(atom/target)
|
||||
client.loot_panel.open(get_turf(target))
|
||||
|
||||
@@ -1030,11 +777,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/Process_Spacemove(movement_dir, continuous_move = FALSE)
|
||||
return TRUE
|
||||
|
||||
/mob/dead/observer/vv_edit_var(var_name, var_value)
|
||||
. = ..()
|
||||
if(var_name == NAMEOF(src, invisibility))
|
||||
set_invisibility(invisibility) // updates light
|
||||
|
||||
/proc/set_observer_default_invisibility(amount, message=null)
|
||||
for(var/mob/dead/observer/G in GLOB.player_list)
|
||||
G.set_invisibility(amount)
|
||||
@@ -1043,18 +785,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
GLOB.observer_default_invisibility = amount
|
||||
|
||||
/mob/dead/observer/proc/open_spawners_menu()
|
||||
set name = "Spawners Menu"
|
||||
set desc = "See all currently available spawners"
|
||||
set category = "Ghost"
|
||||
if(!spawners_menu)
|
||||
spawners_menu = new(src)
|
||||
|
||||
spawners_menu.ui_interact(src)
|
||||
|
||||
/mob/dead/observer/proc/open_minigames_menu()
|
||||
set name = "Minigames Menu"
|
||||
set desc = "See all currently available minigames"
|
||||
set category = "Ghost"
|
||||
if(!client)
|
||||
return
|
||||
if(!isobserver(src))
|
||||
@@ -1065,17 +801,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
minigames_menu.ui_interact(src)
|
||||
|
||||
/mob/dead/observer/proc/tray_view()
|
||||
set category = "Ghost"
|
||||
set name = "T-ray scan"
|
||||
set desc = "Perfom a scan to view sub-floor objects"
|
||||
|
||||
if(SSlag_switch.measures[DISABLE_GHOST_ZOOM_TRAY] && !client?.holder)
|
||||
to_chat(usr, span_notice("That verb is currently globally disabled."))
|
||||
return
|
||||
|
||||
t_ray_scan(src)
|
||||
|
||||
/mob/dead/observer/default_lighting_cutoff()
|
||||
var/datum/preferences/prefs = client?.prefs
|
||||
if(!prefs || (client?.combo_hud_enabled && prefs.toggles & COMBOHUD_LIGHTING))
|
||||
|
||||
Reference in New Issue
Block a user