mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-25 16:54:01 +00:00
- Fixes few typos in the code - Fixes AI Eye object being solid, therefore being able to block movement of other players. - Fixes non-station APCs boosting CPU as others. Implemented Suggestions + Selection is now done in slightly better way (Basic Encryption Hack, Hack/Unlock Cyborg, Hack AI). Only relevant entities are offered in the list. + Adds varedit-modifiable variables for CPU Gain and Storage boost. These variables may be used by admin in game or by tester to faster unlock abilities. + Slightly nerfed APC CPU power generation. + Reworked machine overload. Now it only works on machines which are powered. Unpowered or broken machines cannot be overloaded. /obj/machinery/power type machines (APCs, SMESs, overall most stuff that directly handles electricity) received bonus explosion strength to compensate. Machine overload also drains massive power from local APC, therefore preventing spam of this ability (normal APC should take about 2-3 of these before needing to recharge). Also, qdel instead of del. + System Override now uses shuffled list of APCs when hacking them, as opposed to alphabetical list. + CPU generation rate is now shown in Status tab.
113 lines
2.4 KiB
Plaintext
113 lines
2.4 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/eye
|
|
name = "Eye"
|
|
icon = 'icons/mob/eye.dmi'
|
|
icon_state = "default-eye"
|
|
alpha = 127
|
|
density = 0
|
|
|
|
var/sprint = 10
|
|
var/cooldown = 0
|
|
var/acceleration = 1
|
|
var/owner_follows_eye = 0
|
|
|
|
see_in_dark = 7
|
|
status_flags = GODMODE
|
|
invisibility = INVISIBILITY_EYE
|
|
|
|
var/mob/owner = null
|
|
var/list/visibleChunks = list()
|
|
|
|
var/ghostimage = null
|
|
var/datum/visualnet/visualnet
|
|
|
|
/mob/eye/New()
|
|
ghostimage = image(src.icon,src,src.icon_state)
|
|
ghost_darkness_images |= ghostimage //so ghosts can see the eye when they disable darkness
|
|
ghost_sightless_images |= ghostimage //so ghosts can see the eye when they disable ghost sight
|
|
updateallghostimages()
|
|
..()
|
|
|
|
mob/eye/Destroy()
|
|
if (ghostimage)
|
|
ghost_darkness_images -= ghostimage
|
|
ghost_sightless_images -= ghostimage
|
|
qdel(ghostimage)
|
|
ghostimage = null
|
|
updateallghostimages()
|
|
..()
|
|
|
|
// Movement code. Returns 0 to stop air movement from moving it.
|
|
/mob/eye/Move(n, direct)
|
|
if(owner == src)
|
|
EyeMove(n, direct)
|
|
return 0
|
|
|
|
/mob/eye/examinate()
|
|
set popup_menu = 0
|
|
set src = usr.contents
|
|
return 0
|
|
|
|
/mob/eye/pointed()
|
|
set popup_menu = 0
|
|
set src = usr.contents
|
|
return 0
|
|
|
|
/mob/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/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/eye/proc/getLoc()
|
|
if(owner)
|
|
if(!isturf(owner.loc) || !owner.client)
|
|
return
|
|
return loc
|
|
/mob
|
|
var/mob/eye/eyeobj
|
|
|
|
/mob/proc/EyeMove(n, direct)
|
|
if(!eyeobj)
|
|
return
|
|
|
|
return eyeobj.EyeMove(n, direct)
|
|
|
|
/mob/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
|