This commit is contained in:
SandPoot
2024-01-07 03:36:25 -03:00
41 changed files with 246 additions and 148 deletions
-51
View File
@@ -391,57 +391,6 @@
var/msg = "<span class='smallnotice'>[src] makes eye contact with you.</span>"
addtimer(CALLBACK(GLOBAL_PROC, .proc/to_chat, examined_mob, msg), 3)
/**
* Point at an atom
*
* mob verbs are faster than object verbs. See
* [this byond forum post](https://secure.byond.com/forum/?post=1326139&page=2#comment8198716)
* for why this isn't atom/verb/pointed()
*
* note: ghosts can point, this is intended
*
* visible_message will handle invisibility properly
*
* overridden here and in /mob/dead/observer for different point span classes and sanity checks
*/
/mob/verb/pointed(atom/A as mob|obj|turf in fov_view(), params = "" as text)
set name = "Point To"
set category = "Object"
if(!src || !isturf(src.loc) || !(A in view(src.loc)))
return FALSE
if(istype(A, /obj/effect/temp_visual/point))
return FALSE
var/turf/tile = get_turf(A)
if (!tile)
return FALSE
var/turf/our_tile = get_turf(src)
var/obj/visual = new /obj/effect/temp_visual/point(our_tile, invisibility)
/// Set position
var/final_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x
var/final_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y
var/list/click_params = params2list(params)
if(length(click_params) && click_params["screen-loc"])
var/list/actual_view = getviewsize(client ? client.view : world.view)
var/list/split_coords = splittext(click_params["screen-loc"], ",")
final_x = (text2num(splittext(split_coords[1], ":")[1]) - actual_view[1] / 2) * world.icon_size + (text2num(splittext(split_coords[1], ":")[2]) - world.icon_size)
final_y = (text2num(splittext(split_coords[2], ":")[1]) - actual_view[2] / 2) * world.icon_size + (text2num(splittext(split_coords[2], ":")[2]) - world.icon_size)
//
/// Set rotation
var/matrix/rotated_matrix = new()
rotated_matrix.TurnTo(0, Get_Pixel_Angle(-final_y, -final_x))
visual.transform = rotated_matrix
//
animate(visual, pixel_x = final_x, pixel_y = final_y, time = 1.7, easing = EASE_OUT)
SEND_SIGNAL(src, COMSIG_MOB_POINTED, A)
return TRUE
/mob/proc/can_resist()
return FALSE //overridden in living.dm