Implement Nene Christmas, and fix Nene offsets on other stages.

This commit is contained in:
EliteMasterEric 2024-07-15 06:30:10 -04:00
parent 50b587e3b8
commit 416d60000f
5 changed files with 39 additions and 17 deletions

2
assets

@ -1 +1 @@
Subproject commit 005c96f85f4304865acb196e7cc4d6d83f9d76d8
Subproject commit d5b2d05df6d197f90a1b93f5b50835209c21adf7

View file

@ -382,12 +382,19 @@ class BaseCharacter extends Bopper
// and Darnell (this keeps the flame on his lighter flickering).
// Works for idle, singLEFT/RIGHT/UP/DOWN, alt singing animations, and anything else really.
if (!getCurrentAnimation().endsWith(Constants.ANIMATION_HOLD_SUFFIX)
&& hasAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX)
&& isAnimationFinished())
if (isAnimationFinished()
&& !getCurrentAnimation().endsWith(Constants.ANIMATION_HOLD_SUFFIX)
&& hasAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX))
{
playAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX);
}
else
{
if (isAnimationFinished())
{
trace('Not playing hold (${getCurrentAnimation()}) (${isAnimationFinished()}, ${getCurrentAnimation().endsWith(Constants.ANIMATION_HOLD_SUFFIX)}, ${hasAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX)})');
}
}
// Handle character note hold time.
if (isSinging())
@ -427,7 +434,7 @@ class BaseCharacter extends Bopper
else
{
// Play the idle animation.
trace('${characterId}: attempting dance');
// trace('${characterId}: attempting dance');
dance(true);
}
}
@ -638,6 +645,7 @@ class BaseCharacter extends Bopper
var anim:String = 'sing${dir.nameUpper}${miss ? 'miss' : ''}${suffix != '' ? '-${suffix}' : ''}';
// restart even if already playing, because the character might sing the same note twice.
trace('Playing ${anim}...');
playAnimation(anim, true);
}

View file

@ -178,9 +178,22 @@ class FreeplayState extends MusicBeatSubState
var stickerSubState:Null<StickerSubState> = null;
public static var rememberedDifficulty:Null<String> = Constants.DEFAULT_DIFFICULTY;
/**
* The difficulty we were on when this menu was last accessed.
*/
public static var rememberedDifficulty:String = Constants.DEFAULT_DIFFICULTY;
/**
* The song we were on when this menu was last accessed.
* NOTE: `null` if the last song was `Random`.
*/
public static var rememberedSongId:Null<String> = 'tutorial';
/**
* The character we were on when this menu was last accessed.
*/
public static var rememberedCharacterId:String = Constants.DEFAULT_CHARACTER;
var funnyCam:FunkinCamera;
var rankCamera:FunkinCamera;
var rankBg:FunkinSprite;
@ -210,14 +223,16 @@ class FreeplayState extends MusicBeatSubState
public function new(?params:FreeplayStateParams, ?stickers:StickerSubState)
{
currentCharacterId = params?.character ?? Constants.DEFAULT_CHARACTER;
currentCharacterId = params?.character ?? rememberedCharacterId;
var fetchPlayableCharacter = function():PlayableCharacter {
var result = PlayerRegistry.instance.fetchEntry(params?.character ?? Constants.DEFAULT_CHARACTER);
var result = PlayerRegistry.instance.fetchEntry(params?.character ?? rememberedCharacterId);
if (result == null) throw 'No valid playable character with id ${params?.character}';
return result;
};
currentCharacter = fetchPlayableCharacter();
rememberedCharacterId = currentCharacter?.id ?? Constants.DEFAULT_CHARACTER;
fromResultsParams = params?.fromResults;
if (fromResultsParams?.playRankAnim == true)
@ -744,10 +759,7 @@ class FreeplayState extends MusicBeatSubState
var tempSongs:Array<Null<FreeplaySongData>> = songs;
// Remember just the difficulty because it's important for song sorting.
if (rememberedDifficulty != null)
{
currentDifficulty = rememberedDifficulty;
}
currentDifficulty = rememberedDifficulty;
if (filterStuff != null) tempSongs = sortSongs(tempSongs, filterStuff);
@ -1216,7 +1228,7 @@ class FreeplayState extends MusicBeatSubState
FlxG.switchState(FreeplayState.build(
{
{
character: currentCharacterId == "pico" ? "bf" : "pico",
character: currentCharacterId == "pico" ? Constants.DEFAULT_CHARACTER : "pico",
}
}));
}
@ -1889,7 +1901,7 @@ class FreeplayState extends MusicBeatSubState
intendedCompletion = 0.0;
diffIdsCurrent = diffIdsTotal;
rememberedSongId = null;
rememberedDifficulty = null;
rememberedDifficulty = Constants.DEFAULT_DIFFICULTY;
albumRoll.albumId = null;
}

View file

@ -162,7 +162,7 @@ class SongMenuItem extends FlxSpriteGroup
sparkle = new FlxSprite(ranking.x, ranking.y);
sparkle.frames = Paths.getSparrowAtlas('freeplay/sparkle');
sparkle.animation.addByPrefix('sparkle', 'sparkle', 24, false);
sparkle.animation.addByPrefix('sparkle', 'sparkle Export0', 24, false);
sparkle.animation.play('sparkle', true);
sparkle.scale.set(0.8, 0.8);
sparkle.blend = BlendMode.ADD;
@ -523,7 +523,6 @@ class SongMenuItem extends FlxSpriteGroup
checkWeek(songData?.songId);
}
var frameInTicker:Float = 0;
var frameInTypeBeat:Int = 0;

View file

@ -119,7 +119,10 @@ class MainMenuState extends MusicBeatState
openSubState(new FreeplayState(
{
character: FlxG.keys.pressed.SHIFT ? 'pico' : 'bf',
#if debug
// If SHIFT is held, toggle the selected character, else use the remembered character
character: (FlxG.keys.pressed.SHIFT) ? (FreeplayState.rememberedCharacterId == Constants.DEFAULT_CHARACTER ? 'pico' : 'bf') : null,
#end
}));
});