|
|
|
@ -28,6 +28,7 @@ using HeavenStudio.Util;
|
|
|
|
|
using HeavenStudio.InputSystem;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Loaders
|
|
|
|
@ -93,22 +94,25 @@ namespace HeavenStudio.Games.Loaders
|
|
|
|
|
|
|
|
|
|
new GameAction("endPose", "Finishing Pose")
|
|
|
|
|
{
|
|
|
|
|
function = delegate { var e = eventCaller.currentEntity; SumoBrothers.instance.EndPose(e.beat, e["random"], e["type"], e["bg"], e["confetti"]); },
|
|
|
|
|
function = delegate { var e = eventCaller.currentEntity; SumoBrothers.instance.EndPose(e.beat, e["random"], e["type"], e["bg"], e["confetti"], e["alternate"]); },
|
|
|
|
|
parameters = new List<Param>()
|
|
|
|
|
{ new Param("random", true, "Random Pose", "Picks a random pose that will play on a successful input. Does not include the finale pose.", new List<Param.CollapseParam>()
|
|
|
|
|
{
|
|
|
|
|
new Param.CollapseParam((x, _) => !(bool)x, new string[] { "type" })
|
|
|
|
|
}),
|
|
|
|
|
new Param("type", new EntityTypes.Integer(1, 3, 1), "Pose", "The pose that the Sumo Brothers will make."),
|
|
|
|
|
// add param to alternate bg
|
|
|
|
|
new Param("bg", SumoBrothers.BGType.None, "Background", "The background that appears on a successful input."),
|
|
|
|
|
new Param("confetti", false, "Confetti (WIP)", "Confetti particles will fly everywhere on a successful input.")
|
|
|
|
|
new Param("alternate", true, "Alternate Background", "Alternates between which of the backgrounds appear on a successful input.", new List<Param.CollapseParam>()
|
|
|
|
|
{
|
|
|
|
|
new Param.CollapseParam((x, _) => !(bool)x, new string[] { "bg" })
|
|
|
|
|
}),
|
|
|
|
|
new Param("bg", SumoBrothers.BGType.GreatWave, "Background", "The background that appears on a successful input."),
|
|
|
|
|
new Param("confetti", true, "Confetti (WIP)", "Confetti particles will fly everywhere on a successful input.")
|
|
|
|
|
},
|
|
|
|
|
defaultLength = 5f,
|
|
|
|
|
priority = 2
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
new GameAction("look", "Look Forward")
|
|
|
|
|
new GameAction("look", "Look at Camera")
|
|
|
|
|
{
|
|
|
|
|
function = delegate { var e = eventCaller.currentEntity; SumoBrothers.instance.LookAtCamera(e.beat, e.length); },
|
|
|
|
|
/*parameters = new List<Param>()
|
|
|
|
@ -162,6 +166,9 @@ namespace HeavenStudio.Games
|
|
|
|
|
private double stompShakeLength;
|
|
|
|
|
public double stompShakeSpeed;
|
|
|
|
|
|
|
|
|
|
public List<double> stompShakeTimings = new List<double>();
|
|
|
|
|
public List<float> stompShakeValues = new List<float>();
|
|
|
|
|
|
|
|
|
|
private bool goBopSumo;
|
|
|
|
|
private bool goBopInu;
|
|
|
|
|
|
|
|
|
@ -232,8 +239,8 @@ namespace HeavenStudio.Games
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static PlayerInput.InputAction InputAction_Alt =
|
|
|
|
|
new("CtrSumouAlt", new int[] { IAAltDownCat, IAAltDownCat, IAAltDownCat },
|
|
|
|
|
IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress);
|
|
|
|
|
new("CtrSumouAlt", new int[] { IAAltDownCat, IAFlickCat, IAAltDownCat },
|
|
|
|
|
IA_PadAltPress, IA_TouchFlick, IA_BatonAltPress);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
@ -251,7 +258,6 @@ namespace HeavenStudio.Games
|
|
|
|
|
|
|
|
|
|
sumoPoseType = 0;
|
|
|
|
|
sumoPoseTypeNext = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnDestroy()
|
|
|
|
@ -354,8 +360,8 @@ namespace HeavenStudio.Games
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print("current sumo state: " + sumoState + " and previous sumo state: " + sumoStatePrevious);
|
|
|
|
|
print("sumo pose type: " + sumoPoseType);
|
|
|
|
|
//print("current sumo state: " + sumoState + " and previous sumo state: " + sumoStatePrevious);
|
|
|
|
|
//print("sumo pose type: " + sumoPoseType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*private void SetEndBeat(double beat) // code stolen from crop stomp, slightly modified
|
|
|
|
@ -541,7 +547,7 @@ namespace HeavenStudio.Games
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("sumo stomp dir: " + sumoStompDir);
|
|
|
|
|
//print("sumo stomp dir: " + sumoStompDir);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -630,7 +636,7 @@ namespace HeavenStudio.Games
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("the sumo slap direction:" + sumoSlapDir);
|
|
|
|
|
//print("the sumo slap direction:" + sumoSlapDir);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Crouch(double beat, float length, bool inu, bool sumo)
|
|
|
|
@ -656,16 +662,16 @@ namespace HeavenStudio.Games
|
|
|
|
|
new BeatAction.Action(beat, delegate { lookingAtCamera = true; }),
|
|
|
|
|
new BeatAction.Action(beat, delegate { sumoBrotherPHead.DoScaledAnimationAsync("SumoPSlapLook", 0.5f); }),
|
|
|
|
|
new BeatAction.Action(beat, delegate { sumoBrotherGHead.DoScaledAnimationAsync("SumoGSlapLook", 0.5f); }),
|
|
|
|
|
new BeatAction.Action(beat, delegate { print("look"); }),
|
|
|
|
|
//new BeatAction.Action(beat, delegate { print("look"); }),
|
|
|
|
|
new BeatAction.Action(beat + length, delegate { lookingAtCamera = false; }),
|
|
|
|
|
new BeatAction.Action(beat + length, delegate { if (sumoState == SumoState.Slap) sumoBrotherPHead.DoScaledAnimationAsync("SumoPSlap", 0.5f); }),
|
|
|
|
|
new BeatAction.Action(beat + length, delegate { if (sumoState == SumoState.Slap) sumoBrotherGHead.DoScaledAnimationAsync("SumoGSlap", 0.5f); }),
|
|
|
|
|
new BeatAction.Action(beat + length, delegate { print("lookun"); })
|
|
|
|
|
//new BeatAction.Action(beat + length, delegate { print("lookun"); })
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void EndPose(double beat, bool randomPose, int poseType, int backgroundType, bool confetti)
|
|
|
|
|
public void EndPose(double beat, bool randomPose, int poseType, int backgroundType, bool confetti, bool alternateBG)
|
|
|
|
|
{
|
|
|
|
|
if (cueCurrentlyActive)
|
|
|
|
|
{ return; }
|
|
|
|
@ -681,6 +687,12 @@ namespace HeavenStudio.Games
|
|
|
|
|
poseType = UnityEngine.Random.Range(1, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (alternateBG) {
|
|
|
|
|
if (bgType == BGType.None || bgType == BGType.OtaniOniji) { backgroundType = 0; } else {
|
|
|
|
|
backgroundType = 1; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var cond = Conductor.instance;
|
|
|
|
|
|
|
|
|
|
ScheduleInput(beat, 4f, InputAction_Alt, PoseHit, PoseMiss, Nothing);
|
|
|
|
@ -848,8 +860,6 @@ namespace HeavenStudio.Games
|
|
|
|
|
|
|
|
|
|
void StompHit(PlayerActionEvent caller, float state)
|
|
|
|
|
{
|
|
|
|
|
justStompBeat = Conductor.instance.songPositionInBeatsAsDouble;
|
|
|
|
|
|
|
|
|
|
if (state >= 1f || state <= -1f)
|
|
|
|
|
{
|
|
|
|
|
SoundByte.PlayOneShotGame("sumoBrothers/tink");
|
|
|
|
@ -868,23 +878,62 @@ namespace HeavenStudio.Games
|
|
|
|
|
sumoBrotherP.DoScaledAnimationAsync("SumoStompR", 0.5f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
justStompBeat = Conductor.instance.songPositionInBeatsAsDouble;
|
|
|
|
|
|
|
|
|
|
// Attempt at making the code better, abandoned because the damn lists didn't cooperate
|
|
|
|
|
|
|
|
|
|
/*stompShakeTimings.Clear();
|
|
|
|
|
stompShakeValues.Clear();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 9; i++)
|
|
|
|
|
{
|
|
|
|
|
double currBeat = stompShakeSpeed * i + justStompBeat;
|
|
|
|
|
stompShakeTimings.Add(currBeat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stompShakeValues.Add(-0.3f); // -0.3 0.3 -0.2 0.2 -0.1 0.1 -0.05 0
|
|
|
|
|
stompShakeValues.Add(0.3f);
|
|
|
|
|
stompShakeValues.Add(-0.2f);
|
|
|
|
|
stompShakeValues.Add(0.2f);
|
|
|
|
|
stompShakeValues.Add(-0.1f);
|
|
|
|
|
stompShakeValues.Add(0.1f);
|
|
|
|
|
stompShakeValues.Add(-0.05f);
|
|
|
|
|
stompShakeValues.Add(0f);*/
|
|
|
|
|
|
|
|
|
|
// yaaaay old crusty code
|
|
|
|
|
|
|
|
|
|
BeatAction.New(instance, new List<BeatAction.Action>() {
|
|
|
|
|
new BeatAction.Action(justStompBeat, delegate { stompShakeLength = 0.13; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat, delegate { cameraXNew = -0.2f; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.2, delegate { stompShakeLength = 0.25; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.2, delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.2, delegate { cameraXNew = 0.2f; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.4, delegate { stompShakeLength = 0.25; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.4, delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.4, delegate { cameraXNew = -0.1f; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.6, delegate { stompShakeLength = 0.25; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.6, delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.6, delegate { cameraXNew = 0.05f; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.8, delegate { stompShakeLength = 0.12; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.8, delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 0.8, delegate { cameraXNew = 0f; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + 1, delegate { cameraX = cameraXNew; }),
|
|
|
|
|
});
|
|
|
|
|
//new BeatAction.Action(justStompBeat, delegate { stompShakeLength = 0.13; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat, delegate { cameraXNew = -0.3f; }),
|
|
|
|
|
//new BeatAction.Action(justStompBeat + 0.2, delegate { stompShakeLength = 0.25; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 1), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 1), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 1), delegate { cameraXNew = 0.3f; }),
|
|
|
|
|
//new BeatAction.Action(justStompBeat + 0.4, delegate { stompShakeLength = 0.25; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 2), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 2), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 2), delegate { cameraXNew = -0.2f; }),
|
|
|
|
|
//new BeatAction.Action(justStompBeat + 0.6, delegate { stompShakeLength = 0.25; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 3), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 3), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 3), delegate { cameraXNew = 0.2f; }),
|
|
|
|
|
//new BeatAction.Action(justStompBeat + 0.8, delegate { stompShakeLength = 0.12; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 4), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 4), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 4), delegate { cameraXNew = -0.1f; }),
|
|
|
|
|
//
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 5), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 5), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 5), delegate { cameraXNew = 0.1f; }),
|
|
|
|
|
//
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 6), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 6), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 6), delegate { cameraXNew = -0.1f; }),
|
|
|
|
|
//
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 7), delegate { justStompBeat += stompShakeSpeed; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 7), delegate { cameraX = cameraXNew; }),
|
|
|
|
|
new BeatAction.Action(justStompBeat + (stompShakeSpeed * 7), delegate { cameraXNew = 0f; }),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*BeatAction.New(instance, new List<BeatAction.Action>() {
|
|
|
|
|
new BeatAction.Action(beat, delegate { allowBopInu = false; }),
|
|
|
|
@ -918,14 +967,32 @@ namespace HeavenStudio.Games
|
|
|
|
|
|
|
|
|
|
void StompShake()
|
|
|
|
|
{
|
|
|
|
|
// Attempt at making the code better, abandoned because the damn lists didn't cooperate
|
|
|
|
|
|
|
|
|
|
//var timings = stompShakeTimings.ToList();
|
|
|
|
|
//var values = stompShakeValues.ToList();
|
|
|
|
|
/*if (stompShakeTimings.Count == 0) { return; }
|
|
|
|
|
|
|
|
|
|
if (justStompBeat >= stompShakeTimings[0] && -1f != stompShakeValues[0])
|
|
|
|
|
{
|
|
|
|
|
justStompBeat = stompShakeTimings[0];
|
|
|
|
|
cameraX = cameraXNew;
|
|
|
|
|
cameraXNew = stompShakeValues[0];
|
|
|
|
|
stompShakeValues.RemoveAt(0);
|
|
|
|
|
stompShakeTimings.RemoveAt(0);
|
|
|
|
|
print(stompShakeTimings.Count + " " + stompShakeValues.Count);
|
|
|
|
|
print("cX: " + cameraX + " cXN: " + cameraXNew + "jSB: " + justStompBeat + "sST: " + stompShakeTimings + "sSV: " + stompShakeValues);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
float normalizedBeat = Conductor.instance.GetPositionFromBeat(justStompBeat, stompShakeSpeed);
|
|
|
|
|
|
|
|
|
|
if (1.2f >= normalizedBeat)
|
|
|
|
|
if (1f >= normalizedBeat)
|
|
|
|
|
{
|
|
|
|
|
EasingFunction.Function func = EasingFunction.GetEasingFunction(EasingFunction.Ease.EaseInOutQuad);
|
|
|
|
|
float newPosX = func(cameraX, cameraXNew, normalizedBeat);
|
|
|
|
|
camera.position = new Vector3(newPosX, 0, 0);
|
|
|
|
|
print("cX: " + cameraX + " cXN: " + cameraXNew + "nPX: " + newPosX + "sSL: " + stompShakeLength);
|
|
|
|
|
//print("cX: " + cameraX + " cXN: " + cameraXNew + "nPX: " + newPosX + "sSL: " + stompShakeLength);
|
|
|
|
|
//print("cX: " + cameraX + " cXN: " + cameraXNew + " jSB: " + justStompBeat + " sST: " + stompShakeTimings + " sSV: " + stompShakeValues);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|