mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
Merge 42be9e9d8f
into d31ef12363
This commit is contained in:
commit
3b3031a181
3 changed files with 38 additions and 3 deletions
source/funkin/play
|
@ -2634,13 +2634,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));
|
||||
}
|
||||
}
|
||||
|
@ -2695,7 +2695,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
|
||||
|
@ -308,6 +313,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
|
||||
|
@ -642,6 +661,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);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,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