Vision bugfixes (#16771)

* Fixes see_invisible getting overridden

- Fixes see_invisible from being overwritten if your see_invisible_default is > SEE_INVISIBLE_LEVEL_ONE.

* Fixes ghost manifest() proc runtiming

- Fixes a runtime of when manifest() was called on a ghost with no user. Allows admins to call manifest() without it runtiming.

* Fixes the ghost 'Toggle Visibility' verb

- Due to it being a variable on the proc itself, it wouldn't properly call and store the time..

* Fixes feysight

- Feysight was trying to give vision into the 'see_invisible 60' layer but had forgotten to also give you the plane_holder for that layer.

* fix span

* More fixes

- Allows ghosts to ACTUALLY USE the ghost whisper and become visible proc if their is_manifest is enabled via admins.

- Allows admins to give any /mob verbs and procs instead of just  /mob/living via admin add_verb topic

* False
This commit is contained in:
Cameron Lennox
2024-12-28 20:33:47 +10:00
committed by GitHub
parent c98fe91da3
commit 2528be8bce
4 changed files with 39 additions and 15 deletions
+2
View File
@@ -13,10 +13,12 @@
/datum/modifier/feysight/on_applied()
holder.see_invisible = 60
holder.see_invisible_default = 60
holder.plane_holder.set_vis(VIS_GHOSTS,TRUE)
/datum/modifier/feysight/on_expire()
holder.see_invisible_default = initial(holder.see_invisible_default)
holder.see_invisible = holder.see_invisible_default
holder.plane_holder.set_vis(VIS_GHOSTS,FALSE)
/datum/modifier/feysight/can_apply(var/mob/living/L)
if(L.stat)
+18 -8
View File
@@ -36,6 +36,7 @@
incorporeal_move = 1
var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil.
var/toggled_invisible = 0
var/ghost_sprite = null
var/global/list/possible_ghost_sprites = list(
"Clear" = "blank",
@@ -841,15 +842,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/observer/dead/proc/manifest(mob/user)
is_manifest = TRUE
add_verb(src, /mob/observer/dead/proc/toggle_visibility)
add_verb(src, /mob/observer/dead/proc/ghost_whisper)
// Allows them to use the 'toggle_visibility' verb add_verb(src, /mob/observer/dead/verb/toggle_visibility)
// Allows them to use the 'ghost whisper' verb add_verb(src, /mob/observer/dead/verb/ghost_whisper)
to_chat(src, span_filter_notice(span_purple("As you are now in the realm of the living, you can whisper to the living with the " + span_bold("Spectral Whisper") + " verb, inside the IC tab.")))
if(!user)
visible_message(span_deadsay("The ghost of \the [src] is dragged back in to our plane of reality!"))
toggle_ghost_visibility(TRUE)
return
if(plane != PLANE_WORLD)
user.visible_message( \
span_warning("\The [user] drags ghost, [src], to our plane of reality!"), \
span_warning("You drag [src] to our plane of reality!") \
)
toggle_visibility(TRUE)
toggle_ghost_visibility(TRUE)
else
var/datum/gender/T = gender_datums[user.get_visible_gender()]
user.visible_message ( \
@@ -871,12 +876,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/image/J = image('icons/mob/mob.dmi', loc = src, icon_state = icon)
client.images += J
/mob/observer/dead/proc/toggle_visibility(var/forced = 0)
set category = "Ghost.Settings"
/mob/observer/dead/verb/toggle_visibility()
set name = "Toggle Visibility"
set desc = "Allows you to turn (in)visible (almost) at will."
set category = "Ghost.Settings"
toggle_ghost_visibility()
var/toggled_invisible
/mob/observer/dead/proc/toggle_ghost_visibility(var/forced = FALSE)
if(!is_manifest)
to_chat(src, span_filter_notice("You are not strong enough to pierce the veil..."))
return
if(!forced && plane == PLANE_GHOSTS && world.time < toggled_invisible + 600)
to_chat(src, span_filter_notice("You must gather strength before you can turn visible again..."))
return
@@ -972,7 +982,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//Culted Ghosts
/mob/observer/dead/proc/ghost_whisper()
/mob/observer/dead/verb/ghost_whisper()
set name = "Spectral Whisper"
set category = "IC.Subtle"
@@ -992,7 +1002,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
return 1
else
to_chat(src, span_danger("You have not been pulled past the veil!"))
to_chat(src, span_danger("You have not been pulled past the veil! You can not whisper to the living."))
/mob/observer/dead/verb/choose_ghost_sprite()
set category = "Ghost.Settings"
+11 -3
View File
@@ -1631,7 +1631,11 @@
else //We aren't dead
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
if(see_invisible_default > SEE_INVISIBLE_LEVEL_ONE)
see_invisible = see_invisible_default
else
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
// Do this early so certain stuff gets turned off before vision is assigned.
var/area/A = get_area(src)
@@ -1659,7 +1663,10 @@
else
sight = species.get_vision_flags(src)
see_in_dark = species.darksight
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
if(see_invisible_default > SEE_INVISIBLE_LEVEL_ONE)
see_invisible = see_invisible_default
else
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
var/glasses_processed = 0
var/obj/item/rig/rig = get_rig()
@@ -1673,7 +1680,8 @@
if(XRAY in mutations)
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(!druggy)
see_invisible = SEE_INVISIBLE_LEVEL_TWO
for(var/datum/modifier/M in modifiers)
if(!isnull(M.vision_flags))