diff --git a/src/love/data/characters/BFDarkCharacter.lua b/src/love/data/characters/BFDarkCharacter.lua index 93c9f01..b3ecab8 100644 --- a/src/love/data/characters/BFDarkCharacter.lua +++ b/src/love/data/characters/BFDarkCharacter.lua @@ -4,7 +4,7 @@ function BFDark:new() BaseCharacter.new(self, "sprites/characters/boyfriend-dark.lua") self.child = love.filesystem.load("sprites/characters/boyfriend.lua")() - self.child.alpha = 0 + self.child.alpha = 1 end function BFDark:update(dt) diff --git a/src/love/data/characters/BaseCharacter.lua b/src/love/data/characters/BaseCharacter.lua index 4eec878..a11152c 100644 --- a/src/love/data/characters/BaseCharacter.lua +++ b/src/love/data/characters/BaseCharacter.lua @@ -29,6 +29,8 @@ function Character:update(dt) self.spr.shader = self.shader self.spr.holdTimer = self.holdTimer + + self.spr.alpha = self.alpha or 1 end function Character:draw() diff --git a/src/love/data/characters/GFDarkCharacter.lua b/src/love/data/characters/GFDarkCharacter.lua index 81ccd5c..d991678 100644 --- a/src/love/data/characters/GFDarkCharacter.lua +++ b/src/love/data/characters/GFDarkCharacter.lua @@ -4,7 +4,7 @@ function GFDark:new() BaseCharacter.new(self, "sprites/characters/girlfriend-dark.lua") self.child = love.filesystem.load("sprites/characters/girlfriend.lua")() - self.child.alpha = 0 + self.child.alpha = 1 end function GFDark:update(dt) @@ -22,6 +22,8 @@ function GFDark:update(dt) self.child.shader = self.shader self.child.holdTimer = self.holdTimer + + self.child:setAnimFrame(self.spr:getAnimFrame()) end function GFDark:draw() diff --git a/src/love/data/characters/SpookyDarkCharacter.lua b/src/love/data/characters/SpookyDarkCharacter.lua new file mode 100644 index 0000000..f988bed --- /dev/null +++ b/src/love/data/characters/SpookyDarkCharacter.lua @@ -0,0 +1,64 @@ +local SpookyDarkCharacter = BaseCharacter:extend() + +function SpookyDarkCharacter:new() + BaseCharacter.new(self, "sprites/characters/skid-and-pump-dark.lua") + + self.child = love.filesystem.load("sprites/characters/skid-and-pump.lua")() + self.child.alpha = 1 +end + +function SpookyDarkCharacter:update(dt) + BaseCharacter.update(self, dt) + + self.child:update(dt) + + self.child.x, self.child.y = self.x, self.y + self.child.orientation = self.orientation + self.child.sizeX, self.child.sizeY = self.sizeX, self.sizeY + self.child.offsetX, self.child.offsetY = self.child.offsetX, self.child.offsetY + self.child.shearX, self.child.shearY = self.shearX, self.shearY + self.child.flipX, self.child.flipY = self.flipX, self.flipY + + self.child.shader = self.shader + + self.child.holdTimer = self.holdTimer +end + +function SpookyDarkCharacter:draw() + if not self.visible then return end + + self.child:draw() + self.spr:draw() +end + +function SpookyDarkCharacter:udraw(sx, sy) + if not self.visible then return end + + self.child:udraw(sx, sy) + self.spr:udraw(sx, sy) +end + +function SpookyDarkCharacter:beat(beat) + self.child:beat(beat) + self.spr:beat(beat) +end + +function SpookyDarkCharacter:animate(...) + self.child:animate(...) + self.spr:animate(...) +end + +function SpookyDarkCharacter:isAnimated() + return self.spr:isAnimated() +end + +function SpookyDarkCharacter:getAnimName() + return self.spr:getAnimName() +end + +function SpookyDarkCharacter:setAnimSpeed(speed) + self.child:setAnimSpeed(speed) + self.spr:setAnimSpeed(speed) +end + +return SpookyDarkCharacter \ No newline at end of file diff --git a/src/love/images/png/characters/spooky_dark.png b/src/love/images/png/characters/spooky_dark.png new file mode 100644 index 0000000..dd506e6 Binary files /dev/null and b/src/love/images/png/characters/spooky_dark.png differ diff --git a/src/love/main.lua b/src/love/main.lua index 3959c34..e0ee896 100644 --- a/src/love/main.lua +++ b/src/love/main.lua @@ -206,6 +206,7 @@ function love.load() NeneCharacter = require "data.characters.NeneCharacter" BFDarkCharacter = require "data.characters.BFDarkCharacter" GFDarkCharacter = require "data.characters.GFDarkCharacter" + SpookyDarkCharacter = require "data.characters.SpookyDarkCharacter" -- Modding importMods = require "modding.importMods" diff --git a/src/love/modules/graphics.lua b/src/love/modules/graphics.lua index b52f153..85fa217 100644 --- a/src/love/modules/graphics.lua +++ b/src/love/modules/graphics.lua @@ -206,6 +206,132 @@ local graphics = { return object end, + newCanvas = function(width, height, optionsTable) + -- like new image + local canvas = love.graphics.newCanvas(width, height) + + local object = { + x = 0, + y = 0, + orientation = 0, + sizeX = 1, + sizeY = 1, + offsetX = 0, + offsetY = 0, + shearX = 0, + shearY = 0, + + scrollX = 1, + scrollY = 1, + + visible = true, + alpha = 1, + + setCanvas = function(self, canvas) + canvas = canvas + width = canvas:getWidth() + height = canvas:getHeight() + end, + + renderTo = function(self, func) + local last = love.graphics.getCanvas() + love.graphics.push() + love.graphics.setCanvas(canvas) + love.graphics.translate(canvas:getWidth() / 2, canvas:getHeight() / 2) + love.graphics.scale(self.sizeX, self.sizeY) + love.graphics.translate(-canvas:getWidth() / 2, -canvas:getHeight() / 2) + love.graphics.translate(self.x/2, self.y/2) + func() + love.graphics.pop() + love.graphics.setCanvas(last) + end, + + getCanvas = function(self) + return canvas + end, + + getWidth = function(self) + return width + end, + + getHeight = function(self) + return height + end, + + setScale = function(self, scale) + self.sizeX, self.sizeY = scale, scale + end, + + draw = function(self) + local x = self.x + local y = self.y + + if options and options.floored then + x = math.floor(x) + y = math.floor(y) + end + + local lastColor = {love.graphics.getColor()} + graphics.setColor(lastColor[1], lastColor[2], lastColor[3], lastColor[4] * self.alpha) + + if self.visible then + love.graphics.draw( + canvas, + self.x, + self.y, + self.orientation, + self.sizeX, + self.sizeY, + math.floor(width / 2) + self.offsetX, + math.floor(height / 2) + self.offsetY, + self.shearX, + self.shearY + ) + end + + love.graphics.setColor(lastColor[1], lastColor[2], lastColor[3]) + end, + + udraw = function(self, sx, sy) + local sx = sx or 7 + local sy = sy or sx + local x = self.x + local y = self.y + + if options and options.floored then + x = math.floor(x) + y = math.floor(y) + end + + local lastColor = {love.graphics.getColor()} + graphics.setColor(lastColor[1], lastColor[2], lastColor[3], lastColor[4] * self.alpha) + + if self.visible then + love.graphics.draw( + canvas, + self.x, + self.y, + self.orientation, + sx, + sy, + math.floor(width / 2) + self.offsetX, + math.floor(height / 2) + self.offsetY, + self.shearX, + self.shearY + ) + end + + love.graphics.setColor(lastColor[1], lastColor[2], lastColor[3]) + end + } + + object:setCanvas(canvas) + + options = optionsTable + + return object + end, + newSprite = function(imageData, frameData, animData, animName, loopAnim, optionsTable) local sheet, sheetWidth, sheetHeight @@ -356,6 +482,13 @@ local graphics = { return isLooped end, + setAnimFrame = function(self, frame) + frame = frame + end, + getAnimFrame = function(self) + return frame + end, + setOptions = function(self, optionsTable) options = optionsTable end, diff --git a/src/love/modules/overrides.lua b/src/love/modules/overrides.lua index d18b2b1..10fe000 100644 --- a/src/love/modules/overrides.lua +++ b/src/love/modules/overrides.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: duplicate-set-field love._fps_cap = 60 love.run = love.system.getOS() ~= "NX" and function() @@ -58,3 +59,29 @@ end or love.run function love.setFpsCap(fps) love._fps_cap = fps or 60 end + +local curTranslate = {x = 0, y = 0} +local curScale = {x = 1, y = 1} + +local o_graphics_translate = love.graphics.translate +local o_graphics_scale = love.graphics.scale + +function love.graphics.translate(x, y) + curTranslate.x = curTranslate.x + x + curTranslate.y = curTranslate.y + y + o_graphics_translate(x, y) +end + +function love.graphics.scale(x, y) + curScale.x = x + curScale.y = y + o_graphics_scale(x, y) +end + +function love.graphics.getTranslate() + return curTranslate.x, curTranslate.y +end + +function love.graphics.getScale() + return curScale.x, curScale.y +end \ No newline at end of file diff --git a/src/love/sprites/characters/boyfriend-dark.lua b/src/love/sprites/characters/boyfriend-dark.lua index 4990758..91b83ca 100644 --- a/src/love/sprites/characters/boyfriend-dark.lua +++ b/src/love/sprites/characters/boyfriend-dark.lua @@ -309,7 +309,7 @@ return graphics.newSprite( ["songLEFT miss"] = {start = 101, stop = 134, speed = 24, offsetX = 21, offsetY = 11}, ["singRIGHT"] = {start = 135, stop = 196, speed = 24, offsetX = -43, offsetY = -1}, ["singRIGHT miss"] = {start = 197, stop = 242, speed = 24, offsetX = -39, offsetY = 13}, - ["singUP"] = {start = 243, stop = 257, speed = 24, offsetX = -32, offsetY = 17}, + ["singUP"] = {start = 243, stop = 257, speed = 24, offsetX = -27, offsetY = 17}, ["singUP miss"] = {start = 258, stop = 281, speed = 24, offsetX = -25, offsetY = 10}, ["idle"] = {start = 282, stop = 295, speed = 24, offsetX = 0, offsetY = 0}, ["shaking"] = {start = 296, stop = 299, speed = 24, offsetX = -4, offsetY = 0}, diff --git a/src/love/sprites/characters/girlfriend-dark.lua b/src/love/sprites/characters/girlfriend-dark.lua index ab5cc05..65e9987 100644 --- a/src/love/sprites/characters/girlfriend-dark.lua +++ b/src/love/sprites/characters/girlfriend-dark.lua @@ -10,6 +10,8 @@ return graphics.newSprite( {x = 2849, y = 1291, width = 698, height = 657, offsetX = -2, offsetY = -0, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 7: GF Cheer0001 {x = 2140, y = 1300, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 8: GF Cheer0004 {x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 9: GF Cheer0005 + + {x = 2848, y = 1958, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 39: GF Dancing Beat0029 {x = 5, y = 3278, width = 698, height = 634, offsetX = -2, offsetY = -14, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 10: GF Dancing Beat0000 {x = 2857, y = 5, width = 703, height = 634, offsetX = -0, offsetY = -14, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 11: GF Dancing Beat0001 {x = 2857, y = 649, width = 703, height = 632, offsetX = -0, offsetY = -16, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 12: GF Dancing Beat0002 @@ -39,7 +41,7 @@ return graphics.newSprite( {x = 5, y = 1980, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 36: GF Dancing Beat0026 {x = 5, y = 1980, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 37: GF Dancing Beat0027 {x = 2848, y = 1958, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 38: GF Dancing Beat0028 - {x = 2848, y = 1958, width = 698, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648, rotated = false}, -- 39: GF Dancing Beat0029 + {x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 40: GF Cheer0006 {x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 41: GF Cheer0007 {x = 1427, y = 1302, width = 698, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657, rotated = false}, -- 42: GF Cheer0008 @@ -60,8 +62,8 @@ return graphics.newSprite( { ["cheer"] = {start = 40, stop = 55, speed = 24, offsetX = 0, offsetY = 5}, ["fear"] = {start = 3, stop = 6, speed = 24, offsetX = 0, offsetY = -3}, - ["danceLeft"] = {start = 10, stop = 24, speed = 24, offsetX = 0, offsetY = 0}, - ["danceRight"] = {start = 25, stop = 39, speed = 24, offsetX = 0, offsetY = 0}, + ["danceLeft"] = {start = 10, stop = 25, speed = 24, offsetX = 0, offsetY = 0}, + ["danceRight"] = {start = 26, stop = 39, speed = 24, offsetX = 0, offsetY = 0}, }, "danceLeft", false, diff --git a/src/love/sprites/characters/girlfriend.lua b/src/love/sprites/characters/girlfriend.lua index 48e9398..5fb1eac 100644 --- a/src/love/sprites/characters/girlfriend.lua +++ b/src/love/sprites/characters/girlfriend.lua @@ -42,6 +42,7 @@ return graphics.newSprite( {x = 2844, y = 0, width = 699, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657}, -- 19: GF Cheer0018 {x = 2844, y = 0, width = 699, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657}, -- 20: GF Cheer0019 {x = 2844, y = 0, width = 699, height = 654, offsetX = -2, offsetY = -3, offsetWidth = 703, offsetHeight = 657}, -- 21: GF Cheer0020 + {x = 1418, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 22: GF Dancing Beat0029 {x = 3553, y = 0, width = 699, height = 634, offsetX = -2, offsetY = -14, offsetWidth = 703, offsetHeight = 648}, -- 23: GF Dancing Beat0000 {x = 4262, y = 0, width = 703, height = 634, offsetX = 0, offsetY = -14, offsetWidth = 703, offsetHeight = 648}, -- 24: GF Dancing Beat0001 @@ -72,6 +73,7 @@ return graphics.newSprite( {x = 709, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 49: GF Dancing Beat0026 {x = 709, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 50: GF Dancing Beat0027 {x = 1418, y = 1325, width = 699, height = 642, offsetX = -2, offsetY = -6, offsetWidth = 703, offsetHeight = 648}, -- 51: GF Dancing Beat0028 + {x = 2127, y = 1325, width = 699, height = 635, offsetX = -2, offsetY = -13, offsetWidth = 703, offsetHeight = 648}, -- 52: GF Dancing Beat Hair Landing0000 {x = 2836, y = 1325, width = 703, height = 635, offsetX = 0, offsetY = -13, offsetWidth = 703, offsetHeight = 648}, -- 53: GF Dancing Beat Hair Landing0001 {x = 3549, y = 1325, width = 703, height = 619, offsetX = 0, offsetY = -29, offsetWidth = 703, offsetHeight = 648}, -- 54: GF Dancing Beat Hair Landing0002 diff --git a/src/love/sprites/characters/skid-and-pump-dark.lua b/src/love/sprites/characters/skid-and-pump-dark.lua new file mode 100644 index 0000000..41870f6 --- /dev/null +++ b/src/love/sprites/characters/skid-and-pump-dark.lua @@ -0,0 +1,126 @@ +return graphics.newSprite( + graphics.imagePath("characters/spooky_dark"), + { + {x = 0, y = 0, width = 644, height = 578, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 1: Cheer0000 + {x = 0, y = 0, width = 644, height = 578, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 2: Cheer0001 + {x = 649, y = 0, width = 618, height = 557, offsetX = -14, offsetY = -20, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 3: Cheer0002 + {x = 649, y = 0, width = 618, height = 557, offsetX = -14, offsetY = -20, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 4: Cheer0003 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 5: Cheer0004 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 6: Cheer0005 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 7: Cheer0006 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 8: Cheer0007 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 9: Cheer0008 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 10: Cheer0009 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 11: Cheer0010 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 12: Cheer0011 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 13: Cheer0012 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 14: Cheer0013 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 15: Cheer0014 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 16: Cheer0015 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 17: Cheer0016 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 18: Cheer0017 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 19: Cheer0018 + {x = 1272, y = 0, width = 630, height = 564, offsetX = -6, offsetY = -12, offsetWidth = 644, offsetHeight = 578, rotated = false}, -- 20: Cheer0019 + {x = 1907, y = 0, width = 556, height = 527, offsetX = 0, offsetY = -2, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 21: SingLEFT0000 + {x = 1907, y = 0, width = 556, height = 527, offsetX = 0, offsetY = -2, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 22: SingLEFT0001 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 23: SingLEFT0002 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 24: SingLEFT0003 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 25: SingLEFT0004 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 26: SingLEFT0005 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 27: SingLEFT0006 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 28: SingLEFT0007 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 29: SingLEFT0008 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 30: SingLEFT0009 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 31: SingLEFT0010 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 32: SingLEFT0011 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 33: SingLEFT0012 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 34: SingLEFT0013 + {x = 2468, y = 0, width = 559, height = 531, offsetX = -5, offsetY = 0, offsetWidth = 564, offsetHeight = 531, rotated = false}, -- 35: SingLEFT0014 + {x = 3032, y = 0, width = 463, height = 408, offsetX = 0, offsetY = -4, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 36: SingDOWN0000 + {x = 3032, y = 0, width = 463, height = 408, offsetX = 0, offsetY = -4, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 37: SingDOWN0001 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 38: SingDOWN0002 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 39: SingDOWN0003 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 40: SingDOWN0004 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 41: SingDOWN0005 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 42: SingDOWN0006 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 43: SingDOWN0007 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 44: SingDOWN0008 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 45: SingDOWN0009 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 46: SingDOWN0010 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 47: SingDOWN0011 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 48: SingDOWN0012 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 49: SingDOWN0013 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 50: SingDOWN0014 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 51: SingDOWN0015 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 52: SingDOWN0016 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 53: SingDOWN0017 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 54: SingDOWN0018 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 55: SingDOWN0019 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 56: SingDOWN0020 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 57: SingDOWN0021 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 58: SingDOWN0022 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 59: SingDOWN0023 + {x = 3500, y = 0, width = 448, height = 409, offsetX = -8, offsetY = 0, offsetWidth = 463, offsetHeight = 412, rotated = false}, -- 60: SingDOWN0024 + {x = 0, y = 583, width = 399, height = 571, offsetX = -1, offsetY = 0, offsetWidth = 406, offsetHeight = 571, rotated = false}, -- 61: SingUP0000 + {x = 0, y = 583, width = 399, height = 571, offsetX = -1, offsetY = 0, offsetWidth = 406, offsetHeight = 571, rotated = false}, -- 62: SingUP0001 + {x = 404, y = 583, width = 406, height = 566, offsetX = 0, offsetY = -5, offsetWidth = 406, offsetHeight = 571, rotated = false}, -- 63: SingUP0002 + {x = 404, y = 583, width = 406, height = 566, offsetX = 0, offsetY = -5, offsetWidth = 406, offsetHeight = 571, rotated = false}, -- 64: SingUP0003 + {x = 404, y = 583, width = 406, height = 566, offsetX = 0, offsetY = -5, offsetWidth = 406, offsetHeight = 571, rotated = false}, -- 65: SingUP0004 + {x = 815, y = 583, width = 381, height = 549, offsetX = -50, offsetY = 0, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 66: Idle0001 + {x = 815, y = 583, width = 381, height = 549, offsetX = -50, offsetY = 0, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 67: Idle0002 + {x = 1201, y = 583, width = 379, height = 541, offsetX = -55, offsetY = -8, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 68: Idle0003 + {x = 1201, y = 583, width = 379, height = 541, offsetX = -55, offsetY = -8, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 69: Idle0004 + {x = 1585, y = 583, width = 357, height = 484, offsetX = -79, offsetY = -61, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 70: Idle0005 + {x = 1585, y = 583, width = 357, height = 484, offsetX = -79, offsetY = -61, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 71: Idle0006 + {x = 1947, y = 583, width = 354, height = 494, offsetX = -78, offsetY = -52, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 72: Idle0007 + {x = 1947, y = 583, width = 354, height = 494, offsetX = -78, offsetY = -52, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 73: Idle0008 + {x = 2306, y = 583, width = 492, height = 532, offsetX = 0, offsetY = -16, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 74: Idle0009 + {x = 2306, y = 583, width = 492, height = 532, offsetX = 0, offsetY = -16, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 75: Idle0010 + {x = 2803, y = 583, width = 481, height = 524, offsetX = -7, offsetY = -20, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 76: Idle0011 + {x = 2803, y = 583, width = 481, height = 524, offsetX = -7, offsetY = -20, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 77: Idle0012 + {x = 1585, y = 583, width = 357, height = 484, offsetX = -79, offsetY = -61, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 78: Idle0013 + {x = 1585, y = 583, width = 357, height = 484, offsetX = -79, offsetY = -61, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 79: Idle0014 + {x = 1947, y = 583, width = 354, height = 494, offsetX = -78, offsetY = -52, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 80: Idle0015 + {x = 1947, y = 583, width = 354, height = 494, offsetX = -78, offsetY = -52, offsetWidth = 492, offsetHeight = 549, rotated = false}, -- 81: Idle0016 + {x = 3289, y = 583, width = 442, height = 524, offsetX = 0, offsetY = -9, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 82: SingRIGHT0000 + {x = 3289, y = 583, width = 442, height = 524, offsetX = 0, offsetY = -9, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 83: SingRIGHT0001 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 84: SingRIGHT0002 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 85: SingRIGHT0003 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 86: SingRIGHT0004 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 87: SingRIGHT0005 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 88: SingRIGHT0006 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 89: SingRIGHT0007 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 90: SingRIGHT0008 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 91: SingRIGHT0009 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 92: SingRIGHT0010 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 93: SingRIGHT0011 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 94: SingRIGHT0012 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 95: SingRIGHT0013 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 96: SingRIGHT0014 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 97: SingRIGHT0015 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 98: SingRIGHT0016 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 99: SingRIGHT0017 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 100: SingRIGHT0018 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 101: SingRIGHT0019 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 102: SingRIGHT0020 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 103: SingRIGHT0021 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 104: SingRIGHT0022 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 105: SingRIGHT0023 + {x = 0, y = 1159, width = 437, height = 533, offsetX = 0, offsetY = 0, offsetWidth = 442, offsetHeight = 533, rotated = false}, -- 106: SingRIGHT0024 + }, + { + ["cheer"] = {start = 1, stop = 20, speed = 24, offsetX = 0, offsetY = 0}, + ["singLEFT"] = {start = 21, stop = 35, speed = 24, offsetX = 78, offsetY = -7}, + ["singDOWN"] = {start = 36, stop = 60, speed = 24, offsetX = -66, offsetY = -69}, + ["singUP"] = {start = 61, stop = 65, speed = 24, offsetX = 21, offsetY = 14}, + ["idle"] = {start = 66, stop = 81, speed = 24, offsetX = 0, offsetY = 0}, + ["singRIGHT"] = {start = 82, stop = 106, speed = 24, offsetX = -128, offsetY = -5}, + }, + "Idle", + false, + { + sing_duration = 4, + isCharacter = true, + icon = "spooky" + } +) \ No newline at end of file diff --git a/src/love/sprites/week2.erect/bgtrees.lua b/src/love/sprites/week2.erect/bgtrees.lua new file mode 100644 index 0000000..d88586e --- /dev/null +++ b/src/love/sprites/week2.erect/bgtrees.lua @@ -0,0 +1,22 @@ +return graphics.newSprite( + graphics.imagePath("week2.erect/bgtrees"), + { + {x = 0, y = 0, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 1: bgtrees0000 + {x = 605, y = 0, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 2: bgtrees0001 + {x = 1210, y = 0, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 3: bgtrees0002 + {x = 0, y = 405, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 4: bgtrees0003 + {x = 605, y = 405, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 5: bgtrees0004 + {x = 1210, y = 405, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 6: bgtrees0005 + {x = 0, y = 810, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 7: bgtrees0006 + {x = 605, y = 810, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 8: bgtrees0007 + {x = 1210, y = 810, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 9: bgtrees0008 + {x = 0, y = 1215, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 10: bgtrees0009 + {x = 605, y = 1215, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 11: bgtrees0010 + {x = 1210, y = 1215, width = 600, height = 400, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- 12: bgtrees0011 + }, + { + ["bgtrees"] = {start = 1, stop = 12, speed = 5, offsetX = 0, offsetY = 0}, + }, + "bgtrees", + true +) \ No newline at end of file diff --git a/src/love/stages/erect/hauntedHouse.lua b/src/love/stages/erect/hauntedHouse.lua index 94c5cad..03e244d 100644 --- a/src/love/stages/erect/hauntedHouse.lua +++ b/src/love/stages/erect/hauntedHouse.lua @@ -17,19 +17,26 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . ------------------------------------------------------------------------------]] +local lightningStrikeBeat = 0 +local lightningStrikeOffset = 8 + local curStageStyle = "dark" return { enter = function() + lightningStrikeBeat = 0 + lightningStrikeOffset = 8 stageImages = { bg_light = graphics.newImage(graphics.imagePath("week2.erect/bgLight")), bg_dark = graphics.newImage(graphics.imagePath("week2.erect/bgDark")), + treesSprite = love.filesystem.load("sprites/week2.erect/bgtrees.lua")(), + trees = graphics.newCanvas(600, 400), stairs_light = graphics.newImage(graphics.imagePath("week2.erect/stairsLight")), stairs_dark = graphics.newImage(graphics.imagePath("week2.erect/stairsDark")), } - enemy = BaseCharacter("sprites/characters/skid-and-pump.lua") + enemy = SpookyDarkCharacter() boyfriend = BFDarkCharacter() - girlfriend = GFDarkCharacter() + girlfriend = GFDarkCharacter() girlfriend.x, girlfriend.y = 134, 12 enemy.x, enemy.y = -337, 140 @@ -37,25 +44,101 @@ return { stageImages.stairs_dark.x = 658 stageImages.stairs_light.x = 658 + stageImages.treesSprite.x, stageImages.treesSprite.y = -224, -158 + + stageImages.stairs_light.alpha = 0 + stageImages.bg_light.alpha = 0 + + if love.system.getOS() ~= "NX" then + shaders["rain"]:send("uIntensity", 0.4) + shaders["rain"]:send("uScale", 720 / 200 * 2) + end end, load = function() end, update = function(self, dt) - + stageImages["treesSprite"]:update(dt) + + if love.system.getOS() ~= "NX" then + shaders["rain"]:send("uTime", love.timer.getTime()) + end + + if love.math.random(10) == 10 and Conductor.curBeat > (lightningStrikeBeat + lightningStrikeOffset) then + self:doLightningStrike(true, Conductor.curBeat) + end end, + + doLightningStrike = function(self, playSound, beat) + if playSound then + audio.playSound(sounds["thunder"][love.math.random(2)]) + end + + stageImages["bg_light"].alpha = 1 + stageImages["stairs_light"].alpha = 1 + + boyfriend.alpha = 0 + girlfriend.alpha = 0 + enemy.alpha = 0 + + Timer.after(0.06, function() + stageImages["bg_light"].alpha = 0 + stageImages["stairs_light"].alpha = 0 + + boyfriend.alpha = 1 + girlfriend.alpha = 1 + enemy.alpha = 1 + end) + + Timer.after(0.12, function() + stageImages["bg_light"].alpha = 1 + stageImages["stairs_light"].alpha = 1 + + boyfriend.alpha = 0 + girlfriend.alpha = 0 + enemy.alpha = 0 + + Timer.tween(1.5, stageImages["bg_light"], {alpha = 0}, "linear") + Timer.tween(1.5, stageImages["stairs_light"], {alpha = 0}, "linear") + Timer.tween(1.5, boyfriend, {alpha = 1}, "linear") + Timer.tween(1.5, girlfriend, {alpha = 1}, "linear") + Timer.tween(1.5, enemy, {alpha = 1}, "linear") + end) + + lightningStrikeBeat = beat + lightningStrikeOffset = love.math.random(8, 24) + + boyfriend:animate("shaking") + girlfriend:animate("fear", false, function() girlfriend:animate("danceLeft", false) end) + end, draw = function() - love.graphics.push() + --[[ stageImages["trees"]:renderTo(function() + love.graphics.clear() + love.graphics.translate(stageImages["trees"]:getWidth() / 2, stageImages["trees"]:getHeight() / 2) + stageImages["treesSprite"]:draw() + end) ]] + love.graphics.push() + --[[ if love.system.getOS() ~= "NX" then + love.graphics.setShader(shaders["rain"]) + end ]] + love.graphics.translate(camera.x * 0.8, camera.y * 0.8) + stageImages[--[[ "trees" ]]"treesSprite"]:draw() + --[[ love.graphics.setShader() ]] + -- look. buddy. i don't like you. + love.graphics.pop() + love.graphics.push() love.graphics.translate(camera.x, camera.y) - stageImages["bg_" .. curStageStyle]:draw() + stageImages["bg_dark"]:draw() + stageImages["bg_light"]:draw() girlfriend:draw() enemy:draw() boyfriend:draw() - stageImages["stairs_" .. curStageStyle]:draw() + stageImages["stairs_dark"]:draw() + stageImages["stairs_light"]:draw() love.graphics.pop() end, diff --git a/src/love/states/menu/menuFreeplay.lua b/src/love/states/menu/menuFreeplay.lua index fad39e8..2031c09 100644 --- a/src/love/states/menu/menuFreeplay.lua +++ b/src/love/states/menu/menuFreeplay.lua @@ -35,7 +35,7 @@ local function CreateWeek(weekIndex, hasErect) diffs = {} } for _, diff in ipairs(song.diffs or {}) do - table.insert(newSong.diffs, {diff[1] or "???", diff[2] or "", diff[3] or diff[1] or "???", diff[4] or ""}) + table.insert(newSong.diffs, {diff[1] or "???", diff[2] or "", diff[3] or diff[1] or "???", diff[4] or "-bf"}) end if hasErect then diff --git a/src/love/states/weeks.lua b/src/love/states/weeks.lua index e90b5d3..d91f83d 100644 --- a/src/love/states/weeks.lua +++ b/src/love/states/weeks.lua @@ -34,9 +34,6 @@ end local ratingTimers = {} local useAltAnims -local option = "normal" - -local countNum = 4 -- Used for countdown healthLerp = 1 @@ -942,8 +939,7 @@ end return CONSTANTS.WEEKS.MAX_SCORE else local factor = 1 - 1 / (1 + math.exp(-CONSTANTS.WEEKS.SCORING_SLOPE * (msTiming - CONSTANTS.WEEKS.SCORING_OFFSET))) - --var score = funkin_play_scoring_Scoring.PBOT1_MAX_SCORE * factor + funkin_play_scoring_Scoring.PBOT1_MIN_SCORE | 0; - local score = bit.bxor(CONSTANTS.WEEKS.MAX_SCORE * factor + CONSTANTS.WEEKS.MIN_SCORE, 0) + local score = math.floor(CONSTANTS.WEEKS.MAX_SCORE * factor + CONSTANTS.WEEKS.MIN_SCORE) return score end end @@ -972,8 +968,6 @@ end local curInput = CONSTANTS.WEEKS.INPUT_LIST[i] local gfNote = gfNotes[i] - local noteNum = i - enemyArrow:update(dt) boyfriendArrow:update(dt)