See Saw defuckedification and almost all of toss boys is stretchy now (#427)

* See saw is defucked and toss boys is all stretchy now

* Minor reference edit in toss boys
This commit is contained in:
Rapandrasmus 2023-05-20 16:04:37 +02:00 committed by GitHub
parent 746b64efed
commit e52cd0b2e9
3 changed files with 142 additions and 98 deletions

View file

@ -116,6 +116,7 @@ namespace HeavenStudio.Games
{ {
using Scripts_SeeSaw; using Scripts_SeeSaw;
using System; using System;
using System.Linq;
public class SeeSaw : Minigame public class SeeSaw : Minigame
{ {
@ -163,8 +164,8 @@ namespace HeavenStudio.Games
[SerializeField] SpriteRenderer[] recolors; [SerializeField] SpriteRenderer[] recolors;
[Header("Properties")] [Header("Properties")]
bool sawShouldBop; [NonSerialized] public bool sawShouldBop;
bool seeShouldBop; [NonSerialized] public bool seeShouldBop;
GameEvent bop = new GameEvent(); GameEvent bop = new GameEvent();
float bgColorStartBeat; float bgColorStartBeat;
float bgColorLength; float bgColorLength;
@ -191,17 +192,7 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
var jumpEvents = EventCaller.GetAllInGameManagerList("seeSaw", new string[] { "longLong", "longShort", "shortLong", "shortShort" }); GrabJumpEvents();
List<DynamicBeatmap.DynamicEntity> tempEvents = new List<DynamicBeatmap.DynamicEntity>();
for (int i = 0; i < jumpEvents.Count; i++)
{
if (jumpEvents[i].beat + jumpEvents[i].beat >= Conductor.instance.songPositionInBeats)
{
tempEvents.Add(jumpEvents[i]);
}
}
tempEvents.Sort((s1, s2) => s1.beat.CompareTo(s2.beat));
allJumpEvents = tempEvents;
} }
private void Start() private void Start()
@ -231,6 +222,42 @@ namespace HeavenStudio.Games
} }
} }
private void GrabJumpEvents()
{
var jumpEvents = EventCaller.GetAllInGameManagerList("seeSaw", new string[] { "longLong", "longShort", "shortLong", "shortShort" });
List<DynamicBeatmap.DynamicEntity> tempEvents = new List<DynamicBeatmap.DynamicEntity>();
for (int i = 0; i < jumpEvents.Count; i++)
{
if (jumpEvents[i].beat + jumpEvents[i].beat >= Conductor.instance.songPositionInBeats)
{
tempEvents.Add(jumpEvents[i]);
}
}
tempEvents.Sort((s1, s2) => s1.beat.CompareTo(s2.beat));
List<DynamicBeatmap.DynamicEntity> tempEvents2 = new List<DynamicBeatmap.DynamicEntity>();
if (tempEvents.Count > 1)
{
float goodBeat = tempEvents[0].beat + tempEvents[0].length;
for (int i = 1; i < tempEvents.Count; i++)
{
if (tempEvents[i].beat != goodBeat)
{
tempEvents2.Add(tempEvents[i]);
}
else
{
goodBeat = tempEvents[i].beat + tempEvents[i].length;
}
}
}
tempEvents = tempEvents.Except(tempEvents2).ToList();
allJumpEvents = tempEvents;
foreach (var jump in allJumpEvents)
{
Debug.Log(jump.beat);
}
}
private void Update() private void Update()
{ {
var cond = Conductor.instance; var cond = Conductor.instance;
@ -254,15 +281,15 @@ namespace HeavenStudio.Games
{ {
if (currentJumpIndex < allJumpEvents.Count && currentJumpIndex >= 0) if (currentJumpIndex < allJumpEvents.Count && currentJumpIndex >= 0)
{ {
if (currentJumpIndex == 0 || allJumpEvents[currentJumpIndex].beat > allJumpEvents[currentJumpIndex - 1].length + ((allJumpEvents[currentJumpIndex].datamodel == "seeSaw/longShort" if (currentJumpIndex == 0
|| allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortShort") ? 1 : 2)) || allJumpEvents[currentJumpIndex].beat > allJumpEvents[currentJumpIndex - 1].length + ((allJumpEvents[currentJumpIndex].datamodel is "seeSaw/longShort" or "seeSaw/shortShort") ? 1 : 2))
{ {
if (cond.songPositionInBeats >= allJumpEvents[currentJumpIndex].beat - ((allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortLong" if (cond.songPositionInBeats >= allJumpEvents[currentJumpIndex].beat - ((allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortLong"
|| allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortShort") ? 1 : 2)) || allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortShort") ? 1 : 2))
{ {
if (canPrepare && cond.songPositionInBeats < allJumpEvents[currentJumpIndex].beat) if (canPrepare && cond.songPositionInBeats < allJumpEvents[currentJumpIndex].beat)
{ {
bool inJump = allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortLong" || allJumpEvents[currentJumpIndex].datamodel == "seeSaw/shortShort"; bool inJump = allJumpEvents[currentJumpIndex].datamodel is "seeSaw/shortLong" or "seeSaw/shortShort";
float beatToJump = allJumpEvents[currentJumpIndex].beat - (inJump ? 1 : 2); float beatToJump = allJumpEvents[currentJumpIndex].beat - (inJump ? 1 : 2);
Jukebox.PlayOneShotGame("seeSaw/prepareHigh", beatToJump); Jukebox.PlayOneShotGame("seeSaw/prepareHigh", beatToJump);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
@ -359,17 +386,15 @@ namespace HeavenStudio.Games
if (see.dead || saw.dead) return; if (see.dead || saw.dead) return;
if (currentJumpIndex != 0) if (currentJumpIndex != 0)
{ {
if (currentJumpIndex < allJumpEvents.Count && currentJumpIndex > 0) if (currentJumpIndex >= allJumpEvents.Count || allJumpEvents[currentJumpIndex].beat != beat)
{ {
if (allJumpEvents[currentJumpIndex - 1].beat + allJumpEvents[currentJumpIndex - 1].length != beat && !canPrepare && !canStartJump)
{
currentJumpIndex++;
return; return;
} }
} }
}
saw.canBop = false; saw.canBop = false;
canStartJump = false; canStartJump = false;
if (canPrepare) see.SetState(SeeSawGuy.JumpState.StartJump, beat - 2);
canPrepare = false;
seeSawAnim.transform.localScale = new Vector3(-1, 1, 1); seeSawAnim.transform.localScale = new Vector3(-1, 1, 1);
seeSawAnim.DoScaledAnimationAsync("Good", 0.5f); seeSawAnim.DoScaledAnimationAsync("Good", 0.5f);
if (high) if (high)
@ -409,7 +434,8 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + 4); Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + 4);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + 4, delegate { see.Land(SeeSawGuy.LandType.Normal, true); canPrepare = true; canStartJump = true; see.canBop = true; }) new BeatAction.Action(beat + 3.75f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + 4, delegate { see.Land(SeeSawGuy.LandType.Normal, true); canPrepare = true; canStartJump = true;})
}); });
} }
} }
@ -420,17 +446,15 @@ namespace HeavenStudio.Games
if (see.dead || saw.dead) return; if (see.dead || saw.dead) return;
if (currentJumpIndex != 0) if (currentJumpIndex != 0)
{ {
if (currentJumpIndex < allJumpEvents.Count && currentJumpIndex > 0) if (currentJumpIndex >= allJumpEvents.Count || allJumpEvents[currentJumpIndex].beat != beat)
{ {
if (allJumpEvents[currentJumpIndex - 1].beat + allJumpEvents[currentJumpIndex - 1].length != beat && !canPrepare && !canStartJump)
{
currentJumpIndex++;
return; return;
} }
} }
}
saw.canBop = false; saw.canBop = false;
canStartJump = false; canStartJump = false;
if (canPrepare) see.SetState(SeeSawGuy.JumpState.StartJump, beat - 2);
canPrepare = false;
seeSawAnim.transform.localScale = new Vector3(-1, 1, 1); seeSawAnim.transform.localScale = new Vector3(-1, 1, 1);
seeSawAnim.DoScaledAnimationAsync("Good", 0.5f); seeSawAnim.DoScaledAnimationAsync("Good", 0.5f);
if (high) if (high)
@ -470,7 +494,8 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + beatLength); Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + beatLength);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + beatLength, delegate { see.Land(SeeSawGuy.LandType.Normal, true); canPrepare = true; canStartJump = true; see.canBop = true; }) new BeatAction.Action(beat + beatLength - 0.25f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + beatLength, delegate { see.Land(SeeSawGuy.LandType.Normal, true); canPrepare = true; canStartJump = true;})
}); });
} }
} }
@ -481,17 +506,15 @@ namespace HeavenStudio.Games
if (see.dead || saw.dead) return; if (see.dead || saw.dead) return;
if (currentJumpIndex != 0) if (currentJumpIndex != 0)
{ {
if (currentJumpIndex < allJumpEvents.Count && currentJumpIndex > 0) if (currentJumpIndex >= allJumpEvents.Count || allJumpEvents[currentJumpIndex].beat != beat)
{ {
if (allJumpEvents[currentJumpIndex - 1].beat + allJumpEvents[currentJumpIndex - 1].length != beat && !canPrepare && !canStartJump)
{
currentJumpIndex++;
return; return;
} }
} }
}
saw.canBop = false; saw.canBop = false;
canStartJump = false; canStartJump = false;
if (canPrepare) see.SetState(SeeSawGuy.JumpState.StartJumpIn, beat - 1);
canPrepare = false;
seeSawAnim.transform.localScale = new Vector3(-1, 1, 1); seeSawAnim.transform.localScale = new Vector3(-1, 1, 1);
seeSawAnim.DoScaledAnimationAsync("Good", 0.5f); seeSawAnim.DoScaledAnimationAsync("Good", 0.5f);
if (high) if (high)
@ -531,7 +554,8 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + beatLength); Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + beatLength);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + beatLength, delegate { see.Land(SeeSawGuy.LandType.Normal, false); canPrepare = true; canStartJump = true; see.canBop = true; }) new BeatAction.Action(beat + beatLength - 0.25f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + beatLength, delegate { see.Land(SeeSawGuy.LandType.Normal, false); canPrepare = true; canStartJump = true; })
}); });
} }
} }
@ -542,17 +566,15 @@ namespace HeavenStudio.Games
if (see.dead || saw.dead) return; if (see.dead || saw.dead) return;
if (currentJumpIndex != 0) if (currentJumpIndex != 0)
{ {
if (currentJumpIndex < allJumpEvents.Count && currentJumpIndex > 0) if (currentJumpIndex >= allJumpEvents.Count || allJumpEvents[currentJumpIndex].beat != beat)
{ {
if (allJumpEvents[currentJumpIndex - 1].beat + allJumpEvents[currentJumpIndex - 1].length != beat && !canPrepare && !canStartJump)
{
currentJumpIndex++;
return; return;
} }
} }
}
saw.canBop = false; saw.canBop = false;
canStartJump = false; canStartJump = false;
if (canPrepare) see.SetState(SeeSawGuy.JumpState.StartJumpIn, beat - 1);
canPrepare = false;
seeSawAnim.transform.localScale = new Vector3(-1, 1, 1); seeSawAnim.transform.localScale = new Vector3(-1, 1, 1);
seeSawAnim.DoScaledAnimationAsync("Good", 0.5f); seeSawAnim.DoScaledAnimationAsync("Good", 0.5f);
if (high) if (high)
@ -591,7 +613,8 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + 2); Jukebox.PlayOneShotGame("seeSaw/otherLand", beat + 2);
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + 2, delegate { see.Land(SeeSawGuy.LandType.Normal, false); canPrepare = true; canStartJump = true; see.canBop = true; }) new BeatAction.Action(beat + 1.75f, delegate { see.canBop = true; }),
new BeatAction.Action(beat + 2, delegate { see.Land(SeeSawGuy.LandType.Normal, false); canPrepare = true; canStartJump = true;})
}); });
} }
} }

