Polishes up the reset_view proc, which is basically

`reset_perspective` from tgstation.

Also adds various support for remote viewing lenses - like cameras not
transmitting xray vision, among other things

Recommit because we're using different compiler versions
This commit is contained in:
Crazylemon64
2016-12-21 17:56:57 -08:00
parent 94a6caa4b5
commit 6d3e66f41c
57 changed files with 506 additions and 411 deletions
+4 -1
View File
@@ -33,7 +33,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/New()
..()
if(!icon_manager)
icon_manager = new()
@@ -318,3 +318,6 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
Deconstruct()
/obj/machinery/atmospherics/update_remote_sight(mob/user)
user.sight |= (SEE_TURFS|BLIND)
+4 -1
View File
@@ -110,6 +110,9 @@
#define CHEM_MOB_SPAWN_HOSTILE 1
#define CHEM_MOB_SPAWN_FRIENDLY 2
#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
#define isliving(A) (istype((A), /mob/living))
#define iscarbon(A) (istype((A), /mob/living/carbon))
#define ishuman(A) (istype((A), /mob/living/carbon/human))
@@ -146,4 +149,4 @@
#define isorgan(A) (istype((A), /obj/item/organ/external))
#define hasorgans(A) (ishuman(A))
#define is_admin(user) (check_rights(R_ADMIN, 0, (user)) != 0)
#define is_admin(user) (check_rights(R_ADMIN, 0, (user)) != 0)
+4 -12
View File
@@ -643,9 +643,7 @@
//this is necessarily damaging
var/damage = rand(1,5)
to_chat(M, "<span class='danger'>The unloading machine grabs you with a hard metallic claw!</span>")
if(M.client)
M.client.eye = master
M.client.perspective = EYE_PERSPECTIVE
M.reset_view(master)
M.loc = master
master.types[M.type] = src
M.apply_damage(damage) // todo: ugly
@@ -699,10 +697,7 @@
//this is necessarily damaging
var/damage = rand(1,5)
to_chat(M, "<span class='danger'>The unloading machine grabs you with a hard metallic claw!</span>")
if(M.client)
M.client.eye = master
M.client.perspective = EYE_PERSPECTIVE
M.loc = master
M.forceMove(master)
master.types[M.type] = src
M.apply_damage(damage) // todo: ugly
M.visible_message("\red [M.name] gets pulled into the machine!")
@@ -710,11 +705,8 @@
outlet_reaction(var/atom/W,var/turf/D)
var/mob/living/M = W
M.loc = master.loc
M.forceMove(master.loc)
M.dir = master.outdir
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
D = get_step(D,master.outdir) // throw attempt
eject_speed = rand(0,4)
@@ -796,4 +788,4 @@
var/punches = punch(M,remaining / PUNCH_WORK)
if(punches>1)master.sleep++
return punches * PUNCH_WORK
#undef MAXCOIL
#undef MAXCOIL
+9
View File
@@ -427,6 +427,15 @@
else
return 0
// Used to provide overlays when using this atom as a viewing focus
// (cameras, locker tint, etc.)
/atom/proc/get_remote_view_fullscreens(mob/user)
return
//the sight changes to give to the mob whose perspective is set to that atom (e.g. A mob with nightvision loses its nightvision while looking through a normal camera)
/atom/proc/update_remote_sight(mob/living/user)
return
/atom/proc/checkpass(passflag)
return pass_flags&passflag
+12
View File
@@ -147,6 +147,18 @@
return 1
/mob/living/forceMove(atom/destination)
stop_pulling()
if(buckled)
buckled.unbuckle_mob(src,force=1)
// in lieu of "unbuckle_all_mobs"
if(buckled_mob)
unbuckle_mob(buckled_mob,force=1)
. = ..()
if(client)
reset_view(destination)
update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
//called when src is thrown into hit_atom
/atom/movable/proc/throw_impact(atom/hit_atom, var/speed)
if(istype(hit_atom,/mob/living))
-8
View File
@@ -156,8 +156,6 @@
to_chat(usr, "<span class='boldnotice'>Subject cannot have abiotic items on.</span>")
return
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.forceMove(src)
src.occupant = usr
src.icon_state = "scanner_occupied"
@@ -258,9 +256,6 @@
go_out()
/obj/machinery/dna_scannernew/proc/put_in(var/mob/M)
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.forceMove(src)
src.occupant = M
src.icon_state = "scanner_occupied"
@@ -283,9 +278,6 @@
to_chat(usr, "<span class='warning'>The scanner is locked!</span>")
return
if(src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.forceMove(src.loc)
src.occupant = null
src.icon_state = "scanner_open"
@@ -76,10 +76,9 @@
origin.vest_mode_action.Remove(C)
origin.vest_disguise_action.Remove(C)
origin.set_droppoint_action.Remove(C)
remote_eye.user = null
remote_eye.eye_user = null
C.reset_view(null)
if(C.client)
C.client.perspective = MOB_PERSPECTIVE
C.client.eye = src
C.client.images -= remote_eye.user_image
for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks)
C.client.images -= chunk.obscured
@@ -203,9 +203,6 @@
/obj/machinery/abductor/experiment/proc/eject_abductee()
if(!occupant)
return
if(occupant.client)
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
occupant.forceMove(get_turf(src))
occupant = null
icon_state = "experiment-open"
icon_state = "experiment-open"
+2 -4
View File
@@ -817,11 +817,9 @@ var/global/list/multiverse = list()
log_game("[user][user.key] made [target][target.key] say [wgw] with a voodoo doll.")
if("eyes")
user.set_machine(src)
if(user.client)
user.client.eye = target
user.client.perspective = EYE_PERSPECTIVE
user.reset_view(target)
spawn(100)
user.reset_view()
user.reset_view(null)
user.unset_machine()
if("r_leg","l_leg")
to_chat(user, "<span class='notice'>You move the doll's legs around.</span>")
+1 -4
View File
@@ -96,12 +96,9 @@
user.visible_message("[user] climbs on the operating table.","You climb on the operating table.")
else
visible_message("<span class='alert'>[C] has been laid on the operating table by [user].</span>")
if(C.client)
C.client.perspective = EYE_PERSPECTIVE
C.client.eye = src
C.resting = 1
C.update_canmove()
C.loc = src.loc
C.forceMove(loc)
if(user.pulling == C)
user.stop_pulling()
for(var/obj/O in src)
-12
View File
@@ -343,9 +343,6 @@
return
if(!G || !G:affecting) return
var/mob/M = G:affecting
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.forceMove(src)
src.occupant = M
src.icon_state = "[base_icon]"
@@ -420,9 +417,6 @@
toggle_filter()
if(!occupant)
return
if(occupant.client)
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
occupant.forceMove(loc)
occupant = null
icon_state = "[base_icon]-open"
@@ -521,10 +515,6 @@
to_chat(user, "<span class='boldnotice'>>The sleeper is already occupied!</span>")
return
if(!L) return
if(L.client)
L.client.perspective = EYE_PERSPECTIVE
L.client.eye = src
L.forceMove(src)
src.occupant = L
src.icon_state = "[base_icon]"
@@ -562,8 +552,6 @@
to_chat(usr, "<span class='boldnotice'>The sleeper is already occupied!</span>")
return
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.forceMove(src)
src.occupant = usr
src.icon_state = "[base_icon]"
-6
View File
@@ -93,9 +93,6 @@
if(M.abiotic())
to_chat(user, "<span class='notice'>Subject cannot have abiotic items on.</span>")
return
/*if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src*///THIS IS FUCKING POINTLESS BECAUSE OF ON-LIFE() FUCKING RESET_VIEW() AHHHHHHHHHHGGGGGGGGGG
M.forceMove(src)
occupant = M
icon_state = "body_scanner_1"
@@ -159,9 +156,6 @@
/obj/machinery/bodyscanner/proc/go_out()
if(!occupant || locked)
return
if(occupant.client)
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
occupant.forceMove(loc)
occupant = null
icon_state = "body_scanner_0"
+14
View File
@@ -387,6 +387,20 @@
cam["z"] = 0
return cam
/obj/machinery/camera/get_remote_view_fullscreens(mob/user)
if(view_range == short_range) //unfocused
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
/obj/machinery/camera/update_remote_sight(mob/living/user)
user.see_invisible = SEE_INVISIBLE_LIVING //can't see ghosts through cameras
if(isXRay())
user.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
user.see_in_dark = max(user.see_in_dark, 8)
else
user.sight = 0
user.see_in_dark = 2
return 1
/obj/machinery/camera/portable //Cameras which are placed inside of things, such as helmets.
var/turf/prev_turf
+44 -36
View File
@@ -41,61 +41,70 @@
return
if(!iscarbon(user))
return
var/mob/living/carbon/L = user
if(!current_user)
user.set_machine(src)
if(!eyeobj)
CreateEye()
GrantActions(user)
current_user = user
eyeobj.user = user
eyeobj.name = "Camera Eye ([user.name])"
L.remote_view = 1
L.remote_control = eyeobj
L.client.perspective = EYE_PERSPECTIVE
if(!eyeobj.initialized)
for(var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
if(C.network&networks)
eyeobj.setLoc(get_turf(C))
break
eyeobj.initialized = 1
else
eyeobj.setLoc(eyeobj.loc)
else
if(current_user)
to_chat(user, "The console is already in use!")
return
user.set_machine(src)
if(!eyeobj)
CreateEye()
if(!eyeobj.initialized)
var/camera_location
for(var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
if(C.network&networks)
camera_location = get_turf(C)
break
if(camera_location)
eyeobj.initialized = 1
give_eye_control(user)
else
user.unset_machine()
else
give_eye_control(user)
eyeobj.setLoc(eyeobj.loc)
/obj/machinery/computer/camera_advanced/proc/give_eye_control(mob/user)
GrantActions(user)
current_user = user
eyeobj.eye_user = user
eyeobj.name = "Camera Eye ([user.name])"
// This should be able to be excised once the full view refactor rolls out
user.remote_view = 1
user.remote_control = eyeobj
user.reset_view(eyeobj)
/mob/camera/aiEye/remote
name = "Inactive Camera Eye"
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
var/mob/living/carbon/human/user = null
var/mob/living/carbon/human/eye_user = null
var/obj/machinery/computer/camera_advanced/origin
var/initialized = 0
var/visible_icon = 0
var/image/user_image = null
/mob/camera/aiEye/remote/GetViewerClient()
if(user)
return user.client
if(eye_user)
return eye_user.client
return null
/mob/camera/aiEye/remote/setLoc(T)
if(user)
if(!isturf(user.loc))
if(eye_user)
if(!isturf(eye_user.loc))
return
T = get_turf(T)
loc = T
cameranet.visibility(src)
if(user.client)
if(eye_user.client)
if(visible_icon)
user.client.images -= user_image
eye_user.client.images -= user_image
user_image = image(icon,loc,icon_state,FLY_LAYER)
user.client.images += user_image
user.client.eye = src
eye_user.client.images += user_image
eye_user.client.eye = src
/mob/camera/aiEye/remote/relaymove(mob/user,direct)
var/initial = initial(sprint)
@@ -127,10 +136,9 @@
C.remote_view = 0
remote_eye.origin.current_user = null
remote_eye.origin.jump_action.Remove(C)
remote_eye.user = null
remote_eye.eye_user = null
C.reset_view(null)
if(C.client)
C.client.perspective = MOB_PERSPECTIVE
C.client.eye = src
C.client.images -= remote_eye.user_image
for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks)
C.client.images -= chunk.obscured
+6 -6
View File
@@ -406,9 +406,6 @@
/obj/machinery/atmospherics/unary/cryo_cell/proc/go_out()
if(!occupant)
return
if(occupant.client)
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
occupant.forceMove(get_step(loc, SOUTH)) //this doesn't account for walls or anything, but i don't forsee that being a problem.
if(occupant.bodytemperature < 261 && occupant.bodytemperature >= 70) //Patch by Aranclanos to stop people from taking burn damage after being ejected
occupant.bodytemperature = 261
@@ -431,9 +428,6 @@
if(!node)
to_chat(usr, "\red The cell is not correctly connected to its pipe network!")
return
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.stop_pulling()
M.forceMove(src)
if(M.health > -100 && (M.health < 0 || M.sleeping))
@@ -494,3 +488,9 @@
/datum/data/function/proc/display()
return
/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user)
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
return //we don't see the pipe network while inside cryo.
+4 -18
View File
@@ -442,11 +442,7 @@
to_chat(user, "<span class='boldnotice'>\The [src] is in use.</span>")
return
M.loc = src
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.forceMove(src)
time_till_despawn = initial(time_till_despawn) / willing
@@ -540,12 +536,8 @@
if(src.occupant)
to_chat(user, "<span class='boldnotice'>\The [src] is in use.</span>")
return
L.loc = src
L.forceMove(src)
time_till_despawn = initial(time_till_despawn) / willing
if(L.client)
L.client.perspective = EYE_PERSPECTIVE
L.client.eye = src
else
to_chat(user, "<span class='notice'>You stop [L == user ? "climbing into the cryo pod." : "putting [L] into the cryo pod."]</span>")
return
@@ -637,9 +629,7 @@
return
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.loc = src
usr.forceMove(src)
src.occupant = usr
time_till_despawn = initial(time_till_despawn) / willing_time_divisor
@@ -662,11 +652,7 @@
if(!occupant)
return
if(occupant.client)
occupant.client.eye = src.occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
occupant.loc = get_turf(src)
occupant.forceMove(get_turf(src))
occupant = null
if(orient_right)
+2 -4
View File
@@ -297,10 +297,8 @@
O.loc = loc
for(var/mob/M in contents)
M.loc = loc
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
to_chat(M, "\blue The machine turns off, and you fall out.")
M.reset_view(null)
to_chat(M, "<span class='notice'>The machine turns off, and you fall out.</span>")
return
+4 -12
View File
@@ -166,17 +166,12 @@
H.updatehealth()
/obj/machinery/recharge_station/proc/go_out()
if(!( src.occupant ))
if(!occupant)
return
//for(var/obj/O in src)
// O.loc = src.loc
if(src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.loc = src.loc
src.occupant = null
occupant.forceMove(loc)
occupant = null
build_icon()
src.use_power = 1
use_power = 1
return
/obj/machinery/recharge_station/proc/restock_modules()
@@ -300,9 +295,6 @@
return
user.stop_pulling()
if(user && user.client)
user.client.perspective = EYE_PERSPECTIVE
user.client.eye = src
user.forceMove(src)
occupant = user
+17 -35
View File
@@ -430,27 +430,21 @@
/obj/machinery/suit_storage_unit/proc/eject_occupant(mob/user as mob)
if(src.islocked)
if(islocked)
return
if(!src.OCCUPANT)
if(!OCCUPANT)
return
// for(var/obj/O in src)
// O.loc = src.loc
if(src.OCCUPANT.client)
if(user != OCCUPANT)
to_chat(OCCUPANT, "<font color='blue'>The machine kicks you out!</font>")
if(user.loc != src.loc)
to_chat(OCCUPANT, "<font color='blue'>You leave the not-so-cozy confines of the SSU.</font>")
src.OCCUPANT.client.eye = src.OCCUPANT.client.mob
src.OCCUPANT.client.perspective = MOB_PERSPECTIVE
src.OCCUPANT.loc = src.loc
src.OCCUPANT = null
if(!src.isopen)
src.isopen = 1
src.update_icon()
if(user != OCCUPANT)
to_chat(OCCUPANT, "<font color='blue'>The machine kicks you out!</font>")
if(user.loc != loc)
to_chat(OCCUPANT, "<font color='blue'>You leave the not-so-cozy confines of the SSU.</font>")
OCCUPANT.forceMove(loc)
OCCUPANT = null
if(!isopen)
isopen = 1
update_icon()
return
@@ -487,9 +481,7 @@
visible_message("[usr] starts squeezing into the suit storage unit!")
if(do_after(usr, 10, target = usr))
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.loc = src
usr.forceMove(src)
// usr.metabslow = 1
src.OCCUPANT = usr
src.isopen = 0 //Close the thing after the guy gets inside
@@ -532,10 +524,7 @@
if(do_after(user, 20, target = G:affecting))
if(!G || !G.affecting) return //derpcheck
var/mob/M = G.affecting
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
M.forceMove(src)
src.OCCUPANT = M
src.isopen = 0 //close ittt
@@ -690,10 +679,7 @@
if(do_after(user, 20, target = G:affecting))
if(!G || !G.affecting) return
var/mob/M = G.affecting
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
M.forceMove(src)
src.occupant = M
src.add_fingerprint(user)
@@ -999,16 +985,12 @@
if(!occupant)
return
if(occupant.client)
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
occupant.loc = get_turf(occupant)
occupant.forceMove(loc)
occupant = null
add_fingerprint(usr)
src.updateUsrDialog()
src.update_icon()
updateUsrDialog()
update_icon()
return
/*
@@ -33,6 +33,7 @@
/obj/item/mecha_parts/mecha_equipment/Destroy()//missiles detonating, teleporter creating singularity?
if(chassis)
detach(chassis)
chassis.equipment -= src
listclearnulls(chassis.equipment)
if(chassis.selected == src)
@@ -115,12 +115,22 @@
equip_cooldown = 30
var/scanning = 0
/obj/item/mecha_parts/mecha_equipment/mining_scanner/New()
/obj/item/mecha_parts/mecha_equipment/mining_scanner/attach(obj/mecha/M)
. = ..()
processing_objects.Add(src)
M.occupant_sight_flags |= SEE_TURFS
if(M.occupant)
M.occupant.update_sight()
/obj/item/mecha_parts/mecha_equipment/mining_scanner/detach()
chassis.occupant_sight_flags &= ~SEE_TURFS
processing_objects.Remove(src)
if(chassis.occupant)
chassis.occupant.update_sight()
return ..()
/obj/item/mecha_parts/mecha_equipment/mining_scanner/process()
if(!loc)
processing_objects.Remove(src)
qdel(src)
if(scanning)
return
+7 -5
View File
@@ -65,6 +65,7 @@
var/max_equip = 3
var/datum/events/events
var/turf/crashing = null
var/occupant_sight_flags = 0
var/stepsound = 'sound/mecha/mechstep.ogg'
@@ -1178,12 +1179,8 @@
return 0
var/mob/brainmob = mmi_as_oc.brainmob
brainmob.reset_view(src)
/*
brainmob.client.eye = src
brainmob.client.perspective = EYE_PERSPECTIVE
*/
occupant = brainmob
brainmob.loc = src //should allow relaymove
brainmob.forceMove(src) //should allow relaymove
brainmob.canmove = 1
mmi_as_oc.loc = src
mmi_as_oc.mecha = src
@@ -1440,3 +1437,8 @@
/obj/mecha/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list())
flick_overlay(image('icons/mob/talk.dmi', bubble_loc, bubble_state,MOB_LAYER+1), bubble_recipients, 30)
/obj/mecha/update_remote_sight(mob/living/user)
if(occupant_sight_flags)
if(user == occupant)
user.sight |= occupant_sight_flags
+2 -3
View File
@@ -61,8 +61,8 @@
M.adjust_fire_stacks(1)
M.IgniteMob()
/atom/movable/proc/unbuckle_mob()
if(buckled_mob && buckled_mob.buckled == src && buckled_mob.can_unbuckle(usr))
/atom/movable/proc/unbuckle_mob(force = FALSE)
if(buckled_mob && buckled_mob.buckled == src && (buckled_mob.can_unbuckle(usr) || force))
. = buckled_mob
buckled_mob.buckled = null
buckled_mob.anchored = initial(buckled_mob.anchored)
@@ -72,7 +72,6 @@
post_buckle_mob(.)
//Handle any extras after buckling/unbuckling
//Called on buckle_mob() and unbuckle_mob()
/atom/movable/proc/post_buckle_mob(mob/living/M)
@@ -55,9 +55,7 @@
for(var/mob/M in src) //Should only be one but whatever.
M.loc = src.loc
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
M.reset_view(null)
qdel(src)
@@ -94,10 +94,7 @@
return
if(M == occupant) // so that the guy inside can't eject himself -Agouri
return
if(src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.loc = src.loc
occupant.forceMove(loc)
if(injecting)
implant(src.occupant)
injecting = 0
@@ -113,11 +110,8 @@
if(src.occupant)
to_chat(usr, "<span class='warning'>The [src.name] is already occupied!</span>")
return
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.stop_pulling()
M.loc = src
M.forceMove(src)
src.occupant = M
src.add_fingerprint(usr)
icon_state = "implantchair_on"
@@ -58,13 +58,11 @@
for(var/mob/M in src)
moveMob(M, loc)
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
/obj/structure/closet/proc/moveMob(var/mob/M, var/atom/destination)
loc.Exited(M)
M.loc = destination
M.reset_view(destination)
if(isturf(loc))
loc.Entered(M, src, ignoreRest = 1)
else
@@ -122,10 +120,6 @@
if(M.buckled)
continue
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
moveMob(M, src)
itemcount++
@@ -428,3 +422,7 @@
..()
visible_message("<span class='danger'>[src] is blown apart by the bolt of electricity!</span>", "<span class='danger'>You hear a metallic screeching sound.</span>")
qdel(src)
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
@@ -18,10 +18,7 @@
if(L.buckled)
L.buckled = 0
L.anchored = 0
if(L.client)
L.client.perspective = EYE_PERSPECTIVE
L.client.eye = src
L.loc = src
L.forceMove(src)
L.disabilities += MUTE
health = L.health + 100 //stoning damaged mobs will result in easier to shatter statues
intialTox = L.getToxLoss()
@@ -76,12 +73,9 @@
O.loc = src.loc
for(var/mob/living/M in src)
M.loc = src.loc
M.forceMove(loc)
M.disabilities -= MUTE
M.take_overall_damage((M.health - health - 100),0) //any new damage the statue incurred is transfered to the mob
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
/obj/structure/closet/statue/open()
@@ -164,4 +158,4 @@ obj/structure/statue/angel
icon_state = "angelseen"
obj/structure/statue/corgi
icon_state = "corgi"
icon_state = "corgi"
+8
View File
@@ -154,6 +154,10 @@
src.attack_hand(CM)
/obj/structure/morgue/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
/*
* Morgue tray
*/
@@ -393,6 +397,10 @@
to_chat(CM, "<span class='alert'>You attempt to slide yourself out of \the [src]...</span>")
src.attack_hand(CM)
/obj/structure/crematorium/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
/*
* Crematorium tray
*/
-8
View File
@@ -2235,14 +2235,6 @@
qdel(O)
for(var/obj/structure/grille/O in world)
qdel(O)
/* for(var/obj/machinery/vehicle/pod/O in world)
for(var/mob/M in src)
M.loc = src.loc
if(M.client)
M.client.perspective = MOB_PERSPECTIVE
M.client.eye = M
qdel(O)
ok = 1*/
if("monkey")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","M")
+3 -1
View File
@@ -151,6 +151,8 @@
var/emagged = 0
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/invis_override = 0
var/invis_view = SEE_INVISIBLE_LIVING
var/invisa_view = 0
var/color_view = null//overrides client.color while worn
strip_delay = 20 // but seperated to allow items to protect but not impair vision, like space helmets
@@ -343,6 +345,7 @@ BLIND // can't see anything
src.loc = user
user.wear_mask = null
user.put_in_hands(src)
H.wear_mask_update(src, toggle_off = mask_adjusted)
usr.update_inv_wear_mask()
usr.update_inv_head()
for(var/X in actions)
@@ -707,4 +710,3 @@ BLIND // can't see anything
for(var/obj/item/clothing/accessory/A in accessories)
A.emp_act(severity)
..()
+3 -2
View File
@@ -6,7 +6,6 @@
//slot_flags = SLOT_EYES
//var/vision_flags = 0
//var/darkness_view = 0//Base human is 2
//var/invisa_view = 0
var/prescription = 0
var/prescription_upgradable = 0
var/see_darkness = 1
@@ -360,7 +359,9 @@
to_chat(usr, "You push the [src] up out of your face.")
flash_protect = 0
tint = 0
usr.update_inv_glasses()
var/mob/living/carbon/user = usr
user.update_inv_glasses()
user.update_tint()
for(var/X in actions)
var/datum/action/A = X
@@ -67,6 +67,8 @@
to_chat(usr, "You push the [src] up out of your face.")
flash_protect = 0
tint = 0
var/mob/living/carbon/C = usr
C.update_tint()
usr.update_inv_head() //so our mob-overlays update
for(var/X in actions)
+1 -4
View File
@@ -251,9 +251,6 @@
/obj/item/device/mobcapsule/proc/dump_contents(mob/user)
if(captured)
captured.forceMove(get_turf(src))
if(captured.client)
captured.client.eye = captured.client.mob
captured.client.perspective = MOB_PERSPECTIVE
captured = null
/obj/item/device/mobcapsule/attack_self(mob/user)
@@ -530,4 +527,4 @@
if(do_after(user, 20, target = src))
new /obj/item/stack/rods(loc)
qdel(src)
return ..()
return ..()
@@ -1,6 +0,0 @@
/mob/living/carbon/alien/humanoid/Login()
..()
if(!isturf(loc))
client.eye = loc
client.perspective = EYE_PERSPECTIVE
return
+26 -16
View File
@@ -31,21 +31,31 @@
return 1
/mob/living/carbon/alien/update_sight()
if(stat == DEAD || (XRAY in mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
sight = SEE_MOBS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else
see_in_dark = 4
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if(stat != DEAD)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs)
sight |= E.vision_flags
if(E.dark_view)
see_in_dark = max(see_in_dark, E.dark_view)
if(E.see_invisible)
see_invisible = min(see_invisible, E.see_invisible)
if(see_override)
see_invisible = see_override
@@ -62,22 +62,5 @@
. = 1
/mob/living/carbon/brain/handle_vision()
..()
if(stat == 2 || (XRAY in src.mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if(stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
handle_hud_icons_health()
/mob/living/carbon/brain/breathe()
return
+46
View File
@@ -1039,3 +1039,49 @@ so that different stomachs can handle things in different ways VB*/
/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0)
if(hud_used && hud_used.internals)
hud_used.internals.icon_state = "internal[internal_state]"
//to recalculate and update the mob's total tint from tinted equipment it's wearing.
/mob/living/carbon/proc/update_tint()
if(!tinted_weldhelh)
return
var/tinttotal = get_total_tint()
if(tinttotal >= TINT_BLIND)
overlay_fullscreen("tint", /obj/screen/fullscreen/blind)
else if(tinttotal >= TINT_IMPAIR)
overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2)
else
clear_fullscreen("tint", 0)
/mob/living/carbon/proc/get_total_tint()
. = 0
if(istype(head, /obj/item/clothing/head))
var/obj/item/clothing/head/HT = head
. += HT.tint
if(wear_mask)
. += wear_mask.tint
/mob/living/carbon/human/get_total_tint()
. = ..()
if(glasses)
var/obj/item/clothing/glasses/G = glasses
. += G.tint
//handle stuff to update when a mob equips/unequips a mask.
/mob/living/proc/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
update_inv_wear_mask()
/mob/living/carbon/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
if(C.tint || initial(C.tint))
update_tint()
update_inv_wear_mask()
//handle stuff to update when a mob equips/unequips a headgear.
/mob/living/carbon/proc/head_update(obj/item/I, forced)
if(istype(I, /obj/item/clothing))
var/obj/item/clothing/C = I
if(C.tint || initial(C.tint))
update_tint()
if(I.flags_inv & HIDEMASK || forced)
update_inv_wear_mask()
update_inv_head()
@@ -724,6 +724,17 @@
if(istype(id))
return id
/mob/living/carbon/human/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
species.update_sight(src)
//Removed the horrible safety parameter. It was only being used by ninja code anyways.
//Now checks siemens_coefficient of the affected area by default
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
@@ -111,6 +111,13 @@
update_inv_gloves()
else if(I == glasses)
glasses = null
var/obj/item/clothing/glasses/G = I
if(G.tint)
update_tint()
if(G.prescription)
clear_fullscreen("nearsighted")
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view)
update_sight()
update_inv_glasses()
else if(I == head)
head = null
@@ -118,6 +125,7 @@
update_hair() //rebuild hair
update_fhair()
update_head_accessory()
head_update(I)
update_inv_head()
else if(I == r_ear)
r_ear = null
@@ -140,6 +148,7 @@
if(internal)
internal = null
update_internals_hud_icon(0)
wear_mask_update(I, toggle_off = FALSE)
sec_hud_set_ID()
update_inv_wear_mask()
else if(I == wear_id)
@@ -203,6 +212,7 @@
update_head_accessory(redraw_mob)
if(hud_list.len)
sec_hud_set_ID()
wear_mask_update(W, toggle_off = TRUE)
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
handcuffed = W
@@ -247,6 +257,14 @@
update_inv_ears(redraw_mob)
if(slot_glasses)
glasses = W
var/obj/item/clothing/glasses/G = W
if(G.tint)
update_tint()
if(G.prescription)
if(disabilities & NEARSIGHTED)
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view)
update_sight()
update_inv_glasses(redraw_mob)
if(slot_gloves)
gloves = W
@@ -257,6 +275,7 @@
update_hair(redraw_mob) //rebuild hair
update_fhair(redraw_mob)
update_head_accessory(redraw_mob)
head_update(W)
update_inv_head(redraw_mob)
if(slot_shoes)
shoes = W
@@ -1,8 +1,5 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
/mob/living/carbon/human
var/pressure_alert = 0
@@ -12,11 +9,9 @@
var/exposedtimenow = 0
var/firstexposed = 0
var/heartbeat = 0
var/tinttotal = 0 // Total level of visually impairing items
/mob/living/carbon/human/Life()
fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it.
tinttotal = tintcheck() //here as both hud updates and status updates call it
life_tick++
in_stasis = 0
@@ -46,6 +46,7 @@
var/siemens_coeff = 1 //base electrocution coefficient
var/invis_sight = SEE_INVISIBLE_LIVING
var/darksight = 2
var/hazard_high_pressure = HAZARD_HIGH_PRESSURE // Dangerously high pressure.
var/warning_high_pressure = WARNING_HIGH_PRESSURE // High pressure warning.
@@ -506,15 +507,6 @@
H.see_invisible = SEE_INVISIBLE_LIVING
H.seer = 0
//This checks how much the mob's eyewear impairs their vision
if(H.tinttotal >= TINT_IMPAIR)
if(tinted_weldhelh)
H.overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2)
if(H.tinttotal >= TINT_BLIND)
H.EyeBlind(1)
else
H.clear_fullscreen("tint")
var/minimum_darkness_view = INFINITY
if(H.glasses)
if(istype(H.glasses, /obj/item/clothing/glasses))
@@ -684,3 +676,37 @@ It'll return null if the organ doesn't correspond, so include null checks when u
if(!(organ_slot in has_organ))
return null
return has_organ[organ_slot]
/datum/species/proc/update_sight(mob/living/carbon/human/H)
H.sight = initial(H.sight)
H.see_in_dark = darksight
H.see_invisible = invis_sight
if(H.client.eye != H)
var/atom/A = H.client.eye
if(A.update_remote_sight(H)) //returns 1 if we override all other sight updates.
return
for(var/obj/item/organ/internal/cyberimp/eyes/E in H.internal_organs)
H.sight |= E.vision_flags
if(E.dark_view)
H.see_in_dark = E.dark_view
if(E.see_invisible)
H.see_invisible = min(H.see_invisible, E.see_invisible)
if(H.glasses)
var/obj/item/clothing/glasses/G = H.glasses
H.sight |= G.vision_flags
H.see_in_dark = max(G.darkness_view, H.see_in_dark)
if(G.invis_override)
H.see_invisible = G.invis_override
else
H.see_invisible = min(G.invis_view, H.see_invisible)
if(XRAY in H.mutations)
H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
H.see_in_dark = max(H.see_in_dark, 8)
if(H.see_override) //Override all
H.see_invisible = H.see_override
+24 -18
View File
@@ -409,27 +409,33 @@
return 1
/mob/living/carbon/update_sight()
if(!client)
return
if(stat == DEAD)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
if(XRAY in mutations)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
grant_death_vision()
return
else
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(see_override)
see_invisible = see_override
if(XRAY in mutations)
grant_xray_vision()
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs)
sight |= E.vision_flags
if(E.dark_view)
see_in_dark = max(see_in_dark,E.dark_view)
if(E.see_invisible)
see_invisible = min(see_invisible, E.see_invisible)
if(see_override)
see_invisible = see_override
/mob/living/carbon/handle_hud_icons()
+18
View File
@@ -238,6 +238,24 @@
/mob/living/proc/update_sight()
return
// Gives a mob the vision of being dead
/mob/living/proc/grant_death_vision()
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_OBSERVER
// See through walls, dark, etc.
// basically the same as death vision except you can't
// see ghosts
/mob/living/proc/grant_xray_vision()
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
/mob/living/proc/handle_hud_icons()
handle_hud_icons_health()
return
+8 -1
View File
@@ -1163,4 +1163,11 @@ var/list/ai_verbs_default = list(
to_chat(src, "You are also capable of hacking APCs, which grants you more points to spend on your Malfunction powers. The drawback is that a hacked APC will give you away if spotted by the crew. Hacking an APC takes 60 seconds.")
view_core() //A BYOND bug requires you to be viewing your core before your verbs update
verbs += /mob/living/silicon/ai/proc/choose_modules
malf_picker = new /datum/module_picker
malf_picker = new /datum/module_picker
/mob/living/silicon/ai/reset_view(atom/A)
if(camera_light_on)
light_cameras()
if(istype(A, /obj/machinery/camera))
current = A
. = ..()
+38 -35
View File
@@ -1,3 +1,8 @@
#define POWER_RESTORATION_OFF 0
#define POWER_RESTORATION_START 1
#define POWER_RESTORATION_SEARCH_APC 2
#define POWER_RESTORATION_APC_FOUND 3
/mob/living/silicon/ai/Life()
//doesn't call parent because it's a horrible mess
if(stat == DEAD)
@@ -16,11 +21,16 @@
death()
return 0
if(malfhack)
if(malfhack.aidisabled)
to_chat(src, "<span class='danger'>ERROR: APC access disabled, hack attempt canceled.</span>")
malfhacking = 0
malfhack = null
if(!eyeobj || qdeleted(eyeobj) || !eyeobj.loc)
view_core()
if(machine)
machine.check_eye(src)
if(malfhack && malfhack.aidisabled)
to_chat(src, "<span class='danger'>ERROR: APC access disabled, hack attempt canceled.</span>")
malfhacking = 0
malfhack = null
if(aiRestorePowerRoutine)
adjustOxyLoss(1)
@@ -29,22 +39,9 @@
handle_stunned()
var/is_blind = 0 //THIS WAS JUST FUCKING 'blind' WHICH CONFLICTED WITH A NORMAL VARIABLE
var/area/my_area = get_area(src)
if(istype(my_area))
if(!my_area.power_equip && !is_type_in_list(loc, list(/obj/item, /obj/mecha)))
is_blind = 1 //HOW THE FUCK DID THAT EVEN COMPILE JESUS CHRIST
if(!is_blind)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(see_override)
see_invisible = see_override
if(!lacks_power())
if(aiRestorePowerRoutine == 2)
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
@@ -57,18 +54,12 @@
else
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
see_in_dark = 0
see_invisible = SEE_INVISIBLE_LIVING
if(((!my_area.power_equip) || istype(T, /turf/space)) && !is_type_in_list(loc, list(/obj/item, /obj/mecha)))
if(lacks_power())
if(!aiRestorePowerRoutine)
aiRestorePowerRoutine = 1
update_sight()
to_chat(src, "<span class='danger'>You have lost power!</span>")
if(!is_special_character(src))
set_zeroth_law("")
@@ -78,7 +69,7 @@
sleep(50)
my_area = get_area(src)
T = get_turf(src)
if(my_area && my_area.power_equip && !istype(T, /turf/space))
if(!lacks_power())
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
aiRestorePowerRoutine = 0
return
@@ -115,12 +106,11 @@
aiRestorePowerRoutine = 2
return
if(my_area.power_equip)
if(!istype(T, /turf/space))
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
aiRestorePowerRoutine = 0
clear_fullscreen("blind")
return
if(!lacks_power())
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
aiRestorePowerRoutine = 0
clear_fullscreen("blind")
return
switch(PRP)
if(1)
@@ -170,4 +160,17 @@
if(client)
var/client/C = client
for(var/mob/living/carbon/human/H in view(eyeobj, 14))
C.images += H.hud_list[NATIONS_HUD]
C.images += H.hud_list[NATIONS_HUD]
/mob/living/silicon/ai/update_sight()
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(aiRestorePowerRoutine)
sight = sight&~SEE_TURFS
sight = sight&~SEE_MOBS
sight = sight&~SEE_OBJS
see_in_dark = 0
if(see_override)
see_invisible = see_override
+1 -5
View File
@@ -2,9 +2,5 @@
..()
for(var/obj/machinery/ai_status_display/O in world) //change status
O.mode = 0
if(!isturf(loc))
if(client)
client.eye = loc
client.perspective = EYE_PERSPECTIVE
src.view_core()
return
return
+1 -6
View File
@@ -363,9 +363,6 @@
var/obj/item/device/pda/holder = card.loc
holder.pai = null
if(client)
client.perspective = EYE_PERSPECTIVE
client.eye = src
forceMove(get_turf(card))
card.forceMove(src)
@@ -487,9 +484,7 @@
visible_message("<span class=notice>[src] neatly folds inwards, compacting down to a rectangular card.</span>", "<span class=notice>You neatly fold inwards, compacting down to a rectangular card.</span>")
stop_pulling()
if(client)
client.perspective = EYE_PERSPECTIVE
client.eye = card
reset_view(card)
// If we are being held, handle removing our holder from their inv.
var/obj/item/weapon/holder/H = loc
@@ -17,6 +17,7 @@
if(istype(O,/obj/item/borg/sight))
var/obj/item/borg/sight/S = O
sight_mode &= ~S.sight_mode
update_sight()
if(client)
client.screen -= O
@@ -52,6 +53,7 @@
if((cell.charge * 100 / cell.maxcharge) < B.powerneeded)
to_chat(src, "Not enough power to activate [B.name]!")
return
var/activated_thingy = null
if(!module_state_1)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_1 = O
@@ -59,8 +61,7 @@
O.plane = HUD_PLANE
O.screen_loc = inv1.screen_loc
contents += O
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode |= module_state_1:sight_mode
activated_thingy = O
else if(!module_state_2)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_2 = O
@@ -68,8 +69,7 @@
O.plane = HUD_PLANE
O.screen_loc = inv2.screen_loc
contents += O
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode |= module_state_2:sight_mode
activated_thingy = O
else if(!module_state_3)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_3 = O
@@ -77,11 +77,12 @@
O.plane = HUD_PLANE
O.screen_loc = inv3.screen_loc
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode |= module_state_3:sight_mode
activated_thingy = O
else
to_chat(src, "You need to disable a module first!")
src.update_icons()
if(istype(activated_thingy,/obj/item/borg/sight))
update_sight()
update_icons()
/mob/living/silicon/robot/proc/uneq_active()
uneq_module(module_active)
+29 -23
View File
@@ -120,32 +120,38 @@
return 1
/mob/living/silicon/robot/update_sight()
if(stat == DEAD || sight_mode & BORGXRAY)
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
if(sight_mode & BORGMESON)
sight |= SEE_TURFS
see_invisible = min(see_invisible, SEE_INVISIBLE_MINIMUM)
see_in_dark = 1
if(sight_mode & BORGXRAY)
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_invisible = SEE_INVISIBLE_LIVING
see_in_dark = 8
if(sight_mode & BORGTHERM)
sight |= SEE_MOBS
sight |= SEE_OBJS
see_invisible = min(see_invisible, SEE_INVISIBLE_LIVING)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else
see_in_dark = 8
if(sight_mode & BORGMESON && sight_mode & BORGTHERM)
sight |= SEE_TURFS
sight |= SEE_MOBS
see_invisible = SEE_INVISIBLE_MINIMUM
else if(sight_mode & BORGMESON)
sight |= SEE_TURFS
see_invisible = SEE_INVISIBLE_MINIMUM
see_in_dark = 1
else if(sight_mode & BORGTHERM)
sight |= SEE_MOBS
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if(stat != DEAD)
sight &= ~SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(see_override)
see_invisible = see_override
if(see_override)
see_invisible = see_override
/mob/living/silicon/robot/handle_hud_icons()
update_items()
@@ -393,9 +393,8 @@
passenger = M
load = M
can_buckle = FALSE
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
// Not sure why this is done
reset_view(src)
return TRUE
return FALSE
@@ -423,9 +422,7 @@
if(ismob(load))
var/mob/M = load
if(M.client)
M.client.perspective = MOB_PERSPECTIVE
M.client.eye = M
M.reset_view(null)
unbuckle_mob()
if(load)
@@ -452,9 +449,7 @@
AM.pixel_y = initial(AM.pixel_y)
if(ismob(AM))
var/mob/M = AM
if(M.client)
M.client.perspective = MOB_PERSPECTIVE
M.client.eye = M
M.reset_view(null)
/mob/living/simple_animal/bot/mulebot/call_bot()
..()
@@ -706,6 +706,22 @@
/mob/living/simple_animal/proc/sentience_act() //Called when a simple animal gains sentience via gold slime potion
return
/mob/living/simple_animal/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
/mob/living/simple_animal/SetEarDamage()
return
+1 -6
View File
@@ -43,12 +43,7 @@
sight |= SEE_SELF
..()
if(loc && !isturf(loc))
client.eye = loc
client.perspective = EYE_PERSPECTIVE
else
client.eye = src
client.perspective = MOB_PERSPECTIVE
reset_view(loc)
if(ckey in deadmins)
+27 -1
View File
@@ -487,6 +487,7 @@ var/list/slot_equipment_priority = list( \
return 0 //Unsupported slot
//END HUMAN
// If you're looking for `reset_perspective`, that's a synonym for this proc.
/mob/proc/reset_view(atom/A)
if(client)
if(istype(A, /atom/movable))
@@ -499,8 +500,33 @@ var/list/slot_equipment_priority = list( \
else
client.perspective = EYE_PERSPECTIVE
client.eye = loc
return
return 1
/mob/living/reset_view(atom/A)
. = ..()
if(.)
// Above check means the mob has a client
update_sight()
if(client.eye != src)
var/atom/AT = client.eye
AT.get_remote_view_fullscreens(src)
else
clear_fullscreen("remote_view", 0)
update_pipe_vision()
/mob/dead/reset_view(atom/A)
if(client)
if(ismob(client.eye) && (client.eye != src))
// Note to self: Use `client.eye` for ghost following in place
// of periodic ghost updates
var/mob/target = client.eye
target.following_mobs -= src
. = ..()
if(.)
// Allows sharing HUDs with ghosts
if(hud_used)
client.screen = list()
hud_used.show_hud(hud_used.hud_version)
/mob/proc/show_inv(mob/user)
user.set_machine(src)
+8 -20
View File
@@ -128,10 +128,7 @@
for(var/mob/V in viewers(usr))
V.show_message("[usr] starts putting [GM.name] into the disposal.", 3)
if(do_after(usr, 20, target = GM))
if(GM.client)
GM.client.perspective = EYE_PERSPECTIVE
GM.client.eye = src
GM.loc = src
GM.forceMove(src)
for(var/mob/C in viewers(src))
C.show_message("\red [GM.name] has been placed in the [src] by [user].", 3)
qdel(G)
@@ -189,10 +186,7 @@
msg_admin_attack("[key_name_admin(user)] placed [key_name_admin(target)] in a disposals unit")
else
return
if(target.client)
target.client.perspective = EYE_PERSPECTIVE
target.client.eye = src
target.loc = src
target.forceMove(src)
for(var/mob/C in viewers(src))
if(C == user)
@@ -215,14 +209,8 @@
// leave the disposal
/obj/machinery/disposal/proc/go_out(mob/user)
if(user.client)
user.client.eye = user.client.mob
user.client.perspective = MOB_PERSPECTIVE
user.loc = src.loc
user.forceMove(loc)
update()
return
// ai as human but can't flush
/obj/machinery/disposal/attack_ai(mob/user as mob)
@@ -488,6 +476,10 @@
if(current_size >= STAGE_FIVE)
qdel(src)
/obj/machinery/disposal/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
// virtual disposal object
// travels through pipes in lieu of actual items
// contents will be items flushed by the disposal
@@ -1355,11 +1347,7 @@
// check if mob has client, if so restore client view on eject
/mob/pipe_eject(var/direction)
if(src.client)
src.client.perspective = MOB_PERSPECTIVE
src.client.eye = src
return
reset_view(null)
/obj/effect/decal/cleanable/blood/gibs/pipe_eject(var/direction)
var/list/dirs
@@ -76,7 +76,7 @@
origin.feed_slime_action.Remove(C)
origin.monkey_recycle_action.Remove(C)
//All of this stuff below could probably be a proc for all advanced cameras, only the action removal needs to be camera specific
remote_eye.user = null
remote_eye.eye_user = null
if(C.client)
C.client.perspective = MOB_PERSPECTIVE
C.client.eye = src
@@ -164,4 +164,4 @@
if(issmall(M) && M.stat)
M.visible_message("[M] vanishes as they are reclaimed for recycling!")
X.monkeys += 0.2
qdel(M)
qdel(M)
+4 -6
View File
@@ -8,6 +8,8 @@
w_class = 1
var/vision_flags = 0
var/dark_view = 0
var/see_invisible = 0
var/list/eye_colour = list(0,0,0)
var/list/old_eye_colour = list(0,0,0)
var/flash_protect = 0
@@ -18,15 +20,11 @@
..()
if(aug_message && !special)
to_chat(owner, "<span class='notice'>[aug_message]</span>")
M.sight |= vision_flags
M.update_sight()
/obj/item/organ/internal/cyberimp/eyes/remove(var/mob/living/carbon/M, var/special = 0)
. = ..()
M.sight ^= vision_flags
/obj/item/organ/internal/cyberimp/eyes/on_life()
..()
owner.sight |= vision_flags
M.update_sight()
/obj/item/organ/internal/cyberimp/eyes/emp_act(severity)
if(!owner)