mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Adds spinning animation for meteors.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "code\_helpers\lists.dm"
|
||||
#include "code\_helpers\logging.dm"
|
||||
#include "code\_helpers\maths.dm"
|
||||
#include "code\_helpers\matrices.dm"
|
||||
#include "code\_helpers\mobs.dm"
|
||||
#include "code\_helpers\names.dm"
|
||||
#include "code\_helpers\sanitize_values.dm"
|
||||
|
||||
17
code/_helpers/matrices.dm
Normal file
17
code/_helpers/matrices.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/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)
|
||||
var/matrix/m120 = matrix(transform)
|
||||
m120.Turn(120)
|
||||
var/matrix/m240 = matrix(transform)
|
||||
m240.Turn(240)
|
||||
var/matrix/m360 = matrix(transform)
|
||||
speed /= 3 //Gives us 3 equal time segments for our three turns.
|
||||
//Why not one turn? Because byond will see that the start and finish are the same place and do nothing
|
||||
//Why not two turns? Because byond will do a flip instead of a turn
|
||||
animate(src, transform = m120, time = speed, loops)
|
||||
animate(transform = m240, time = speed)
|
||||
animate(transform = m360, time = speed)
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
/obj/effect/meteor/New()
|
||||
..()
|
||||
//SpinAnimation()
|
||||
SpinAnimation()
|
||||
|
||||
/obj/effect/meteor/Bump(atom/A)
|
||||
if(A)
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
//meteor showers are lighter and more common,
|
||||
/datum/event/meteor_wave/tick()
|
||||
if(activeFor >= next_meteor)
|
||||
if(waves && activeFor >= next_meteor)
|
||||
spawn() spawn_meteors(severity * rand(1,2), get_meteors())
|
||||
next_meteor += rand(15, 30) / severity
|
||||
waves--
|
||||
endWhen = (waves <= 0 ? activeFor + 15 : next_meteor + 1)
|
||||
endWhen = (waves ? next_meteor + 1 : activeFor + 15)
|
||||
|
||||
/datum/event/meteor_wave/end()
|
||||
switch(severity)
|
||||
|
||||
@@ -157,15 +157,15 @@
|
||||
|
||||
/obj/machinery/power/supermatter/get_transit_zlevel()
|
||||
//don't send it back to the station -- most of the time
|
||||
if(prob(99))
|
||||
if(prob(99))
|
||||
var/list/candidates = accessible_z_levels.Copy()
|
||||
for(var/zlevel in config.station_levels)
|
||||
candidates.Remove("[zlevel]")
|
||||
candidates.Remove("[src.z]")
|
||||
|
||||
|
||||
if(candidates.len)
|
||||
return text2num(pickweight(candidates))
|
||||
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/supermatter/process()
|
||||
@@ -382,7 +382,7 @@
|
||||
defer_powernet_rebuild = 1
|
||||
// Let's just make this one loop.
|
||||
for(var/atom/X in orange(pull_radius,src))
|
||||
X.singularity_pull(src, STAGE_FIVE)
|
||||
spawn() X.singularity_pull(src, STAGE_FIVE)
|
||||
|
||||
if(defer_powernet_rebuild != 2)
|
||||
defer_powernet_rebuild = 0
|
||||
|
||||
Reference in New Issue
Block a user