mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-19 14:41:50 +00:00
changes: Fixed an issue where the segment count argument of orbit() was ignored, leading to the Tesla not animating as it was intended to. Fixed an issue where /datum/event had two completely unrelated definitions (fixes #3192).
27 lines
878 B
Plaintext
27 lines
878 B
Plaintext
/matrix/proc/TurnTo(old_angle, new_angle)
|
|
. = new_angle - old_angle
|
|
Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT
|
|
|
|
|
|
/atom/proc/SpinAnimation(speed = 10, loops = -1, clockwise = 1, segments = 3)
|
|
if(!segments)
|
|
return
|
|
var/segment = 360/segments
|
|
if(!clockwise)
|
|
segment = -segment
|
|
var/list/matrices = list()
|
|
for(var/i in 1 to segments-1)
|
|
var/matrix/M = matrix(transform)
|
|
M.Turn(segment*i)
|
|
matrices += M
|
|
var/matrix/last = matrix(transform)
|
|
matrices += last
|
|
|
|
speed /= segments
|
|
|
|
animate(src, transform = matrices[1], time = speed, loops)
|
|
for(var/i in 2 to segments) //2 because 1 is covered above
|
|
animate(transform = matrices[i], time = speed)
|
|
//doesn't have an object argument because this is "Stacking" with the animate call above
|
|
//3 billion% intentional
|