Fan Club: various adjustments

address input lockout (still has one minor issue I need to check)
make certain forced animations make more sense
This commit is contained in:
minenice55
2022-04-28 16:01:07 -04:00
parent ad05ecf6f2
commit 6be3b47559
12 changed files with 31 additions and 495 deletions

View File

@ -47,7 +47,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("play stage animation", delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnimStage(e.beat, e.type); }, 1, true, parameters: new List<Param>()
{
new Param("type", FanClub.StageAnimations.Reset, "Animation", "Animation to play")
new Param("type", FanClub.StageAnimations.Flash, "Animation", "Animation to play")
}),
});
}
@ -73,7 +73,7 @@ namespace HeavenStudio.Games
Call,
Response,
Jump,
//TODO: BigCall
BigCall,
Squat,
Wink,
Dab
@ -295,8 +295,8 @@ namespace HeavenStudio.Games
public void PlayAnim(float beat, float length, int type)
{
idolJumpStartTime = Single.MinValue;
DisableResponse(beat, length);
DisableBop(beat, length);
DisableResponse(beat, length + 0.5f);
DisableBop(beat, length + 0.5f);
switch (type)
{
@ -325,11 +325,18 @@ namespace HeavenStudio.Games
case (int) IdolAnimations.Jump:
DoIdolJump(beat, length);
break;
case (int) IdolAnimations.BigCall:
BeatAction.New(Arisa, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolBigCall0", -1, 0); }),
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolBigCall1", -1, 0); }),
});
break;
case (int) IdolAnimations.Squat:
BeatAction.New(Arisa, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat0", -1, 0); }),
new BeatAction.Action(beat + 1f, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat1", -1, 0); }),
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat1", -1, 0); }),
});
break;
case (int) IdolAnimations.Wink:
@ -403,10 +410,10 @@ namespace HeavenStudio.Games
new MultiSound.Sound("fanClub/arisa_hai_3_jp", beat + 2f),
});
Prepare(beat + 3f);
responseToggle = false;
DisableBop(beat, 8f);
Prepare(beat + 3f);
Prepare(beat + 4f);
Prepare(beat + 5f);
Prepare(beat + 6f);
@ -555,12 +562,13 @@ namespace HeavenStudio.Games
const float BIGCALL_LENGTH = 2.75f;
public void CallBigReady(float beat, bool noSound = false)
{
Prepare(beat + 1.5f);
Prepare(beat + 2f);
if (!noSound)
Jukebox.PlayOneShotGame("fanClub/crowd_big_ready");
DisableSpecBop(beat, 3.75f);
Prepare(beat + 1.5f);
Prepare(beat + 2f);
PlayAnimationAll("FanBigReady", onlyOverrideBop: true);
BeatAction.New(this.gameObject, new List<BeatAction.Action>()

View File

@ -29,7 +29,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
float clappingStartTime = 0f;
public Queue<KeyValuePair<float, int>> upcomingHits;
public SortedList<float, int> upcomingHits;
public float startBeat;
public int type;
public bool doCharge = false;
@ -39,7 +39,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
public void Init()
{
if (player)
upcomingHits = new Queue<KeyValuePair<float, int>>(); // beat, type
upcomingHits = new SortedList<float, int>(); // beat, type
inputHit = true;
hasHit = true;
@ -53,7 +53,12 @@ namespace HeavenStudio.Games.Scripts_FanClub
public void AddHit(float beat, int type)
{
inputHit = false;
upcomingHits.Enqueue(new KeyValuePair<float, int>(beat, type));
try
{
upcomingHits.Add(beat, type);
}
catch (ArgumentException)
{}
}
public void Hit(bool _hit, int type = 0, bool fromAutoplay = false)
@ -77,15 +82,18 @@ namespace HeavenStudio.Games.Scripts_FanClub
{
if (upcomingHits?.Count > 0)
{
var next = upcomingHits.Dequeue();
var k = upcomingHits.Keys[0];
var v = upcomingHits[k];
startBeat = next.Key;
type = next.Value == 2 ? 0 : next.Value;
doCharge = (next.Value == 2);
startBeat = k;
type = v == 2 ? 0 : v;
doCharge = (v == 2);
// reset our shit to prepare for next hit
hasHit = false;
ResetState();
upcomingHits.Remove(k);
}
else if (Conductor.instance.GetPositionFromBeat(startBeat, 1) >= Minigame.EndTime())
{