Fan Club: fix forcing idol anims during responses

This commit is contained in:
minenice55 2022-03-21 11:29:24 -04:00
parent 0004961f90
commit 77edc1f624

View file

@ -49,6 +49,7 @@ namespace HeavenStudio.Games
public GameEvent bop = new GameEvent(); public GameEvent bop = new GameEvent();
public GameEvent specBop = new GameEvent(); public GameEvent specBop = new GameEvent();
public GameEvent noBop = new GameEvent(); public GameEvent noBop = new GameEvent();
public GameEvent noResponse = new GameEvent();
public GameEvent noSpecBop = new GameEvent(); public GameEvent noSpecBop = new GameEvent();
private bool responseToggle = false; private bool responseToggle = false;
@ -176,6 +177,12 @@ namespace HeavenStudio.Games
noBop.startBeat = beat; noBop.startBeat = beat;
} }
private void DisableResponse(float beat, float length)
{
noResponse.length = length;
noResponse.startBeat = beat;
}
private void DisableSpecBop(float beat, float length) private void DisableSpecBop(float beat, float length)
{ {
float bt = Conductor.instance.songPositionInBeats; float bt = Conductor.instance.songPositionInBeats;
@ -193,8 +200,8 @@ namespace HeavenStudio.Games
public void PlayAnim(float beat, float length, int type) public void PlayAnim(float beat, float length, int type)
{ {
noBop.length = length; DisableResponse(beat, length);
noBop.startBeat = beat; DisableBop(beat, length);
switch (type) switch (type)
{ {
@ -239,16 +246,20 @@ namespace HeavenStudio.Games
private void DoIdolClaps() private void DoIdolClaps()
{ {
if (!responseToggle) if (!responseToggle)
{
if (!(Conductor.instance.songPositionInBeats >= noResponse.startBeat && Conductor.instance.songPositionInBeats < noResponse.startBeat + noResponse.length))
{ {
idolAnimator.Play("IdolCrap", -1, 0); idolAnimator.Play("IdolCrap", -1, 0);
idolClapEffect.Play(); idolClapEffect.Play();
} }
} }
}
private void DoIdolResponse() private void DoIdolResponse()
{ {
if (responseToggle) if (responseToggle)
{ {
if (!(Conductor.instance.songPositionInBeats >= noResponse.startBeat && Conductor.instance.songPositionInBeats < noResponse.startBeat + noResponse.length))
idolAnimator.Play("IdolResponse", -1, 0); idolAnimator.Play("IdolResponse", -1, 0);
} }
} }