diff --git a/baystation12.dme b/baystation12.dme index 143149c577..e94c923fd0 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -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" diff --git a/code/_helpers/matrices.dm b/code/_helpers/matrices.dm new file mode 100644 index 0000000000..abb0366382 --- /dev/null +++ b/code/_helpers/matrices.dm @@ -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) diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 96367b4a11..544a046251 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -123,7 +123,7 @@ /obj/effect/meteor/New() ..() - //SpinAnimation() + SpinAnimation() /obj/effect/meteor/Bump(atom/A) if(A) diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index 43093a3de8..ae2adeef32 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -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) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index c08f85b298..c30f577313 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -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