Skip to content

Commit

Permalink
some fixies and some duplications removes
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed May 9, 2024
1 parent 551867b commit cc648b5
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 888 deletions.
501 changes: 0 additions & 501 deletions src/love/.backup/boyfriend.xml

This file was deleted.

257 changes: 0 additions & 257 deletions src/love/.backup/girlfriend.xml

This file was deleted.

92 changes: 0 additions & 92 deletions src/love/.backup/notes.xml

This file was deleted.

1 change: 1 addition & 0 deletions src/love/conf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function love.conf(t)
t.identity = "VE-FNFR"
t.version = "11.4"
t.console = _debug
t.window.vsync = false

if _debug then
local major, minor, revision, codename = love.getVersion()
Expand Down
6 changes: 5 additions & 1 deletion src/love/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function borderedText(text,x,y,r,sx,sy,ox,oy,kx,ky,alpha)
graphics.setColor(1,1,1, alpha or 1)
love.graphics.print(text,x,y,r,sx,sy,ox,oy,kx,ky)
end

mainDrawing = true

require "modules.overrides"
Expand All @@ -160,7 +161,7 @@ function love.load()
json = require "lib.json"
lume = require "lib.lume"
Object = require "lib.classic"
xml = require "lib.xml".parse
xml = require "lib.xml"
lovefftINST = require "lib.fft.lovefft"
lovefftBFVOCALS = require "lib.fft.lovefft"
lovefftENEMYVOCALS = require "lib.fft.lovefft"
Expand Down Expand Up @@ -664,6 +665,9 @@ function love.focus(t)
end

function love.quit()
if settings.lastDEBUGOption then
settings.showDebug = settings.lastDEBUGOption
end
saveSettings(false)
saveSavedata()
end
16 changes: 15 additions & 1 deletion src/love/modules/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,21 @@ CONSTANTS.WEEKS = {
"go",
"set",
"ready"
}
},
JUDGE_THRES = {
PERFECT_THRES = 5,
MISS_THRES = 160,
KILLER_THRES = 12.5,
SICK_THRES = 45,
GOOD_THRES = 90,
BAD_THRES = 135,
SHIT_THRES = 160
},
MAX_SCORE = 500,
MIN_SCORE = 0,
MISS_SCORE = 0,
SCORING_OFFSET = 54.00,
SCORING_SLOPE = 0.080
}

return CONSTANTS
4 changes: 2 additions & 2 deletions src/love/modules/deprecated.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ function weeks.legacyGenerateNotes(self, chart)
sprites.rightArrow
}

for i, section in ipairs(chart.notes) do
for _, section in ipairs(chart.notes) do
local mustHitSection = section.mustHitSection or false
for j, noteData in ipairs(section.sectionNotes) do
for _, noteData in ipairs(section.sectionNotes) do
local time = noteData[1]
local noteType = noteData[2]
local noteVer = noteData[4] or "normal"
Expand Down
2 changes: 1 addition & 1 deletion src/love/modules/xml/Sprite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Sprite.getFramesFromSparrow(tex, desc)

