mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 18:07:37 +02:00
Rhythm Somen - Basic Setup, Cues
No inputs yet, but I figure this is big enough I can push it just to be safe
This commit is contained in:

committed by
minenice55

parent
3eeaf1c772
commit
9d0b87924b
123
Assets/Scripts/Games/RhythmSomen/RhythmSomen.cs
Normal file
123
Assets/Scripts/Games/RhythmSomen/RhythmSomen.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using HeavenStudio.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
using static Minigames;
|
||||
public static class PcoSomenLoader
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller) {
|
||||
return new Minigame("rhythmSomen", "Rhythm Sōmen \n<color=#eb5454>[WIP don't use]</color>", "000000", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("crane (far)", delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); }, 4.0f, false),
|
||||
new GameAction("crane (close)", delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); }, 3.0f, false),
|
||||
new GameAction("crane (both)", delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); }, 4.0f, false),
|
||||
new GameAction("offbeat bell", delegate { RhythmSomen.instance.DoBell(eventCaller.currentEntity.beat); }, 1.0f, false),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace HeavenStudio.Games
|
||||
{
|
||||
// using Scripts_RhythmSomen;
|
||||
public class RhythmSomen : Minigame
|
||||
{
|
||||
public Animator SomenPlayer;
|
||||
public Animator CloseCrane;
|
||||
public Animator FarCrane;
|
||||
public GameObject Player;
|
||||
|
||||
public GameEvent bop = new GameEvent();
|
||||
|
||||
public static RhythmSomen instance;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
|
||||
{
|
||||
SomenPlayer.Play("HeadBob", -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void DoFarCrane(float beat)
|
||||
{
|
||||
//Far Drop Multisound
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("rhythmSomen/somen_lowerfar", beat),
|
||||
new MultiSound.Sound("rhythmSomen/somen_drop", beat + 1f),
|
||||
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
|
||||
});
|
||||
|
||||
BeatAction.New(Player, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.0f, delegate { FarCrane.Play("Open", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.5f, delegate { FarCrane.Play("Lift", -1, 0);}),
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void DoCloseCrane(float beat)
|
||||
{
|
||||
//Close Drop Multisound
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("rhythmSomen/somen_lowerclose", beat),
|
||||
new MultiSound.Sound("rhythmSomen/somen_drop", beat + 1f),
|
||||
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
|
||||
});
|
||||
|
||||
BeatAction.New(Player, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.0f, delegate { CloseCrane.Play("OpenClose", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.5f, delegate { CloseCrane.Play("LiftClose", -1, 0);}),
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void DoBothCrane(float beat)
|
||||
{
|
||||
//Both Drop Multisound
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("rhythmSomen/somen_lowerfar", beat),
|
||||
new MultiSound.Sound("rhythmSomen/somen_doublealarm", beat),
|
||||
new MultiSound.Sound("rhythmSomen/somen_drop", beat + 1f),
|
||||
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
|
||||
});
|
||||
|
||||
BeatAction.New(Player, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}),
|
||||
new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.0f, delegate { CloseCrane.Play("OpenClose", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.0f, delegate { FarCrane.Play("Open", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.5f, delegate { CloseCrane.Play("LiftClose", -1, 0);}),
|
||||
new BeatAction.Action(beat + 1.5f, delegate { FarCrane.Play("Lift", -1, 0);}),
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void DoBell(float beat)
|
||||
{
|
||||
//Bell Sound lol
|
||||
Jukebox.PlayOneShotGame("rhythmSomen/somen_bell");
|
||||
|
||||
BeatAction.New(Player, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { SomenPlayer.Play("Exclam", -1, 0);}),
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user