[MIRROR] Vision bugfixes (#9716)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2024-12-28 16:39:15 +01:00
committed by GitHub
co-authored by Cameron Lennox
parent 5fee898ae7
commit f3e348b131
4 changed files with 39 additions and 15 deletions
+8 -4
View File
@@ -411,14 +411,18 @@
else if(href_list["addverb"])
if(!check_rights(R_DEBUG)) return
var/mob/living/H = locate(href_list["addverb"])
var/mob/H = locate(href_list["addverb"])
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living")
if(!ismob(H))
to_chat(usr, "This can only be done to instances of type /mob")
return
var/list/possibleverbs = list()
possibleverbs += "Cancel" // One for the top...
possibleverbs += typesof(/mob/proc,/mob/verb,/mob/living/proc,/mob/living/verb)
possibleverbs += typesof(/mob/proc, /mob/verb)
if(istype(H,/mob/observer/dead))
possibleverbs += typesof(/mob/observer/dead/proc,/mob/observer/dead/verb)
if(istype(H,/mob/living))
possibleverbs += typesof(/mob/living/proc,/mob/living/verb)
if(istype(H,/mob/living/carbon/human))
possibleverbs += typesof(/mob/living/carbon/proc,/mob/living/carbon/verb,/mob/living/carbon/human/verb,/mob/living/carbon/human/proc)
if(istype(H,/mob/living/silicon/robot))
+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",
@@ -859,15 +860,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 ( \
@@ -889,12 +894,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
@@ -990,7 +1000,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"
@@ -1010,7 +1020,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
@@ -1702,7 +1702,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)
@@ -1730,7 +1734,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()
@@ -1744,7 +1751,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))