local f = {texture=tex, frames={}}
local sw, sh = tex:getWidth(), tex:getHeight()
for i, c in ipairs(xml(desc)) do
for i, c in ipairs(xml.parse(desc)) do
if c.tag == "SubTexture" then
table.insert(f.frames, Sprite.newFrame(
c.attr.name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
return graphics.newSprite(
love.graphics.newImage(graphics.imagePath("weekend1/darnell")),
love.graphics.newImage(graphics.imagePath("characters/darnell")),
-- Automatically generated from darnell.xml
{
{x = 432, y = 921, width = 374, height = 471, offsetX = -44, offsetY = -79, offsetWidth = 643, offsetHeight = 665, rotated = false}, -- 1: Idle0001
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
return graphics.newSprite(
love.graphics.newImage(graphics.imagePath("weekend1/Nene")),
love.graphics.newImage(graphics.imagePath("characters/Nene")),
-- Automatically generated from Nene.xml
{
{x = 0, y = 0, width = 433, height = 294, offsetX = 42, offsetY = -45, offsetWidth = 312, offsetHeight = 496, rotated = true}, -- 1: ComboCheer0001
Expand Down
2 changes: 1 addition & 1 deletion src/love/stages/tank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ return {

if not inCutscene then
tankAngle = (tankAngle or 10) + (tankSpeed or 7) * dt
stageImages["Tank Rolling"].x = 0 + 1500 * math.cos(math.pi / 180 * (1 * tankAngle + 180))
stageImages["Tank Rolling"].x = 1500 * math.cos(math.pi / 180 * (1 * tankAngle + 180))
stageImages["Tank Rolling"].y = 1200 + 1100 * math.sin(math.pi / 180 * (1 * tankAngle + 180))

stageImages["Tank Rolling"].orientation = math.rad(tankAngle - 90 + 15)
Expand Down
1 change: 1 addition & 0 deletions src/love/states/debug/debugMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ return {
state = frameDebug
}
}
settings.lastDEBUGOption = settings.showDebug
settings.showDebug = false
end,

Expand Down
2 changes: 1 addition & 1 deletion src/love/states/menu/menuCredits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ return {
}
},
["Friday Night Funkin"] = {
heading = CreateText("Friday Night Funkin'", true),
heading = CreateText("Friday Night Funkin", true),
selected = false,
members = {
{name = CreateText("ninjamuffin99"), desc = "Programmer", selected = false, callback = function() love.system.openURL("https://twitter.com/ninja_muffin99") end},
Expand Down
12 changes: 2 additions & 10 deletions src/love/states/menu/menuSelect.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
local leftFunc, rightFunc, confirmFunc, backFunc, drawFunc
local confirmFunc

local menuState

local menuButton

local function switchMenu(menu)
menuState = 1
end

return {
enter = function(self, previous)

Expand Down Expand Up @@ -40,7 +35,7 @@ return {
end
)
end
},
},
{
sprite = love.filesystem.load("sprites/menu/freeplay.lua")(),
confirm = function()
Expand Down Expand Up @@ -111,8 +106,6 @@ return {
buttons[menuButton].confirm()
end

switchMenu(1)

graphics:fadeInWipe(0.6)

end,
Expand Down Expand Up @@ -171,7 +164,6 @@ return {
love.graphics.pop()
love.graphics.setFont(font)
love.graphics.pop()

end,

leave = function(self)
Expand Down
29 changes: 12 additions & 17 deletions src/love/states/weeks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
------------------------------------------------------------------------------]]

-- Nabbed from the JS source of FNF v0.3.0 (PBOT1 Scoring)
local MaxScore, ScoringOffset, ScoringSlope = 500, 54.00, 0.080
local MinScore, MissScore = 9, 0
local PerfectThres, MissThres, KillerThres, SickThres, GoodThres, BadThres, ShitThres = 5, 160, 12.5, 45, 90, 135, 160

local DefaultTimeSignatureNum = 4
local timeSignatureNum = DefaultTimeSignatureNum

Expand Down Expand Up @@ -409,7 +405,6 @@ return {
elseif chartData.scrollSpeed["default"] then
_speed = chartData.scrollSpeed["default"]
end


if settings.customScrollSpeed == 1 then
speed = _speed
Expand Down Expand Up @@ -728,29 +723,29 @@ return {
end,

judgeNote = function(self, msTiming)
if msTiming <= SickThres then
if msTiming <= CONSTANTS.WEEKS.JUDGE_THRES.SICK_THRES then
return "sick"
elseif msTiming < GoodThres then
elseif msTiming < CONSTANTS.WEEKS.JUDGE_THRES.GOOD_THRES then
return "good"
elseif msTiming < BadThres then
elseif msTiming < CONSTANTS.WEEKS.JUDGE_THRES.BAD_THRES then
return "bad"
elseif msTiming < ShitThres then
elseif msTiming < CONSTANTS.WEEKS.JUDGE_THRES.SHIT_THRES then
return "shit"
else
return miss
return "miss"
end
end,

scoreNote = function(self, msTiming)
if msTiming > MissThres then
return MissScore
if msTiming > CONSTANTS.WEEKS.JUDGE_THRES.MISS_THRES then
return CONSTANTS.WEEKS.MISS_SCORE
else
if msTiming < PerfectThres then
return MaxScore
if msTiming < CONSTANTS.WEEKS.JUDGE_THRES.PERFECT_THRES then
return CONSTANTS.WEEKS.MAX_SCORE
else
local factor = 1 - 1 / (1 + math.exp(-ScoringSlope * (msTiming - ScoringOffset)))
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(MaxScore * factor + MinScore, 0)
local score = bit.bxor(CONSTANTS.WEEKS.MAX_SCORE * factor + CONSTANTS.WEEKS.MIN_SCORE, 0)
return score
end
end
Expand Down Expand Up @@ -917,7 +912,7 @@ return {
if #boyfriendNote > 0 then
for j = 1, #boyfriendNote do
if boyfriendNote[j] and boyfriendNote[j]:getAnimName() == "on" then
if (boyfriendNote[j].time - musicTime <= MissThres) then
if (boyfriendNote[j].time - musicTime <= CONSTANTS.WEEKS.JUDGE_THRES.MISS_THRES) then
local notePos
local ratingAnim

Expand Down
2 changes: 1 addition & 1 deletion src/love/substates/settings-keybinds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local invalidkeys = {
["lsuper"] = "lsuper",
["menu"] = "menu",
}
local curInput = inputList[i]

return {
enter = function(self)
images = {
Expand Down
2 changes: 1 addition & 1 deletion src/love/weeks/weekend1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ return {
elseif noteType == "wekend-1-kickcan" then
character:animate("kick-can")
return true
elseif noteType == "weekend-1-kneecan" then
elseif noteType == "weekend-1-kneecan" then
character:animate("knee-forward")
return true
end
Expand Down

0 comments on commit cc648b5

Please sign in to comment.