feat: Added non-naughty Perfect results screen animation for Boyfriend (#821)

* change result state stuff

* add more fields

* change testing

* assets submod

---------

Co-authored-by: Cameron Taylor <cameron.taylor.ninja@gmail.com>
This commit is contained in:
Victor G
2024-11-26 15:39:12 -05:00
committed by GitHub
co-authored by Cameron Taylor
parent a9f6521b0e
commit c6d5bda802
4 changed files with 30 additions and 9 deletions
+1 -1
Submodule assets updated: 8bc7fffb6e...12f3546db6
+2 -2
View File
@@ -235,7 +235,7 @@ class InitState extends FlxState
storyMode: true,
title: "Cum Song Erect by Kawai Sprite",
songId: "cum",
characterId: "pico-playable",
characterId: "bf",
difficultyId: "nightmare",
isNewHighscore: true,
scoreData:
@@ -251,7 +251,7 @@ class InitState extends FlxState
combo: 69,
maxCombo: 69,
totalNotesHit: 140,
totalNotes: 275
totalNotes: 190
}
// 2400 total notes = 7% = LOSS
// 275 total notes = 69% = NICE
@@ -331,6 +331,10 @@ typedef PlayerResultsAnimationData =
@:default([0, 0])
var offsets:Array<Float>;
@:optional
@:default("both")
var filter:String;
@:optional
@:default(500)
var zIndex:Int;
@@ -347,6 +351,10 @@ typedef PlayerResultsAnimationData =
@:default('')
var startFrameLabel:Null<String>;
@:optional
@:default('')
var sound:Null<String>;
@:optional
@:default(true)
var looped:Bool;
+19 -6
View File
@@ -67,7 +67,9 @@ class ResultState extends MusicBeatSubState
{
sprite:FlxAtlasSprite,
delay:Float,
forceLoop:Bool
forceLoop:Bool,
startFrameLabel:String,
sound:String
}> = [];
var characterSparrowAnimations:Array<
{
@@ -184,6 +186,11 @@ class ResultState extends MusicBeatSubState
{
if (animData == null) continue;
if (animData.filter != "both")
{
if (Preferences.naughtyness && animData.filter != "naughty" || !Preferences.naughtyness && animData.filter != "safe") continue;
}
var animPath:String = Paths.stripLibrary(animData.assetPath);
var animLibrary:String = Paths.getLibrary(animData.assetPath);
var offsets = animData.offsets ?? [0, 0];
@@ -199,7 +206,6 @@ class ResultState extends MusicBeatSubState
{
// Animation is not looped.
animation.onAnimationComplete.add((_name:String) -> {
trace("AHAHAH 2");
if (animation != null)
{
animation.anim.pause();
@@ -209,7 +215,6 @@ class ResultState extends MusicBeatSubState
else if (animData.loopFrameLabel != null)
{
animation.onAnimationComplete.add((_name:String) -> {
trace("AHAHAH 2");
if (animation != null)
{
animation.playAnimation(animData.loopFrameLabel ?? '', true, false, true); // unpauses this anim, since it's on PlayOnce!
@@ -227,7 +232,6 @@ class ResultState extends MusicBeatSubState
}
});
}
// Hide until ready to play.
animation.visible = false;
// Queue to play.
@@ -235,7 +239,9 @@ class ResultState extends MusicBeatSubState
{
sprite: animation,
delay: animData.delay ?? 0.0,
forceLoop: (animData.loopFrame ?? -1) == 0
forceLoop: (animData.loopFrame ?? -1) == 0,
startFrameLabel: (animData.startFrameLabel ?? ""),
sound: (animData.sound ?? "")
});
// Add to the scene.
add(animation);
@@ -599,7 +605,14 @@ class ResultState extends MusicBeatSubState
new FlxTimer().start(atlas.delay, _ -> {
if (atlas.sprite == null) return;
atlas.sprite.visible = true;
atlas.sprite.playAnimation('');
atlas.sprite.playAnimation(atlas.startFrameLabel);
if (atlas.sound != "")
{
var sndPath:String = Paths.stripLibrary(atlas.sound);
var sndLibrary:String = Paths.getLibrary(atlas.sound);
FunkinSound.playOnce(Paths.sound(sndPath, sndLibrary), 1.0);
}
});
}