View file

@ -50,6 +50,8 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
[SerializeField] Transform groundTrans; [SerializeField] Transform groundTrans;
bool hasChangedAnimMidAir; bool hasChangedAnimMidAir;
[SerializeField] ParticleSystem deathParticle; [SerializeField] ParticleSystem deathParticle;
float wantChoke = -1;
float wantChokeLength;
[SerializeField] private Animator invertAnim; [SerializeField] private Animator invertAnim;
@ -168,7 +170,12 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
public void Choke(float beat, float length) public void Choke(float beat, float length)
{ {
if (!canBop || currentState != JumpState.None || dead) return; if (!canBop || currentState != JumpState.None || dead)
{
wantChoke = beat;
wantChokeLength = length;
return;
}
dead = true; dead = true;
anim.DoScaledAnimationAsync("Choke_" + (see ? "See" : "Saw") + "_Intro", 0.5f); anim.DoScaledAnimationAsync("Choke_" + (see ? "See" : "Saw") + "_Intro", 0.5f);
Jukebox.PlayOneShotGame("seeSaw/explosion" + (see ? "Black" : "White"), beat + length); Jukebox.PlayOneShotGame("seeSaw/explosion" + (see ? "Black" : "White"), beat + length);
@ -203,9 +210,20 @@ namespace HeavenStudio.Games.Scripts_SeeSaw
break; break;
case JumpState.EndJumpOut: case JumpState.EndJumpOut:
case JumpState.EndJumpIn: case JumpState.EndJumpIn:
anim.Play("NeutralSee", 0, 0);
transform.position = groundTrans.position; transform.position = groundTrans.position;
SetState(JumpState.None, 0); SetState(JumpState.None, 0);
if (wantChoke >= Conductor.instance.songPositionInBeats - 0.25f && wantChoke <= Conductor.instance.songPositionInBeats + 0.25f)
{
Choke(wantChoke, wantChokeLength);
}
else if (see ? game.seeShouldBop : game.sawShouldBop)
{
Bop();
}
else
{
anim.Play("NeutralSee", 0, 0);
}
return; return;
} }
if (landType is LandType.Big && !see) if (landType is LandType.Big && !see)

