2023-01-13 22:24:26 +00:00
|
|
|
using HeavenStudio.Util;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Loaders
|
|
|
|
{
|
|
|
|
using static Minigames;
|
|
|
|
public static class RvlDoubleDateLoader
|
|
|
|
{
|
|
|
|
public static Minigame AddGame(EventCaller eventCaller) {
|
2023-04-02 02:28:23 +00:00
|
|
|
return new Minigame("doubleDate", "Double Date", "ef854a", false, false, new List<GameAction>()
|
2023-01-13 22:24:26 +00:00
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
new GameAction("bop", "Bop")
|
2023-01-13 22:24:26 +00:00
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
function = delegate { var e = eventCaller.currentEntity; DoubleDate.instance.Bop(e.beat, e.length, e["bop"], e["autoBop"]); },
|
|
|
|
resizable = true,
|
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
2024-01-15 02:04:10 +00:00
|
|
|
new Param("bop", true, "Bop", "Toggle if the two couples should bop for the duration of this event."),
|
|
|
|
new Param("autoBop", false, "Bop (Auto)", "Toggle if the two couples should automatically bop until another Bop event is reached.")
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
2023-01-13 22:24:26 +00:00
|
|
|
},
|
2023-03-27 03:12:23 +00:00
|
|
|
new GameAction("soccer", "Soccer Ball")
|
2023-01-13 22:24:26 +00:00
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
preFunction = delegate { var e = eventCaller.currentEntity; DoubleDate.QueueSoccerBall(e.beat, e["b"]); },
|
2023-04-22 19:39:54 +00:00
|
|
|
preFunctionLength = 1f,
|
2023-03-27 03:12:23 +00:00
|
|
|
defaultLength = 2f,
|
2023-12-12 16:54:04 +00:00
|
|
|
parameters = new()
|
|
|
|
{
|
2024-01-15 02:04:10 +00:00
|
|
|
new("b", false, "Weasels Jump", "Toggle if the weasels should jump upon successfully hitting the cue.")
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
},
|
|
|
|
new GameAction("basket", "Basket Ball")
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
preFunction = delegate { var e = eventCaller.currentEntity; DoubleDate.QueueBasketBall(e.beat, e["b"]); },
|
2023-04-22 19:39:54 +00:00
|
|
|
preFunctionLength = 1f,
|
2023-03-27 03:12:23 +00:00
|
|
|
defaultLength = 2f,
|
2023-12-12 16:54:04 +00:00
|
|
|
parameters = new()
|
|
|
|
{
|
2024-01-15 02:04:10 +00:00
|
|
|
new("b", false, "Weasels Jump", "Toggle if the weasels should jump upon successfully hitting the cue.")
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
2023-01-13 22:24:26 +00:00
|
|
|
},
|
|
|
|
new GameAction("football", "Football")
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
preFunction = delegate { var e = eventCaller.currentEntity; DoubleDate.QueueFootBall(e.beat, e["b"]); },
|
2023-04-22 19:39:54 +00:00
|
|
|
preFunctionLength = 1f,
|
2023-03-27 03:12:23 +00:00
|
|
|
defaultLength = 2.5f,
|
2023-12-12 16:54:04 +00:00
|
|
|
parameters = new()
|
|
|
|
{
|
2024-01-15 02:04:10 +00:00
|
|
|
new("b", true, "Weasels Jump", "Toggle if the weasels should jump upon successfully hitting the cue.")
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("blush", "Blush")
|
|
|
|
{
|
|
|
|
function = delegate { DoubleDate.instance.GirlBlush(); }
|
|
|
|
},
|
2024-01-15 02:04:10 +00:00
|
|
|
new GameAction("toggleGirls", "Set Girls' Presence")
|
2023-12-12 16:54:04 +00:00
|
|
|
{
|
|
|
|
function = delegate { DoubleDate.instance.ToggleGirls(eventCaller.currentEntity["b"]); },
|
|
|
|
defaultLength = 0.5f,
|
|
|
|
parameters = new()
|
|
|
|
{
|
2024-01-15 02:04:10 +00:00
|
|
|
new("b", false, "Present", "Toggle if the girl and the female weasel should appear.")
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
|
|
|
},
|
2024-01-15 02:04:10 +00:00
|
|
|
new GameAction("stare", "Boy Looks")
|
2023-12-12 16:54:04 +00:00
|
|
|
{
|
|
|
|
function = delegate { DoubleDate.instance.ToggleStare(eventCaller.currentEntity["b"]); },
|
|
|
|
defaultLength = 0.5f,
|
|
|
|
parameters = new()
|
|
|
|
{
|
2024-01-15 02:04:10 +00:00
|
|
|
new("b", true, "Look", "Toggle if the boy should look at the girl.")
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
},
|
2023-12-12 16:54:04 +00:00
|
|
|
new GameAction("time", "Time of Day")
|
|
|
|
{
|
|
|
|
function = delegate { DoubleDate.instance.SetTime(eventCaller.currentEntity["d"]); },
|
|
|
|
defaultLength = 0.5f,
|
|
|
|
parameters = new()
|
|
|
|
{
|
2024-01-22 00:36:12 +00:00
|
|
|
new("d", DoubleDate.DayTime.Sunset, "Time", "Set the time of day.")
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
|
|
|
}
|
2023-05-28 17:34:44 +00:00
|
|
|
},
|
|
|
|
new List<string>() {"rvl", "normal"},
|
|
|
|
"rvldate", "en",
|
|
|
|
new List<string>() {}
|
|
|
|
);
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games
|
|
|
|
{
|
|
|
|
using Scripts_DoubleDate;
|
|
|
|
|
|
|
|
public class DoubleDate : Minigame
|
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
[Header("Prefabs")]
|
2023-04-22 19:20:01 +00:00
|
|
|
[SerializeField] GameObject soccer;
|
|
|
|
[SerializeField] GameObject basket;
|
|
|
|
[SerializeField] GameObject football;
|
|
|
|
[SerializeField] GameObject dropShadow;
|
|
|
|
[SerializeField] ParticleSystem leaves;
|
|
|
|
|
2023-03-27 03:12:23 +00:00
|
|
|
[Header("Components")]
|
|
|
|
[SerializeField] Animator boyAnim;
|
|
|
|
[SerializeField] Animator girlAnim;
|
|
|
|
[SerializeField] DoubleDateWeasels weasels;
|
|
|
|
[SerializeField] Animator treeAnim;
|
2023-04-22 19:20:01 +00:00
|
|
|
[SerializeField] GameObject clouds;
|
2023-12-12 16:54:04 +00:00
|
|
|
[SerializeField] private GameObject girlObj;
|
|
|
|
[SerializeField] private GameObject girlWeaselObj;
|
|
|
|
[SerializeField] private GameObject girlWeaselShockObj;
|
|
|
|
[SerializeField] private Material doubleDateCellAnim;
|
|
|
|
[SerializeField] private SpriteRenderer bgSquare;
|
|
|
|
[SerializeField] private SpriteRenderer bgGradient;
|
|
|
|
[SerializeField] private Sprite bgIntro;
|
|
|
|
[SerializeField] private Sprite bgLong;
|
|
|
|
|
|
|
|
private Color squareColor;
|
2023-04-22 19:20:01 +00:00
|
|
|
|
2023-03-27 03:12:23 +00:00
|
|
|
[Header("Variables")]
|
2023-12-12 16:54:04 +00:00
|
|
|
[SerializeField] private Color _skyColor;
|
2024-01-22 00:15:28 +00:00
|
|
|
[SerializeField] private Color noonColor;
|
2023-12-12 16:54:04 +00:00
|
|
|
[SerializeField] private float _animSpeed = 1.25f;
|
2023-04-22 19:20:01 +00:00
|
|
|
[SerializeField] public float cloudSpeed;
|
|
|
|
[SerializeField] public float cloudDistance;
|
|
|
|
[SerializeField] public float floorHeight;
|
|
|
|
[SerializeField] public float shadowDepthScaleMin;
|
|
|
|
[SerializeField] public float shadowDepthScaleMax;
|
|
|
|
[SerializeField] SuperCurveObject.Path[] ballBouncePaths;
|
2023-06-10 19:13:29 +00:00
|
|
|
double lastGirlGacha = double.MinValue;
|
2023-03-27 03:12:23 +00:00
|
|
|
bool canBop = true;
|
2023-01-13 22:24:26 +00:00
|
|
|
public static DoubleDate instance;
|
2023-04-22 19:20:01 +00:00
|
|
|
public static List<QueuedBall> queuedBalls = new List<QueuedBall>();
|
2023-06-10 19:13:29 +00:00
|
|
|
[NonSerialized] public double lastHitWeasel = double.MinValue;
|
2023-04-22 19:20:01 +00:00
|
|
|
|
|
|
|
public enum BallType
|
|
|
|
{
|
|
|
|
Soccer,
|
|
|
|
Basket,
|
|
|
|
Football
|
|
|
|
}
|
|
|
|
|
|
|
|
public struct QueuedBall
|
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
public double beat;
|
2023-04-22 19:20:01 +00:00
|
|
|
public BallType type;
|
2023-12-12 16:54:04 +00:00
|
|
|
public bool jump;
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
|
|
|
|
2023-10-29 19:44:47 +00:00
|
|
|
public static PlayerInput.InputAction InputAction_TouchPress =
|
|
|
|
new("RvlDateTouchPress", new int[] { IAEmptyCat, IAPressCat, IAEmptyCat },
|
|
|
|
IA_Empty, IA_TouchBasicPress, IA_Empty);
|
|
|
|
public static PlayerInput.InputAction InputAction_TouchRelease =
|
|
|
|
new("RvlDateTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat },
|
|
|
|
IA_Empty, IA_TouchBasicRelease, IA_Empty);
|
|
|
|
|
2023-04-22 19:20:01 +00:00
|
|
|
// Editor gizmo to draw trajectories
|
|
|
|
new void OnDrawGizmos()
|
|
|
|
{
|
|
|
|
base.OnDrawGizmos();
|
|
|
|
foreach (SuperCurveObject.Path path in ballBouncePaths)
|
|
|
|
{
|
|
|
|
if (path.preview)
|
|
|
|
{
|
|
|
|
soccer.GetComponent<SoccerBall>().DrawEditorGizmo(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public void CheckGirlsPresence(double beat)
|
|
|
|
{
|
|
|
|
var allEvents = EventCaller.GetAllInGameManagerList("doubleDate", new string[] { "toggleGirls" }).FindAll(x => x.beat < beat);
|
|
|
|
if (allEvents.Count == 0) return;
|
|
|
|
allEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
|
|
|
|
|
|
|
|
ToggleGirls(allEvents[^1]["b"]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void CheckBoyStare(double beat)
|
|
|
|
{
|
|
|
|
var allEvents = EventCaller.GetAllInGameManagerList("doubleDate", new string[] { "stare" }).FindAll(x => x.beat < beat);
|
|
|
|
if (allEvents.Count == 0) return;
|
|
|
|
allEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
|
|
|
|
|
|
|
|
ToggleStare(allEvents[^1]["b"]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum DayTime
|
|
|
|
{
|
|
|
|
Day,
|
2024-01-22 00:36:12 +00:00
|
|
|
Sunset
|
2023-12-12 16:54:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void DayTimeCheck(double beat)
|
|
|
|
{
|
|
|
|
var allEvents = EventCaller.GetAllInGameManagerList("doubleDate", new string[] { "time" }).FindAll(x => x.beat < beat);
|
|
|
|
if (allEvents.Count == 0) return;
|
|
|
|
allEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
|
|
|
|
|
|
|
|
SetTime(allEvents[^1]["d"]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SetTime(int time)
|
|
|
|
{
|
2024-01-22 00:36:12 +00:00
|
|
|
if (time == (int)DayTime.Sunset)
|
2023-12-12 16:54:04 +00:00
|
|
|
{
|
2024-01-22 00:15:28 +00:00
|
|
|
doubleDateCellAnim.SetColor("_Color", noonColor);
|
2023-12-12 16:54:04 +00:00
|
|
|
bgSquare.color = squareColor;
|
|
|
|
bgGradient.sprite = bgLong;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
doubleDateCellAnim.SetColor("_Color", Color.white);
|
|
|
|
bgSquare.color = _skyColor;
|
|
|
|
bgGradient.sprite = bgIntro;
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public override void OnPlay(double beat)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
queuedBalls.Clear();
|
2023-12-12 16:54:04 +00:00
|
|
|
CheckGirlsPresence(beat);
|
|
|
|
CheckBoyStare(beat);
|
|
|
|
DayTimeCheck(beat);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnGameSwitch(double beat)
|
|
|
|
{
|
|
|
|
CheckGirlsPresence(beat);
|
|
|
|
CheckBoyStare(beat);
|
|
|
|
DayTimeCheck(beat);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
|
|
|
|
2023-04-22 19:39:54 +00:00
|
|
|
private void OnDestroy() {
|
|
|
|
queuedBalls.Clear();
|
2023-06-03 23:30:17 +00:00
|
|
|
foreach (var evt in scheduledInputs)
|
|
|
|
{
|
|
|
|
evt.Disable();
|
|
|
|
}
|
2023-04-22 19:39:54 +00:00
|
|
|
}
|
|
|
|
|
2023-01-13 22:24:26 +00:00
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
2023-12-05 22:38:52 +00:00
|
|
|
SetupBopRegion("doubleDate", "bop", "autoBop");
|
2024-01-22 00:15:28 +00:00
|
|
|
doubleDateCellAnim.SetColor("_Color", noonColor);
|
2023-12-12 16:54:04 +00:00
|
|
|
squareColor = bgSquare.color;
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
|
|
|
|
2023-04-22 19:20:01 +00:00
|
|
|
private void Start() {
|
|
|
|
clouds.transform.position = Vector3.left * ((Time.realtimeSinceStartup * cloudSpeed) % cloudDistance);
|
|
|
|
}
|
|
|
|
|
2023-11-23 16:19:39 +00:00
|
|
|
public override void OnBeatPulse(double beat)
|
|
|
|
{
|
2023-12-05 22:38:52 +00:00
|
|
|
if (BeatIsInBopRegion(beat)) SingleBop();
|
2023-11-23 16:19:39 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 03:12:23 +00:00
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
|
|
|
if (cond.isPlaying && !cond.isPaused)
|
|
|
|
{
|
2023-04-22 19:20:01 +00:00
|
|
|
if (queuedBalls.Count != 0)
|
|
|
|
{
|
|
|
|
foreach (QueuedBall ball in queuedBalls)
|
|
|
|
{
|
|
|
|
switch (ball.type)
|
|
|
|
{
|
|
|
|
case BallType.Soccer:
|
2023-12-12 16:54:04 +00:00
|
|
|
SpawnSoccerBall(ball.beat, ball.jump);
|
2023-04-22 19:20:01 +00:00
|
|
|
break;
|
|
|
|
case BallType.Basket:
|
2023-12-12 16:54:04 +00:00
|
|
|
SpawnBasketBall(ball.beat, ball.jump);
|
2023-04-22 19:20:01 +00:00
|
|
|
break;
|
|
|
|
case BallType.Football:
|
2023-12-12 16:54:04 +00:00
|
|
|
SpawnFootBall(ball.beat, ball.jump);
|
2023-04-22 19:20:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
queuedBalls.Clear();
|
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
2023-04-22 19:20:01 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((!cond.isPaused) && queuedBalls.Count != 0)
|
|
|
|
{
|
|
|
|
queuedBalls.Clear();
|
|
|
|
}
|
|
|
|
}
|
2023-10-29 19:44:47 +00:00
|
|
|
if (PlayerInput.GetIsAction(InputAction_TouchPress))
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
boyAnim.DoScaledAnimationAsync("Ready", _animSpeed);
|
2023-10-29 19:44:47 +00:00
|
|
|
}
|
|
|
|
if (PlayerInput.GetIsAction(InputAction_TouchRelease) && !IsExpectingInputNow(InputAction_FlickPress))
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
boyAnim.DoScaledAnimationAsync("UnReady", _animSpeed);
|
2023-10-29 19:44:47 +00:00
|
|
|
}
|
|
|
|
if (PlayerInput.GetIsAction(InputAction_FlickPress) && !IsExpectingInputNow(InputAction_FlickPress))
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
SoundByte.PlayOneShotGame("doubleDate/kick_whiff");
|
2023-03-27 03:12:23 +00:00
|
|
|
Kick(true, true, false);
|
|
|
|
}
|
2023-04-22 19:20:01 +00:00
|
|
|
clouds.transform.position = Vector3.left * ((Time.realtimeSinceStartup * cloudSpeed) % cloudDistance);
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public void GirlBlush()
|
|
|
|
{
|
|
|
|
girlAnim.DoScaledAnimationAsync("GirlBlush", _animSpeed);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ToggleGirls(bool active)
|
|
|
|
{
|
|
|
|
girlObj.SetActive(active);
|
|
|
|
girlWeaselObj.SetActive(active);
|
|
|
|
girlWeaselShockObj.SetActive(active);
|
|
|
|
}
|
|
|
|
|
|
|
|
private bool _isStaring = false;
|
|
|
|
|
|
|
|
public void ToggleStare(bool active)
|
|
|
|
{
|
|
|
|
boyAnim.SetBool("Stare", active);
|
|
|
|
_isStaring = active;
|
|
|
|
}
|
|
|
|
|
2023-03-27 03:12:23 +00:00
|
|
|
public void ToggleBop(bool go)
|
|
|
|
{
|
|
|
|
canBop = go;
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void Bop(double beat, float length, bool goBop, bool autoBop)
|
2023-01-13 22:24:26 +00:00
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
if (goBop)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < length; i++)
|
|
|
|
{
|
2023-09-11 22:28:04 +00:00
|
|
|
BeatAction.New(instance, new List<BeatAction.Action>()
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + i, delegate { SingleBop(); })
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 03:12:23 +00:00
|
|
|
void SingleBop()
|
2023-01-13 22:24:26 +00:00
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
if (canBop)
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
boyAnim.DoScaledAnimationAsync(_isStaring ? "IdleBop2" : "IdleBop", _animSpeed);
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
2023-06-10 19:13:29 +00:00
|
|
|
if (Conductor.instance.songPositionInBeatsAsDouble > lastGirlGacha)
|
2023-12-12 16:54:04 +00:00
|
|
|
girlAnim.DoScaledAnimationAsync("GirlBop", _animSpeed);
|
2023-03-27 03:12:23 +00:00
|
|
|
weasels.Bop();
|
|
|
|
}
|
|
|
|
|
2023-04-22 19:20:01 +00:00
|
|
|
public void Kick(bool hit = true, bool forceNoLeaves = false, bool weaselsHappy = true, bool jump = false)
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
|
|
|
if (hit)
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
boyAnim.DoScaledAnimationAsync("Kick", _animSpeed);
|
2023-04-22 19:20:01 +00:00
|
|
|
if (jump)
|
|
|
|
{
|
|
|
|
weasels.Jump();
|
2023-06-10 19:13:29 +00:00
|
|
|
lastGirlGacha = Conductor.instance.songPositionInBeatsAsDouble + 0.5f;
|
2023-12-12 16:54:04 +00:00
|
|
|
girlAnim.DoScaledAnimationAsync("GirlLookUp", _animSpeed);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
|
|
|
else if (weaselsHappy) weasels.Happy();
|
2023-03-27 03:12:23 +00:00
|
|
|
if (!forceNoLeaves)
|
|
|
|
{
|
2023-09-11 22:28:04 +00:00
|
|
|
BeatAction.New(instance, new List<BeatAction.Action>()
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 1f, delegate
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-04-22 19:20:01 +00:00
|
|
|
leaves.Play();
|
2023-12-12 16:54:04 +00:00
|
|
|
treeAnim.DoScaledAnimationAsync("TreeRustle", _animSpeed);
|
2023-03-27 03:12:23 +00:00
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
boyAnim.DoScaledAnimationAsync("Barely", _animSpeed);
|
2023-04-22 19:20:01 +00:00
|
|
|
weasels.Surprise();
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public static void QueueSoccerBall(double beat, bool shouldJump)
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-04-22 19:39:54 +00:00
|
|
|
if (GameManager.instance.currentGame != "doubleDate")
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
queuedBalls.Add(new QueuedBall()
|
|
|
|
{
|
|
|
|
beat = beat,
|
2023-12-12 16:54:04 +00:00
|
|
|
type = BallType.Soccer,
|
|
|
|
jump = shouldJump
|
2023-04-22 19:20:01 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
instance.SpawnSoccerBall(beat, shouldJump);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
2023-06-10 19:13:29 +00:00
|
|
|
SoundByte.PlayOneShotGame("doubleDate/soccerBounce", beat, forcePlay: true);
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public static void QueueBasketBall(double beat, bool shouldJump)
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-04-22 19:39:54 +00:00
|
|
|
if (GameManager.instance.currentGame != "doubleDate")
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
queuedBalls.Add(new QueuedBall()
|
|
|
|
{
|
|
|
|
beat = beat,
|
2023-12-12 16:54:04 +00:00
|
|
|
type = BallType.Basket,
|
|
|
|
jump = shouldJump
|
2023-04-22 19:20:01 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
instance.SpawnBasketBall(beat, shouldJump);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("doubleDate/basketballBounce", beat),
|
|
|
|
new MultiSound.Sound("doubleDate/basketballBounce", beat + 0.75f),
|
2023-04-22 19:39:54 +00:00
|
|
|
}, forcePlay: true);
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public static void QueueFootBall(double beat, bool shouldJump)
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-04-22 19:39:54 +00:00
|
|
|
if (GameManager.instance.currentGame != "doubleDate")
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
queuedBalls.Add(new QueuedBall()
|
|
|
|
{
|
|
|
|
beat = beat,
|
2023-12-12 16:54:04 +00:00
|
|
|
type = BallType.Football,
|
|
|
|
jump = shouldJump
|
2023-04-22 19:20:01 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
instance.SpawnFootBall(beat, shouldJump);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("doubleDate/footballBounce", beat),
|
|
|
|
new MultiSound.Sound("doubleDate/footballBounce", beat + 0.75f),
|
2023-04-22 19:39:54 +00:00
|
|
|
}, forcePlay: true);
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public void SpawnSoccerBall(double beat, bool shouldJump)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
SoccerBall spawnedBall = Instantiate(soccer, instance.transform).GetComponent<SoccerBall>();
|
2023-12-12 16:54:04 +00:00
|
|
|
spawnedBall.Init(beat, shouldJump);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public void SpawnBasketBall(double beat, bool shouldJump)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
Basketball spawnedBall = Instantiate(basket, instance.transform).GetComponent<Basketball>();
|
2023-12-12 16:54:04 +00:00
|
|
|
spawnedBall.Init(beat, shouldJump);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
public void SpawnFootBall(double beat, bool shouldJump)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
Football spawnedBall = Instantiate(football, instance.transform).GetComponent<Football>();
|
2023-12-12 16:54:04 +00:00
|
|
|
spawnedBall.Init(beat, shouldJump);
|
2023-04-22 19:20:01 +00:00
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void MissKick(double beat, bool hit = false)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
lastGirlGacha = Conductor.instance.songPositionInBeatsAsDouble + 1.5f;
|
2023-12-12 16:54:04 +00:00
|
|
|
girlAnim.DoScaledAnimationAsync("GirlSad", _animSpeed);
|
2023-04-22 19:20:01 +00:00
|
|
|
if (hit)
|
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
lastHitWeasel = Conductor.instance.songPositionInBeatsAsDouble;
|
2023-09-11 22:28:04 +00:00
|
|
|
BeatAction.New(this, new List<BeatAction.Action>()
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
new BeatAction.Action(beat - (0.25f/3f), delegate { weasels.Hit(beat); }),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
lastHitWeasel = Conductor.instance.songPositionInBeatsAsDouble;
|
2023-09-11 22:28:04 +00:00
|
|
|
BeatAction.New(this, new List<BeatAction.Action>()
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 0.25, delegate { weasels.Hide(beat + 0.25f); }),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public SuperCurveObject.Path GetPath(string name)
|
|
|
|
{
|
|
|
|
foreach (SuperCurveObject.Path path in ballBouncePaths)
|
|
|
|
{
|
|
|
|
if (path.name == name)
|
|
|
|
{
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return default(SuperCurveObject.Path);
|
|
|
|
}
|
|
|
|
|
|
|
|
public GameObject MakeDropShadow()
|
|
|
|
{
|
|
|
|
GameObject shadow = Instantiate(dropShadow, transform);
|
|
|
|
return shadow;
|
|
|
|
}
|
|
|
|
}
|
2024-01-22 00:15:28 +00:00
|
|
|
}
|