mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 02:25:06 +01:00
Fixing client eye (#18577)
* signal foundation * reset_perspective implemented * you too * setting mob * no * fix * tweak * remote view element * these too * use element * cleanup more manual code * fix element * mutation signal * handle being dropped from holders, and fix pai hud * handle qdel * it's a component now * ugly holder fix * another fix * follow view target * item remote view * doc update * unneeded * this needs a recode to work better * many fixes * these are all unneeded * almost working viewerlist remotes * this uses component too * this needs to die to it's item * don't allow spamming tgui menus * tg style args * fixing behaviors * fuk * working view release from holders * only final matters * comment order and disposal fix * cryotube loc fix * no mob should reset its view every life tick * major improvements * still forbid z level change even if we allow moving * this too * don't doubledip * qdel on self is unneeded * wipe remote views on logout * vore bellies need to manually clear views * fixAI hud * belly release fixes * cannot use binoculars in a vore belly * pai card can be picked up and dropped correctly * ventcrawl fix and distracted fix * this is better * forcemove * vr console fix * use flag for this * belly stuff * various cleanups * oops * fixes statue spell * unneeded perspective clear * automatic instead * continued cleanup * that was dumb * needed * none of this works * are these even needed * lets lock down to these * lets try to make this work * extremely close to working * needs to solve final pai issues * mob eye change signal * Revert "mob eye change signal" This reverts commiteedd5da934. * significant progress * safety * expected to be not null * likely not needed * don't spam component changes * endview on logout * accessors * egg fixing * Revert "egg fixing" This reverts commit6a54049c69. * getting closer * even closer * needs type * close... * extremely close to working * fixing pai stuff * this too * promising fixes * docs * this is recursive move's responsibility tbh * unneeded now * oops * better decouple * topmost check * cleanup * holder released from egg fix * pai fix for reset view * debug info * some better pai ejection code * better way * unneeded * needs to be null * better vision restore * use correct handling * no longer needed * required * handle decouple on mecha too * name clarity * do not allow double dipping zoom items * ethereal jaunt needs a full cleanup later * fix blackscreen flicker * remove set machine from pda * Update code/game/objects/items.dm * Update code/game/objects/items.dm * Update code/game/objects/items.dm * Update code/game/objects/items.dm --------- Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
@@ -870,6 +870,20 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
holder.particle_test = new /datum/particle_editor(in_atom)
|
||||
holder.particle_test.tgui_interact(mob)
|
||||
|
||||
/client/proc/set_eye(new_eye)
|
||||
if(new_eye == eye)
|
||||
return
|
||||
var/atom/old_eye = eye
|
||||
eye = new_eye
|
||||
SEND_SIGNAL(src, COMSIG_CLIENT_SET_EYE, old_eye, new_eye)
|
||||
|
||||
/mob/proc/is_remote_viewing()
|
||||
if(!client || !client.mob || !client.eye)
|
||||
return FALSE
|
||||
if(isturf(client.mob.loc) && get_turf(client.eye) == get_turf(client.mob))
|
||||
return FALSE
|
||||
return (client.eye != client.mob)
|
||||
|
||||
#undef ADMINSWARNED_AT
|
||||
#undef CURRENT_MINUTE
|
||||
#undef CURRENT_SECOND
|
||||
|
||||
@@ -144,10 +144,7 @@
|
||||
src.add_fingerprint(user)
|
||||
if(do_after(user, 3 SECONDS, target = src) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message(span_danger("[user] stuffs [victim] into the gibber!"))
|
||||
if(victim.client)
|
||||
victim.client.perspective = EYE_PERSPECTIVE
|
||||
victim.client.eye = src
|
||||
victim.loc = src
|
||||
victim.forceMove(src)
|
||||
src.occupant = victim
|
||||
update_icon()
|
||||
|
||||
@@ -167,10 +164,7 @@
|
||||
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.forceMove(get_turf(src))
|
||||
src.occupant = null
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -211,14 +211,12 @@
|
||||
var/obj/item/I = locate(i) in container
|
||||
if (I && I.reagents)
|
||||
I.reagents.trans_to_holder(buffer,I.reagents.total_volume)
|
||||
// Outpost 21 upport start - Handle holders dropping mobs on destruction. No more endless mice burgers
|
||||
if(istype(I,/obj/item/holder))
|
||||
var/obj/item/holder/hol = I
|
||||
if(hol.held_mob?.client)
|
||||
hol.held_mob.ghostize()
|
||||
qdel(hol.held_mob)
|
||||
hol.held_mob = null
|
||||
// Outpost 21 upport end
|
||||
qdel(I)
|
||||
|
||||
//Find fruits
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
ai.camera_visibility(src)
|
||||
|
||||
if(ai.client && !ai.multicam_on)
|
||||
ai.client.eye = src
|
||||
ai.reset_perspective(src)
|
||||
|
||||
if(ai.master_multicam)
|
||||
ai.master_multicam.refresh_view()
|
||||
@@ -58,8 +58,7 @@
|
||||
eyeobj.owner = null
|
||||
qdel(eyeobj) // No AI, no Eye
|
||||
eyeobj = null
|
||||
if(client)
|
||||
client.eye = new_eye
|
||||
reset_perspective(new_eye)
|
||||
|
||||
/mob/living/silicon/ai/proc/create_eyeobj(var/newloc)
|
||||
if(eyeobj)
|
||||
@@ -70,8 +69,7 @@
|
||||
all_eyes += eyeobj
|
||||
eyeobj.owner = src
|
||||
eyeobj.name = "[src.name] (AI Eye)" // Give it a name
|
||||
if(client)
|
||||
client.eye = eyeobj
|
||||
reset_perspective(eyeobj)
|
||||
SetName(src.name)
|
||||
|
||||
/atom/proc/move_camera_by_click()
|
||||
@@ -88,9 +86,9 @@
|
||||
|
||||
if(!src.eyeobj)
|
||||
return
|
||||
if(client.eye)
|
||||
reset_perspective(src)
|
||||
|
||||
if(client && client.eye)
|
||||
client.eye = src
|
||||
for(var/datum/chunk/c in eyeobj.visibleChunks)
|
||||
c.remove(eyeobj)
|
||||
src.eyeobj.setLoc(src)
|
||||
|
||||
@@ -64,9 +64,7 @@
|
||||
if(T != loc)
|
||||
loc = T
|
||||
|
||||
if(owner.client)
|
||||
owner.client.eye = src
|
||||
|
||||
owner.reset_perspective(src)
|
||||
if(owner_follows_eye)
|
||||
visualnet.updateVisibility(owner, 0)
|
||||
owner.loc = loc
|
||||
|
||||
+13
-15
@@ -30,7 +30,6 @@ var/list/holder_mob_icon_cache = list()
|
||||
ASSERT(ismob(held))
|
||||
. = ..()
|
||||
held.forceMove(src)
|
||||
held.reset_view(src)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/mob/living/get_status_tab_items()
|
||||
@@ -68,10 +67,10 @@ var/list/holder_mob_icon_cache = list()
|
||||
. += ""
|
||||
. += "Location: [location]"
|
||||
|
||||
/// Loads the mob into the holder and sets several vis_flags
|
||||
/obj/item/holder/Entered(mob/held, atom/OldLoc)
|
||||
if(held_mob)
|
||||
held.forceMove(get_turf(src))
|
||||
held.reset_view(null)
|
||||
return
|
||||
ASSERT(ismob(held))
|
||||
. = ..()
|
||||
@@ -83,38 +82,39 @@ var/list/holder_mob_icon_cache = list()
|
||||
original_transform = held.transform
|
||||
held.transform = null
|
||||
|
||||
/// Handles restoring the vis flags and scale of the mob, also makes the holder invisible now that it's empty.
|
||||
/obj/item/holder/Exited(atom/movable/thing, atom/OldLoc)
|
||||
if(thing == held_mob)
|
||||
held_mob.transform = original_transform
|
||||
held_mob.update_transform() //VOREStation edit
|
||||
held_mob.update_transform()
|
||||
held_mob.vis_flags = original_vis_flags
|
||||
held_mob = null
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
..()
|
||||
|
||||
/// Dumps the mob if we still hold one, and if we are held by a mob clears us from its inventory.
|
||||
/obj/item/holder/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
if(held_mob)
|
||||
var/mob/cached_mob = held_mob
|
||||
dump_mob()
|
||||
cached_mob.reset_perspective() // This case cannot be handled gracefully, make sure the mob view is cleaned up.
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.drop_from_inventory(src, get_turf(src))
|
||||
return ..()
|
||||
M.drop_from_inventory(src, loc)
|
||||
. = ..()
|
||||
|
||||
/// If the mob somehow leaves the holder, clean us up.
|
||||
/obj/item/holder/process()
|
||||
if(held_mob?.loc != src || isturf(loc))
|
||||
if(held_mob?.loc != src || isturf(loc) || isbelly(loc))
|
||||
qdel(src)
|
||||
|
||||
/// Releases the mob from inside the holder. Calls forceMove() which calls Exited(). Then does cleanup for the client's eye location.
|
||||
/obj/item/holder/proc/dump_mob()
|
||||
if(!held_mob)
|
||||
return
|
||||
if (held_mob.loc == src || isnull(held_mob.loc))
|
||||
held_mob.transform = original_transform
|
||||
held_mob.update_transform()
|
||||
held_mob.vis_flags = original_vis_flags
|
||||
held_mob.reset_view(null)
|
||||
held_mob.forceMove(get_turf(src))
|
||||
held_mob = null
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
held_mob.forceMove(loc)
|
||||
|
||||
/obj/item/holder/throw_at(atom/target, range, speed, thrower)
|
||||
if(held_mob)
|
||||
@@ -146,12 +146,10 @@ var/list/holder_mob_icon_cache = list()
|
||||
holster.clear_holster()
|
||||
to_chat(held, span_warning("You extricate yourself from [holster]."))
|
||||
forceMove(get_turf(src))
|
||||
held.reset_view(null)
|
||||
else if(isitem(loc))
|
||||
var/obj/item/I = loc
|
||||
to_chat(held, span_warning("You struggle free of [loc]."))
|
||||
forceMove(get_turf(src))
|
||||
held.reset_view(null)
|
||||
if(istype(I))
|
||||
I.on_holder_escape(src)
|
||||
|
||||
|
||||
@@ -132,12 +132,8 @@
|
||||
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /atom/movable/screen/fullscreen/impaired, 1)
|
||||
set_fullscreen(eye_blurry, "blurry", /atom/movable/screen/fullscreen/blurry)
|
||||
set_fullscreen(druggy, "high", /atom/movable/screen/fullscreen/high)
|
||||
if(machine)
|
||||
if(machine.check_eye(src) < 0)
|
||||
reset_view(null)
|
||||
else
|
||||
if(client && !client.adminobs)
|
||||
reset_view(null)
|
||||
if(machine && machine.check_eye(src) < 0)
|
||||
reset_perspective()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -207,11 +207,7 @@
|
||||
set_fullscreen(eye_blurry, "blurry", /atom/movable/screen/fullscreen/blurry)
|
||||
set_fullscreen(druggy, "high", /atom/movable/screen/fullscreen/high)
|
||||
|
||||
if (machine)
|
||||
if (!( machine.check_eye(src) ))
|
||||
reset_view(null)
|
||||
else
|
||||
if(client && !client.adminobs)
|
||||
reset_view(null)
|
||||
if (machine && machine.check_eye(src) < 0)
|
||||
reset_perspective()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -890,8 +890,6 @@
|
||||
set category = "Superpower"
|
||||
|
||||
if(stat!=CONSCIOUS)
|
||||
reset_view(0)
|
||||
remoteview_target = null
|
||||
return
|
||||
|
||||
if(!(mMorph in mutations))
|
||||
@@ -964,9 +962,7 @@
|
||||
set name = "Project mind"
|
||||
set category = "Abilities.Superpower"
|
||||
|
||||
if(stat!=CONSCIOUS)
|
||||
reset_view(0)
|
||||
remoteview_target = null
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
if(!(mRemotetalk in src.mutations))
|
||||
@@ -995,17 +991,11 @@
|
||||
set name = "Remote View"
|
||||
set category = "Abilities.Superpower"
|
||||
|
||||
if(stat!=CONSCIOUS)
|
||||
remoteview_target = null
|
||||
reset_view(0)
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
if(!(mRemote in src.mutations))
|
||||
remoteview_target = null
|
||||
reset_view(0)
|
||||
remove_verb(src, /mob/living/carbon/human/proc/remoteobserve)
|
||||
if(client.eye != client.mob)
|
||||
reset_view(0)
|
||||
if(is_remote_viewing())
|
||||
reset_perspective()
|
||||
return
|
||||
|
||||
var/list/mob/creatures = list()
|
||||
@@ -1022,13 +1012,9 @@
|
||||
creatures += h
|
||||
|
||||
var/mob/target = input ("Who do you want to project your mind to?") as mob in creatures
|
||||
|
||||
if (target)
|
||||
remoteview_target = target
|
||||
reset_view(target)
|
||||
else
|
||||
remoteview_target = null
|
||||
reset_view(0)
|
||||
if(target)
|
||||
AddComponent(/datum/component/remote_view/mremote_mutation, target)
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/get_visible_gender(mob/user, force)
|
||||
switch(force)
|
||||
@@ -1572,7 +1558,7 @@
|
||||
return remove_from_mob(W, src.loc)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/reset_view(atom/A, update_hud = 1)
|
||||
/mob/living/carbon/human/reset_perspective(atom/A, update_hud = 1)
|
||||
..()
|
||||
if(update_hud)
|
||||
handle_regular_hud_updates()
|
||||
|
||||
@@ -87,7 +87,6 @@
|
||||
|
||||
var/xylophone = 0 //For the spoooooooky xylophone cooldown
|
||||
|
||||
var/mob/remoteview_target = null
|
||||
var/hand_blood_color
|
||||
|
||||
var/list/flavor_texts = list()
|
||||
|
||||
@@ -367,17 +367,11 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
update_inv_r_hand()
|
||||
|
||||
W.hud_layerise()
|
||||
|
||||
if(W.zoom)
|
||||
W.zoom()
|
||||
|
||||
W.in_inactive_hand(src)
|
||||
|
||||
//VOREStation Addition Start
|
||||
if(istype(W, /obj/item))
|
||||
var/obj/item/I = W
|
||||
I.equip_special()
|
||||
//VOREStation Addition End
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -1663,7 +1663,7 @@
|
||||
if(found_welder)
|
||||
client.screen |= GLOB.global_hud.darkMask
|
||||
|
||||
/mob/living/carbon/human/reset_view(atom/A)
|
||||
/mob/living/carbon/human/reset_perspective(atom/A)
|
||||
..()
|
||||
if(machine_visual && machine_visual != A)
|
||||
machine_visual.remove_visual(src)
|
||||
@@ -1672,13 +1672,6 @@
|
||||
if(stat == DEAD)
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS|SEE_SELF
|
||||
see_in_dark = 8
|
||||
if(client)
|
||||
if(client.view != world.view) // If mob dies while zoomed in with device, unzoom them.
|
||||
for(var/obj/item/item in contents)
|
||||
if(item.zoom)
|
||||
item.zoom()
|
||||
break
|
||||
|
||||
else //We aren't dead
|
||||
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
||||
|
||||
@@ -1720,12 +1713,12 @@
|
||||
|
||||
var/glasses_processed = 0
|
||||
var/obj/item/rig/rig = get_rig()
|
||||
if(istype(rig) && rig.visor && !looking_elsewhere)
|
||||
if(istype(rig) && rig.visor && !is_remote_viewing())
|
||||
if(!rig.helmet || (head && rig.helmet == head))
|
||||
if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses)
|
||||
glasses_processed = process_glasses(rig.visor.vision.glasses)
|
||||
|
||||
if(glasses && !glasses_processed && !looking_elsewhere)
|
||||
if(glasses && !glasses_processed && !is_remote_viewing())
|
||||
glasses_processed = process_glasses(glasses)
|
||||
if(XRAY in mutations)
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
@@ -1754,23 +1747,13 @@
|
||||
if(machine)
|
||||
var/viewflags = machine.check_eye(src)
|
||||
if(viewflags < 0)
|
||||
reset_view(null, 0)
|
||||
else if(viewflags && !looking_elsewhere)
|
||||
reset_perspective()
|
||||
else if(viewflags && !is_remote_viewing())
|
||||
sight |= viewflags
|
||||
else
|
||||
machine.apply_visual(src)
|
||||
else if(eyeobj)
|
||||
if(eyeobj.owner != src)
|
||||
|
||||
reset_view(null)
|
||||
else
|
||||
var/isRemoteObserve = 0
|
||||
if((mRemote in mutations) && remoteview_target)
|
||||
if(remoteview_target.stat==CONSCIOUS)
|
||||
isRemoteObserve = 1
|
||||
if(!isRemoteObserve && client && !client.adminobs)
|
||||
remoteview_target = null
|
||||
reset_view(null, 0)
|
||||
else if(eyeobj && eyeobj.owner != src)
|
||||
reset_perspective()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/process_glasses(var/obj/item/clothing/glasses/G)
|
||||
|
||||
@@ -365,7 +365,6 @@
|
||||
src.drop_from_inventory(S.OurRig)
|
||||
P.forceMove(S.OurRig)
|
||||
S.OurRig.canremove = 1
|
||||
P.reset_view()
|
||||
else //Make one if not
|
||||
to_chat(temporary_form, span_warning("Somehow, your RIG got disconnected from your species. This may have been caused by an admin heal. A new one has been created for you, contact a coder."))
|
||||
new /obj/item/rig/protean(src,src)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
seal_delay = 0
|
||||
var/mob/living/myprotean
|
||||
initial_modules = list(/obj/item/rig_module/protean/syphon, /obj/item/rig_module/protean/armor, /obj/item/rig_module/protean/healing)
|
||||
flags = PHORONGUARD
|
||||
item_flags = NOSTRIP
|
||||
|
||||
helm_type = /obj/item/clothing/head/helmet/space/rig/protean //These are important for sprite pointers
|
||||
|
||||
@@ -1270,8 +1270,6 @@
|
||||
// We just swapped hands, so the thing in our inactive hand will notice it's not the focus
|
||||
var/obj/item/I = get_inactive_hand()
|
||||
if(I)
|
||||
if(I.zoom)
|
||||
I.zoom()
|
||||
I.in_inactive_hand(src) //This'll do specific things, determined by the item
|
||||
return
|
||||
|
||||
|
||||
@@ -72,8 +72,6 @@
|
||||
|
||||
var/makes_dirt = TRUE //FALSE if the mob shouldn't be making dirt on the ground when it walks
|
||||
|
||||
var/looking_elsewhere = FALSE //If the mob's view has been relocated to somewhere else, like via a camera or with binocs
|
||||
|
||||
var/image/selected_image = null // Used for buildmode AI control stuff.
|
||||
|
||||
var/allow_self_surgery = FALSE // Used to determine if the mob can perform surgery on itself.
|
||||
|
||||
@@ -515,7 +515,7 @@ var/list/ai_verbs_default = list(
|
||||
if(.)
|
||||
end_multicam()
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
/mob/living/silicon/ai/reset_perspective(atom/A)
|
||||
if(camera)
|
||||
camera.set_light(0)
|
||||
if(istype(A,/obj/machinery/camera))
|
||||
@@ -526,8 +526,7 @@ var/list/ai_verbs_default = list(
|
||||
if(.)
|
||||
if(!A && isturf(loc) && eyeobj)
|
||||
end_multicam()
|
||||
client.eye = eyeobj
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
reset_perspective(eyeobj)
|
||||
if(istype(A,/obj/machinery/camera))
|
||||
if(camera_light_on) A.set_light(AI_CAMERA_LUMINOSITY)
|
||||
else A.set_light(0)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
if (src.stat != CONSCIOUS)
|
||||
src.cameraFollow = null
|
||||
src.reset_view(null)
|
||||
src.reset_perspective()
|
||||
disconnect_shell("Disconnecting from remote shell due to local system failure.")
|
||||
|
||||
src.updatehealth()
|
||||
|
||||
@@ -2,9 +2,5 @@
|
||||
..()
|
||||
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
|
||||
O.mode = 0
|
||||
if(!isturf(loc))
|
||||
if (client)
|
||||
client.eye = loc
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
src.view_core()
|
||||
return
|
||||
|
||||
@@ -246,7 +246,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room)
|
||||
to_chat(src, span_notice("Multiple-camera viewing mode activated."))
|
||||
|
||||
/mob/living/silicon/ai/proc/refresh_multicam()
|
||||
reset_view(GLOB.ai_camera_room_landmark)
|
||||
reset_perspective(GLOB.ai_camera_room_landmark)
|
||||
if(client)
|
||||
for(var/atom/movable/screen/movable/pic_in_pic/P as anything in multicam_screens)
|
||||
P.show_to(client)
|
||||
@@ -259,7 +259,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room)
|
||||
if(client)
|
||||
for(var/atom/movable/screen/movable/pic_in_pic/P as anything in multicam_screens)
|
||||
P.unshow_to(client)
|
||||
reset_view()
|
||||
reset_perspective(src)
|
||||
to_chat(src, span_notice("Multiple-camera viewing mode deactivated."))
|
||||
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
/mob/living/silicon/pai/proc/switchCamera(var/obj/machinery/camera/C)
|
||||
if (!C)
|
||||
src.unset_machine()
|
||||
src.reset_view(null)
|
||||
src.reset_perspective()
|
||||
return 0
|
||||
if (stat == 2 || !C.status || !(src.network in C.network)) return 0
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
src.set_machine(src)
|
||||
src.current = C
|
||||
src.reset_view(C)
|
||||
src.AddComponent(/datum/component/remote_view, C)
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/pai/verb/reset_record_view()
|
||||
@@ -204,7 +204,7 @@
|
||||
/mob/living/silicon/pai/cancel_camera()
|
||||
set category = "Abilities.pAI Commands"
|
||||
set name = "Cancel Camera View"
|
||||
src.reset_view(null)
|
||||
src.reset_perspective()
|
||||
src.unset_machine()
|
||||
src.cameraFollow = null
|
||||
|
||||
@@ -219,7 +219,25 @@
|
||||
if(stat || sleeping || paralysis || weakened)
|
||||
return
|
||||
|
||||
if(src.loc != card)
|
||||
if(loc != card)
|
||||
return
|
||||
|
||||
// Lets not trap the pai forever. These are special cases we want to escape out of when in our card
|
||||
if(istype(loc.loc, /obj/item/pda))
|
||||
var/obj/item/pda/ourpda = loc.loc
|
||||
if(ourpda.pai == card)
|
||||
ourpda.pai.forceMove(ourpda.loc)
|
||||
ourpda.pai = null
|
||||
visible_message(span_warning("\The [card] ejects itself from \the [ourpda]."))
|
||||
return
|
||||
if(istype(loc.loc, /obj/item/storage/vore_egg))
|
||||
var/obj/item/storage/vore_egg/ouregg = loc.loc
|
||||
to_chat(src, span_notice("You craftily use your built in rumble function to break free of \the [ouregg]'s confines!"))
|
||||
ouregg.hatch(src)
|
||||
return
|
||||
|
||||
if(is_folding_unsafe(loc.loc))
|
||||
to_chat(src, span_danger("It's not safe to unfold while inside a [loc.loc]!"))
|
||||
return
|
||||
|
||||
if(card.projector != PP_FUNCTIONAL && card.emitter != PP_FUNCTIONAL)
|
||||
@@ -256,16 +274,15 @@
|
||||
var/obj/item/pda/holder = card.loc
|
||||
holder.pai = null
|
||||
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
src.client.eye = src
|
||||
src.forceMove(get_turf(card))
|
||||
|
||||
src.forceMove(card.loc)
|
||||
card.forceMove(src)
|
||||
card.screen_loc = null
|
||||
canmove = TRUE
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T)) T.visible_message(span_filter_notice(span_bold("[src]") + " folds outwards, expanding into a mobile form."))
|
||||
if(isturf(loc))
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T)) T.visible_message(span_filter_notice(span_bold("[src]") + " folds outwards, expanding into a mobile form."))
|
||||
|
||||
add_verb(src, /mob/living/silicon/pai/proc/pai_nom)
|
||||
add_verb(src, /mob/living/proc/vertical_nom)
|
||||
update_icon()
|
||||
@@ -380,7 +397,12 @@
|
||||
|
||||
last_special = world.time + 100
|
||||
|
||||
if(src.loc == card)
|
||||
if(loc == card)
|
||||
return
|
||||
|
||||
// some snowflake locations where we really shouldn't fold up...
|
||||
if(is_folding_unsafe(loc))
|
||||
to_chat(src, span_danger("It's not safe to fold up while inside a [loc]!"))
|
||||
return
|
||||
|
||||
release_vore_contents(FALSE) //VOREStation Add
|
||||
@@ -388,40 +410,35 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T) && !silent) T.visible_message(span_filter_notice(span_bold("[src]") + " neatly folds inwards, compacting down to a rectangular card."))
|
||||
|
||||
if(client)
|
||||
src.stop_pulling()
|
||||
src.client.perspective = EYE_PERSPECTIVE
|
||||
src.client.eye = card
|
||||
stop_pulling()
|
||||
|
||||
//stop resting
|
||||
resting = 0
|
||||
|
||||
// If we are being held, handle removing our holder from their inv.
|
||||
var/obj/item/holder/H = loc
|
||||
if(istype(H))
|
||||
var/mob/living/M = H.loc
|
||||
var/obj/item/holder/our_holder = loc
|
||||
if(istype(our_holder))
|
||||
var/turf/drop_turf = get_turf(our_holder)
|
||||
var/mob/living/M = our_holder.loc
|
||||
if(istype(M))
|
||||
M.drop_from_inventory(H)
|
||||
H.loc = get_turf(src)
|
||||
src.loc = get_turf(H)
|
||||
M.drop_from_inventory(our_holder)
|
||||
src.forceMove(card)
|
||||
card.forceMove(drop_turf)
|
||||
|
||||
if(isbelly(loc)) //If in tumby, when fold up, card go into tumby
|
||||
var/obj/belly/B = loc
|
||||
src.forceMove(card)
|
||||
card.forceMove(B)
|
||||
|
||||
if(istype( src.loc,/obj/structure/disposalholder))
|
||||
if(istype(loc,/obj/structure/disposalholder))
|
||||
var/obj/structure/disposalholder/hold = loc
|
||||
src.loc = card
|
||||
card.loc = hold
|
||||
src.forceMove(card)
|
||||
card.forceMove(hold)
|
||||
|
||||
else //Otherwise go on floor
|
||||
src.loc = card
|
||||
card.loc = get_turf(card)
|
||||
card.forceMove(get_turf(src))
|
||||
src.forceMove(card)
|
||||
card.forceMove(card.loc)
|
||||
|
||||
canmove = 1
|
||||
resting = 0
|
||||
icon_state = "[chassis]"
|
||||
@@ -430,6 +447,9 @@
|
||||
remove_verb(src, /mob/living/silicon/pai/proc/pai_nom)
|
||||
remove_verb(src, /mob/living/proc/vertical_nom)
|
||||
|
||||
/mob/living/silicon/pai/proc/is_folding_unsafe(check_location)
|
||||
return isbelly(check_location) || istype(check_location, /obj/machinery) || istype(check_location, /obj/item/storage/vore_egg || istype(check_location, /obj/item/pda))
|
||||
|
||||
// No binary for pAIs.
|
||||
/mob/living/silicon/pai/binarycheck()
|
||||
return 0
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon = 'icons/mob/pai_hud.dmi'
|
||||
var/base_state
|
||||
|
||||
/atom/movable/pai/Click(location, control, params)
|
||||
/atom/movable/screen/pai/Click(location, control, params)
|
||||
. = ..()
|
||||
if(!ispAI(usr))
|
||||
return
|
||||
|
||||
@@ -105,7 +105,6 @@
|
||||
user.visible_message(span_warning("[hound.name] is ingesting [trashmouse] into their [src.name]."), span_notice("You start ingesting [trashmouse] into your [src.name]..."))
|
||||
if(do_after(user, 3 SECONDS, target = trashmouse) && length(contents) < max_item_count)
|
||||
trashmouse.forceMove(src)
|
||||
trashmouse.reset_view(src)
|
||||
user.visible_message(span_warning("[hound.name]'s [src.name] groans lightly as [trashmouse] slips inside."), span_notice("Your [src.name] groans lightly as [trashmouse] slips inside."))
|
||||
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
|
||||
if(delivery)
|
||||
@@ -125,7 +124,6 @@
|
||||
user.visible_message(span_warning("[hound.name] is ingesting [trashman] into their [src.name]."), span_notice("You start ingesting [trashman] into your [src.name]..."))
|
||||
if(do_after(user, 3 SECONDS, target = trashman) && !patient && !trashman.buckled && length(contents) < max_item_count)
|
||||
trashman.forceMove(src)
|
||||
trashman.reset_view(src)
|
||||
START_PROCESSING(SSobj, src)
|
||||
user.visible_message(span_warning("[hound.name]'s [src.name] groans lightly as [trashman] slips inside."), span_notice("Your [src.name] groans lightly as [trashman] slips inside."))
|
||||
log_attack("[key_name(hound)] has eaten [key_name(patient)] with a cyborg belly. ([hound ? "<a href='byond://?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[hound.x];Y=[hound.y];Z=[hound.z]'>JMP</a>" : "null"])")
|
||||
@@ -155,7 +153,6 @@
|
||||
return //If you try to eat two people at once, you can only eat one.
|
||||
else //If you don't have someone in you, proceed.
|
||||
H.forceMove(src)
|
||||
H.reset_view(src)
|
||||
update_patient()
|
||||
START_PROCESSING(SSobj, src)
|
||||
user.visible_message(span_warning("[hound.name]'s [src.name] lights up as [H.name] slips inside."), span_notice("Your [src] lights up as [H] slips inside. Life support functions engaged."))
|
||||
@@ -206,7 +203,6 @@
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/person = C
|
||||
person.forceMove(get_turf(src))
|
||||
person.reset_view()
|
||||
else
|
||||
var/obj/T = C
|
||||
T.loc = hound.loc
|
||||
@@ -416,7 +412,6 @@
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/person = C
|
||||
person.forceMove(get_turf(src))
|
||||
person.reset_view()
|
||||
else
|
||||
var/obj/T = C
|
||||
T.loc = hound.loc
|
||||
|
||||
@@ -292,12 +292,8 @@
|
||||
set_fullscreen(eye_blurry, "blurry", /atom/movable/screen/fullscreen/blurry)
|
||||
set_fullscreen(druggy, "high", /atom/movable/screen/fullscreen/high)
|
||||
|
||||
if (machine)
|
||||
if (machine.check_eye(src) < 0)
|
||||
reset_view(null)
|
||||
else
|
||||
if(client && !client.adminobs)
|
||||
reset_view(null)
|
||||
if (machine && machine.check_eye(src) < 0)
|
||||
reset_perspective()
|
||||
|
||||
if(emagged)
|
||||
throw_alert("hacked", /atom/movable/screen/alert/hacked)
|
||||
|
||||
@@ -394,7 +394,7 @@
|
||||
/mob/living/silicon/setEarDamage()
|
||||
return
|
||||
|
||||
/mob/living/silicon/reset_view()
|
||||
/mob/living/silicon/reset_perspective(atom/new_eye)
|
||||
. = ..()
|
||||
if(cameraFollow)
|
||||
cameraFollow = null
|
||||
|
||||
@@ -171,7 +171,6 @@
|
||||
|
||||
forceMove(get_turf(host))
|
||||
|
||||
reset_view(null)
|
||||
machine = null
|
||||
|
||||
if(ishuman(host))
|
||||
@@ -180,7 +179,6 @@
|
||||
if(head)
|
||||
head.implants -= src
|
||||
|
||||
host.reset_view(null)
|
||||
host.machine = null
|
||||
host = null
|
||||
|
||||
|
||||
@@ -331,8 +331,6 @@
|
||||
|
||||
forceMove(get_turf(host))
|
||||
|
||||
reset_view(null)
|
||||
|
||||
host = null
|
||||
|
||||
/mob/living/simple_mob/animal/sif/leech/verb/inject_victim()
|
||||
|
||||
@@ -46,12 +46,9 @@
|
||||
..()
|
||||
SEND_SIGNAL(src, COMSIG_MOB_LOGIN)
|
||||
|
||||
if(loc && !isturf(loc))
|
||||
client.eye = loc
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
else
|
||||
client.eye = src
|
||||
if(!restore_remote_views())
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
client.set_eye(src)
|
||||
add_click_catcher()
|
||||
update_client_color()
|
||||
|
||||
|
||||
+67
-17
@@ -244,19 +244,69 @@
|
||||
/mob/proc/restrained()
|
||||
return
|
||||
|
||||
/mob/proc/reset_view(atom/A)
|
||||
if (client)
|
||||
if (istype(A, /atom/movable))
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
client.eye = A
|
||||
else
|
||||
if (isturf(loc))
|
||||
client.eye = client.mob
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
else
|
||||
/**
|
||||
* Reset the attached clients perspective (viewpoint)
|
||||
*
|
||||
* reset_perspective() set eye to common default : mob on turf, loc otherwise. If the client mob is inside an object with REMOTEVIEW_ON_ENTER, it will restart that object's remote view.
|
||||
* reset_perspective(thing) set the eye to the thing (if it's equal to current default reset to mob perspective). This ignores REMOTEVIEW_ON_ENTER, and forces focus to the mob.
|
||||
*/
|
||||
/mob/proc/reset_perspective(atom/new_eye)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(!client)
|
||||
return
|
||||
|
||||
if(new_eye)
|
||||
if(ismovable(new_eye))
|
||||
//Set the new eye unless it's us
|
||||
if(new_eye != src)
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
client.eye = loc
|
||||
client.set_eye(new_eye)
|
||||
else
|
||||
client.set_eye(client.mob)
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
else if(isturf(new_eye))
|
||||
//Set to the turf unless it's our current turf
|
||||
if(new_eye != loc)
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
client.set_eye(new_eye)
|
||||
else
|
||||
client.set_eye(client.mob)
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
else
|
||||
return TRUE //no setting eye to stupid things like areas or whatever
|
||||
else
|
||||
//If we return focus to our own mob, but we are still inside something with an inherent remote view. Restart it.
|
||||
if(restore_remote_views())
|
||||
return TRUE
|
||||
//Reset to common defaults: mob if on turf, otherwise current loc
|
||||
if(isturf(loc))
|
||||
client.set_eye(client.mob)
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
else
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
client.set_eye(loc)
|
||||
/// Signal sent after the eye has been successfully updated, with the client existing.
|
||||
SEND_SIGNAL(src, COMSIG_MOB_RESET_PERSPECTIVE)
|
||||
return TRUE
|
||||
|
||||
/// Reapplies remote views based on object type and flags. Returns true if the view was assigned.
|
||||
/mob/proc/restore_remote_views()
|
||||
if(!loc) // Nullspace during respawn
|
||||
return FALSE
|
||||
if(isturf(loc)) // Cannot be remote if it was a turf, also obj and turf flags overlap so stepping into space triggers remoteview endlessly.
|
||||
return FALSE
|
||||
// Check if we actually need to drop our current remote view component, as this is expensive to do, and leads to more difficult to understand error prone logic
|
||||
var/datum/component/remote_view/remote_comp = GetComponent(/datum/component/remote_view)
|
||||
if(remote_comp?.looking_at_target_already(loc))
|
||||
return FALSE
|
||||
if(isitem(loc) || isbelly(loc)) // Requires more careful handling than structures because they are held by mobs
|
||||
AddComponent(/datum/component/remote_view/mob_holding_item, loc)
|
||||
return TRUE
|
||||
if(loc.flags & REMOTEVIEW_ON_ENTER) // Handle atoms that begin a remote view upon entering them.
|
||||
AddComponent(/datum/component/remote_view, loc)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/proc/ret_grab(list/L, flag)
|
||||
return
|
||||
@@ -509,17 +559,17 @@
|
||||
var/mob/mob_eye = targets[eye_name]
|
||||
|
||||
if(client && mob_eye)
|
||||
client.eye = mob_eye
|
||||
if (is_admin)
|
||||
client.adminobs = 1
|
||||
if(mob_eye == client.mob || client.eye == client.mob)
|
||||
client.adminobs = 0
|
||||
AddComponent(/datum/component/remote_view, focused_on = mob_eye)
|
||||
if(is_admin)
|
||||
client.adminobs = TRUE
|
||||
if(mob_eye == client.mob || !is_remote_viewing())
|
||||
client.adminobs = FALSE
|
||||
|
||||
/mob/verb/cancel_camera()
|
||||
set name = "Cancel Camera View"
|
||||
set category = "OOC.Game"
|
||||
unset_machine()
|
||||
reset_view(null)
|
||||
reset_perspective()
|
||||
|
||||
/mob/Topic(href, href_list)
|
||||
if(href_list["mach_close"])
|
||||
|
||||
@@ -205,13 +205,6 @@
|
||||
if(L.is_incorporeal())//Move though walls
|
||||
Process_Incorpmove(direct)
|
||||
return
|
||||
/* TODO observer unzoom
|
||||
if(view != world.view) // If mob moves while zoomed in with device, unzoom them.
|
||||
for(var/obj/item/item in mob.contents)
|
||||
if(item.zoom)
|
||||
item.zoom()
|
||||
break
|
||||
*/
|
||||
|
||||
if(Process_Grab())
|
||||
return
|
||||
|
||||
@@ -582,6 +582,8 @@
|
||||
adjustBruteLoss(rand(damage_min, damage_max))
|
||||
Weaken(4)
|
||||
updatehealth()
|
||||
// There is really no situation where smacking into a floor and possibly dying horribly would NOT result in you dropping your remote view... It's also safer then assuming they should persist.
|
||||
reset_perspective()
|
||||
|
||||
/mob/living/carbon/human/fall_impact(atom/hit_atom, damage_min, damage_max, silent, planetary)
|
||||
if(!species?.handle_falling(src, hit_atom, damage_min, damage_max, silent, planetary))
|
||||
|
||||
@@ -104,9 +104,9 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
|
||||
/obj/machinery/computer/ship/helm/tgui_close(mob/user)
|
||||
. = ..()
|
||||
|
||||
// Unregister map objects
|
||||
user.client?.clear_map(linked?.map_name)
|
||||
user.reset_perspective()
|
||||
|
||||
/obj/machinery/computer/ship/helm/tgui_data(mob/user)
|
||||
var/list/data = ..()
|
||||
@@ -268,7 +268,11 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
. = TRUE
|
||||
|
||||
if("manual")
|
||||
viewing_overmap(ui.user) ? unlook(ui.user) : look(ui.user)
|
||||
if(!viewing_overmap(ui.user) && linked)
|
||||
if(!viewers) viewers = list() // List must exist for pass by reference to work
|
||||
start_coordinated_remoteview(ui.user, linked, viewers)
|
||||
else
|
||||
ui.user.reset_perspective()
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
@@ -89,7 +89,11 @@
|
||||
switch(action)
|
||||
if("viewing")
|
||||
if(ui.user && !isAI(ui.user))
|
||||
viewing_overmap(ui.user) ? unlook(ui.user) : look(ui.user)
|
||||
if(!viewing_overmap(ui.user) && linked)
|
||||
if(!viewers) viewers = list() // List must exist for pass by reference to work
|
||||
start_coordinated_remoteview(ui.user, linked, viewers)
|
||||
else
|
||||
ui.user.reset_perspective()
|
||||
. = TRUE
|
||||
|
||||
if("link")
|
||||
|
||||
@@ -35,7 +35,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
/obj/machinery/computer/ship/proc/display_reconnect_dialog(var/mob/user, var/flavor)
|
||||
var/datum/browser/popup = new (user, "[src]", "[src]")
|
||||
if(viewing_overmap(user))
|
||||
unlook(user, TRUE)
|
||||
user.reset_perspective()
|
||||
popup.set_content("<center>" + span_bold(span_red("Error")) + "<br>Unable to connect to [flavor].<br><a href='byond://?src=\ref[src];sync=1'>Reconnect</a></center>")
|
||||
popup.open()
|
||||
|
||||
@@ -60,73 +60,45 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
sync_linked(ui.user)
|
||||
return TRUE
|
||||
if("close")
|
||||
unlook(ui.user)
|
||||
ui.user.unset_machine()
|
||||
ui.user.reset_perspective()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// 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)
|
||||
if(!linked)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/ship/look(var/mob/user)
|
||||
apply_visual(user)
|
||||
user.reset_view(linked)
|
||||
if(linked.real_appearance)
|
||||
user.client?.images += linked.real_appearance
|
||||
user.set_machine(src)
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
L.looking_elsewhere = 1
|
||||
L.handle_vision()
|
||||
user.set_viewsize(world.view + extra_view)
|
||||
user.AddComponent(/datum/component/recursive_move)
|
||||
RegisterSignal(user, COMSIG_OBSERVER_MOVED, /obj/machinery/computer/ship/proc/unlook)
|
||||
// TODO GLOB.stat_set_event.register(user, src, /obj/machinery/computer/ship/proc/unlook)
|
||||
LAZYDISTINCTADD(viewers, WEAKREF(user))
|
||||
|
||||
/obj/machinery/computer/ship/proc/unlook(var/mob/user, forced)
|
||||
SIGNAL_HANDLER
|
||||
if(!linked && !forced) //If we have no linked computer, return early. Forcing is for when we do a one-time action that we want to clear the UI.
|
||||
return
|
||||
user.reset_view()
|
||||
/obj/machinery/computer/ship/unlook(var/mob/user)
|
||||
user.unset_machine()
|
||||
if(linked && linked.real_appearance && user.client)
|
||||
user.client.images -= linked.real_appearance
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
L.looking_elsewhere = 0
|
||||
L.handle_vision()
|
||||
user.set_viewsize() // reset to default
|
||||
UnregisterSignal(user, COMSIG_OBSERVER_MOVED)
|
||||
// TODO GLOB.stat_set_event.unregister(user, src, /obj/machinery/computer/ship/proc/unlook)
|
||||
LAZYREMOVE(viewers, WEAKREF(user))
|
||||
|
||||
/obj/machinery/computer/ship/proc/viewing_overmap(mob/user)
|
||||
return (WEAKREF(user) in viewers)
|
||||
|
||||
/obj/machinery/computer/ship/tgui_status(mob/user)
|
||||
. = ..()
|
||||
if(viewing_overmap(user) && (user.machine != src))
|
||||
unlook(user, TRUE)
|
||||
|
||||
/obj/machinery/computer/ship/tgui_close(mob/user)
|
||||
. = ..()
|
||||
user.unset_machine()
|
||||
unlook(user, TRUE)
|
||||
user.reset_perspective()
|
||||
|
||||
/obj/machinery/computer/ship/check_eye(var/mob/user)
|
||||
if(!get_dist(user, src) > 1 || user.blinded || !linked)
|
||||
unlook(user)
|
||||
user.reset_perspective()
|
||||
return -1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/ship/sensors/Destroy()
|
||||
sensors = null
|
||||
if(LAZYLEN(viewers))
|
||||
for(var/datum/weakref/W in viewers)
|
||||
var/M = W.resolve()
|
||||
if(M)
|
||||
unlook(M, TRUE)
|
||||
. = ..()
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
if(2) // Eject pAI device
|
||||
var/turf/T = get_turf_or_move(pda.loc)
|
||||
if(T)
|
||||
pda.pai.loc = T
|
||||
pda.pai.forceMove(T)
|
||||
pda.pai = null
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -184,8 +184,6 @@
|
||||
SStgui.close_uis(src)
|
||||
|
||||
/obj/item/pda/attack_self(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
|
||||
if(active_uplink_check(user))
|
||||
return
|
||||
|
||||
@@ -438,8 +436,7 @@
|
||||
return //Return in case of failed check or when successful.
|
||||
updateSelfDialog()//For the non-input related code.
|
||||
else if(istype(C, /obj/item/paicard) && !src.pai)
|
||||
user.drop_item()
|
||||
C.loc = src
|
||||
user.drop_item(src)
|
||||
pai = C
|
||||
to_chat(user, span_notice("You slot \the [C] into \the [src]."))
|
||||
SStgui.update_uis(src) // update all UIs attached to src
|
||||
@@ -448,8 +445,7 @@
|
||||
if(O)
|
||||
to_chat(user, span_notice("There is already a pen in \the [src]."))
|
||||
else
|
||||
user.drop_item()
|
||||
C.loc = src
|
||||
user.drop_item(src)
|
||||
to_chat(user, span_notice("You slot \the [C] into \the [src]."))
|
||||
add_overlay("pda-pen")
|
||||
return
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(ui.user)
|
||||
ui.user.set_machine(src)
|
||||
|
||||
if(!touch_silent)
|
||||
playsound(src, 'sound/machines/pda_click.ogg', 20)
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
projectile_type = /obj/item/projectile/bullet/rifle/a145
|
||||
accuracy = -75
|
||||
scoped_accuracy = 75
|
||||
ignore_visor_zoom_restriction = TRUE // Ignore the restriction on vision modifiers when using this gun's scope.
|
||||
one_handed_penalty = 90
|
||||
var/bolt_open = 0
|
||||
|
||||
|
||||
@@ -447,10 +447,7 @@
|
||||
|
||||
// check if mob has client, if so restore client view on eject
|
||||
/mob/pipe_eject(var/direction)
|
||||
if (client)
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
client.eye = src
|
||||
return
|
||||
reset_perspective()
|
||||
|
||||
/obj/effect/decal/cleanable/blood/gibs/pipe_eject(direction)
|
||||
var/list/dirs
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
var/destinationTag = "" // changes if contains a delivery container
|
||||
var/hasmob = FALSE //If it contains a mob
|
||||
var/partialTag = "" //set by a partial tagger the first time round, then put in destinationTag if it goes through again.
|
||||
flags = REMOTEVIEW_ON_ENTER
|
||||
dir = 0
|
||||
|
||||
// initialize a holder from the contents of a disposal unit
|
||||
@@ -22,9 +23,6 @@
|
||||
for(var/mob/living/M in flush_list)
|
||||
if(M.stat != DEAD && !istype(M,/mob/living/silicon/robot/drone))
|
||||
hasmob = TRUE
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
|
||||
//Checks 1 contents level deep. This means that players can be sent through disposals...
|
||||
//...but it should require a second person to open the package. (i.e. person inside a wrapped locker)
|
||||
@@ -102,10 +100,6 @@
|
||||
/obj/structure/disposalholder/proc/merge(obj/structure/disposalholder/other)
|
||||
for(var/atom/movable/AM in other)
|
||||
AM.forceMove(src) // move everything in other holder to this one
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.client) // if a client mob, update eye to follow this holder
|
||||
M.client.eye = src
|
||||
qdel(other)
|
||||
|
||||
/obj/structure/disposalholder/proc/settag(new_tag)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
active_power_usage = 2200 //the pneumatic pump power. 3 HP ~ 2200W
|
||||
idle_power_usage = 100
|
||||
var/stat_tracking = TRUE
|
||||
flags = REMOTEVIEW_ON_ENTER
|
||||
|
||||
// create a new disposal
|
||||
// find the attached trunk (if present) and init gas resvr.
|
||||
@@ -120,9 +121,6 @@
|
||||
for (var/mob/V in viewers(user))
|
||||
V.show_message("[user] starts putting [GM.name] into the disposal.", 3)
|
||||
if(do_after(user, 2 SECONDS, target = src))
|
||||
if (GM.client)
|
||||
GM.client.perspective = EYE_PERSPECTIVE
|
||||
GM.client.eye = src
|
||||
GM.forceMove(src)
|
||||
for (var/mob/C in viewers(src))
|
||||
C.show_message(span_red("[GM.name] has been placed in the [src] by [user]."), 3)
|
||||
@@ -187,9 +185,6 @@
|
||||
add_attack_logs(user,target,"Disposals dunked")
|
||||
else
|
||||
return
|
||||
if (target.client)
|
||||
target.client.perspective = EYE_PERSPECTIVE
|
||||
target.client.eye = src
|
||||
|
||||
target.forceMove(src)
|
||||
|
||||
@@ -211,9 +206,6 @@
|
||||
|
||||
// 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.forceMove(get_turf(src))
|
||||
update()
|
||||
return
|
||||
|
||||
@@ -513,9 +513,6 @@
|
||||
var/mob/living/carbon/human/occupant = get_occupant()
|
||||
if(!occupant)
|
||||
return
|
||||
if (occupant.client)
|
||||
occupant.client.eye = occupant.client.mob
|
||||
occupant.client.perspective = MOB_PERSPECTIVE
|
||||
occupant.forceMove(get_turf(src))
|
||||
set_occupant(null)
|
||||
icon_state = "implantchair"
|
||||
@@ -528,11 +525,8 @@
|
||||
if(get_occupant())
|
||||
to_chat(usr, span_warning("\The [src] is already occupied!"))
|
||||
return
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.stop_pulling()
|
||||
M.loc = src
|
||||
M.forceMove(src)
|
||||
set_occupant(M)
|
||||
src.add_fingerprint(usr)
|
||||
icon_state = "implantchair_on"
|
||||
|
||||
@@ -382,7 +382,7 @@
|
||||
/obj/item/spellbook/oneuse/forcewall/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, span_warning("You suddenly feel very solid!"))
|
||||
var/obj/structure/closet/statue/S = new /obj/structure/closet/statue(user.loc, user)
|
||||
var/obj/structure/closet/statue/S = new /obj/structure/closet/statue(get_turf(user), user)
|
||||
S.timer = 30
|
||||
user.drop_item()
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
if(target.forceMove(T))
|
||||
break
|
||||
target.canmove = 1
|
||||
target.client.eye = target
|
||||
target.reset_perspective() // Fixes a blackscreen
|
||||
qdel(animation)
|
||||
qdel(holder)
|
||||
|
||||
|
||||
@@ -73,19 +73,18 @@
|
||||
if(current_uav.check_eye(ui.user) < 0)
|
||||
to_chat(ui.user,span_warning("The screen freezes for a moment, before returning to the UAV selection menu. It's not able to connect to that UAV."))
|
||||
else
|
||||
viewing_uav(ui.user) ? unlook(ui.user) : look(ui.user)
|
||||
if(!viewing_uav(ui.user))
|
||||
if(!viewers) viewers = list() // List must exist for pass by reference to work
|
||||
start_coordinated_remoteview(ui.user, current_uav, viewers)
|
||||
else
|
||||
ui.user.reset_perspective()
|
||||
return TRUE
|
||||
|
||||
if("power_uav")
|
||||
if(!current_uav)
|
||||
return FALSE
|
||||
else if(current_uav.toggle_power())
|
||||
//Clean up viewers faster
|
||||
if(LAZYLEN(viewers))
|
||||
for(var/datum/weakref/W in viewers)
|
||||
var/M = W.resolve()
|
||||
if(M)
|
||||
unlook(M)
|
||||
SEND_SIGNAL(src,COMSIG_REMOTE_VIEW_CLEAR)
|
||||
return TRUE
|
||||
|
||||
/datum/tgui_module/uav/proc/set_current(var/obj/item/uav/U)
|
||||
@@ -95,12 +94,7 @@
|
||||
signal_strength = 0
|
||||
current_uav = U
|
||||
RegisterSignal(U, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(current_uav_changed_z))
|
||||
|
||||
if(LAZYLEN(viewers))
|
||||
for(var/datum/weakref/W in viewers)
|
||||
var/M = W.resolve()
|
||||
if(M)
|
||||
look(M)
|
||||
SEND_SIGNAL(src,COMSIG_REMOTE_VIEW_CLEAR)
|
||||
|
||||
/datum/tgui_module/uav/proc/clear_current()
|
||||
if(!current_uav)
|
||||
@@ -109,13 +103,7 @@
|
||||
UnregisterSignal(current_uav, COMSIG_MOVABLE_Z_CHANGED)
|
||||
signal_strength = 0
|
||||
current_uav = null
|
||||
|
||||
if(LAZYLEN(viewers))
|
||||
for(var/datum/weakref/W in viewers)
|
||||
var/M = W.resolve()
|
||||
if(M)
|
||||
to_chat(M, span_warning("You're disconnected from the UAV's camera!"))
|
||||
unlook(M)
|
||||
SEND_SIGNAL(src,COMSIG_REMOTE_VIEW_CLEAR)
|
||||
|
||||
/datum/tgui_module/uav/proc/current_uav_changed_z(old_z, new_z)
|
||||
SIGNAL_HANDLER
|
||||
@@ -170,31 +158,16 @@
|
||||
else
|
||||
return max(our_signal, their_signal)
|
||||
|
||||
/* All handling viewers */
|
||||
/datum/tgui_module/uav/Destroy()
|
||||
if(LAZYLEN(viewers))
|
||||
for(var/datum/weakref/W in viewers)
|
||||
var/M = W.resolve()
|
||||
if(M)
|
||||
unlook(M)
|
||||
. = ..()
|
||||
|
||||
/datum/tgui_module/uav/tgui_status(mob/user)
|
||||
. = ..()
|
||||
if(. > STATUS_DISABLED)
|
||||
if(viewing_uav(user))
|
||||
look(user)
|
||||
return
|
||||
unlook(user)
|
||||
|
||||
/datum/tgui_module/uav/tgui_close(mob/user)
|
||||
. = ..()
|
||||
unlook(user)
|
||||
user.reset_perspective()
|
||||
|
||||
/datum/tgui_module/uav/proc/viewing_uav(mob/user)
|
||||
return (WEAKREF(user) in viewers)
|
||||
|
||||
/datum/tgui_module/uav/proc/look(mob/user)
|
||||
/datum/tgui_module/uav/look(mob/user)
|
||||
if(issilicon(user)) //Too complicated for me to want to mess with at the moment
|
||||
to_chat(user, span_warning("Regulations prevent you from controlling several corporeal forms at the same time!"))
|
||||
return
|
||||
@@ -204,25 +177,27 @@
|
||||
|
||||
if(user.machine != tgui_host())
|
||||
user.set_machine(tgui_host())
|
||||
user.reset_view(current_uav)
|
||||
current_uav.add_master(user)
|
||||
LAZYDISTINCTADD(viewers, WEAKREF(user))
|
||||
|
||||
/datum/tgui_module/uav/proc/unlook(mob/user)
|
||||
/datum/tgui_module/uav/unlook(mob/user)
|
||||
user.unset_machine()
|
||||
user.reset_view()
|
||||
if(current_uav)
|
||||
current_uav.remove_master(user)
|
||||
LAZYREMOVE(viewers, WEAKREF(user))
|
||||
|
||||
/datum/tgui_module/uav/tgui_close(mob/user)
|
||||
. = ..()
|
||||
user.reset_perspective()
|
||||
|
||||
/datum/tgui_module/uav/check_eye(mob/user)
|
||||
if(get_dist(user, tgui_host()) > 1 || user.blinded || !current_uav)
|
||||
unlook(user)
|
||||
user.reset_perspective()
|
||||
return -1
|
||||
|
||||
var/viewflag = current_uav.check_eye(user)
|
||||
if(viewflag < 0) //camera doesn't work
|
||||
unlook(user)
|
||||
user.reset_perspective()
|
||||
return -1
|
||||
|
||||
return viewflag
|
||||
|
||||
@@ -10,14 +10,6 @@
|
||||
if(linked)
|
||||
name = "[linked.name] [name]"
|
||||
|
||||
/datum/tgui_module/ship/Destroy()
|
||||
if(LAZYLEN(viewers))
|
||||
for(var/datum/weakref/W in viewers)
|
||||
var/M = W.resolve()
|
||||
if(M)
|
||||
unlook(M)
|
||||
. = ..()
|
||||
|
||||
/datum/tgui_module/ship/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
@@ -39,19 +31,14 @@
|
||||
|
||||
/datum/tgui_module/ship/tgui_status(mob/user)
|
||||
. = ..()
|
||||
if(. > STATUS_DISABLED)
|
||||
if(viewing_overmap(user))
|
||||
look(user)
|
||||
return
|
||||
unlook(user)
|
||||
if(viewing_overmap(user) && (user.machine != src))
|
||||
user.reset_perspective()
|
||||
|
||||
/datum/tgui_module/ship/tgui_close(mob/user)
|
||||
. = ..()
|
||||
user.unset_machine()
|
||||
unlook(user)
|
||||
|
||||
// Unregister map objects
|
||||
user.client?.clear_map(linked?.map_name)
|
||||
user.reset_perspective()
|
||||
|
||||
/datum/tgui_module/ship/proc/sync_linked()
|
||||
var/obj/effect/overmap/visitable/ship/sector = get_overmap_sector(get_z(tgui_host()))
|
||||
@@ -73,32 +60,22 @@
|
||||
linked = sector
|
||||
return 1
|
||||
|
||||
/datum/tgui_module/ship/proc/look(var/mob/user)
|
||||
if(linked)
|
||||
user.set_machine(src)
|
||||
user.reset_view(linked)
|
||||
/datum/tgui_module/ship/look(var/mob/user)
|
||||
user.set_viewsize(world.view + extra_view)
|
||||
user.AddComponent(/datum/component/recursive_move)
|
||||
if(!map_view_used)
|
||||
RegisterSignal(user, COMSIG_OBSERVER_MOVED, /datum/tgui_module/ship/proc/unlook)
|
||||
map_view_used = TRUE
|
||||
LAZYDISTINCTADD(viewers, WEAKREF(user))
|
||||
|
||||
/datum/tgui_module/ship/proc/unlook(var/mob/user)
|
||||
SIGNAL_HANDLER
|
||||
user.reset_view()
|
||||
/datum/tgui_module/ship/unlook(var/mob/user)
|
||||
user.set_viewsize() // reset to default
|
||||
if(map_view_used)
|
||||
UnregisterSignal(user, COMSIG_OBSERVER_MOVED)
|
||||
map_view_used = FALSE
|
||||
LAZYREMOVE(viewers, WEAKREF(user))
|
||||
|
||||
/datum/tgui_module/ship/proc/viewing_overmap(mob/user)
|
||||
return (WEAKREF(user) in viewers)
|
||||
|
||||
/datum/tgui_module/ship/check_eye(var/mob/user)
|
||||
if(!get_dist(user, tgui_host()) > 1 || user.blinded || !linked)
|
||||
unlook(user)
|
||||
user.reset_perspective()
|
||||
return -1
|
||||
else
|
||||
return 0
|
||||
@@ -159,7 +136,11 @@
|
||||
return FALSE
|
||||
|
||||
if(action == "viewing")
|
||||
viewing_overmap(ui.user) ? unlook(ui.user) : look(ui.user)
|
||||
if(!viewing_overmap(ui.user))
|
||||
if(!viewers) viewers = list() // List must exist for pass by reference to work
|
||||
start_coordinated_remoteview(ui.user, linked, viewers)
|
||||
else
|
||||
ui.user.reset_perspective()
|
||||
return TRUE
|
||||
|
||||
/datum/tgui_module/ship/nav/ntos
|
||||
@@ -419,7 +400,11 @@
|
||||
. = TRUE
|
||||
|
||||
if("manual")
|
||||
viewing_overmap(ui.user) ? unlook(ui.user) : look(ui.user)
|
||||
if(!viewing_overmap(ui.user))
|
||||
if(!viewers) viewers = list()
|
||||
start_coordinated_remoteview(ui.user, linked, viewers)
|
||||
else
|
||||
ui.user.reset_perspective()
|
||||
. = TRUE
|
||||
/* END HELM */
|
||||
/* ENGINES */
|
||||
|
||||
@@ -248,6 +248,6 @@ var/list/ventcrawl_machinery = list(
|
||||
for(var/image/current_image in pipes_shown)
|
||||
client.images -= current_image
|
||||
client.screen -= GLOB.global_hud.centermarker
|
||||
client.eye = src
|
||||
reset_perspective(src)
|
||||
|
||||
pipes_shown.len = 0
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
user.remove_ventcrawl()
|
||||
user.add_ventcrawl(target_move)
|
||||
user.forceMove(target_move)
|
||||
user.client.eye = target_move //if we don't do this, Byond only updates the eye every tick - required for smooth movement
|
||||
user.reset_perspective(target_move) //if we don't do this, Byond only updates the eye every tick - required for smooth movement
|
||||
if(world.time > user.next_play_vent)
|
||||
user.next_play_vent = world.time+30
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -900,9 +900,6 @@
|
||||
slip.slip_protect = world.time + 25 // This is to prevent slipping back into your pred if they stand on soap or something.
|
||||
//Place them into our drop_location
|
||||
M.forceMove(drop_location())
|
||||
if(ismob(M))
|
||||
var/mob/ourmob = M
|
||||
ourmob.reset_view(null)
|
||||
items_preserved -= M
|
||||
|
||||
//Special treatment for absorbed prey
|
||||
@@ -961,10 +958,6 @@
|
||||
soundfile = GLOB.fancy_release_sounds[release_sound]
|
||||
if(soundfile)
|
||||
playsound(src, soundfile, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF, frequency = noise_freq, preference = /datum/preference/toggle/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
|
||||
//Should fix your view not following you out of mobs sometimes!
|
||||
if(ismob(M))
|
||||
var/mob/ourmob = M
|
||||
ourmob.reset_view(null)
|
||||
|
||||
if(!owner.ckey && escape_stun)
|
||||
owner.Weaken(escape_stun)
|
||||
@@ -981,9 +974,6 @@
|
||||
prey.buckled.unbuckle_mob()
|
||||
|
||||
prey.forceMove(src)
|
||||
if(ismob(prey))
|
||||
var/mob/ourmob = prey
|
||||
ourmob.reset_view(owner)
|
||||
owner.updateVRPanel()
|
||||
|
||||
for(var/mob/living/M in contents)
|
||||
@@ -1175,10 +1165,6 @@
|
||||
if(M.loc != src)
|
||||
M.forceMove(src)
|
||||
|
||||
if(ismob(M))
|
||||
var/mob/ourmob = M
|
||||
ourmob.reset_view(owner)
|
||||
|
||||
//Seek out absorbed prey of the prey, absorb them too.
|
||||
//This in particular will recurse oddly because if there is absorbed prey of prey of prey...
|
||||
//it will just move them up one belly. This should never happen though since... when they were
|
||||
@@ -1522,9 +1508,6 @@
|
||||
return
|
||||
content.belly_cycles = 0
|
||||
content.forceMove(target)
|
||||
if(ismob(content) && !isobserver(content))
|
||||
var/mob/ourmob = content
|
||||
ourmob.reset_view(owner)
|
||||
if(isitem(content))
|
||||
var/obj/item/I = content
|
||||
if(istype(I,/obj/item/card/id))
|
||||
|
||||
@@ -76,9 +76,6 @@
|
||||
src.add_fingerprint(user)
|
||||
if(do_after(user, 3 SECONDS, target = src) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message(span_danger("[user] stuffs [victim] into the core extractor!"))
|
||||
if(victim.client)
|
||||
victim.client.perspective = EYE_PERSPECTIVE
|
||||
victim.client.eye = src
|
||||
victim.forceMove(src)
|
||||
src.occupant = victim
|
||||
update_light_color()
|
||||
|
||||
@@ -375,9 +375,6 @@
|
||||
src.add_fingerprint(user)
|
||||
if(do_after(user, 3 SECONDS, target = src) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message(span_danger("[user] stuffs [victim] into the [src]!"))
|
||||
if(victim.client)
|
||||
victim.client.perspective = EYE_PERSPECTIVE
|
||||
victim.client.eye = src
|
||||
victim.forceMove(src)
|
||||
occupant = victim
|
||||
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
src.add_fingerprint(user)
|
||||
if(do_after(user, 3 SECONDS, target = src) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message(span_danger("[user] stuffs [victim] into the injector!"))
|
||||
if(victim.client)
|
||||
victim.client.perspective = EYE_PERSPECTIVE
|
||||
victim.client.eye = src
|
||||
victim.forceMove(src)
|
||||
src.occupant = victim
|
||||
|
||||
|
||||
Reference in New Issue
Block a user