Skip to content

Commit

Permalink
fc shit idk
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshubs authored and Yoshubs committed Sep 27, 2021
1 parent eed0e0a commit bdf6a54
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 41 deletions.
31 changes: 14 additions & 17 deletions source/gameFolder/meta/data/Timings.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class Timings
// from left to right
// max milliseconds, score from it and percentage
public static var judgementsMap:Map<String, Array<Dynamic>> = [
"sick" => [0, 50, 350, 100],
"good" => [1, 100, 150, 75],
"bad" => [2, 120, 0, 25],
"sick" => [0, 50, 350, 100, ' [SFC]'],
"good" => [1, 100, 150, 75, ' [GFC]'],
"bad" => [2, 120, 0, 25, ' [FC]'],
"shit" => [3, 160, -50, -150],
"miss" => [4, 200, -100, -175],
];
Expand All @@ -34,6 +34,9 @@ class Timings
public static var comboDisplay:String = '';
public static var notesHitNoSus:Int = 0;

public static var gottenJudgements:Map<String, Int> = [];
public static var smallestRating:String;

public static function callAccuracy()
{
// reset the accuracy to 0%
Expand All @@ -48,6 +51,11 @@ class Timings
biggestThreshold = judgementsMap.get(i)[1];
msThreshold = biggestThreshold;

// set the gotten judgement amounts
for (judgement in judgementsMap.keys())
gottenJudgements.set(judgement, 0);
smallestRating = 'sick';

notesHit = 0;
notesHitNoSus = 0;

Expand Down Expand Up @@ -86,20 +94,9 @@ class Timings
public static function updateFCDisplay()
{
// update combo display
// if you dont understand this look up ternary operators, they're REALLY useful for condensing code and
// I would totally encourage you check them out and learn a little more
comboDisplay = ((PlayState.combo >= notesHitNoSus) ? ((trueAccuracy >= 100) ? ' [PERFECT]' : ' [FC]') : '');

// to break it down further
/*
if (PlayState.combo >= notesHitNoSus) {
if (trueAccuracy >= 100)
comboDisplay = ' [PERFECT]';
else
comboDisplay = ' [FC]';
} else
comboDisplay = '';
*/
comboDisplay = '';
if (judgementsMap.get(smallestRating)[4] != null)
comboDisplay = judgementsMap.get(smallestRating)[4];

// this updates the most so uh
PlayState.uiHUD.updateScoreText();
Expand Down
57 changes: 33 additions & 24 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -719,27 +719,27 @@ class PlayState extends MusicBeatState
// check all of the controls
for (i in 0...pressControls.length)
{
// improved this a little bit, maybe its a lil
var possibleNoteList:Array<Note> = [];
var pressedNotes:Array<Note> = [];

characterStrums.notesGroup.forEachAlive(function(daNote:Note)
// and if a note is being pressed
if (pressControls[i])
{
if ((daNote.noteData == i) && daNote.canBeHit && !daNote.tooLate && !daNote.wasGoodHit)
possibleNoteList.push(daNote);
});
possibleNoteList.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
// improved this a little bit, maybe its a lil
var possibleNoteList:Array<Note> = [];
var pressedNotes:Array<Note> = [];

// if there is a list of notes that exists for that control
if (possibleNoteList.length > 0)
{
var eligable = true;
var firstNote = true;
// loop through the possible notes
for (coolNote in possibleNoteList)
characterStrums.notesGroup.forEachAlive(function(daNote:Note)
{
if ((daNote.noteData == i) && daNote.canBeHit && !daNote.tooLate && !daNote.wasGoodHit)
possibleNoteList.push(daNote);
});
possibleNoteList.sort((a, b) -> Std.int(a.strumTime - b.strumTime));

// if there is a list of notes that exists for that control
if (possibleNoteList.length > 0)
{
// and if a note is being pressed
if (pressControls[coolNote.noteData])
var eligable = true;
var firstNote = true;
// loop through the possible notes
for (coolNote in possibleNoteList)
{
for (noteDouble in pressedNotes)
{
Expand All @@ -754,14 +754,14 @@ class PlayState extends MusicBeatState
goodNoteHit(coolNote, character, characterStrums, firstNote); // then hit the note
pressedNotes.push(coolNote);
}
// end of this little check
}
// end of this little check
//
}
//
else // else just call bad notes
if (!Init.trueSettings.get('Ghost Tapping'))
missNoteCheck(true, i, character, true);
}
else // else just call bad notes
if (!Init.trueSettings.get('Ghost Tapping') && pressControls[i])
missNoteCheck(true, i, character, true);
//
}
}
Expand Down Expand Up @@ -1139,7 +1139,7 @@ class PlayState extends MusicBeatState
numScore.x -= 95;
numScore.x -= ((comboString.length - 1) * 22);
lastCombo.push(numScore);
FlxTween.tween(numScore, {y: numScore.y + 20}, 0.1, {type: FlxTween.BACKWARD, ease: FlxEase.circOut});
FlxTween.tween(numScore, {y: numScore.y + 20}, 0.1, {type: FlxTweenType.BACKWARD, ease: FlxEase.circOut});
}
if (preload)
numScore.visible = false;
Expand Down Expand Up @@ -1244,6 +1244,15 @@ class PlayState extends MusicBeatState
rating.screenCenter();
}

// return the actual rating to the array of judgements
Timings.gottenJudgements.set(daRating, Timings.gottenJudgements.get(daRating) + 1);

// set new smallest rating
if (Timings.smallestRating != daRating) {
if (Timings.judgementsMap.get(Timings.smallestRating)[0] < Timings.judgementsMap.get(daRating)[0])
Timings.smallestRating = daRating;
}

if (cache)
rating.visible = false;
}
Expand Down

0 comments on commit bdf6a54

Please sign in to comment.