Files
Polaris/code/modules/mob/freelook/eye.dm
Arokha Sieyes f2fef6f410 Planes Framework (#4545)
* Polaris initial plane upstream merge

* POLARIS: Fix RIG visors with new plane system, and material scanner VIS_FULLBRIGHT

* POLARIS: Fix GetFlatIcon so that cameras and id pictures don't show the HUD overlays.

* POLARIS: Adds a 'alter values' proc for plane master ease of tweaking

Setting stuff like colorblindness variety and things.

* Remove NIF reference, fix lighting layer define

* Handle effects above lighting plane

* Moved all layer defines to planes+layers.dm
* Fixed overlays that are supposed to be above lighting to use the PLANE_LIGHTING_ABOVE

* Merge: 3000% human/update_icons() speed improvement

* Merge: Avoid ghosts pointing at things
2018-01-17 13:45:54 -06:00

107 lines
2.1 KiB
Plaintext

// EYE
//
// A mob that another mob controls to look around the station with.
// It streams chunks as it moves around, which will show it what the controller can and cannot see.
/mob/observer/eye
name = "Eye"
icon = 'icons/mob/eye.dmi'
icon_state = "default-eye"
alpha = 127
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
var/owner_follows_eye = 0
see_in_dark = 7
status_flags = GODMODE
plane = PLANE_AI_EYE
var/mob/owner = null
var/list/visibleChunks = list()
var/ghostimage = null
var/datum/visualnet/visualnet
/mob/observer/eye/Destroy()
if(owner)
if(owner.eyeobj == src)
owner.eyeobj = null
owner = null
. = ..()
/mob/observer/eye/Move(n, direct)
if(owner == src)
return EyeMove(n, direct)
return 0
/mob/observer/eye/airflow_hit(atom/A)
airflow_speed = 0
airflow_dest = null
/mob/observer/eye/examinate()
set popup_menu = 0
set src = usr.contents
return 0
/mob/observer/eye/pointed()
set popup_menu = 0
set src = usr.contents
return 0
/mob/observer/eye/examine(mob/user)
// Use this when setting the eye's location.
// It will also stream the chunk that the new loc is in.
/mob/observer/eye/proc/setLoc(var/T)
if(owner)
T = get_turf(T)
if(T != loc)
loc = T
if(owner.client)
owner.client.eye = src
if(owner_follows_eye)
visualnet.updateVisibility(owner, 0)
owner.loc = loc
visualnet.updateVisibility(owner, 0)
visualnet.visibility(src)
return 1
return 0
/mob/observer/eye/proc/getLoc()
if(owner)
if(!isturf(owner.loc) || !owner.client)
return
return loc
/mob
var/mob/observer/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
return eyeobj.EyeMove(n, direct)
/mob/observer/eye/EyeMove(n, direct)
var/initial = initial(sprint)
var/max_sprint = 50
if(cooldown && cooldown < world.timeofday)
sprint = initial
for(var/i = 0; i < max(sprint, initial); i += 20)
var/turf/step = get_turf(get_step(src, direct))
if(step)
setLoc(step)
cooldown = world.timeofday + 5
if(acceleration)
sprint = min(sprint + 0.5, max_sprint)
else
sprint = initial
return 1