2022-06-12 22:15:53 +00:00
|
|
|
using HeavenStudio.Util;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Loaders
|
|
|
|
{
|
|
|
|
using static Minigames;
|
|
|
|
public static class PcoSomenLoader
|
|
|
|
{
|
2023-01-25 03:54:19 +00:00
|
|
|
public static Minigame AddGame(EventCaller eventCaller)
|
|
|
|
{
|
2022-08-24 03:14:51 +00:00
|
|
|
return new Minigame("rhythmSomen", "Rhythm Sōmen", "99CC34", false, false, new List<GameAction>()
|
2022-06-12 22:15:53 +00:00
|
|
|
{
|
2022-08-21 03:13:52 +00:00
|
|
|
new GameAction("crane (far)", "Far Crane")
|
|
|
|
{
|
2023-01-25 03:54:19 +00:00
|
|
|
function = delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 4.0f,
|
2022-08-21 03:13:52 +00:00
|
|
|
},
|
|
|
|
new GameAction("crane (close)", "Close Crane")
|
|
|
|
{
|
2023-01-25 03:54:19 +00:00
|
|
|
function = delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 3.0f,
|
2022-08-21 03:13:52 +00:00
|
|
|
},
|
|
|
|
new GameAction("crane (both)", "Both Cranes")
|
|
|
|
{
|
2023-01-25 03:54:19 +00:00
|
|
|
function = delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 4.0f,
|
2022-08-21 03:13:52 +00:00
|
|
|
},
|
|
|
|
new GameAction("offbeat bell", "Offbeat Warning")
|
|
|
|
{
|
|
|
|
function = delegate { RhythmSomen.instance.DoBell(eventCaller.currentEntity.beat); },
|
|
|
|
},
|
2022-06-12 22:15:53 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games
|
|
|
|
{
|
|
|
|
// using Scripts_RhythmSomen;
|
|
|
|
public class RhythmSomen : Minigame
|
|
|
|
{
|
2023-02-05 03:05:43 +00:00
|
|
|
[SerializeField] ParticleSystem splashEffect;
|
2022-06-12 22:15:53 +00:00
|
|
|
public Animator SomenPlayer;
|
2022-06-24 01:47:42 +00:00
|
|
|
public Animator FrontArm;
|
|
|
|
public Animator EffectHit;
|
|
|
|
public Animator EffectSweat;
|
|
|
|
public Animator EffectExclam;
|
|
|
|
public Animator EffectShock;
|
2022-06-12 22:15:53 +00:00
|
|
|
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))
|
|
|
|
{
|
2023-01-25 03:54:19 +00:00
|
|
|
SomenPlayer.Play("HeadBob", -1, 0);
|
2022-06-12 22:15:53 +00:00
|
|
|
}
|
2022-06-24 01:47:42 +00:00
|
|
|
|
|
|
|
if (PlayerInput.Pressed() && !IsExpectingInputNow())
|
|
|
|
{
|
2023-01-25 03:54:19 +00:00
|
|
|
Jukebox.PlayOneShotGame("rhythmSomen/somen_mistake");
|
|
|
|
FrontArm.Play("ArmPluck", -1, 0);
|
|
|
|
EffectSweat.Play("BlobSweating", -1, 0);
|
|
|
|
ScoreMiss();
|
2022-06-24 01:47:42 +00:00
|
|
|
}
|
2022-06-12 22:15:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void DoFarCrane(float beat)
|
|
|
|
{
|
|
|
|
//Far Drop Multisound
|
2022-06-24 01:47:42 +00:00
|
|
|
ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
|
2022-06-12 22:15:53 +00:00
|
|
|
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),
|
|
|
|
});
|
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
BeatAction.New(Player, new List<BeatAction.Action>()
|
2022-06-12 22:15:53 +00:00
|
|
|
{
|
|
|
|
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
|
2022-06-24 01:47:42 +00:00
|
|
|
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
|
2022-06-12 22:15:53 +00:00
|
|
|
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),
|
|
|
|
});
|
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
BeatAction.New(Player, new List<BeatAction.Action>()
|
2022-06-12 22:15:53 +00:00
|
|
|
{
|
|
|
|
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);}),
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
public void DoBothCrane(float beat)
|
2022-06-12 22:15:53 +00:00
|
|
|
{
|
|
|
|
//Both Drop Multisound
|
2022-06-24 01:47:42 +00:00
|
|
|
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
|
|
|
|
ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
|
2022-06-12 22:15:53 +00:00
|
|
|
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),
|
|
|
|
});
|
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
BeatAction.New(Player, new List<BeatAction.Action>()
|
2022-06-12 22:15:53 +00:00
|
|
|
{
|
|
|
|
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);}),
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
public void DoBell(float beat)
|
|
|
|
{
|
|
|
|
//Bell Sound lol
|
|
|
|
Jukebox.PlayOneShotGame("rhythmSomen/somen_bell");
|
2022-06-12 22:15:53 +00:00
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
BeatAction.New(Player, new List<BeatAction.Action>()
|
2022-06-12 22:15:53 +00:00
|
|
|
{
|
2022-06-24 01:47:42 +00:00
|
|
|
new BeatAction.Action(beat, delegate { EffectExclam.Play("ExclamAppear", -1, 0);}),
|
2022-06-12 22:15:53 +00:00
|
|
|
});
|
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
}
|
2022-06-24 01:47:42 +00:00
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
public void CatchSuccess(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2023-02-05 03:05:43 +00:00
|
|
|
splashEffect.Play();
|
|
|
|
if (state >= 1f || state <= -1f)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("rhythmSomen/somen_splash");
|
|
|
|
FrontArm.Play("ArmPluckNG", -1, 0);
|
|
|
|
EffectSweat.Play("BlobSweating", -1, 0);
|
|
|
|
return;
|
|
|
|
}
|
2022-06-24 01:47:42 +00:00
|
|
|
Jukebox.PlayOneShotGame("rhythmSomen/somen_catch");
|
2023-02-05 03:05:43 +00:00
|
|
|
Jukebox.PlayOneShotGame("rhythmSomen/somen_catch_old", volume: 0.25f);
|
|
|
|
FrontArm.Play("ArmPluckOK", -1, 0);
|
2022-06-24 01:47:42 +00:00
|
|
|
EffectHit.Play("HitAppear", -1, 0);
|
2023-01-25 03:54:19 +00:00
|
|
|
}
|
2022-06-24 01:47:42 +00:00
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
public void CatchMiss(PlayerActionEvent caller)
|
|
|
|
{
|
2022-06-24 01:47:42 +00:00
|
|
|
EffectShock.Play("ShockAppear", -1, 0);
|
2023-01-25 03:54:19 +00:00
|
|
|
}
|
2022-06-24 01:47:42 +00:00
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
public void CatchEmpty(PlayerActionEvent caller)
|
|
|
|
{
|
2022-06-24 01:47:42 +00:00
|
|
|
|
2023-01-25 03:54:19 +00:00
|
|
|
}
|
2022-06-12 22:15:53 +00:00
|
|
|
}
|
|
|
|
}
|