Skip to content

Commit

Permalink
Hopefully fixes random misses
Browse files Browse the repository at this point in the history
Fixed keyboard press not recognized

Readjusted notes accuracy
  • Loading branch information
MikuAuahDark committed Jun 12, 2017
1 parent 317bb80 commit e2ab576
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
17 changes: 12 additions & 5 deletions livesim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ function DEPLS.StoryboardFunctions.SetNotesSpeed(notes_speed)

-- Recalculate accuracy
for i = 1, 5 do
DEPLS.NoteAccuracy[i][2] = DEPLS.NoteAccuracy[i][1] / (400 / math.max(notes_speed, 800) * 0.001)
DEPLS.NoteAccuracy[i][2] = DEPLS.NoteAccuracy[i][1] / 310 * math.max(notes_speed, 800)
end
DEPLS.NoteAccuracy.InvV = (math.max(notes_speed, 800) * 0.001) / 400
DEPLS.NoteAccuracy.InvV = math.max(notes_speed, 800) / 400

return prev
end
Expand Down Expand Up @@ -649,9 +649,9 @@ function DEPLS.Start(argv)

-- Calculate note accuracy
for i = 1, 5 do
DEPLS.NoteAccuracy[i][2] = DEPLS.NoteAccuracy[i][1] / (400 / (math.max(DEPLS.NotesSpeed, 800) * 0.001))
DEPLS.NoteAccuracy[i][2] = DEPLS.NoteAccuracy[i][1] / 310 * math.max(DEPLS.NotesSpeed, 800)
end
DEPLS.NoteAccuracy.InvV = (math.max(DEPLS.NotesSpeed, 800) * 0.001) / 400
DEPLS.NoteAccuracy.InvV = math.max(DEPLS.NotesSpeed, 800) / 400

-- Initialize flash animation
DEPLS.LiveShowCleared:setMovie("ef_311")
Expand Down Expand Up @@ -946,7 +946,7 @@ end
local TouchTracking = {}
local isMousePress = false
local TouchXRadius = 128
local TouchYRadius = 75
local TouchYRadius = 76
function DEPLS.MousePressed(x, y, button, touch_id)
if DEPLS.ElapsedTime <= 0 or DEPLS.AutoPlay then return end

Expand Down Expand Up @@ -1023,6 +1023,13 @@ function DEPLS.KeyPressed(key, scancode, repeat_bit)
elseif key == "f5" then
DEPLS.BeatmapAudioVolume = math.max(DEPLS.BeatmapAudioVolume - 0.05, 0)
update_audio_volume()
elseif DEPLS.ElapsedTime >= 0 then
for i = 1, 9 do
if key == DEPLS.Keys[i] then
DEPLS.NoteManager.SetTouch(i, key)
break
end
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
-- IN THE SOFTWARE.
--]]---------------------------------------------------------------------------

DEPLS_VERSION = "1.1.3"
DEPLS_VERSION_NUMBER = 01010300 -- xxyyzzww. x = major, y = minor, z = patch, w = pre-release counter
DEPLS_VERSION = "1.1.4"
DEPLS_VERSION_NUMBER = 01010400 -- xxyyzzww. x = major, y = minor, z = patch, w = pre-release counter

----------------------
-- AquaShine loader --
Expand Down
12 changes: 6 additions & 6 deletions note.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ function SingleNoteObject.Update(this, deltaT)
this.CircleScale = math.min(ElapsedTime / DEPLS.NotesSpeed, 1)

-- If it's not pressed, and it's beyond miss range, make it miss
local notedistance = distance(this.FirstCircle[1] - this.CenterIdol[1], this.FirstCircle[2] - this.CenterIdol[2])
local notedistance = NoteAccuracy.InvV * distance(this.FirstCircle[1] - this.CenterIdol[1], this.FirstCircle[2] - this.CenterIdol[2])

if ElapsedTime >= DEPLS.NotesSpeed and notedistance >= NoteAccuracy[5][1] then
if ElapsedTime >= DEPLS.NotesSpeed and notedistance >= NoteAccuracy[5][2] then
DEPLS.Routines.PerfectNode.Image = DEPLS.Images.Miss
DEPLS.Routines.PerfectNode.Replay = true
DEPLS.Routines.ComboCounter.Reset = true
Expand Down Expand Up @@ -311,7 +311,7 @@ function SingleNoteObject.SetTouchID(this, touchid)
end

-- We don't want someone accidentally tap it while it's in long distance
if notedistance <= NoteAccuracy[4][2] then
if notedistance <= NoteAccuracy[5][2] then
if notedistance <= NoteAccuracy[1][2] then
DEPLS.Routines.PerfectNode.Image = DEPLS.Images.Perfect
this.ScoreMultipler = 1
Expand Down Expand Up @@ -405,9 +405,9 @@ function LongNoteObject.Update(this, deltaT)
local cmp2 = this.TouchID and NotesSpeed + this.ZeroAccuracyEndNote or NotesSpeed

if ElapsedTime >= cmp2 then
local notedistance = distance(cmp[1] - this.CenterIdol[1], cmp[2] - this.CenterIdol[2])
local notedistance = NoteAccuracy.InvV * distance(cmp[1] - this.CenterIdol[1], cmp[2] - this.CenterIdol[2])

if notedistance >= NoteAccuracy[5][1] then
if notedistance > NoteAccuracy[5][2] then
DEPLS.Routines.PerfectNode.Image = DEPLS.Images.Miss
DEPLS.Routines.PerfectNode.Replay = true
DEPLS.Routines.ComboCounter.Reset = true
Expand Down Expand Up @@ -554,7 +554,7 @@ function LongNoteObject.SetTouchID(this, touchid)
end

-- We don't want someone accidentally tap it while it's in long distance
if notedistance <= NoteAccuracy[4][2] then
if notedistance <= NoteAccuracy[5][2] then
if notedistance <= NoteAccuracy[1][2] then
DEPLS.Routines.PerfectNode.Image = DEPLS.Images.Perfect
this.ScoreMultipler = 1
Expand Down

0 comments on commit e2ab576

Please sign in to comment.