diff --git a/nootils/decor/fire.ts b/nootils/decor/fire.ts index 9de682f..6926c41 100644 --- a/nootils/decor/fire.ts +++ b/nootils/decor/fire.ts @@ -1,6 +1,6 @@ -import {Random} from '../internal/random.ts'; - -import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@2.1.0/src/mod.ts"; +import { rand } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; /** * Spawns in walls that resemble a fire. @@ -12,23 +12,22 @@ import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" * @param y The starting Y position of the fire. * @param z The starting Z position of the fire. * @author StormPacer + * @author IntoTheAbyss490(Updated Everything) */ export function Fire(startingBeat: number, duration: number, fireWallDuration: number, size: number, x: number, y: number, z: number) { for (let i = 0; i < (duration * 6); i++) { - let wall = new Remapper.Wall(startingBeat + (i / 6), fireWallDuration, 1, 0, 0); - wall.customData = { - _interactable: false, - _scale: [size, size, size], - _animation: { - _dissolve: [[0, 0], [1, 0.1], [1, 0.7], [0, 1]], - _color: [[1, 0, 0, 0.5, 0], [0.996, 1, 0.239, 0.5, 1]], - _localRotation: [[Random(0, 180), Random(0, 180), Random(0, 180), 0], [Random(0, 180), Random(0, 180), Random(0, 180), 1]], - _definitePosition: [[x, y, z, 0, "easeOutCubic"], [(x + Random(-2, 2)), (y + Random(3, 5)), z, 1]] - } - }; - - wall.push(true); + let wall = new Wall(startingBeat + (i / 6), fireWallDuration, 1, 0, 0); + wall.interactable = false, + wall.scale = [size, size, size], + wall.animate.dissolve = [[0, 0], [1, 0.1], [1, 0.7], [0, 1]], + wall.animate.color = [[1, 0, 0, 0.5, 0], [0.996, 1, 0.239, 0.5, 1]], + wall.animate.localRotation = [[rand(0, 180), rand(0, 180), rand(0, 180), 0], [rand(0, 180), rand(0, 180), rand(0, 180), 1]], + wall.animate.definitePosition = [[x, y, z, 0, "easeOutCubic"], [(x + rand(-2, 2)), (y + rand(3, 5)), z, 1]] + + wall.push(); } -} +}; + +//Fire(0, 100, 20, 0.25, 0, 0, 0) \ No newline at end of file diff --git a/nootils/decor/floatingPillars.ts b/nootils/decor/floatingPillars.ts index 0aef615..10d6de2 100644 --- a/nootils/decor/floatingPillars.ts +++ b/nootils/decor/floatingPillars.ts @@ -1,6 +1,6 @@ -import {Random} from '../internal/random.ts'; - -import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" +// deno-lint-ignore-file +import { rand } from 'https://deno.land/x/remapper@3.1.2/src/mod.ts'; +import { Wall } from 'https://deno.land/x/remapper@3.1.2/src/mod.ts'; /** * Spawns in floating pillars on the desired positions and spacing. @@ -18,9 +18,10 @@ import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" * @param B The blue value for the color of the pillars. * @param A The alpha value for the color of the pillars. * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -export function FloatingPillars(startBeat: number, endBeat: number, amountPerRow: number, spacing: number, startX: number, height: number, width: number, startZ: number, track: string, R: number, G: number, B: number, A: number) { +export function FloatingPillars(startBeat: number, endBeat: number, amountPerRow: number, spacing: number, startX: number, height: number, width: number, startZ: number, track: string, R: number, G: number, B: number, A: number, min: number, max: number) { let z = startZ for (let i = 0; i <= amountPerRow; i++) { if (z <= spacing * amountPerRow) { @@ -30,21 +31,19 @@ export function FloatingPillars(startBeat: number, endBeat: number, amountPerRow if (x <= spacing * amountPerRow) { x += spacing - let wall = new Remapper.Wall(startBeat, endBeat - startBeat, 1, 0, 0); - - wall.customData = { - _track: track, - _color: [R, G, B, A], - _interactable: false, - _scale: [width, height, width], - _animation: { - _definitePosition: [[x, Random(5, 30), z, 0, "easeInOutCubic"], [x, Random(5, 30), z, 0.2, "easeInOutCubic"], [x, Random(5, 30), z, 0.4, "easeInOutCubic"], [x, Random(5, 30), z, 0.6, "easeInOutCubic"], [x, Random(5, 30), z, 0.8, "easeInOutCubic"], [x, Random(5, 30), z, 1, "easeInOutCubic"]] - } - }; + let wall = new Wall(startBeat, endBeat - startBeat, 1, 0, 0); - wall.push(true); - } - } + wall.track.value = track, + wall.color = [R, G, B, A], + wall.interactable = false, + wall.scale = [width, height, width], + wall.animate.localRotation = [[rand(0, 360), rand(0, 360), rand(0, 360), 0, "easeInOutCubic"], [rand(0, 360), rand(0, 360), rand(0, 360), 0.2, "easeInOutCubic"], [rand(0, 360), rand(0, 360), rand(0, 360), 0.4, "easeInOutCubic"], [rand(0, 360), rand(0, 360), rand(0, 360), 0.6, "easeInOutCubic"], [rand(0, 360), rand(0, 360), rand(0, 360), 0.8, "easeInOutCubic"], [rand(0, 360), rand(0, 360), rand(0, 360), 1, "easeInOutCubic"]], + wall.animate.definitePosition = [[x, rand(min, max, 0.1), z, 0, "easeInOutCubic"], [x, rand(min, max, 0.1), z, 0.2, "easeInOutCubic"], [x, rand(min, max, 0.1), z, 0.4, "easeInOutCubic"], [x, rand(min, max, 0.1), z, 0.6, "easeInOutCubic"], [x, rand(min, max, 0.1), z, 0.8, "easeInOutCubic"], [x, rand(min, max, 0.1), z, 1, "easeInOutCubic"]] + wall.push(); + } + }; } } } + +//FloatingPillars(0.125, 168, 12, 12, -65, 0.5, 0.5, -10, "pillarsTrack", 1, 1, 1, 10, 2, 35) \ No newline at end of file diff --git a/nootils/decor/rain.ts b/nootils/decor/rain.ts index 687bb85..6ed4c51 100644 --- a/nootils/decor/rain.ts +++ b/nootils/decor/rain.ts @@ -1,32 +1,35 @@ -import {Random} from '../internal/random.ts'; - -import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; +import { rand } from "https://deno.land/x/remapper@3.1.2/src/mod.ts" /** * Spawns in walls that resemble rain. * @param startingBeat The beat that the rain should start on. * @param duration For how many beats the rain should last for. * @param amount How many walls should be created per beat. + * @param R The red value for the color. + * @param G The green value for the color. + * @param B The blue value for the color. + * @param A The alpha value for the color. * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -export function Rain(startingBeat: number, duration: number, amount: number) { +export function Rain(startingBeat: number, duration: number, amount: number, R: number, G: number, B: number, A: number) { for (let i = 0; i < (duration * amount); i++) { - let x = Random(-40, 40) - let z = Random(0, 50) - - let wall = new Remapper.Wall(startingBeat + (i / amount), 0.5, 1, 0, 0); + let x = rand(-40, 40) + let z = rand(0, 50) - wall.customData = { - _color: [0.419, 0.513, 1, 0.1], - _interactable: false, - _scale: [0.1, 6, 0.1], - _animation: { - _dissolve: [[0, 0.1], [1, 0.2], [1, 0.9], [0, 1]], - _definitePosition: [[x, Random(200, 300), z, 0], [x, Random(-60, -40), z, 1]] - } - }; + let wall = new Wall(startingBeat + (i / amount), 0.5, 1, 0, 0); - wall.push(true); + wall.color = [R, G, B, A], + wall.interactable = false, + wall.scale = [0.1, 6, 0.1], + wall.animate.dissolve = [[0, 0.1], [1, 0.2], [1, 0.9], [0, 1]], + wall.animate.definitePosition = [[x, rand(200, 300), z, 0], [x, rand(-60, -40), z, 1]] + + wall.push(); } -} +}; + +//Rain(0, 100, 100,0.419, 0.513, 1, 0.1) \ No newline at end of file diff --git a/nootils/decor/smoke.ts b/nootils/decor/smoke.ts index 6fe2f8b..f05fc0b 100644 --- a/nootils/decor/smoke.ts +++ b/nootils/decor/smoke.ts @@ -1,5 +1,6 @@ -import {Random} from '../internal/random.ts'; -import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; +import { rand } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; /** * Spawns in walls that resemble smoke @@ -10,25 +11,28 @@ import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" * @param x The starting X position of the smoke. * @param y The starting Y position of the smoke. * @param z The starting Z position of the smoke. + * @param R The red value for the color. + * @param G The green value for the color. + * @param B The blue value for the color. + * @param A The alpha value for the color. * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -export function Smoke(startingBeat: number, duration: number, smokeWallDuration: number, size: number, x: number, y: number, z: number) { +export function Smoke(startingBeat: number, duration: number, smokeWallDuration: number, size: number, x: number, y: number, z: number, R: number, G: number, B: number, A: number) { for (let i = 0; i < (duration * 6); i++) { - let wall = new Remapper.Wall(startingBeat + (i / 6), smokeWallDuration, 1, 0, 0); + let wall = new Wall(startingBeat + (i / 6), smokeWallDuration, 1, 0, 0); - wall.customData = { - _color: [0.1, 0.1, 0.1, 0.1], - _interactable: false, - _scale: [size, size, size], - _animation: { - _dissolve: [[0, 0], [1, 0.1], [1, 0.7], [0, 1]], - _localRotation: [[Random(0, 180), Random(0, 180), Random(0, 180), 0], [Random(0, 180), Random(0, 180), Random(0, 180), 1]], - _definitePosition: [[x, y, z, 0, "easeOutCubic"], [(x + Random(-3, 3)), (y + Random(4, 8)), z, 1]] - } - }; - - wall.push(true); + wall.color = [R, G, B, A], + wall.interactable = false, + wall.scale = [size, size, size], + wall.animate.dissolve = [[0, 0], [1, 0.1], [1, 0.7], [0, 1]], + wall.animate.localRotation = [[rand(0, 180), rand(0, 180), rand(0, 180), 0], [rand(0, 180), rand(0, 180), rand(0, 180), 1]], + wall.animate.definitePosition = [[x, y, z, 0, "easeOutCubic"], [(x + rand(-3, 3)), (y + rand(4, 8)), z, 1]] + + wall.push(); } -} +}; + +//Smoke(0, 100, 20, 0.25, 0, 0, 0, 0.1, 0.1, 0.1, 0.1) \ No newline at end of file diff --git a/nootils/decor/snow.ts b/nootils/decor/snow.ts index b5dc951..b1b016a 100644 --- a/nootils/decor/snow.ts +++ b/nootils/decor/snow.ts @@ -1,33 +1,36 @@ -import {Random} from "../internal/random.ts" - -import * as Remapper from "https://deno.land/x/remapper@3.0.0/src/mod.ts" +// deno-lint-ignore-file +import { rand } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; /** * Spawns in walls that resemble snow. * @param startingBeat The beat that the snow should start on. * @param duration For how many beats the snow should last for. * @param amount How many walls should be created per beat. + * @param R The red value for the color. + * @param G The green value for the color. + * @param B The blue value for the color. + * @param A The alpha value for the color. * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -export function Snow(startingBeat: number, duration: number, amount: number) { +export function Snow(startingBeat: number, duration: number, amount: number, R: number, G: number, B: number, A: number) { for (let i = 0; i < (duration * amount); i++) { - let x = Random(-40, 40) - let z = Random(0, 50) - let y = Random(60, 80) - - let wall = new Remapper.Wall(startingBeat + (i / amount), 5, 1, 0, 0); + let x = rand(-40, 40) + let z = rand(0, 50) + let y = rand(60, 80) - wall.customData = { - _color: [1, 1, 1, 4], - _interactable: false, - _scale: [0.2, 0.2, 0.2], - _animation: { - _dissolve: [[0, 0.1], [1, 0.2], [1, 0.9], [0, 1]], - _definitePosition: [[x, (y = y - 15), z, 0], [(x + Random(-4, 4)), (y = y - 15), (z + Random(-5, 5)), 0.2], [(x + Random(-4, 4)), (y = y - 15), (z + Random(-5, 5)), 0.4], [(x + Random(-4, 4)), (y = y - 15), (z + Random(-5, 5)), 0.6], [(x + Random(-4, 4)), (y = y - 15), (z + Random(-5, 5)), 0.8], [(x + Random(-4, 4)), (y = y - 15), (z + Random(-5, 5)), 1]] - } - }; + let wall = new Wall(startingBeat + (i / amount), 5, 1, 0, 0); - wall.push(true); + wall.color = [R, G, B, A], + wall.interactable = false, + wall.scale = [0.2, 0.2, 0.2], + wall.animate.dissolve = [[0, 0.1], [1, 0.2], [1, 0.9], [0, 1]], + wall.animate.definitePosition = [[x, (y = y - 15), z, 0], [(x + rand(-4, 4)), (y = y - 15), (z + rand(-5, 5)), 0.2], [(x + rand(-4, 4)), (y = y - 15), (z + rand(-5, 5)), 0.4], [(x + rand(-4, 4)), (y = y - 15), (z + rand(-5, 5)), 0.6], [(x + rand(-4, 4)), (y = y - 15), (z + rand(-5, 5)), 0.8], [(x + rand(-4, 4)), (y = y - 15), (z + rand(-5, 5)), 1]] + + wall.push(); } -} +}; + +//Snow(0, 100, 100, 1, 1, 1, 4) \ No newline at end of file diff --git a/nootils/decor/wallBorderSize.ts b/nootils/decor/wallBorderSize.ts deleted file mode 100644 index f5d66c3..0000000 --- a/nootils/decor/wallBorderSize.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - -/** - * Changes the border size of the walls between the beats. - * Works for all kind of walls. - * @param size The size you want the border to have (1 = default size). - * @param startTime The beat of the FIRST wall you want to change the border of (will start at the first wall if it is left 'undefined'). - * @param endTime The beat of the LAST wall you want to change the border of (will end at the last wall if it is left 'undefined'). - * @param track Assigns a track to the filtered walls (optional). - * @author Spidey - */ - -function wallBorderSize(size: number = 1, startTime: number = Number.NEGATIVE_INFINITY, endTime: number = Number.POSITIVE_INFINITY, track?: string){ - const filteredwalls = Remapper.activeDiff.walls.filter(w => w.time >= startTime && w.time <= endTime); - filteredwalls.forEach(wall => { - if (!wall.customData) wall.customData = {}; - if (!wall.position) wall.position = [wall.lineIndex - 2, wall.type === 0 ? 0 : 1.5]; - if (!wall.scale) wall.scale = [wall.width, wall.type === 0 ? 3.5 : 2]; - - wall.position = [wall.position[0] + ((wall.scale[0] - (wall.scale[0] / size)) / 2), wall.position[1]]; - wall.scale = [wall.scale[0] / size, wall.scale[1] / size]; - - wall.animation._scale = [size, size, 1]; - - if (typeof track !== 'undefined') { - if (!wall.customData) wall.customData = {}; - if (Array.isArray(wall.customData._track)) wall.customData._track.push(track) - else wall.customData._track = track; - } - }); -}; - - -export {wallBorderSize} diff --git a/nootils/decor/water.ts b/nootils/decor/water.ts index 4c2759e..c7be5e3 100644 --- a/nootils/decor/water.ts +++ b/nootils/decor/water.ts @@ -1,4 +1,5 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; /** * Spawns a wall that resembles water. @@ -7,10 +8,15 @@ import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" * @param track What track the water should be assigned to. * @param speed How fast the water should move, numbers between 0-5. * @param y On which Y position the water should spawn. + * @param R The red value for the color. + * @param G The green value for the color. + * @param B The blue value for the color. + * @param A The alpha value for the color. * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -export function Water(startBeat: number, endBeat: number, track: string, speed: number, y: number) { +export function Water(startBeat: number, endBeat: number, track: string, speed: number, y: number, R: number, G: number, B: number, A: number) { let z = 0 switch(speed) { case 0: @@ -27,18 +33,15 @@ export function Water(startBeat: number, endBeat: number, track: string, speed: z = -1500 } - let wall = new Remapper.Wall(startBeat, endBeat, 1, 0, 0); - - wall.customData = { - _track: track, - _color: [0, 1.5, 2, 10], - _fake: true, - _interactable: false, - _scale: [2000, 0.5, 2000], - _animation: { - _definitePosition: [[-1000, y, -1000, 0], [-1000, y, z, 1]] - } - }; + let wall = new Wall(startBeat, endBeat, 1, 0, 0); + wall.track.value = track, + wall.color = [R, G, B, A], + wall.interactable = false, + wall.scale = [2000, 0.5, 2000], + wall.animate.definitePosition = [[-1000, y, -1000, 0], [-1000, y, z, 1]] + wall.push(); } + +//Water(0, 100, "water", 0.25, 0, 0, 1.5, 2, 10) \ No newline at end of file diff --git a/nootils/index.ts b/nootils/index.ts index a68c9c7..9dc5cec 100644 --- a/nootils/index.ts +++ b/nootils/index.ts @@ -1,22 +1,20 @@ /* Nootils - Made by StormPacer and cal117 and curated by the community. Powered by Remapper + +Updated by IntoTheAbyss490 */ -export * from './decor/wallBorderSize.ts' + export * from './decor/floatingPillars.ts' export * from './decor/fire.ts' export * from './decor/rain.ts' export * from './decor/smoke.ts' export * from './decor/snow.ts' export * from './decor/water.ts' -export * from './stars.ts' -export * from './notes/ghosty.ts' -export * from './notes/notetrail.ts' export * from './notes/floatingdebris.ts' -export * from './utils/giveTrack.ts' export * from './shapes/triangle.ts' export * from './shapes/square.ts' diff --git a/nootils/internal/random.ts b/nootils/internal/random.ts deleted file mode 100644 index 373639b..0000000 --- a/nootils/internal/random.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function Random(min: number, max: number, rounding?: number): number { - if (!rounding) return Number((Math.random() * (max - min) + min).toFixed(4)) - return Number((Math.random() * (max - min) + min).toFixed(rounding)) -} \ No newline at end of file diff --git a/nootils/notes/floatingdebris.ts b/nootils/notes/floatingdebris.ts index 24c9b02..4864ecd 100644 --- a/nootils/notes/floatingdebris.ts +++ b/nootils/notes/floatingdebris.ts @@ -1,7 +1,5 @@ -import {Random} from '../internal/random.ts'; - -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - +// deno-lint-ignore-file +import {CUT, Note, notesBetween, rand } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; /** * Gives the effect of floating debris when you slice a note. @@ -10,46 +8,42 @@ import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" * @param duration How long the debris will last, defaulted to 2. * @param spread How far the debris will go, defaulted to 1. * @author Pangwen + * @author IntoTheAbyss490(Updating Everything) */ -export function FloatingDebris(startBeat: number, endBeat: number, duration: number = 2, spread: number = 1) { - Remapper.notesBetween(startBeat, endBeat, note => { - if (note.type != Remapper.NOTE.BOMB) { - let dupe = new Remapper.Note(note.time, note.type, note.direction, note.position); +export function FloatingDebris(startBeat: number, endBeat: number, duration: number, spread: number) { + notesBetween(startBeat, endBeat, note => { + let dupe = new Note(note.time, note.type, note.direction, note.offset); dupe.noteGravity = false; dupe.noteLook = false; dupe.spawnEffect = false; - dupe.fake = true; dupe.interactable = false; dupe.offset = duration; - dupe.animation._dissolveArrow = [[0, 0]]; - dupe.animation._dissolve = [[0, 0], [0, 0.5], [0.85, 0.501], [0, 1, "easeOutCubic"]]; - dupe.animation._localRotation = [[0, 0, 0, 0.5], [Random(-180, 180), Random(-180, 180), Random(-180, 180), 1]]; - if (note.direction == Remapper.NOTE.UP) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [0*spread, 3, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.DOWN) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [0*spread, -3, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.LEFT) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [-3*spread, 0, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.RIGHT) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [3*spread, 0, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.UP_LEFT) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [-3*spread, 3, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.UP_RIGHT) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [3*spread, 3, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.DOWN_LEFT) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [-3*spread, -3, 5, 1, "easeOutCubic"]]; - } else if (note.direction == Remapper.NOTE.DOWN_RIGHT) { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [3*spread, -3, 5, 1, "easeOutCubic"]]; + dupe.animate.dissolveArrow = [[0, 0]]; + dupe.animate.dissolve = [[0, 0], [0, 0.5], [0.85, 0.501], [0, 1, "easeOutCubic"]]; + dupe.animate.localRotation = [[0, 0, 0, 0.5], [rand(-180, 180), rand(-180, 180), rand(-180, 180), 1]]; + if (note.direction == CUT.UP) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [0*spread, 3, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.DOWN) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [0*spread, -3, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.LEFT) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [-3*spread, 0, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.RIGHT) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [3*spread, 0, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.UP_LEFT) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [-3*spread, 3, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.UP_RIGHT) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [3*spread, 3, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.DOWN_LEFT) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [-3*spread, -3, 5, 1, "easeOutCubic"]]; + } else if (note.direction == CUT.DOWN_RIGHT) { + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [3*spread, -3, 5, 1, "easeOutCubic"]]; } else { - dupe.animation._definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [Random(-3, 3), Random(-3, 3), 5, 1, "easeOutCubic"]]; + dupe.animate.definitePosition = [[0, 0, 0, 0], [0, 0, 0, 0.5], [rand(-3, 3), rand(-3, 3), 5, 1, "easeOutCubic"]]; } - - dupe.push(); - } - - }); -}; + dupe.push(); +})}; +//FloatingDebris(0, 100, 5, 5) \ No newline at end of file diff --git a/nootils/notes/ghosty.ts b/nootils/notes/ghosty.ts index 294ffbe..896d1fb 100644 --- a/nootils/notes/ghosty.ts +++ b/nootils/notes/ghosty.ts @@ -1,63 +1,70 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - -function InternalGhosty(filteredNotes: Remapper.Note[], speed: number, maxY: number, easing: Remapper.EASE = "easeInOutCubic", transparent?: boolean) { - const positions: any = [[0, 0, 0, 0]]; - let positive = false; - for (let i = speed + 1; i > 0; i--) { - let pos = positive ? [0, maxY, 0, 0.35 / i, easing] : [0, -maxY, 0, 0.35 / i, easing]; - positions.push(pos); - positive = !positive; - } - positions.push([0, 0, 0, 0.4, easing]); - filteredNotes.forEach(note => { - note.animation = { - _dissolve: [ - transparent ? [0, 0] : [1, 0], - ], - _dissolveArrow: [ - [0, 0], - [1, 0.05], - ], - _position: positions, - } - }); -} - -/** - * Make notes bounce up and down like ghosts. - * This will override any animations already applied to the notes. - * @param track The track to apply the effect to. - * @param speed The speed in how many times it bounces before reaching the player. - * @param maxY The max Y level the note can reach on negative Y and positive Y - * @param easing The easing type. - * @param transparent Should only the arrow be visible? - * @author cal117 - */ -function GhostyTrack(track: string, speed: number, maxY: number, easing: Remapper.EASE = "easeInOutCubic", transparent?: boolean) { - const filteredNotes = Remapper.activeDiff.notes.filter(note => { - if(!note.customData) note.customData = {}; - if(Array.isArray(note.customData._track)) return note.customData._track.includes(track); - else if (note.customData._track == track) return true; - else return false; - }); - InternalGhosty(filteredNotes, speed, maxY, easing, transparent); -} - -/** - * Make notes bounce up and down like ghosts. - * @param startBeat The beat to start the effect on. - * @param endBeat The beat to end the effect on. - * @param speed The speed in how many times it bounces before reaching the player. - * @param maxY The max Y level the note can reach on negative Y and positive Y - * @param easing The easing to use. - * @param transparent Should only the arrow be visible? - * @author cal117 - */ -function Ghosty(startBeat: number, endBeat: number, speed: number, maxY: number, easing: Remapper.EASE = "easeInOutCubic", transparent?: boolean) { - const filteredNotes = Remapper.activeDiff.notes.filter(n => n.time >= startBeat && n.time <= endBeat); - InternalGhosty(filteredNotes, speed, maxY, easing, transparent); -} - -export { - GhostyTrack, Ghosty -}; +// deno-lint-ignore-file +import { activeDiff, EASE, Note } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; + +/** Base function needed to make the effects in ghosty.ts work*/ + +export function InternalGhosty(filteredNotes: Note[], speed: number, maxY: number, easing: EASE = "easeInOutCubic", transparent?: boolean) { + const positions: any = [[0, 0, 0, 0]]; + let positive = false; + for (let i = speed + 1; i > 0; i--) { + let pos = positive ? [0, maxY, 0, 0.35 / i, easing] : [0, -maxY, 0, 0.35 / i, easing]; + positions.push(pos); + positive = !positive; + } + positions.push([0, 0, 0, 0.4, easing]); + filteredNotes.forEach(note => { + note.animate.dissolve = [ + transparent ? [0, 0] : [1, 0], + ], + note.animate.dissolveArrow = [ + [0, 0], + [1, 0.05], + ], + note.animate.position = positions, + note.push(); + }); +} +//!YOU NEED TO INCLUDE INTERNAL GHOSTY ABOVE THE DIFFERENT EFFECTS FUNCTIONS(Found Below) + +/** + * Make notes(in the specified track) bounce up and down like ghosts. + * This will override any animations already applied to the notes. + * @param track The track to apply the effect to. + * @param speed The speed in how many times it bounces before reaching the player. + * @param maxY The max Y level the note can reach on negative Y and positive Y + * @param easing The easing type. + * @param transparent Should only the arrow be visible? + * @author cal117 + * @author IntoTheAbyss490(Updating Everything) + */ + +export function GhostyTrack(track: string, speed: number, maxY: number, easing: EASE = "easeInOutCubic", transparent?: boolean) { + const filteredNotes = activeDiff.notes.filter(note => { + if(!note.customData) note.customData = {}; + if(Array.isArray(note.track.value)) return note.track.value.includes(track); + else if (note.track.value == track) return true; + else return false; + }); + InternalGhosty(filteredNotes, speed, maxY, easing, transparent); +} + +//GhostyTrack("track", 0.5, 1, "easeOutCubic", true) + +/** + * Make notes bounce up and down like ghosts. + * @param startBeat The beat to start the effect on. + * @param endBeat The beat to end the effect on. + * @param speed The speed in how many times it bounces before reaching the player. + * @param maxY The max Y level the note can reach on negative Y and positive Y + * @param easing The easing to use. + * @param transparent Should only the arrow be visible? + * @author cal117 + * @author IntoTheAbyss490(Updating Everything) + */ + +export function Ghosty(startBeat: number, endBeat: number, speed: number, maxY: number, easing: EASE = "easeInOutCubic", transparent?: boolean) { + const filteredNotes = activeDiff.notes.filter(n => n.time >= startBeat && n.time <= endBeat); + InternalGhosty(filteredNotes, speed, maxY, easing, transparent); +} + +//Ghosty(0, 100, 0.5, 1, "easeOutCubic", false) diff --git a/nootils/notes/notetrail.ts b/nootils/notes/notetrail.ts index 2e0609d..95e8c3f 100644 --- a/nootils/notes/notetrail.ts +++ b/nootils/notes/notetrail.ts @@ -1,65 +1,63 @@ -import {Random} from '../internal/random.ts'; - -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - -enum NoteTrailType { - BLOCK = "block", - ARROW = "arrow", - BOTH = "both", -} - -function InternalNoteTrail(filterednotes: Remapper.Note[], length: number = 5, type: NoteTrailType) { - filterednotes.forEach(note => { - note.noteGravity = false; - note.noteLook = false; - note.spawnEffect = false; - for (let i = 1; i <= length; i++) { - let dupe = new Remapper.Note(note.time, note.type, note.direction, note.position); - dupe.noteGravity = false; - dupe.noteLook = false; - dupe.spawnEffect = false; - dupe.fake = true; - dupe.animation._position = [[Random(-0.2, 0.2), 0, i * 4, 0.4], [0, 0, 0, 0.7]]; - dupe.animation._localRotation = [[Random(0, 180), Random(0, 180), Random(0, 180), 0], [0, 0, 0, 0.3]]; - if (type.valueOf() == "note" || type.valueOf() == "both") dupe.animation._dissolve = [[0.1, 0], [0, 1, "easeInOutCubic"]]; - if (type.valueOf() == "arrow" || type.valueOf() == "both") dupe.animation._dissolveArrow = [[0.1, 0]]; - dupe.push(); - } - }) -} - -/** - * Spawns a trail behind a note - similar to Somewhere Out There - * @param startBeat The beat to start the effect on. - * @param endBeat The beat to end the effect on. - * @param length The length of the trail. - * @param type What the effect should use for the trail, it can be "arrow" or "block" - * @author cal117 - */ -function NoteTrail(startBeat: number, endBeat: number, length: number = 5, type: NoteTrailType = NoteTrailType.ARROW) { - const filterednotes = Remapper.activeDiff.notes.filter(note => note.time >= startBeat && note.time <= endBeat); - InternalNoteTrail(filterednotes, length, type); -} - -/** - * Spawns a trail behind a note - similar to Somewhere Out There - * @param track The track to apply the effect on. - * @param length The length of the trail. - * @param type What the effect should use for the trail, it can be "arrow" or "block" - * @author cal117 - */ -function NoteTrailTrack(track: string, length: number = 5, type: NoteTrailType = NoteTrailType.ARROW) { - const filterednotes = Remapper.activeDiff.notes.filter(note => { - if(!note.customData) note.customData = {}; - if(Array.isArray(note.customData._track)) return note.customData._track.includes(track); - else if (note.customData._track == track) return true; - else return false; - }); - InternalNoteTrail(filterednotes, length, type); -} - -export { - NoteTrailType, - NoteTrail, - NoteTrailTrack -} +// deno-lint-ignore-file +import {activeDiff, CUT, Note, notesBetween, rand } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; + +enum NoteTrailType { + BLOCK = "block", + ARROW = "arrow", + BOTH = "both", +} + +export function InternalNoteTrail(filterednotes: Note[], length: number, type: NoteTrailType) { + filterednotes.forEach(note => { + note.noteGravity = false; + note.noteLook = false; + note.spawnEffect = false; + for (let i = 1; i <= length; i++) { + let dupe = new Note(note.time, note.type, note.direction, note.x, note.y); + dupe.noteGravity = false; + dupe.noteLook = false; + dupe.spawnEffect = false; + dupe.animate.position = [[rand(-0.2, 0.2), 0, i * 4, 0.4], [0, 0, 0, 0.7]]; + dupe.animate.localRotation = [[rand(0, 180), rand(0, 180), rand(0, 180), 0], [0, 0, 0, 0.3]]; + if (type.valueOf() == "block" || type.valueOf() == "both") dupe.animate.dissolve = [[0.1, 0], [0, 1, "easeInOutCubic"]]; + if (type.valueOf() == "arrow" || type.valueOf() == "both") dupe.animate.dissolveArrow = [[0.1, 0]]; + dupe.push(); + } + }) +} + +/** + * Spawns a trail behind a note - similar to Somewhere Out There + * @param startBeat The beat to start the effect on. + * @param endBeat The beat to end the effect on. + * @param length The length of the trail. + * @param type What the effect should use for the trail, it can be "NoteTrailType.ARROW" or "NoteTrailType.BLOCK". + * @author cal117 + * @author IntoTheAbyss490(Updating Everything) + */ +export function NoteTrail(startBeat: number, endBeat: number, length: number, type: NoteTrailType) { + const filterednotes = activeDiff.notes.filter(note => note.time >= startBeat && note.time <= endBeat); + InternalNoteTrail(filterednotes, length, type); +} + +//NoteTrailTrack(0, 100, 5, NoteTrailType.BLOCK) + +/** + * Spawns a trail behind a note - similar to Somewhere Out There + * @param track The track to apply the effect on. + * @param length The length of the trail. + * @param type What the effect should use for the trail, it can be "NoteTrailType.ARROW" or "NoteTrailType.BLOCK". + * @author cal117 + * @author IntoTheAbyss490(Updating Everything) + */ + +export function NoteTrailTrack(track: string, length: number, type: NoteTrailType) { + const filterednotes = activeDiff.notes.filter(note => { + if(Array.isArray(note.track.value)) return note.track.value.includes(track); + else if (note.track.value == track) return true; + else return false; + }); + InternalNoteTrail(filterednotes, length, type); +} + +//NoteTrailTrack("track", 5, NoteTrailType.BLOCK) \ No newline at end of file diff --git a/nootils/shapes/circle.ts b/nootils/shapes/circle.ts index d87aac1..6f891c0 100644 --- a/nootils/shapes/circle.ts +++ b/nootils/shapes/circle.ts @@ -1,23 +1,9 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - -/** - * Spawns a wall circle that you can later animate with AnimateTrack, adapted from Reddek's function. - * @param startTime The beat that the circle should be spawned on. - * @param endTime The beat that the circle should disappear. - * @param track What track the walls should be assigned to. - * @param radius How big the radius of the circle should be. - * @param amount How many walls should be in the circle. - * @param height How tall the walls in the circle should be. - * @param length How long the walls in the circle should be. - * @param x On which X position the circle should spawn. - * @param y On which Y position the circle should spawn. - * @param z On which Z position the circle should spawn. - * @author StormPacer - */ +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; export function Circle(startTime: number, endTime: number, track: string, radius: number, amount: number, height: number, length: number, x: number, y: number, z: number) { for (let i = 0; i < amount; i++) { - let wall = new Remapper.Wall(startTime, endTime - startTime, 0, 0, 0) + let wall = new Wall(startTime, endTime - startTime, 0, 0, 0) let angle = Math.PI * 2 / amount; let rot = 360 / amount * i; @@ -26,17 +12,14 @@ export function Circle(startTime: number, endTime: number, track: string, radius let sx = x + Math.cos(radians) * radius - width / 2; let sy = y + Math.sin(radians) * radius - height / 2; - wall.customData = { - _interactable: false, - _track: track, - _scale: [width, height, length], - _rotation: [0, 0, 0], - _localRotation: [0, 0, 90 + rot], - _position: [sx, sy, 0], - _animation: { - _definitePosition: [[0, 0, z, 0]] - } - } - wall.push() + wall.interactable = false, + wall.track.value = track, + wall.scale = [width, height, length], + wall.rotation = [0, 0, 0], + wall.localRotation = [0, 0, 90 + rot], + wall.position = [sx, sy], + wall.animate.definitePosition = [[0, 0, z, 0]] + + wall.push() } } \ No newline at end of file diff --git a/nootils/shapes/square.ts b/nootils/shapes/square.ts index 2c50c0f..bfd46e3 100644 --- a/nootils/shapes/square.ts +++ b/nootils/shapes/square.ts @@ -1,59 +1,41 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - -/** - * Spawns a wall square that you can later animate with AnimateTrack. - * @param startTime The beat that the square should be spawned on. - * @param endTime The beat that the square should disappear. - * @param track What track the square walls should be assigned to. - * @param x On which X position the square should spawn. - * @param y On which Y position the square should spawn. - * @param z On which Z position the square should spawn. - * @param length How long the square walls should be. - * @author StormPacer - */ +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; export function Square(startTime: number, endTime: number, track: string, x: number, y: number, z: number, length: number) { - let wall1 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) - - wall1.customData = { - _track: track, - _scale: [10, 0.1, length], - _animation: { - _definitePosition: [[x, y, z, 0]] - } - } + let wall1 = new Wall(startTime, endTime - startTime, 0, 1) + + wall1.track.value = track, + wall1.scale = [10, 0.1, length], + + wall1.animate.definitePosition = [[x, y, z, 0]] + wall1.push() - let wall2 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) - wall2.customData = { - _track: track, - _scale: [0.1, 10, length], - _animation: { - _definitePosition: [[x + 9.8, y, z, 0]] - } - } + let wall2 = new Wall(startTime, endTime - startTime, 0, 1) + + wall2.track.value = track, + wall2.scale = [0.1, 10, length], + + wall2.animate.definitePosition = [[x + 9.8, y, z, 0]] + wall2.push() - let wall3 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) + let wall3 = new Wall(startTime, endTime - startTime, 0, 1) + + wall3.track.value = track, + wall3.scale = [0.1, 10, length], + + wall3.animate.definitePosition = [[x, y, z, 0]] - wall3.customData = { - _track: track, - _scale: [0.1, 10, length], - _animation: { - _definitePosition: [[x, y, z, 0]] - } - } wall3.push() - let wall4 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) + let wall4 = new Wall(startTime, endTime - startTime, 0, 1) + + wall4.track.value = track, + wall4.scale = [10, 0.1, length], - wall4.customData = { - _track: track, - _scale: [10, 0.1, length], - _animation: { - _definitePosition: [[x + -0.1, y + 10, z, 0]] - } - } + wall4.animate.definitePosition = [[x + -0.1, y + 10, z, 0]] + wall4.push() } \ No newline at end of file diff --git a/nootils/shapes/triangle.ts b/nootils/shapes/triangle.ts index dd63e96..b171cbb 100644 --- a/nootils/shapes/triangle.ts +++ b/nootils/shapes/triangle.ts @@ -1,47 +1,33 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" - -/** - * Spawns a wall triangle that you can later animate with AnimateTrack. - * @param startTime The beat that the triangle should be spawned on. - * @param endTime The beat that the triangle should disappear. - * @param track What track the triangle walls should be assigned to. - * @param x On which X position the triangle should spawn. - * @param y On which Y position the triangle should spawn. - * @param z On which Z position the triangle should spawn. - * @param length How long the triangle walls should be. - * @author StormPacer - */ +// deno-lint-ignore-file +import { Wall } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; export function Triangle(startTime: number, endTime: number, track: string, x: number, y: number, z: number, length: number) { - let wall1 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) - wall1.customData = { - _scale: [10, 0.1, length], - _track: track, - _animation: { - _definitePosition: [[x, y, z, 0]] - } - } + let wall1 = new Wall(startTime, endTime - startTime, 0, 1) + + wall1.scale = [10, 0.1, length], + wall1.track.value = track, + + wall1.animate.definitePosition = [[x, y, z, 0]] + wall1.push() - let wall2 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) - wall2.customData = { - _scale: [10, 0.1, length], - _localRotation: [0, 0, -60], - _track: track, - _animation: { - _definitePosition: [[2.39 + x, 4.25 + y, z, 0]] - } - } + let wall2 = new Wall(startTime, endTime - startTime, 0, 1) + + wall2.scale = [10, 0.1, length], + wall2.localRotation = [0, 0, -60], + wall2.track.value = track, + + wall2.animate.definitePosition = [[2.39 + x, 4.25 + y, z, 0]] + wall2.push() - let wall3 = new Remapper.Wall(startTime, endTime - startTime, 0, 1) - wall3.customData = { - _scale: [10, 0.1, length], - _localRotation: [0, 0, 60], - _track: track, - _animation: { - _definitePosition: [[-2.39 + x, 4.25 + y, z, 0]] - } - } + let wall3 = new Wall(startTime, endTime - startTime, 0, 1) + + wall3.scale = [10, 0.1, length], + wall3.localRotation = [0, 0, 60], + wall3.track.value = track, + + wall3.animate.definitePosition = [[-2.39 + x, 4.25 + y, z, 0]] + wall3.push() } \ No newline at end of file diff --git a/nootils/utils/giveTrack.ts b/nootils/utils/giveTrack.ts index 0613ecc..69b09f8 100644 --- a/nootils/utils/giveTrack.ts +++ b/nootils/utils/giveTrack.ts @@ -1,4 +1,4 @@ -import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" +import { activeDiff } from "https://deno.land/x/remapper@3.1.2/src/mod.ts"; /** * Gives the notes between desired beats a track. @@ -6,94 +6,36 @@ import * as Remapper from "https://deno.land/x/remapper@2.1.0/src/mod.ts" * @param t1 From which beat it should start assigning the track. * @param t2 To which beat it should assign the tracks to. * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -function GiveNotesTrack(track: string, t1: number, t2: number) { - const filterednotes = Remapper.activeDiff.notes.filter(n => n.time >= t1 && n.time <= t2) +export function GiveNotesTrack(track: string, t1: number, t2: number) { + const filterednotes = activeDiff.notes.filter(n => n.time >= t1 && n.time <= t2) filterednotes.forEach(note => { - if (!note.customData._track) note.customData._track = track - if (Array.isArray(note.customData._track)) note.customData._track.push(track) - else if (note.customData._track != track) note.customData._track = [note.customData._track, track] + if (!note.track.value) note.track.value = track + if (Array.isArray(note.track.value)) note.track.value.push(track) + else if (note.track.value != track) note.track.value = [note.track.value, track] }); } +//GiveNotesTrack("Track", 0, 100) + /** * Gives the walls between desired beats a track. * @param track The track you want the walls to have. * @param t1 From which beat it should start assigning the track. * @param t2 To which beat it should assign the tracks to. - * @author StormPacer + * @author StormPacer + * @author IntoTheAbyss490(Updating Everything) */ -function GiveWallsTrack(track: string, t1: number, t2: number) { - const filteredwalls = Remapper.activeDiff.walls.filter(o => o.time >= t1 && o.time <= t2) +export function GiveWallsTrack(track: string, t1: number, t2: number) { + const filteredwalls = activeDiff.walls.filter(o => o.time >= t1 && o.time <= t2) filteredwalls.forEach(wall => { if (!wall.customData) wall.customData = {}; - if (Array.isArray(wall.customData._track)) wall.customData._track.push(track) - else wall.customData._track = track; - }) -} - -/** - * Gives the notes between desired beats a track. Separates by lanes - * @param lane1Track The track you want the notes on lane 1 to have. - * @param lane2Track The track you want the notes on lane 2 to have. - * @param lane3Track The track you want the notes on lane 3 to have. - * @param lane4Track The track you want the notes on lane 4 to have. - * @param t1 From which beat it should start assigning the track. - * @param t2 To which beat it should assign the tracks to. - * @author StormPacer - */ - -function GiveNotesOnLanesTrack(lane1Track: string, lane2Track: string, lane3Track: string, lane4Track: string, t1: number, t2: number) { - const filterednotes = Remapper.activeDiff.notes.filter(n => n.time >= t1 && n.time <= t2) - filterednotes.forEach(note => { - if (note.json._lineLayer == 0) { - if (!note.customData._track) note.customData._track = lane1Track - if (Array.isArray(note.customData._track)) note.customData._track.push(lane1Track) - else if (note.customData._track != lane1Track) note.customData._track = [note.customData._track, lane1Track] - } - if (note.json._lineLayer == 1) { - if (!note.customData._track) note.customData._track = lane2Track - if (Array.isArray(note.customData._track)) note.customData._track.push(lane2Track) - else if (note.customData._track != lane2Track) note.customData._track = [note.customData._track, lane2Track] - } - if (note.json._lineLayer == 2) { - if (!note.customData._track) note.customData._track = lane3Track - if (Array.isArray(note.customData._track)) note.customData._track.push(lane3Track) - else if (note.customData._track != lane3Track) note.customData._track = [note.customData._track, lane3Track] - } - if (note.json._lineLayer == 3) { - if (!note.customData._track) note.customData._track = lane4Track - if (Array.isArray(note.customData._track)) note.customData._track.push(lane4Track) - else if (note.customData._track != lane4Track) note.customData._track = [note.customData._track, lane4Track] - } - }) -} - -/** - * Gives the notes between desired beats a track. Separates by type - * @param type0Track The track you want the left notes to have. - * @param type1Track The track you want the right notes to have. - * @param t1 From which beat it should start assigning the track. - * @param t2 To which beat it should assign the tracks to. - * @author StormPacer - */ - -function GiveTypeNotesTrack(type0Track: string, type1Track: string, t1: number, t2: number) { - const filterednotes = Remapper.activeDiff.notes.filter(n => n.time >= t1 && n.time <= t2) - filterednotes.forEach(note => { - if (note.type == 0) { - if (!note.customData._track) note.customData._track = type0Track - if (Array.isArray(note.customData._track)) note.customData._track.push(type0Track) - else if (note.customData._track != type0Track) note.customData._track = [note.customData._track, type0Track] - } - if (note.type == 1) { - if (!note.customData._track) note.customData._track = type1Track - if (Array.isArray(note.customData._track)) note.customData._track.push(type1Track) - else if (note.customData._track != type0Track) note.customData._track = [note.customData._track, type1Track] - } + if (Array.isArray(wall.track.value)) wall.track.value.push(track) + else wall.track.value = track; }) } -export {GiveNotesTrack, GiveWallsTrack, GiveTypeNotesTrack, GiveNotesOnLanesTrack} +//GiveWallsTrack("Track", 0, 100) \ No newline at end of file