diff --git a/bapi.dll b/bapi.dll index 87e57686b65..1bdf36e23f9 100644 Binary files a/bapi.dll and b/bapi.dll differ diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 54a2ff6fd62..f090607dc02 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -359,14 +359,18 @@ usr << up_image QDEL_IN(up_image, 12) return - var/turf/T1 = get_turf(usr) + + if(!isliving(usr)) + return + var/mob/living/user = usr + var/turf/T1 = get_turf(user) var/turf/T = GET_TURF_ABOVE(T1) if (!T) - to_chat(usr, SPAN_NOTICE("There is nothing above you!")) + to_chat(user, SPAN_NOTICE("There is nothing above you!")) else if (T.is_hole) - to_chat(usr, SPAN_NOTICE("There's no roof above your head! You can see up!")) + user.look_up_open_space(T1) else - to_chat(usr, SPAN_NOTICE("You see a ceiling staring back at you.")) + to_chat(user, SPAN_NOTICE("You see a ceiling staring back at you.")) if("module") if(isrobot(usr)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 269f2a78d0e..9859762fcd5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -2259,16 +2259,17 @@ set desc = "If you want to know what's above." set category = "IC" + look_up_open_space(get_turf(src)) +/mob/living/proc/look_up_open_space(var/turf/T) if(client && !is_physically_disabled()) if(z_eye) reset_view(null) QDEL_NULL(z_eye) return - var/turf/T = get_turf(src) var/turf/above = GET_TURF_ABOVE(T) if(TURF_IS_MIMICING(above)) - z_eye = new /atom/movable/z_observer/z_up(src, src) + z_eye = new /atom/movable/z_observer/z_up(src, src, T) visible_message(SPAN_NOTICE("[src] looks up."), SPAN_NOTICE("You look up.")) reset_view(z_eye) return @@ -2281,21 +2282,23 @@ set desc = "If you want to know what's below." set category = "IC" + look_down_open_space(get_turf(src)) + +/mob/living/proc/look_down_open_space(var/turf/T) if(client && !is_physically_disabled()) if(z_eye) reset_view(null) QDEL_NULL(z_eye) return - var/turf/T = get_turf(src) if(TURF_IS_MIMICING(T) && GET_TURF_BELOW(T)) - z_eye = new /atom/movable/z_observer/z_down(src, src) + z_eye = new /atom/movable/z_observer/z_down(T, src, T) visible_message(SPAN_NOTICE("[src] looks below."), SPAN_NOTICE("You look below.")) reset_view(z_eye) return else T = get_step(T, dir) if(TURF_IS_MIMICING(T) && GET_TURF_BELOW(T)) - z_eye = new /atom/movable/z_observer/z_down(src, src, TRUE) + z_eye = new /atom/movable/z_observer/z_down(T, src, T) visible_message(SPAN_NOTICE("[src] leans over to look below."), SPAN_NOTICE("You lean over to look below.")) reset_view(z_eye) return diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 75a2fa656b5..47439254eae 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -371,7 +371,7 @@ return M.attackby(W,src) var/randn = rand(1, 100) - if(z_eye && z_eye.tile_shifted) //They're looking down in front of them. + if(z_eye) //They're looking down in front of them. var/turf/T = loc var/obj/structure/railing/problem_railing var/same_loc = FALSE diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 03a27947773..ed7baa28984 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -788,38 +788,36 @@ simulated = FALSE anchored = TRUE mouse_opacity = FALSE + /// The mob that this observer belongs to. var/mob/living/owner - var/tile_shifted = FALSE + /// The physical open-space turf we are watching. + var/turf/target_turf -/atom/movable/z_observer/Initialize(mapload, var/mob/living/user, var/tile_shift = FALSE) +/atom/movable/z_observer/Initialize(mapload, var/mob/living/user, var/turf/given_turf) . = ..() owner = user - if(tile_shift) - var/turf/T = get_step(owner, owner.dir) - forceMove(T) - tile_shifted = TRUE + target_turf = given_turf follow() RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(follow)) /atom/movable/z_observer/proc/follow() /atom/movable/z_observer/z_up/follow() - forceMove(get_step(owner, UP)) + forceMove(get_step(target_turf, UP)) if(isturf(src.loc)) var/turf/T = src.loc - if(T && TURF_IS_MIMICING(T)) + if((T && TURF_IS_MIMICING(T)) && (get_turf(owner) == get_step(src, DOWN))) return owner.reset_view(null) owner.z_eye = null qdel(src) /atom/movable/z_observer/z_down/follow() - var/turf/down_step = get_step(tile_shifted ? src : owner, DOWN) + var/turf/down_step = get_step(target_turf, DOWN) /// If we move down more than 1 step, don't move down again. if((GET_Z(owner) - down_step.z) < 2) forceMove(down_step) - var/turf/T = get_turf(tile_shifted ? get_step(owner, owner.dir) : owner) - if(T && TURF_IS_MIMICING(T)) + if(owner.Adjacent(target_turf) && (owner.dir == get_dir(owner, target_turf))) return owner.reset_view(null) owner.z_eye = null @@ -828,6 +826,7 @@ /atom/movable/z_observer/Destroy() UnregisterSignal(owner, COMSIG_MOVABLE_MOVED) owner = null + target_turf = null . = ..() /atom/movable/z_observer/can_fall() diff --git a/code/modules/multiz/turfs/open_space.dm b/code/modules/multiz/turfs/open_space.dm index d42b699a041..464fe6817dd 100644 --- a/code/modules/multiz/turfs/open_space.dm +++ b/code/modules/multiz/turfs/open_space.dm @@ -209,6 +209,13 @@ for(var/obj/O in src) O.hide(0) +/turf/simulated/open/examine(mob/user, distance, is_adjacent, infix, suffix, show_extended) + . = ..() + if(isliving(user)) + var/mob/living/looker = user + if(looker.Adjacent(src) && !looker.incapacitated()) + looker.look_down_open_space(src) + /turf/simulated/open/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) . = ..() if(distance <= 2) @@ -259,7 +266,6 @@ return /turf/simulated/open/attack_hand(var/mob/user) - if(ishuman(user) && user.a_intent == I_GRAB) var/mob/living/carbon/human/H = user var/turf/T = get_turf(H) diff --git a/html/changelogs/mattatlas-lookhotkey.yml b/html/changelogs/mattatlas-lookhotkey.yml new file mode 100644 index 00000000000..c40db89906e --- /dev/null +++ b/html/changelogs/mattatlas-lookhotkey.yml @@ -0,0 +1,60 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: ChangeMe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "You can now look down open spaces by shift clicking/examining them when they're next to you." + - rscadd: "You can now look up open spaces by clicking the HUD element at the top right." + - bugfix: "Fixed inconsistencies with the camera getting stuck while looking up or down. It should now be much more fluid."