diff --git a/src/love/.vscode/settings.json b/src/love/.vscode/settings.json index c6c7c7c1..02229867 100644 --- a/src/love/.vscode/settings.json +++ b/src/love/.vscode/settings.json @@ -6,7 +6,8 @@ "redundant-parameter", "missing-parameter", "lowercase-global", - "assign-type-mismatch" + "assign-type-mismatch", + "redefined-local" ], "Lua.runtime.version": "LuaJIT", "Lua.runtime.special": [], diff --git a/src/love/data/weeks/weekData.lua b/src/love/data/weeks/weekData.lua index 2787cdbb..27b60421 100644 --- a/src/love/data/weeks/weekData.lua +++ b/src/love/data/weeks/weekData.lua @@ -1,5 +1,4 @@ return { - [0] = require "weeks.test", require "weeks.tutorial", require "weeks.week1", require "weeks.week2", @@ -8,5 +7,6 @@ return { require "weeks.week5", require "weeks.week6", require "weeks.week7", - require "weeks.weekend1" + require "weeks.weekend1", + require "weeks.test", } \ No newline at end of file diff --git a/src/love/data/weeks/weekMeta.lua b/src/love/data/weeks/weekMeta.lua index bc57e973..92f28cc5 100644 --- a/src/love/data/weeks/weekMeta.lua +++ b/src/love/data/weeks/weekMeta.lua @@ -1,10 +1,4 @@ return { -- Add/remove weeks here - [0] = { - "Test", - { - "Test" - } - }, { "Tutorial", { @@ -76,5 +70,11 @@ return { -- Add/remove weeks here {"Blazin"}, {"Cutscene", show=false} } - } + }, + { + "Test", + { + {"Test", diffs = {{"normal", ext=""}}}, -- Test only has a "normal" difficulty with no extension. + } + }, } \ No newline at end of file diff --git a/src/love/main.lua b/src/love/main.lua index 857d63d5..a6db68c3 100644 --- a/src/love/main.lua +++ b/src/love/main.lua @@ -299,10 +299,17 @@ function love.load() if song.show == nil then song.show = true end + if song.diffs == nil then + song.diffs = {{"easy", ext=""}, {"normal", ext=""}, {"hard", ext=""}} + else + for _, v in ipairs(song.diffs) do + v.ext = v[2] + end + end end end end - modWeekPlacement = #weekMeta -- everything after the main weeks is a mod folder. + modWeekPlacement = #weekMeta-1 -- everything after the main weeks is a mod folder. require "modules.extras" diff --git a/src/love/modules/Option.lua b/src/love/modules/Option.lua index 4be0fc0c..cc46746f 100644 --- a/src/love/modules/Option.lua +++ b/src/love/modules/Option.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global local Option = {} Option.__index = Option diff --git a/src/love/modules/mp4Handler.lua b/src/love/modules/mp4Handler.lua index b52a2c1e..0b3989ca 100644 --- a/src/love/modules/mp4Handler.lua +++ b/src/love/modules/mp4Handler.lua @@ -1,5 +1,7 @@ +---@diagnostic disable: undefined-global --https://github.com/semyon422/aqua/blob/27ae6a4ab6ae40c0bd68d94b3f14a88607fe0120/video/video.lua -- CURRENTLY ONLY SUPPORTS WINDOWS x64. PLEASE USE LOVE2D'S BUILT-IN .ogv SUPPORT FOR NOW. +-- ALSO ITS NOT EVEN ADDED YET LMFAO if love.system.getOS() == "Windows" then Try( function() diff --git a/src/love/modules/util.lua b/src/love/modules/util.lua index cc1b7b7a..5d03e5da 100644 --- a/src/love/modules/util.lua +++ b/src/love/modules/util.lua @@ -103,6 +103,14 @@ function util.tryExcept(try, except) end end +function util.cloneTable(t) + local newT = {} + for k, v in pairs(t) do + newT[k] = v + end + + return newT +end -- God like coding --[[ diff --git a/src/love/sprites/menu/uiStSheet.lua b/src/love/sprites/menu/uiStSheet.lua index 95567374..676038b8 100644 --- a/src/love/sprites/menu/uiStSheet.lua +++ b/src/love/sprites/menu/uiStSheet.lua @@ -1,4 +1,5 @@ return graphics.newSprite( + ---@diagnostic disable-next-line: undefined-global uiStSheetImg, -- Do not add the .png extension { {x = 0, y = 0, width = 200, height = 200, offsetX = 0, offsetY = 0, offsetWidth = 200, offsetHeight = 200}, -- 1: uiStSheet boolOff0000 diff --git a/src/love/sprites/pixel/icons.lua b/src/love/sprites/pixel/icons.lua index 38c6b22e..8568dd9a 100644 --- a/src/love/sprites/pixel/icons.lua +++ b/src/love/sprites/pixel/icons.lua @@ -10,11 +10,11 @@ return graphics.newSprite( {x = 60, y = 0, width = 30, height = 30, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0} -- 3: Spirit }, { - [bf] = {start = 1, stop = 1, speed = 0, offsetX = 0, offsetY = 0}, + ["bf"] = {start = 1, stop = 1, speed = 0, offsetX = 0, offsetY = 0}, ["senpai"] = {start = 2, stop = 2, speed = 0, offsetX = 0, offsetY = 0}, ["spirit"] = {start = 3, stop = 3, speed = 0, offsetX = 0, offsetY = 0} }, - bf, + "bf", false, { floored = true diff --git a/src/love/stages/city.lua b/src/love/stages/city.lua index d5e7efbe..734bf5a2 100644 --- a/src/love/stages/city.lua +++ b/src/love/stages/city.lua @@ -82,7 +82,7 @@ return { if stageImages["Train"].x < -3000 and stageImages["Train"].finishing then --trainReset() -- bruh this shit is trying to troll me rn - -- why does it reset the train then still do it 1 more time + -- why does it reset the train then still do it 1 more time stageImages["Train"].doShit = false stageImages["Train"].moving = false stageImages["Train"].startedMoving = false diff --git a/src/love/stages/mall.lua b/src/love/stages/mall.lua index 3cbff76b..1043037d 100644 --- a/src/love/stages/mall.lua +++ b/src/love/stages/mall.lua @@ -57,7 +57,7 @@ return { if song == 3 then camera.defaultZoom = 0.9 - if scaryIntro then + if __scaryIntro then camera.x, camera.y = -150, 750 camera.zoom = 2.5 diff --git a/src/love/states/menu/menuFreeplay.lua b/src/love/states/menu/menuFreeplay.lua index 48be0192..8adf9210 100644 --- a/src/love/states/menu/menuFreeplay.lua +++ b/src/love/states/menu/menuFreeplay.lua @@ -22,17 +22,13 @@ local function CreateWeek(weekIndex, hasErect) if not song.show then goto continue end local song = { name = song[1], - diffs = { - -- diffname, songExt - {"easy", ext=""}, - {"normal", ext=""}, - {"hard", ext=""}, - (hasErect and {"erect", ext="-erect"} or nil), - (hasErect and {"nightmare", ext="-erect"} or nil), - (hasPico and {"pico", ext="-pico"} or nil) - } + diffs = util.cloneTable(song.diffs) } + table.insert(song.diffs, (hasErect and {"erect", ext="-erect"} or nil)) + table.insert(song.diffs, (hasErect and {"nightmare", ext="-erect"} or nil)) + table.insert(song.diffs, (hasPico and {"pico", ext="-pico"} or nil)) + table.insert(week.songs, song) elseif type(song) == "string" then local song = { @@ -107,7 +103,6 @@ return { curWeekScore = 0 averageAccuracy = 0 ratingText = "???" - songDifficulty = 2 curSongScore = 0 curSongAccuracy = 0 @@ -116,9 +111,11 @@ return { averageAccuracy = string.format("%.2f%%", averageAccuracy) - for i = 0, #weekMeta do + for i = 1, #weekMeta do allWeeks[i] = CreateWeek(i) end + + songDifficulty = util.clamp(2, 1, #allWeeks[weekNum].songs[songNum].diffs) end, update = function(self, dt) @@ -126,7 +123,7 @@ return { if menuNum == 1 then weekNum = weekNum + 1 if weekNum > #weekMeta then - weekNum = 0 + weekNum = 1 end if songDifficulty > #allWeeks[weekNum].songs[songNum].diffs then songDifficulty = #allWeeks[weekNum].songs[songNum].diffs @@ -148,7 +145,7 @@ return { elseif input:pressed("up") then if menuNum == 1 then weekNum = weekNum - 1 - if weekNum < 0 then + if weekNum < 1 then weekNum = #weekMeta end diff --git a/src/love/weeks/week5.lua b/src/love/weeks/week5.lua index ef21252c..e417ccf2 100644 --- a/src/love/weeks/week5.lua +++ b/src/love/weeks/week5.lua @@ -21,7 +21,7 @@ local walls, escalator, christmasTree, snow local topBop, bottomBop, santa -local scaryIntro = false +__scaryIntro = false return { enter = function(self, from, songNum, songAppend, _songExt) @@ -46,7 +46,7 @@ return { if song == 3 then camera.defaultZoom = 0.9 - if scaryIntro then + if __scaryIntro then camera.x, camera.y = -150, 750 camera.zoom = 2.5 @@ -80,11 +80,11 @@ return { self:initUI() - if scaryIntro then + if __scaryIntro then Timer.after( 5, function() - scaryIntro = false + __scaryIntro = false camTimer = Timer.tween(2, camera, {x = -boyfriend.x + 100, y = -boyfriend.y + 75, sizeX = 0.9, sizeY = 0.9}, "out-quad") @@ -121,18 +121,18 @@ return { end, update = function(self, dt) - if not scaryIntro then + if not __scaryIntro then weeks:update(dt) stages["mall"]:update(dt) - if not (scaryIntro or countingDown or graphics.isFading()) and not (inst:isPlaying() and voicesBF:isPlaying()) and not paused then + if not (__scaryIntro or countingDown or graphics.isFading()) and not (inst:isPlaying() and voicesBF:isPlaying()) and not paused then if storyMode and song < 3 then weeks:saveData() song = song + 1 -- Winter Horrorland setup if song == 3 then - scaryIntro = true + __scaryIntro = true audio.playSound(sounds.lightsOff) @@ -169,7 +169,7 @@ return { stages["mall"]:draw() love.graphics.pop() - if not scaryIntro then + if not __scaryIntro then weeks:drawUI() end end,