diff --git a/assets b/assets index a1d24709d..fe0570d4c 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit a1d24709d4a89f188beac95b55da9594b2db28cd +Subproject commit fe0570d4cfe20d232bad062f3140787faad1baeb diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 91c3f3af9..cb1cacbc1 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2224,8 +2224,8 @@ class PlayState extends MusicBeatSubState holdNote.handledMiss = true; // Mute vocals and play miss animation, but don't penalize. - vocals.playerVolume = 0; - if (currentStage != null && currentStage.getBoyfriend() != null) currentStage.getBoyfriend().playSingAnimation(holdNote.noteData.getDirection(), true); + // vocals.playerVolume = 0; + // if (currentStage != null && currentStage.getBoyfriend() != null) currentStage.getBoyfriend().playSingAnimation(holdNote.noteData.getDirection(), true); } } } diff --git a/source/funkin/play/ResultScore.hx b/source/funkin/play/ResultScore.hx new file mode 100644 index 000000000..d5d5a6567 --- /dev/null +++ b/source/funkin/play/ResultScore.hx @@ -0,0 +1,140 @@ +package funkin.play; + +import flixel.FlxSprite; +import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup; + +class ResultScore extends FlxTypedSpriteGroup +{ + public var scoreShit(default, set):Int = 0; + + function set_scoreShit(val):Int + { + if (group == null || group.members == null) return val; + var loopNum:Int = group.members.length - 1; + var dumbNumb = Std.parseInt(Std.string(val)); + var prevNum:ScoreNum; + + while (dumbNumb > 0) + { + group.members[loopNum].digit = dumbNumb % 10; + + // var funnyNum = group.members[loopNum]; + // prevNum = group.members[loopNum + 1]; + + // if (prevNum != null) + // { + // funnyNum.x = prevNum.x - (funnyNum.width * 0.7); + // } + + // funnyNum.y = (funnyNum.baseY - (funnyNum.height / 2)) + 73; + // funnyNum.x = (funnyNum.baseX - (funnyNum.width / 2)) + 450; // this plus value is hand picked lol! + + dumbNumb = Math.floor(dumbNumb / 10); + loopNum--; + } + + while (loopNum > 0) + { + group.members[loopNum].digit = 10; + loopNum--; + } + + return val; + } + + public function animateNumbers():Void + { + for (i in group.members) + { + i.playAnim(); + } + } + + public function new(x:Float, y:Float, digitCount:Int, scoreShit:Int = 100) + { + super(x, y); + + for (i in 0...digitCount) + { + add(new ScoreNum(x + (65 * i), y)); + } + + this.scoreShit = scoreShit; + } + + public function updateScore(scoreNew:Int) + { + scoreShit = scoreNew; + } +} + +class ScoreNum extends FlxSprite +{ + public var digit(default, set):Int = 10; + + function set_digit(val):Int + { + if (val >= 0 && animation.curAnim != null && animation.curAnim.name != numToString[val]) + { + animation.play(numToString[val], true, false, 0); + updateHitbox(); + + switch (val) + { + case 1: + // offset.x -= 15; + case 5: + // set offsets + // offset.x += 0; + // offset.y += 10; + + case 7: + // offset.y += 6; + case 4: + // offset.y += 5; + case 9: + // offset.y += 5; + default: + centerOffsets(false); + } + } + + return digit = val; + } + + public function playAnim():Void + { + animation.play(numToString[digit], true, false, 0); + } + + public var baseY:Float = 0; + public var baseX:Float = 0; + + var numToString:Array = [ + "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "DISABLED" + ]; + + public function new(x:Float, y:Float) + { + super(x, y); + + baseY = y; + baseX = x; + + frames = Paths.getSparrowAtlas('resultScreen/score-digital-numbers'); + + for (i in 0...10) + { + var stringNum:String = numToString[i]; + animation.addByPrefix(stringNum, '$stringNum DIGITAL', 24, false); + } + + animation.addByPrefix('DISABLED', 'DISABLED', 24, false); + + this.digit = 10; + + animation.play(numToString[digit], true); + + updateHitbox(); + } +} diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 3ae8ad138..c05257338 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -11,6 +11,7 @@ import flixel.math.FlxPoint; import funkin.ui.MusicBeatSubState; import flixel.math.FlxRect; import flixel.text.FlxBitmapText; +import funkin.ui.freeplay.FreeplayScore; import flixel.tweens.FlxEase; import funkin.ui.freeplay.FreeplayState; import flixel.tweens.FlxTween; @@ -188,7 +189,7 @@ class ResultState extends MusicBeatSubState scorePopin.visible = false; add(scorePopin); - var highscoreNew:FlxSprite = new FlxSprite(280, 580); + var highscoreNew:FlxSprite = new FlxSprite(310, 570); highscoreNew.frames = Paths.getSparrowAtlas("resultScreen/highscoreNew"); highscoreNew.animation.addByPrefix("new", "NEW HIGHSCORE", 24); highscoreNew.visible = false; @@ -228,9 +229,9 @@ class ResultState extends MusicBeatSubState var tallyMissed:TallyCounter = new TallyCounter(260, (hStuf * 9) + extraYOffset, params.scoreData.tallies.missed, 0xFFC68AE6); ratingGrp.add(tallyMissed); - var score:TallyCounter = new TallyCounter(825, 630, params.scoreData.score, RIGHT); - score.scale.set(2, 2); - ratingGrp.add(score); + var score:ResultScore = new ResultScore(35, 305, 10, params.scoreData.score); + score.visible = false; + add(score); for (ind => rating in ratingGrp.members) { @@ -247,6 +248,10 @@ class ResultState extends MusicBeatSubState ratingsPopin.animation.finishCallback = anim -> { scorePopin.animation.play("score"); + scorePopin.animation.finishCallback = anim -> { + score.visible = true; + score.animateNumbers(); + }; scorePopin.visible = true; if (params.isNewHighscore) diff --git a/source/funkin/play/notes/NoteHoldCover.hx b/source/funkin/play/notes/NoteHoldCover.hx index 52ae97d4f..7bed8a08c 100644 --- a/source/funkin/play/notes/NoteHoldCover.hx +++ b/source/funkin/play/notes/NoteHoldCover.hx @@ -77,13 +77,6 @@ class NoteHoldCover extends FlxTypedSpriteGroup public override function update(elapsed):Void { super.update(elapsed); - if ((!holdNote.alive || holdNote.missedNote) && !glow.animation.curAnim.name.startsWith('holdCoverEnd')) - { - // If alive is false, the hold note was held to completion. - // If missedNote is true, the hold note was "dropped". - - playEnd(); - } } public function playStart():Void diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 2b10c05ee..2b4e09370 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -370,8 +370,6 @@ class Strumline extends FlxSpriteGroup // Hold note is offscreen, kill it. holdNote.visible = false; holdNote.kill(); // Do not destroy! Recycling is faster. - - // The cover will see this and clean itself up. } else if (holdNote.hitNote && holdNote.sustainLength <= 0) { @@ -385,10 +383,16 @@ class Strumline extends FlxSpriteGroup playStatic(holdNote.noteDirection); } - if (holdNote.cover != null) + if (holdNote.cover != null && isPlayer) { holdNote.cover.playEnd(); } + else if (holdNote.cover != null) + { + // *lightning* *zap* *crackle* + holdNote.cover.visible = false; + holdNote.cover.kill(); + } holdNote.visible = false; holdNote.kill(); @@ -410,6 +414,13 @@ class Strumline extends FlxSpriteGroup { holdNote.y = this.y - INITIAL_OFFSET + calculateNoteYPos(holdNote.strumTime, vwoosh) + yOffset + STRUMLINE_SIZE / 2; } + + // Clean up the cover. + if (holdNote.cover != null) + { + holdNote.cover.visible = false; + holdNote.cover.kill(); + } } else if (Conductor.instance.songPosition > holdNote.strumTime && holdNote.hitNote) { diff --git a/source/funkin/ui/freeplay/FreeplayScore.hx b/source/funkin/ui/freeplay/FreeplayScore.hx index 413b182e0..da4c9f5d4 100644 --- a/source/funkin/ui/freeplay/FreeplayScore.hx +++ b/source/funkin/ui/freeplay/FreeplayScore.hx @@ -42,11 +42,11 @@ class FreeplayScore extends FlxTypedSpriteGroup return val; } - public function new(x:Float, y:Float, scoreShit:Int = 100) + public function new(x:Float, y:Float, digitCount:Int, scoreShit:Int = 100) { super(x, y); - for (i in 0...7) + for (i in 0...digitCount) { add(new ScoreNum(x + (45 * i), y, 0)); } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 7264124c4..0724ad022 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -425,7 +425,7 @@ class FreeplayState extends MusicBeatSubState tmr.time = FlxG.random.float(20, 60); }, 0); - fp = new FreeplayScore(460, 60, 100); + fp = new FreeplayScore(460, 60, 7, 100); fp.visible = false; add(fp); diff --git a/source/funkin/util/StructureUtil.hx b/source/funkin/util/StructureUtil.hx index f94de4652..2f0c3818a 100644 --- a/source/funkin/util/StructureUtil.hx +++ b/source/funkin/util/StructureUtil.hx @@ -102,6 +102,17 @@ class StructureUtil } } if (!Reflect.isObject(a) || !Reflect.isObject(b)) return b; + if (Std.isOfType(b, haxe.ds.StringMap)) + { + if (Std.isOfType(a, haxe.ds.StringMap)) + { + return MapTools.merge(a, b); + } + else + { + return StructureUtil.toMap(a).merge(b); + } + } var result:DynamicAccess = Reflect.copy(a);