This commit is contained in:
silicons
2022-04-27 02:21:21 -07:00
parent a4899d0395
commit a6e4af5a31
6 changed files with 39 additions and 16 deletions

View File

@@ -8,7 +8,7 @@
var/mob/M = AM
if(!IS_CONSCIOUS(M))
return
if(!M.self_perspective)
if(!AM.self_perspective)
return
for(var/client/C in AM.self_perspective.GetClients())
var/min = -world.icon_size * strength

View File

@@ -1,9 +1,32 @@
/**
* a perspective, governing what sight flags/eyes/etc a client should have
* MOB PERRSPECTIVE SYSTEM
*
* used to manage remote viewing, so on, so forth
* allows managed control of client viewport/eye changes
*
* see mob_perspective.dm for more info
* as of right now, perspectives will **trample** the following on every set:
* client.eye
* client.lazy_eye (unimplemented)
* client.virtual_eye (unimplemented)
* client.perspective
* client.view
* mob.see_in_dark
* mob.see_invisible
* mob.sight
*
* these will be added/removed using synchronized access,
* and therefore existing values will be left alone,
* as long as existing values are not also in the perspective:
* client.screen
* client.images
*
* this is intentional - most of mobcode uses their own screen/image synchronization code.
* perspectives will never be able to replace that without ruining a lot of lazy-load
* behavior. instead, perspective is focused on allowing using it to manage generic
* synchronization of screen/images, rather than forcing the rest of the codebase to use it.
*
* however, perspectives are designed to force synchronization of the vars it does trample,
* because there's no better way to do it (because those vars are, semantically, only relevant to our perspective),
* while screen/images can be used for embedded maps/hud/etc.
*/
/datum/perspective
/// eye - where visual calcs go from

View File

@@ -1180,8 +1180,10 @@
client.screen |= cam.client_huds
if(stat == DEAD) //Dead
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(healths) healths.icon_state = "health7" //DEAD healthmeter
if(!druggy)
SetSeeInvisibleSelf(SEE_INVISIBLE_LEVEL_TWO)
if(healths)
healths.icon_state = "health7" //DEAD healthmeter
else if(stat == UNCONSCIOUS && health <= 0) //Crit
//Critical damage passage overlay
@@ -1419,7 +1421,7 @@
break
else //We aren't dead
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
SetSeeInvisibleSelf(self_perspective.see_in_dark > 2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default)
if(XRAY in mutations)
AddSightSelf(SEE_TURFS | SEE_MOBS | SEE_OBJS)
@@ -1442,7 +1444,7 @@
else
SetSightSelf(species.get_vision_flags(src))
SetSeeInDarkSelf(species.darksight)
SetSeeInvisibleSelf(see_in_dark > 2? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default)
SetSeeInvisibleSelf(self_perspective.see_in_dark > 2? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default)
var/glasses_processed = 0
var/obj/item/rig/rig = back

View File

@@ -531,8 +531,7 @@
var/eye_name = null
var/ok = "[is_admin ? "Admin Observe" : "Observe"]"
eye_name = input("Please, select a player!",/ ok, null, null) as null|anything in creatures
eye_name = input("Please, select a player!", "Observe", null, null) as null | anything in creatures
if (!eye_name)
return

View File

@@ -65,10 +65,9 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
// Management of mob view displacement. look to shift view to the ship on the overmap; unlook to shift back.
/obj/machinery/computer/ship/proc/look(var/mob/user)
/obj/machinery/computer/ship/proc/look(mob/user)
if(linked)
apply_visual(user)
user.reset_view(linked)
user.reset_perspective(linked)
user.set_machine(src)
if(isliving(user))
var/mob/living/L = user
@@ -82,8 +81,8 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
// TODO GLOB.stat_set_event.register(user, src, /obj/machinery/computer/ship/proc/unlook)
LAZYDISTINCTADD(viewers, WR)
/obj/machinery/computer/ship/proc/unlook(var/mob/user)
user.reset_view()
/obj/machinery/computer/ship/proc/unlook(mob/user)
user.reset_perspective()
user.set_viewsize() // Reset to default
UnregisterSignal(user, COMSIG_MOVABLE_MOVED, /obj/machinery/computer/ship/proc/unlook)
if(isliving(user))

View File

@@ -228,7 +228,7 @@
H.mutations.Add(XRAY)
H.AddSightSelf(SEE_MOBS|SEE_OBJS|SEE_TURFS)
H.SetSeeInDarkSelf(8)
H.SetSeeInvisSelf(SEE_INVISIBLE_LEVEL_TWO)
H.SetSeeInvisibleSelf(SEE_INVISIBLE_LEVEL_TWO)
to_chat(H, "<span class='notice'>The walls suddenly disappear.</span>")
temp = "You have purchased a scrying orb, and gained x-ray vision."
max_uses--