This commit is contained in:
AffectedArc07
2021-06-24 17:29:18 +01:00
parent 956daa36ec
commit 9b86a42a3d
7 changed files with 17 additions and 16 deletions
+11 -10
View File
@@ -31,19 +31,20 @@
return 1
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
if(!start || !end) return 0
/proc/get_angle(atom/movable/start, atom/movable/end)//For beams.
if(!start || !end)
return 0
var/dy
var/dx
dy=(32*end.y+end.pixel_y)-(32*start.y+start.pixel_y)
dx=(32*end.x+end.pixel_x)-(32*start.x+start.pixel_x)
dy = (32 * end.y + end.pixel_y) - (32 * start.y + start.pixel_y)
dx = (32 * end.x + end.pixel_x) - (32 * start.x + start.pixel_x)
if(!dy)
return (dx>=0)?90:270
.=arctan(dx/dy)
if(dy<0)
.+=180
else if(dx<0)
.+=360
return (dx >= 0) ? 90 : 270
. = arctan(dx / dy)
if(dy < 0)
. += 180
else if(dx < 0)
. += 360
//Returns location. Returns null if no location was found.
/proc/get_teleport_loc(turf/location,mob/target,distance = 1, density = 0, errorx = 0, errory = 0, eoffsetx = 0, eoffsety = 0)
+1 -1
View File
@@ -58,7 +58,7 @@
return ..()
/datum/beam/proc/Draw()
var/Angle = round(Get_Angle(origin,target))
var/Angle = round(get_angle(origin, target))
var/matrix/rot_matrix = matrix()
rot_matrix.Turn(Angle)
+1 -1
View File
@@ -680,7 +680,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
if(has_cover)
popUp() //pop the turret up if it's not already up.
// Set angle
set_angle(Get_Angle(src, target))
set_angle(get_angle(src, target))
shootAt(target)
return TRUE
@@ -43,5 +43,5 @@
. = ..()
if(target)
var/matrix/M = new
M.Turn(Get_Angle(src, target))
M.Turn(get_angle(src, target))
transform = M
+1 -1
View File
@@ -98,7 +98,7 @@
icon_state = "1"
/obj/item/lightning/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
var/angle = Get_Angle(A, user)
var/angle = get_angle(A, user)
//to_chat(world, angle)
angle = round(angle) + 45
if(angle > 180)
@@ -189,7 +189,7 @@ Difficulty: Very Hard
var/turf/target_turf = get_turf(target)
playsound(src, 'sound/magic/clockwork/invoke_general.ogg', 200, TRUE, 2)
newtonian_move(get_dir(target_turf, src))
var/angle_to_target = Get_Angle(src, target_turf)
var/angle_to_target = get_angle(src, target_turf)
if(isnum(set_angle))
angle_to_target = set_angle
var/static/list/colossus_shotgun_shot_angles = list(12.5, 7.5, 2.5, -2.5, -7.5, -12.5)
+1 -1
View File
@@ -239,7 +239,7 @@
if((!current || loc == current))
current = locate(clamp(x + xo, 1, world.maxx), clamp(y + yo, 1, world.maxy), z)
if(isnull(Angle))
Angle = round(Get_Angle(src, current))
Angle = round(get_angle(src, current))
if(spread)
Angle += (rand() - 0.5) * spread
var/matrix/M = new