mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
unmute character vocals for animations
This commit is contained in:
parent
edb270d15e
commit
42be9e9d8f
3 changed files with 38 additions and 3 deletions
source/funkin/play
|
@ -2613,13 +2613,13 @@ class PlayState extends MusicBeatSubState
|
|||
});
|
||||
}
|
||||
}
|
||||
vocals.playerVolume = 0;
|
||||
if (!currentStage.getBoyfriend().tempVocals) vocals.playerVolume = 0;
|
||||
|
||||
applyScore(-10, 'miss', healthChange, true);
|
||||
|
||||
if (playSound)
|
||||
{
|
||||
vocals.playerVolume = 0;
|
||||
if (!currentStage.getBoyfriend().tempVocals) vocals.playerVolume = 0;
|
||||
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6));
|
||||
}
|
||||
}
|
||||
|
@ -2674,7 +2674,7 @@ class PlayState extends MusicBeatSubState
|
|||
|
||||
if (event.playSound)
|
||||
{
|
||||
vocals.playerVolume = 0;
|
||||
if (!currentStage.getBoyfriend().tempVocals) vocals.playerVolume = 0;
|
||||
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,11 @@ class BaseCharacter extends Bopper
|
|||
final _data:CharacterData;
|
||||
final singTimeSteps:Float;
|
||||
|
||||
/**
|
||||
* When set to true, the next animation to play will temporarily force the character's vocals to play.
|
||||
*/
|
||||
public var tempVocals:Bool = false;
|
||||
|
||||
/**
|
||||
* The offset between the corner of the sprite and the origin of the sprite (at the character's feet).
|
||||
* cornerPosition = stageData - characterOrigin
|
||||
|
@ -307,6 +312,20 @@ class BaseCharacter extends Bopper
|
|||
// Force the character to play the idle after the animation ends.
|
||||
this.dance(true);
|
||||
}
|
||||
if (tempVocals)
|
||||
{
|
||||
// stop the temporary vocals
|
||||
if (characterType == BF && PlayState.instance.vocals.playerVolume == 1)
|
||||
{
|
||||
PlayState.instance.vocals.playerVolume = 0;
|
||||
}
|
||||
|
||||
if (characterType == DAD && PlayState.instance.vocals.opponentVolume == 1)
|
||||
{
|
||||
PlayState.instance.vocals.opponentVolume = 0;
|
||||
}
|
||||
tempVocals = false;
|
||||
}
|
||||
}
|
||||
|
||||
function resetCameraFocusPoint():Void
|
||||
|
@ -641,6 +660,21 @@ class BaseCharacter extends Bopper
|
|||
|
||||
public override function playAnimation(name:String, restart:Bool = false, ignoreOther:Bool = false, reversed:Bool = false):Void
|
||||
{
|
||||
if (tempVocals)
|
||||
{
|
||||
// restart the character's vocals for the duration of the animation
|
||||
if (characterType == BF && PlayState.instance.vocals.playerVolume == 0)
|
||||
{
|
||||
PlayState.instance.vocals.playerVolume = 1;
|
||||
}
|
||||
else if (characterType == DAD && PlayState.instance.vocals.opponentVolume == 0)
|
||||
{
|
||||
PlayState.instance.vocals.opponentVolume = 1;
|
||||
}
|
||||
else if (characterType != BF || characterType != DAD)
|
||||
tempVocals = false;
|
||||
}
|
||||
|
||||
super.playAnimation(name, restart, ignoreOther, reversed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ class PlayAnimationSongEvent extends SongEvent
|
|||
if (Std.isOfType(target, BaseCharacter))
|
||||
{
|
||||
var targetChar:BaseCharacter = cast target;
|
||||
targetChar.tempVocals = force;
|
||||
targetChar.playAnimation(anim, force, force);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue