Even more space soccer animations + Clappy Trio Autoplay bug fixed

This commit is contained in:
Braedon
2022-01-24 22:49:40 -05:00
parent 8a42130953
commit aa86cac41b
16 changed files with 8022 additions and 49 deletions

View File

@ -6,12 +6,8 @@ using RhythmHeavenMania.Util;
namespace RhythmHeavenMania.Games.ClappyTrio
{
public class ClappyTrioPlayer : MonoBehaviour
public class ClappyTrioPlayer : PlayerActionObject
{
public bool early;
public bool perfect;
public bool late;
private float lastClapBeat;
private float lastClapLength;
[SerializeField] private bool clapVacant;
@ -24,24 +20,30 @@ namespace RhythmHeavenMania.Games.ClappyTrio
public bool canHit;
private GameObject clapEffect;
int aceTimes = 0;
private void Start()
{
clapEffect = transform.GetChild(4).GetChild(3).gameObject;
}
public override void OnAce()
{
Clap(true);
}
private void Update()
{
if (PlayerInput.Pressed())
{
Clap();
Clap(false);
}
if (clapVacant == true)
{
float normalizedBeat = (Conductor.instance.GetLoopPositionFromBeat(lastClapBeat, lastClapLength));
if (normalizedBeat > Minigame.EarlyTime() && normalizedBeat < Minigame.PerfectTime() && lastIndex == 0)
/*if (normalizedBeat > Minigame.EarlyTime() && normalizedBeat < Minigame.PerfectTime() && lastIndex == 0)
{
SetEligibility(true, false, false);
lastIndex++;
@ -60,6 +62,16 @@ namespace RhythmHeavenMania.Games.ClappyTrio
lastClapLength = 0;
lastClapBeat = 0;
hit = false;
}*/
StateCheck(normalizedBeat);
if (normalizedBeat > Minigame.LateTime())
{
clapVacant = false;
lastIndex = 0;
lastClapLength = 0;
lastClapBeat = 0;
}
}
}
@ -74,30 +86,17 @@ namespace RhythmHeavenMania.Games.ClappyTrio
public void SetClapAvailability(float startBeat, float length)
{
ResetAce();
lastClapBeat = startBeat;
clapVacant = true;
lastClapLength = length;
}
private void SetEligibility(bool early, bool perfect, bool late)
private void Clap(bool overrideCanHit)
{
this.early = false;
this.perfect = false;
this.late = false;
bool canHit = state.early != true && state.late != true && state.perfect == true && hit == false;
if (early)
this.early = true;
else if (perfect)
this.perfect = true;
else if (late)
this.late = true;
}
private void Clap()
{
bool canHit = early != true && late != true && perfect == true && hit == false;
if (canHit)
if (canHit || overrideCanHit)
{
clapEffect.SetActive(true);
Jukebox.PlayOneShotGame("clappyTrio/rightClap");

View File

@ -33,7 +33,7 @@ namespace RhythmHeavenMania.Games
{
OnAce();
AceVisuals();
// aceTimes++;
aceTimes++;
}
}
}

View File

@ -85,7 +85,7 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
{
if (dispensing)
{
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(dispensedBeat, 2.5f);
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(dispensedBeat, 2.35f);
holder.transform.position = dispenseCurve.GetPoint(normalizedBeatAnim);
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(0f, -1440f, normalizedBeatAnim));
@ -128,9 +128,9 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
}
else if (highKicked.enabled)
{
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(highKicked.startBeat, 1.85f);
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(highKicked.startBeat, 1.8f);
holder.transform.position = highKickCurve.GetPoint(normalizedBeatAnim);
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, -460f, normalizedBeatAnim));
spriteHolder.transform.eulerAngles = new Vector3(0, 0, Mathf.Lerp(lastSpriteRot, lastSpriteRot + 360f, normalizedBeatAnim));
// if (state.perfect) Debug.Break();

View File

@ -55,13 +55,27 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
{
kickTimes++;
if (kickLeft)
if (highKick)
{
anim.Play("KickLeft", 0, 0);
if (kickLeft)
{
anim.Play("HighKickLeft_0", 0, 0);
}
else
{
anim.Play("HighKickRight_0", 0, 0);
}
}
else
else if (!highKick)
{
anim.Play("KickRight", 0, 0);
if (kickLeft)
{
anim.Play("KickLeft", 0, 0);
}
else
{
anim.Play("KickRight", 0, 0);
}
}
if (highKick == false)
{
@ -77,6 +91,8 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
public void HighKick(bool hit)
{
kickTimes++;
if (hit)
{
Jukebox.PlayOneShotGame("spaceSoccer/highkicktoe1_hit");
@ -86,6 +102,15 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
Jukebox.PlayOneShotGame("spaceSoccer/highkicktoe1");
}
if (kickLeft)
{
anim.Play("HighKickLeft_0", 0, 0);
}
else
{
anim.Play("HighKickRight_0", 0, 0);
}
ball.HighKick();
ResetState();
}
@ -100,6 +125,16 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
{
Jukebox.PlayOneShotGame("spaceSoccer/highkicktoe3");
}
if (kickLeft)
{
anim.Play("ToeLeft", 0, 0);
}
else
{
anim.Play("ToeRight", 0, 0);
}
ball.Toe();
kickPrepare = false;
ResetState();