Skip to content

Commit

Permalink
fix shit add ratings
Browse files Browse the repository at this point in the history
  • Loading branch information
x8c8r committed Jun 20, 2024
1 parent d9c1989 commit 9292d20
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 15 deletions.
58 changes: 54 additions & 4 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class PlayState extends MusicBeatState
public static var bads:Int = 0;
public static var goods:Int = 0;
public static var sicks:Int = 0;
public static var accDisplay:String = "";

var halloweenLevel:Bool = false;

Expand Down Expand Up @@ -1403,8 +1404,54 @@ class PlayState extends MusicBeatState
}

super.update(elapsed);

scoreTxt.text = "Score:" + songScore + " | Misses:" + misses + " | Accuracy:" + accuracy + "% " + (fc ? "| FC" : misses == 0 ? "| A" : accuracy <= 75 ? "| BAD" : "");
if (songScore == 0)
accDisplay = "boowomp";
else if (accuracy == 100)
accDisplay = "PFC";
else if (misses == 0 && shits == 0 && bads == 0)
accDisplay = "Good FC";
else if (accuracy >= 99)
accDisplay = "Not an FC smh";
else if (accuracy >= 95)
accDisplay = "uhhh i guess its good?";
else if (accuracy >= 93)
accDisplay = "93 lollll";
else if (accuracy >= 90)
accDisplay = "inaccurate andy";
else if (accuracy >= 89)
accDisplay = "kill this guy with hammers";
else if (accuracy >= 87)
accDisplay = "WAS THAT THE BI-";
else if (accuracy >= 85)
accDisplay = "SFC (stands for shit fuck cake)";
else if (accuracy >= 83)
accDisplay = "83 lollll";
else if (accuracy >= 73)
accDisplay = "73 lollll";
else if (accuracy >= 69)
accDisplay = "haha sex";
else if (accuracy >= 63)
accDisplay = "63 lollll";
else if (accuracy >= 56)
accDisplay = "jo56hs";
else if (accuracy >= 53)
accDisplay = "53 lollll";
else if (accuracy >= 43)
accDisplay = "43 lollll";
else if (accuracy >= 33)
accDisplay = "33 lollll";
else if (accuracy >= 23)
accDisplay = "23 lollll";
else if (accuracy >= 13)
accDisplay = "13 lollll";
else if (accuracy >= 10)
accDisplay = "certain death";
else if (accuracy >= 3)
accDisplay = "3 lollll";
else if (accuracy == 0)
accDisplay = "HOW ARE YOU STILL ALIVE";

scoreTxt.text = "Score:" + songScore + " | Misses:" + misses + " | Accuracy:" + accuracy + "% | " + accDisplay;

if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
{
Expand Down Expand Up @@ -1829,15 +1876,18 @@ class PlayState extends MusicBeatState
shit: shits,
miss: misses,
score: songScore,
accuracy: accuracy
accuracy: accuracy,
rating: accDisplay
};

persistentUpdate = false;
persistentDraw = true;

FlxG.save.data.beatSongs.push(curSong.toLowerCase());

openSubState(new ResultsSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y, results, this));
var sub:FlxSubState = new ResultsSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y, results, this);
sub.cameras = [camHUD];
openSubState(sub);
}

var endingSong:Bool = false;
Expand Down
22 changes: 11 additions & 11 deletions source/ResultsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ typedef FunkinResults = {
var miss:Int;
var score:Int;
var accuracy:Float;
var rating:String;
}

class ResultsSubState extends MusicBeatSubstate {
Expand All @@ -38,21 +39,21 @@ class ResultsSubState extends MusicBeatSubstate {

texts = new FlxTypedGroup<FlxText>();

var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.stage.stageWidth, FlxG.stage.stageHeight, FlxColor.BLACK);
bg.alpha = 0;
bg.scrollFactor.set();
add(bg);

var exitText = new FlxText(20, FlxG.height - 150, 0, "Press ENTER to finish", 24, false);
var exitText = new FlxText(-150, FlxG.height - 150, 0, "Press ENTER to finish", 24, false);
exitText.setFormat(Paths.font("vcr.ttf"), 24, FlxColor.WHITE, FlxTextAlign.LEFT);

sickText = new FlxText(20, 150, 0, "Sicks: " + results.sick, 32, false);
goodText = new FlxText(20, 185, 0, "Goods: " + results.good, 32, false);
badText = new FlxText(20, 215, 0, "Bads: " + results.bad, 32, false);
shitText = new FlxText(20, 245, 0, "Shits: " + results.shit, 32, false);
missText = new FlxText(20, 275, 0, "Misses: " + results.miss, 32, false);
scoreText = new FlxText(20, 25, 0, "Score: " + results.score, 64, false);
accText = new FlxText(20, 450, 0, "Accuracy: " + results.accuracy + "%", 48, false);
sickText = new FlxText(-150, 150, 0, "Sicks: " + results.sick, 32, false);
goodText = new FlxText(-150, 185, 0, "Goods: " + results.good, 32, false);
badText = new FlxText(-150, 215, 0, "Bads: " + results.bad, 32, false);
shitText = new FlxText(-150, 245, 0, "Shits: " + results.shit, 32, false);
missText = new FlxText(-150, 275, 0, "Misses: " + results.miss, 32, false);
scoreText = new FlxText(-150, 25, 0, "Score: " + results.score, 64, false);
accText = new FlxText(-150, 450, 0, "Accuracy: " + results.accuracy + "% (" + results.rating + ")", 48, false);

sickText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, FlxTextAlign.LEFT);
goodText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, FlxTextAlign.LEFT);
Expand All @@ -73,14 +74,13 @@ class ResultsSubState extends MusicBeatSubstate {

texts.forEach((t:FlxText) -> {
t.alpha = 0;
t.x = -150;
});

add(texts);

for (i in 0... texts.length) {
new FlxTimer().start(0.1 * (i+1), (timer:FlxTimer) -> {
FlxTween.tween(texts.members[i], {alpha: 1, x: 20}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.3});
FlxTween.tween(texts.members[i], {alpha: 1, x: 50}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.3});
});
new FlxTimer().start(0.3 + (0.1*(i + 1)), (timer:FlxTimer) -> {
FlxG.sound.play(Paths.sound('scrollMenu'));
Expand Down

0 comments on commit 9292d20

Please sign in to comment.