View file

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using HeavenStudio.Util; using HeavenStudio.Util;
using DG.Tweening;
namespace HeavenStudio.Games.Loaders namespace HeavenStudio.Games.Loaders
{ {
@ -26,6 +27,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("pass", "Normal Toss") new GameAction("pass", "Normal Toss")
{ {
defaultLength = 2f, defaultLength = 2f,
resizable = true,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("who", TossBoys.KidChoice.Aokun, "Receiver", "Who will receive the ball?") new Param("who", TossBoys.KidChoice.Aokun, "Receiver", "Who will receive the ball?")
@ -34,6 +36,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("dual", "Dual Toss") new GameAction("dual", "Dual Toss")
{ {
defaultLength = 1f, defaultLength = 1f,
resizable = true,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("who", TossBoys.KidChoice.Akachan, "Receiver", "Who will receive the ball?") new Param("who", TossBoys.KidChoice.Akachan, "Receiver", "Who will receive the ball?")
@ -42,6 +45,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("high", "High Toss") new GameAction("high", "High Toss")
{ {
defaultLength = 3f, defaultLength = 3f,
resizable = true,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("who", TossBoys.KidChoice.Kiiyan, "Receiver", "Who will receive the ball?") new Param("who", TossBoys.KidChoice.Kiiyan, "Receiver", "Who will receive the ball?")
@ -50,6 +54,7 @@ namespace HeavenStudio.Games.Loaders
new GameAction("lightning", "Lightning Toss") new GameAction("lightning", "Lightning Toss")
{ {
defaultLength = 2f, defaultLength = 2f,
resizable = true,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("who", TossBoys.KidChoice.Aokun, "Receiver", "Who will receive the ball?") new Param("who", TossBoys.KidChoice.Aokun, "Receiver", "Who will receive the ball?")
@ -61,7 +66,7 @@ namespace HeavenStudio.Games.Loaders
}, },
new GameAction("pop", "Pop Ball") new GameAction("pop", "Pop Ball")
{ {
defaultLength = 2f, defaultLength = 1f,
}, },
new GameAction("bop", "Bop") new GameAction("bop", "Bop")
{ {
@ -91,7 +96,6 @@ namespace HeavenStudio.Games.Loaders
} }
namespace HeavenStudio.Games namespace HeavenStudio.Games
{ {
using DG.Tweening;
using Scripts_TossBoys; using Scripts_TossBoys;
public class TossBoys : Minigame public class TossBoys : Minigame
@ -141,6 +145,7 @@ namespace HeavenStudio.Games
public static TossBoys instance; public static TossBoys instance;
bool shouldBop = true; bool shouldBop = true;
public GameEvent bop = new GameEvent(); public GameEvent bop = new GameEvent();
float currentEventLength;
private void Awake() private void Awake()
{ {
@ -358,6 +363,7 @@ namespace HeavenStudio.Games
{ {
currentReceiver = (WhichTossKid)receiver["who"]; currentReceiver = (WhichTossKid)receiver["who"];
currentPassType = receiver.datamodel; currentPassType = receiver.datamodel;
currentEventLength = receiver.length;
} }
else else
{ {
@ -369,22 +375,19 @@ namespace HeavenStudio.Games
*/ */
currentReceiver = tempLastReceiver; currentReceiver = tempLastReceiver;
} }
float eventLength = 2f;
switch (currentPassType) switch (currentPassType)
{ {
case "tossBoys/pass": case "tossBoys/pass":
PassBall(beat); PassBall(beat, currentEventLength);
break; break;
case "tossBoys/dual": case "tossBoys/dual":
DualToss(beat); DualToss(beat, currentEventLength);
eventLength = 1f;
break; break;
case "tossBoys/high": case "tossBoys/high":
HighToss(beat); HighToss(beat, currentEventLength);
eventLength = 3f;
break; break;
case "tossBoys/lightning": case "tossBoys/lightning":
LightningToss(beat); LightningToss(beat, currentEventLength);
break; break;
default: default:
break; break;
@ -397,16 +400,16 @@ namespace HeavenStudio.Games
{ {
currentBall.anim.DoScaledAnimationAsync("Hit", 0.5f); currentBall.anim.DoScaledAnimationAsync("Hit", 0.5f);
} }
if (passBallDict.ContainsKey(beat + eventLength) && passBallDict[beat + eventLength].datamodel == "tossBoys/pop") if (passBallDict.ContainsKey(beat + currentEventLength) && passBallDict[beat + currentEventLength].datamodel == "tossBoys/pop")
{ {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + eventLength - 1, delegate { GetCurrentReceiver().PopBallPrepare(); }) new BeatAction.Action(beat + currentEventLength - 1, delegate { GetCurrentReceiver().PopBallPrepare(); })
}); });
} }
} }
void PassBall(float beat) void PassBall(float beat, float length)
{ {
string last = GetColorBasedOnTossKid(lastReceiver, false); string last = GetColorBasedOnTossKid(lastReceiver, false);
string current = GetColorBasedOnTossKid(currentReceiver, true); string current = GetColorBasedOnTossKid(currentReceiver, true);
@ -418,26 +421,26 @@ namespace HeavenStudio.Games
switch (last + current) switch (last + current)
{ {
case "redBlue": case "redBlue":
currentBall.SetState(TossBoysBall.State.RedBlue, beat); currentBall.SetState(TossBoysBall.State.RedBlue, beat, length);
break; break;
case "blueRed": case "blueRed":
secondBeat = 0.5f; secondBeat = 0.5f;
currentBall.SetState(TossBoysBall.State.BlueRed, beat); currentBall.SetState(TossBoysBall.State.BlueRed, beat, length);
break; break;
case "blueYellow": case "blueYellow":
currentBall.SetState(TossBoysBall.State.BlueYellow, beat); currentBall.SetState(TossBoysBall.State.BlueYellow, beat, length);
break; break;
case "yellowRed": case "yellowRed":
secondBeat = 0.5f; secondBeat = 0.5f;
currentBall.SetState(TossBoysBall.State.YellowRed, beat); currentBall.SetState(TossBoysBall.State.YellowRed, beat, length);
break; break;
case "redYellow": case "redYellow":
secondBeat = 0.5f; secondBeat = 0.5f;
thirdOffset = 0.060f; thirdOffset = 0.060f;
currentBall.SetState(TossBoysBall.State.RedYellow, beat); currentBall.SetState(TossBoysBall.State.RedYellow, beat, length);
break; break;
case "yellowBlue": case "yellowBlue":
currentBall.SetState(TossBoysBall.State.YellowBlue, beat); currentBall.SetState(TossBoysBall.State.YellowBlue, beat, length);
break; break;
default: default:
break; break;
@ -449,19 +452,19 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tossBoys/" + last + current + 1, beat), new MultiSound.Sound("tossBoys/" + last + current + 1, beat),
new MultiSound.Sound("tossBoys/" + last + current + 2, beat + secondBeat, 1, 1, false, secondOffset), new MultiSound.Sound("tossBoys/" + last + current + 2, beat + secondBeat, 1, 1, false, secondOffset),
}; };
if (passBallDict.ContainsKey(beat + 2) && (passBallDict[beat + 2].datamodel == "tossBoys/dual" || passBallDict[beat + 2].datamodel == "tossBoys/lightning" || passBallDict[beat + 2].datamodel == "tossBoys/blur")) if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/dual" or "tossBoys/lightning" or "tossBoys/blur"))
{ {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + 1, delegate { DoSpecialBasedOnReceiver(beat + 1); }) new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
}); });
} }
if (secondBeat == 0.5f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + 3, beat + 1, 1, 1, false, thirdOffset)); if (secondBeat == 0.5f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + 3, beat + 1, 1, 1, false, thirdOffset));
MultiSound.Play(soundsToPlay.ToArray()); MultiSound.Play(soundsToPlay.ToArray());
ScheduleInput(beat, 2f, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty); ScheduleInput(beat, length, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty);
} }
void DualToss(float beat) void DualToss(float beat, float length)
{ {
string last = GetColorBasedOnTossKid(lastReceiver, false); string last = GetColorBasedOnTossKid(lastReceiver, false);
string current = GetColorBasedOnTossKid(currentReceiver, true); string current = GetColorBasedOnTossKid(currentReceiver, true);
@ -473,26 +476,26 @@ namespace HeavenStudio.Games
switch (last + current) switch (last + current)
{ {
case "redBlue": case "redBlue":
currentBall.SetState(TossBoysBall.State.RedBlueDual, beat); currentBall.SetState(TossBoysBall.State.RedBlueDual, beat, length);
break; break;
case "blueYellow": case "blueYellow":
currentBall.SetState(TossBoysBall.State.BlueYellowDual, beat); currentBall.SetState(TossBoysBall.State.BlueYellowDual, beat, length);
break; break;
case "yellowBlue": case "yellowBlue":
currentBall.SetState(TossBoysBall.State.YellowBlueDual, beat); currentBall.SetState(TossBoysBall.State.YellowBlueDual, beat, length);
break; break;
case "blueRed": case "blueRed":
secondBeat = 0.25f; secondBeat = 0.25f;
thirdOffset = 0.020f; thirdOffset = 0.020f;
currentBall.SetState(TossBoysBall.State.BlueRedDual, beat); currentBall.SetState(TossBoysBall.State.BlueRedDual, beat, length);
break; break;
case "yellowRed": case "yellowRed":
secondBeat = 0.25f; secondBeat = 0.25f;
currentBall.SetState(TossBoysBall.State.YellowRedDual, beat); currentBall.SetState(TossBoysBall.State.YellowRedDual, beat, length);
break; break;
case "redYellow": case "redYellow":
secondOffset = 0.060f; secondOffset = 0.060f;
currentBall.SetState(TossBoysBall.State.RedYellowDual, beat); currentBall.SetState(TossBoysBall.State.RedYellowDual, beat, length);
break; break;
default: default:
break; break;
@ -504,20 +507,20 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tossBoys/" + last + current + "Low" + 1, beat), new MultiSound.Sound("tossBoys/" + last + current + "Low" + 1, beat),
new MultiSound.Sound("tossBoys/" + last + current + "Low" + 2, beat + secondBeat, 1, 1, false, secondOffset), new MultiSound.Sound("tossBoys/" + last + current + "Low" + 2, beat + secondBeat, 1, 1, false, secondOffset),
}; };
if (passBallDict.ContainsKey(beat + 1) && (passBallDict[beat + 1].datamodel == "tossBoys/lightning" || passBallDict[beat + 1].datamodel == "tossBoys/blur")) if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/lightning" or "tossBoys/blur"))
{ {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat, delegate { DoSpecialBasedOnReceiver(beat); }) new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
}); });
} }
if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "Low" + 3, beat + 0.5f, 1, 1, false, thirdOffset)); if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "Low" + 3, beat + 0.5f, 1, 1, false, thirdOffset));
MultiSound.Play(soundsToPlay.ToArray()); MultiSound.Play(soundsToPlay.ToArray());
bool stopSpecial = passBallDict.ContainsKey(beat + 1) && passBallDict[beat + 1].datamodel is "tossBoys/pass" or "tossBoys/high" or "tossBoys/pop"; bool stopSpecial = passBallDict.ContainsKey(beat + length) && passBallDict[beat + length].datamodel is "tossBoys/pass" or "tossBoys/high" or "tossBoys/pop";
ScheduleInput(beat, 1f, GetInputTypeBasedOnCurrentReceiver(), stopSpecial ? JustHitBallUnSpecial : JustHitBall, Miss, Empty); ScheduleInput(beat, length, GetInputTypeBasedOnCurrentReceiver(), stopSpecial ? JustHitBallUnSpecial : JustHitBall, Miss, Empty);
} }
void HighToss(float beat) void HighToss(float beat, float length)
{ {
string last = GetColorBasedOnTossKid(lastReceiver, false); string last = GetColorBasedOnTossKid(lastReceiver, false);
string current = GetColorBasedOnTossKid(currentReceiver, true); string current = GetColorBasedOnTossKid(currentReceiver, true);
@ -529,24 +532,24 @@ namespace HeavenStudio.Games
switch (last + current) switch (last + current)
{ {
case "redBlue": case "redBlue":
currentBall.SetState(TossBoysBall.State.RedBlueHigh, beat); currentBall.SetState(TossBoysBall.State.RedBlueHigh, beat, length);
break; break;
case "redYellow": case "redYellow":
currentBall.SetState(TossBoysBall.State.RedYellowHigh, beat); currentBall.SetState(TossBoysBall.State.RedYellowHigh, beat, length);
break; break;
case "blueYellow": case "blueYellow":
currentBall.SetState(TossBoysBall.State.BlueYellowHigh, beat); currentBall.SetState(TossBoysBall.State.BlueYellowHigh, beat, length);
break; break;
case "yellowBlue": case "yellowBlue":
currentBall.SetState(TossBoysBall.State.YellowBlueHigh, beat); currentBall.SetState(TossBoysBall.State.YellowBlueHigh, beat, length);
break; break;
case "yellowRed": case "yellowRed":
secondBeat = 0.25f; secondBeat = 0.25f;
currentBall.SetState(TossBoysBall.State.YellowRedHigh, beat); currentBall.SetState(TossBoysBall.State.YellowRedHigh, beat, length);
break; break;
case "blueRed": case "blueRed":
secondBeat = 0.25f; secondBeat = 0.25f;
currentBall.SetState(TossBoysBall.State.BlueRedHigh, beat); currentBall.SetState(TossBoysBall.State.BlueRedHigh, beat, length);
break; break;
default: default:
break; break;
@ -558,19 +561,19 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tossBoys/" + last + current + "High" + 1, beat), new MultiSound.Sound("tossBoys/" + last + current + "High" + 1, beat),
new MultiSound.Sound("tossBoys/" + last + current + "High" + 2, beat + secondBeat, 1, 1, false, secondOffset), new MultiSound.Sound("tossBoys/" + last + current + "High" + 2, beat + secondBeat, 1, 1, false, secondOffset),
}; };
if (passBallDict.ContainsKey(beat + 3) && (passBallDict[beat + 3].datamodel == "tossBoys/dual" || passBallDict[beat + 3].datamodel == "tossBoys/lightning" || passBallDict[beat + 3].datamodel == "tossBoys/blur")) if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/dual" or "tossBoys/lightning" or "tossBoys/blur"))
{ {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + 2, delegate { DoSpecialBasedOnReceiver(beat + 2); }) new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
}); });
} }
if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "High" + 3, beat + 0.5f, 1, 1, false, thirdOffset)); if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "High" + 3, beat + 0.5f, 1, 1, false, thirdOffset));
MultiSound.Play(soundsToPlay.ToArray()); MultiSound.Play(soundsToPlay.ToArray());
ScheduleInput(beat, 3f, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty); ScheduleInput(beat, length, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty);
} }
void LightningToss(float beat) void LightningToss(float beat, float length)
{ {
string last = GetColorBasedOnTossKid(lastReceiver, false); string last = GetColorBasedOnTossKid(lastReceiver, false);
string current = GetColorBasedOnTossKid(currentReceiver, true); string current = GetColorBasedOnTossKid(currentReceiver, true);
@ -598,13 +601,13 @@ namespace HeavenStudio.Games
switch (last) switch (last)
{ {
case "blue": case "blue":
currentBall.SetState(TossBoysBall.State.BlueKeep, beat); currentBall.SetState(TossBoysBall.State.BlueKeep, beat, length / 2);
break; break;
case "red": case "red":
currentBall.SetState(TossBoysBall.State.RedKeep, beat); currentBall.SetState(TossBoysBall.State.RedKeep, beat, length / 2);
break; break;
case "yellow": case "yellow":
currentBall.SetState(TossBoysBall.State.YellowKeep, beat); currentBall.SetState(TossBoysBall.State.YellowKeep, beat, length / 2);
break; break;
} }
} }
@ -614,17 +617,17 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tossBoys/" + last + current + "Low" + 2, beat + secondBeat, 1, 1, false, secondOffset), new MultiSound.Sound("tossBoys/" + last + current + "Low" + 2, beat + secondBeat, 1, 1, false, secondOffset),
}; };
if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "Low" + 3, beat + 0.5f, 1, 1, false, thirdOffset)); if (secondBeat == 0.25f) soundsToPlay.Add(new MultiSound.Sound("tossBoys/" + last + current + "Low" + 3, beat + 0.5f, 1, 1, false, thirdOffset));
if (passBallDict.ContainsKey(beat + 2) && (passBallDict[beat + 2].datamodel == "tossBoys/dual" || passBallDict[beat + 2].datamodel == "tossBoys/blur")) if (passBallDict.ContainsKey(beat + length) && (passBallDict[beat + length].datamodel is "tossBoys/dual" or "tossBoys/blur"))
{ {
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + 1, delegate { DoSpecialBasedOnReceiver(beat + 1); }) new BeatAction.Action(beat + length - 1, delegate { DoSpecialBasedOnReceiver(beat + length - 1); })
}); });
} }
MultiSound.Play(soundsToPlay.ToArray()); MultiSound.Play(soundsToPlay.ToArray());
bool stopSpecial = passBallDict.ContainsKey(beat + 2) && passBallDict[beat + 2].datamodel is "tossBoys/pass" or "tossBoys/high" or "tossBoys/pop"; bool stopSpecial = passBallDict.ContainsKey(beat + length) && passBallDict[beat + length].datamodel is "tossBoys/pass" or "tossBoys/high" or "tossBoys/pop";
ScheduleInput(beat, 1f, GetInputBasedOnTossKid(lastReceiver), stopSpecial ? JustKeepUnSpecial : JustKeep, Miss, Empty); ScheduleInput(beat, length / 2, GetInputBasedOnTossKid(lastReceiver), stopSpecial ? JustKeepUnSpecial : JustKeep, Miss, Empty);
ScheduleInput(beat, 2f, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty); ScheduleInput(beat, length, GetInputTypeBasedOnCurrentReceiver(), JustHitBall, Miss, Empty);
} }
void BlurToss(float beat) void BlurToss(float beat)