Coin Toss - Improvement

- imported sofuto's textures
- tweaked animation errors
- added a new cowbell variation
- marching orders nonsense??
This commit is contained in:
KrispyDotlessI
2022-09-10 20:56:26 +08:00
parent 95f1e19ea9
commit 287f8db6d1
22 changed files with 639 additions and 277 deletions

View File

@ -25,45 +25,45 @@ namespace HeavenStudio.Games.Loaders
return new Minigame("marchingOrders", "Marching Orders \n<color=#eb5454>[WIP]</color>", "00A43B", false, false, new List<GameAction>()
{
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.Bop(e.beat, e.length); },
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.Bop(e.beat, e.length); },
defaultLength = 1f,
resizable = true
},
new GameAction("marching", "Cadets March")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.CadetsMarch(e.beat, e.length); },
resizable = true
},
new GameAction("marching", "Cadets March")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.CadetsMarch(e.beat, e.length); },
defaultLength = 4f,
resizable = true
},
resizable = true
},
new GameAction("attention", "Attention...")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeAttention(e.beat); },
defaultLength = 2.25f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.AttentionSound(e.beat);}
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeAttention(e.beat); },
defaultLength = 2.25f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.AttentionSound(e.beat);}
},
new GameAction("march", "March!")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeMarch(e.beat); },
defaultLength = 2f,
new GameAction("march", "March!")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeMarch(e.beat); },
defaultLength = 2f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.MarchSound(e.beat);}
},
new GameAction("halt", "Halt!")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeHalt(e.beat); },
defaultLength = 2f,
},
new GameAction("halt", "Halt!")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeHalt(e.beat); },
defaultLength = 2f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.HaltSound(e.beat);}
},
new GameAction("face turn", "Direction to Turn")
new GameAction("face turn", "Direction to Turn")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeFaceTurn(e.beat, e["type"], e["type2"]); },
defaultLength = 4f,
parameters = new List<Param>()
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeFaceTurn(e.beat, e["type"], e["type2"]); },
defaultLength = 4f,
parameters = new List<Param>()
{
new Param("type", MarchingOrders.DirectionFaceTurn.Right, "Direction", "The direction sarge wants the cadets to face"),
new Param("type2", MarchingOrders.FaceTurnLength.Normal, "Length", "How fast or slow the event lasts"),
@ -79,36 +79,37 @@ namespace HeavenStudio.Games
//using Scripts_MarchingOrders;
public class MarchingOrders : Minigame
{
//code is just copied from other minigame code, i will polish them later
[Header("References")]
//code is just copied from other minigame code, i will polish them later
[Header("References")]
public Animator Sarge;
public Animator Cadet1;
public Animator Cadet2;
public Animator Cadet3;
public Animator CadetPlayer;
public Animator CadetHead1;
public Animator CadetHead2;
public Animator CadetHead3;
public Animator CadetHeadPlayer;
public Animator CadetPlayer;
public Animator CadetHead1;
public Animator CadetHead2;
public Animator CadetHead3;
public Animator CadetHeadPlayer;
public GameObject Player;
public GameEvent bop = new GameEvent();
public GameEvent noBop = new GameEvent();
public GameEvent marching = new GameEvent();
private int marchCount;
private int turnLength;
public GameEvent bop = new GameEvent();
public GameEvent noBop = new GameEvent();
public GameEvent marching = new GameEvent();
private int marchOtherCount;
private int marchPlayerCount;
private int turnLength;
public static MarchingOrders instance;
public enum DirectionFaceTurn
{
{
Right,
Left,
}
public enum FaceTurnLength
{
{
Normal,
Fast,
}
@ -122,50 +123,50 @@ namespace HeavenStudio.Games
// Update is called once per frame
void Update()
{
var cond = Conductor.instance;
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (cond.songPositionInBeats >= bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length)
{
if (!(cond.songPositionInBeats >= noBop.startBeat && cond.songPositionInBeats < noBop.startBeat + noBop.length))
Cadet1.DoScaledAnimationAsync("Bop", 0.5f);
Cadet2.DoScaledAnimationAsync("Bop", 0.5f);
Cadet3.DoScaledAnimationAsync("Bop", 0.5f);
CadetPlayer.DoScaledAnimationAsync("Bop", 0.5f);
Cadet2.DoScaledAnimationAsync("Bop", 0.5f);
Cadet3.DoScaledAnimationAsync("Bop", 0.5f);
CadetPlayer.DoScaledAnimationAsync("Bop", 0.5f);
}
}
if (cond.ReportBeat(ref marching.lastReportedBeat, bop.startBeat % 1))
if (cond.ReportBeat(ref marching.lastReportedBeat, bop.startBeat % 1))
{
if (cond.songPositionInBeats >= marching.startBeat && cond.songPositionInBeats < marching.startBeat + marching.length)
{
marchCount += 1;
var marchAnim = (marchCount % 2 != 0 ? "MarchR" : "MarchL");
marchOtherCount += 1;
var marchAnim = (marchOtherCount % 2 != 0 ? "MarchR" : "MarchL");
Jukebox.PlayOneShotGame("marchingOrders/step1");
Cadet1.DoScaledAnimationAsync(marchAnim, 0.5f);
Cadet2.DoScaledAnimationAsync(marchAnim, 0.5f);
Cadet3.DoScaledAnimationAsync(marchAnim, 0.5f);
Cadet1.DoScaledAnimationAsync(marchAnim, 0.5f);
Cadet2.DoScaledAnimationAsync(marchAnim, 0.5f);
Cadet3.DoScaledAnimationAsync(marchAnim, 0.5f);
}
}
if (PlayerInput.Pressed() && !IsExpectingInputNow())
if (PlayerInput.Pressed() && !IsExpectingInputNow())
{
Jukebox.PlayOneShot("miss");
Sarge.DoScaledAnimationAsync("Anger", 0.5f);
}
}
public void Bop(float beat, float length)
public void Bop(float beat, float length)
{
bop.length = length;
bop.startBeat = beat;
}
public void CadetsMarch(float beat, float length)
{
marching.length = length;
marching.startBeat = beat;
marching.startBeat = beat;
}
public void SargeAttention(float beat)
@ -175,105 +176,107 @@ namespace HeavenStudio.Games
new MultiSound.Sound("marchingOrders/attention2", beat + 0.25f),
new MultiSound.Sound("marchingOrders/attention3", beat + 0.75f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.25f, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
});
}
public void SargeMarch(float beat)
public void SargeMarch(float beat)
{
marchCount = 0;
MultiSound.Play(new MultiSound.Sound[] {
marchOtherCount = 0;
marchPlayerCount = 0;
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/march1", beat),
new MultiSound.Sound("marchingOrders/march2", beat + 1f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet1.DoScaledAnimationAsync("MarchL", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet1.DoScaledAnimationAsync("MarchL", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet2.DoScaledAnimationAsync("MarchL", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet3.DoScaledAnimationAsync("MarchL", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { CadetPlayer.DoScaledAnimationAsync("MarchL", 0.5f);}),
});
new BeatAction.Action(beat + 1f, delegate { Cadet3.DoScaledAnimationAsync("MarchL", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { CadetPlayer.DoScaledAnimationAsync("MarchL", 0.5f);}),
});
}
public void SargeHalt(float beat)
public void SargeHalt(float beat)
{
MultiSound.Play(new MultiSound.Sound[] {
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/halt1", beat),
new MultiSound.Sound("marchingOrders/halt2", beat + 1f),
new MultiSound.Sound("marchingOrders/step1", beat + 1f),
new MultiSound.Sound("marchingOrders/step1", beat + 1f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet1.DoScaledAnimationAsync("Halt", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet1.DoScaledAnimationAsync("Halt", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet2.DoScaledAnimationAsync("Halt", 0.5f);}),
new BeatAction.Action(beat + 1f, delegate { Cadet3.DoScaledAnimationAsync("Halt", 0.5f);}),
});
new BeatAction.Action(beat + 1f, delegate { Cadet3.DoScaledAnimationAsync("Halt", 0.5f);}),
});
}
public void SargeFaceTurn(float beat, int type, int type2)
public void SargeFaceTurn(float beat, int type, int type2)
{
switch (type2)
{
case (int) MarchingOrders.FaceTurnLength.Fast:
turnLength = 0;
break;
default:
turnLength = 1;
break;
switch (type2)
{
case (int) MarchingOrders.FaceTurnLength.Fast:
turnLength = 0;
break;
default:
turnLength = 1;
break;
}
switch (type)
switch (type)
{
case (int) MarchingOrders.DirectionFaceTurn.Left:
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/leftFaceTurn1", beat),
new MultiSound.Sound("marchingOrders/leftFaceTurn2", beat + 0.5f),
new MultiSound.Sound("marchingOrders/leftFaceTurn3", beat + turnLength + 1f),
new MultiSound.Sound("marchingOrders/leftFaceTurn4", beat + turnLength + 2f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead1.DoScaledAnimationAsync("FaceL", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead2.DoScaledAnimationAsync("FaceL", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead3.DoScaledAnimationAsync("FaceL", 0.5f);}),
});
break;
default:
//ScheduleInput(beat, turnLength + 2f, InputType.DIRECTION_RIGHT_DOWN, LeftSuccess, LeftMiss, LeftEmpty);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/rightFaceTurn1", beat),
new MultiSound.Sound("marchingOrders/rightFaceTurn2", beat + 0.5f),
new MultiSound.Sound("marchingOrders/rightFaceTurn3", beat + turnLength + 1f),
new MultiSound.Sound("marchingOrders/rightFaceTurn4", beat + turnLength + 2f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead1.DoScaledAnimationAsync("FaceR", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead2.DoScaledAnimationAsync("FaceR", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead3.DoScaledAnimationAsync("FaceR", 0.5f);}),
});
new MultiSound.Sound("marchingOrders/leftFaceTurn1", beat),
new MultiSound.Sound("marchingOrders/leftFaceTurn2", beat + 0.5f),
new MultiSound.Sound("marchingOrders/leftFaceTurn3", beat + turnLength + 1f),
new MultiSound.Sound("marchingOrders/leftFaceTurn4", beat + turnLength + 2f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead1.DoScaledAnimationAsync("FaceL", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead2.DoScaledAnimationAsync("FaceL", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead3.DoScaledAnimationAsync("FaceL", 0.5f);}),
});
break;
}
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
new BeatAction.Action(beat + turnLength + 1f, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
});
}
public static void AttentionSound(float beat)
default:
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/rightFaceTurn1", beat),
new MultiSound.Sound("marchingOrders/rightFaceTurn2", beat + 0.5f),
new MultiSound.Sound("marchingOrders/rightFaceTurn3", beat + turnLength + 1f),
new MultiSound.Sound("marchingOrders/rightFaceTurn4", beat + turnLength + 2f),
}, forcePlay:true);
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead1.DoScaledAnimationAsync("FaceR", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead2.DoScaledAnimationAsync("FaceR", 0.5f);}),
new BeatAction.Action(beat + turnLength + 2f, delegate { CadetHead3.DoScaledAnimationAsync("FaceR", 0.5f);}),
});
break;
}
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
new BeatAction.Action(beat + turnLength + 1f, delegate { Sarge.DoScaledAnimationAsync("Talk", 0.5f);}),
});
}
public static void AttentionSound(float beat)
{
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/attention1", beat),
@ -281,16 +284,16 @@ namespace HeavenStudio.Games
new MultiSound.Sound("marchingOrders/attention3", beat + 0.75f),
}, forcePlay:true);
}
public static void MarchSound(float beat)
public static void MarchSound(float beat)
{
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/march1", beat),
new MultiSound.Sound("marchingOrders/march2", beat + 1f),
}, forcePlay:true);
}
public static void HaltSound(float beat)
public static void HaltSound(float beat)
{
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/halt1", beat),