2022-07-25 02:04:55 +00:00
|
|
|
using System;
|
2022-02-19 18:51:46 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2022-07-25 02:04:55 +00:00
|
|
|
using DG.Tweening;
|
2022-02-19 18:51:46 +00:00
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
using HeavenStudio.Util;
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-04-12 16:14:46 +00:00
|
|
|
namespace HeavenStudio.Games.Loaders
|
|
|
|
{
|
|
|
|
using static Minigames;
|
|
|
|
public static class AgbTapLoader
|
|
|
|
{
|
|
|
|
public static Minigame AddGame(EventCaller eventCaller) {
|
2023-03-12 22:20:28 +00:00
|
|
|
return new Minigame("tapTrial", "Tap Trial", "94ffb5", false, false, new List<GameAction>()
|
2022-04-12 16:14:46 +00:00
|
|
|
{
|
2022-08-20 23:03:51 +00:00
|
|
|
new GameAction("bop", "Bop")
|
|
|
|
{
|
2023-03-07 17:22:32 +00:00
|
|
|
function = delegate { var e = eventCaller.currentEntity; TapTrial.instance.Bop(e.beat, e.length, e["toggle"], e["toggle2"]); },
|
|
|
|
resizable = true,
|
2022-08-20 23:03:51 +00:00
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
2023-03-07 17:22:32 +00:00
|
|
|
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not"),
|
|
|
|
new Param("toggle2", false, "Bop (Auto)", "Whether both will bop automatically to the beat or not")
|
2022-08-20 23:03:51 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("tap", "Tap")
|
|
|
|
{
|
|
|
|
|
|
|
|
function = delegate { TapTrial.instance.Tap(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 2.0f
|
|
|
|
},
|
|
|
|
new GameAction("double tap", "Double Tap")
|
|
|
|
{
|
|
|
|
|
|
|
|
function = delegate { TapTrial.instance.DoubleTap(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 2.0f
|
|
|
|
},
|
|
|
|
new GameAction("triple tap", "Triple Tap")
|
|
|
|
{
|
|
|
|
|
|
|
|
function = delegate { TapTrial.instance.TripleTap(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 4.0f
|
|
|
|
},
|
|
|
|
new GameAction("jump tap prep", "Prepare Stance")
|
|
|
|
{
|
|
|
|
|
|
|
|
function = delegate { TapTrial.instance.JumpTapPrep(eventCaller.currentEntity.beat); },
|
|
|
|
},
|
|
|
|
new GameAction("jump tap", "Jump Tap")
|
|
|
|
{
|
|
|
|
|
|
|
|
function = delegate { TapTrial.instance.JumpTap(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 2.0f
|
|
|
|
},
|
|
|
|
new GameAction("final jump tap", "Final Jump Tap")
|
|
|
|
{
|
|
|
|
|
|
|
|
function = delegate { TapTrial.instance.FinalJumpTap(eventCaller.currentEntity.beat); },
|
|
|
|
defaultLength = 2.0f
|
|
|
|
},
|
|
|
|
new GameAction("scroll event", "Scroll Background")
|
|
|
|
{
|
|
|
|
|
2023-02-14 16:31:51 +00:00
|
|
|
function = delegate { TapTrial.instance.scrollEvent(eventCaller.currentEntity["toggle"], eventCaller.currentEntity["flash"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = .5f,
|
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
new Param("toggle", true, "Scroll FX", "Will scroll"),
|
|
|
|
new Param("flash", false, "Flash FX", "Will flash to white"),
|
2022-08-20 23:03:51 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("giraffe events", "Giraffe Animations")
|
|
|
|
{
|
|
|
|
|
2023-02-14 16:31:51 +00:00
|
|
|
function = delegate { TapTrial.instance.giraffeEvent(eventCaller.currentEntity["instant"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = .5f,
|
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
new Param("toggle", true, "Enter?", "Giraffe will enter the scene"),
|
|
|
|
new Param("instant", false, "Instant", "Will the giraffe enter/exit instantly?")
|
2022-08-20 23:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-12 16:14:46 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
namespace HeavenStudio.Games
|
2022-02-19 18:51:46 +00:00
|
|
|
{
|
2022-03-12 04:10:13 +00:00
|
|
|
using Scripts_TapTrial;
|
2022-07-25 02:04:55 +00:00
|
|
|
using HeavenStudio.Common;
|
2022-03-12 04:10:13 +00:00
|
|
|
|
2022-02-19 18:51:46 +00:00
|
|
|
public class TapTrial : Minigame
|
|
|
|
{
|
2022-02-19 21:03:45 +00:00
|
|
|
[Header("References")]
|
|
|
|
public TapTrialPlayer player;
|
2022-07-25 02:04:55 +00:00
|
|
|
//public GameObject tap;
|
2022-07-11 05:53:25 +00:00
|
|
|
[SerializeField] List<Animator> monkeys;
|
2022-07-25 02:04:55 +00:00
|
|
|
[SerializeField] List<GameObject> monkey_roots;
|
|
|
|
[SerializeField] GameObject player_root;
|
|
|
|
//temporary
|
|
|
|
[SerializeField] List<GameObject> monkey_effects;
|
|
|
|
[SerializeField] List<GameObject> player_effects;
|
|
|
|
[SerializeField] Scroll scrollBG;
|
|
|
|
[SerializeField] SpriteRenderer flash;
|
|
|
|
[SerializeField] ScrollForTap scroll;
|
|
|
|
[SerializeField] GameObject giraffe;
|
2023-02-14 16:31:51 +00:00
|
|
|
bool goBop = true, isPrep;
|
2022-07-25 02:04:55 +00:00
|
|
|
bool hasJumped, isFinalJump;
|
|
|
|
public float jumpStartTime = Single.MinValue;
|
|
|
|
float jumpPos;
|
|
|
|
public float time;
|
|
|
|
bool once;
|
|
|
|
public bool crIsRunning;
|
|
|
|
[SerializeField] GameObject bg;
|
|
|
|
bool giraffeIsIn;
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2023-03-07 17:22:32 +00:00
|
|
|
public GameEvent bop = new GameEvent();
|
|
|
|
|
2022-02-19 21:03:45 +00:00
|
|
|
public static TapTrial instance { get; set; }
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
private void Update()
|
|
|
|
{
|
2023-03-07 17:22:32 +00:00
|
|
|
if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
|
2022-07-25 02:04:55 +00:00
|
|
|
{
|
2023-03-07 17:22:32 +00:00
|
|
|
if (goBop) SingleBop();
|
2022-07-11 05:53:25 +00:00
|
|
|
}
|
2022-07-25 02:04:55 +00:00
|
|
|
|
|
|
|
jumpPos = Conductor.instance.GetPositionFromBeat(jumpStartTime, 1f);
|
|
|
|
if (Conductor.instance.songPositionInBeats >= jumpStartTime && Conductor.instance.songPositionInBeats < jumpStartTime + 1f)
|
|
|
|
{
|
|
|
|
float yMul = jumpPos * 2f - 1f;
|
|
|
|
float yWeight = -(yMul * yMul) + 1f;
|
|
|
|
monkey_roots[0].transform.localPosition = new Vector3(0, 1.5f * yWeight);
|
|
|
|
monkey_roots[1].transform.localPosition = new Vector3(0, 1.5f * yWeight);
|
|
|
|
if (!isFinalJump)
|
|
|
|
{
|
|
|
|
player_root.transform.localPosition = new Vector3(0f, 2.5f * yWeight);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
player_root.transform.localPosition = new Vector3(0f, 3.5f * yWeight);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
monkey_roots[0].transform.localPosition = new Vector3(0, 0);
|
|
|
|
monkey_roots[1].transform.localPosition = new Vector3(0, 0);
|
|
|
|
player_root.transform.localPosition = new Vector3(0, 0);
|
|
|
|
if (hasJumped)
|
|
|
|
{
|
|
|
|
//Jukebox.PlayOneShotGame("fanClub/landing_impact", pitch: UnityEngine.Random.Range(0.95f, 1f), volume: 1f / 4);
|
|
|
|
}
|
|
|
|
hasJumped = false;
|
2023-02-14 16:31:51 +00:00
|
|
|
if (PlayerInput.Pressed() && !IsExpectingInputNow())
|
|
|
|
{
|
|
|
|
player.anim.Play("Tap", 0, 0);
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tonk");
|
|
|
|
}
|
2022-07-25 02:04:55 +00:00
|
|
|
}
|
2022-07-11 05:53:25 +00:00
|
|
|
}
|
|
|
|
|
2023-03-07 17:22:32 +00:00
|
|
|
void SingleBop()
|
|
|
|
{
|
|
|
|
if (!isPrep)
|
|
|
|
{
|
|
|
|
if (monkeys[0].GetCurrentAnimatorStateInfo(0).IsName("Idle")) monkeys[0].DoScaledAnimationAsync("Bop", 0.5f);
|
|
|
|
if (monkeys[1].GetCurrentAnimatorStateInfo(0).IsName("Idle")) monkeys[1].DoScaledAnimationAsync("Bop", 0.5f);
|
|
|
|
if (player.anim.GetCurrentAnimatorStateInfo(0).IsName("Idle")) player.anim.DoScaledAnimationAsync("Bop", 0.5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Bop(float beat, float length, bool isBopping, bool autoBop)
|
2022-07-11 05:53:25 +00:00
|
|
|
{
|
2023-03-07 17:22:32 +00:00
|
|
|
goBop = autoBop;
|
|
|
|
if (isBopping)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < length; i++)
|
|
|
|
{
|
|
|
|
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + i, delegate { SingleBop(); })
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2022-07-11 05:53:25 +00:00
|
|
|
}
|
2022-02-28 00:17:12 +00:00
|
|
|
|
2022-02-19 21:03:45 +00:00
|
|
|
public void Tap(float beat)
|
|
|
|
{
|
2022-07-25 02:04:55 +00:00
|
|
|
isPrep = true;
|
2022-02-28 17:17:50 +00:00
|
|
|
Jukebox.PlayOneShotGame("tapTrial/ook");
|
2023-02-14 16:31:51 +00:00
|
|
|
player.anim.DoScaledAnimationAsync("TapPrepare", 0.5f);
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
//Monkey Tap Prepare Anim
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
new BeatAction.Action(beat, delegate { monkeys[0].DoScaledAnimationAsync("TapPrepare", 0.5f); }),
|
|
|
|
new BeatAction.Action(beat, delegate { monkeys[1].DoScaledAnimationAsync("TapPrepare", 0.5f); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { monkeys[0].DoScaledAnimationAsync("Tap", 0.6f); particleEffectMonkeys(); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { monkeys[1].DoScaledAnimationAsync("Tap", 0.6f); }),
|
2022-07-11 05:53:25 +00:00
|
|
|
});
|
|
|
|
//CreateTap(beat);
|
|
|
|
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, OnTap, OnTapMiss, OnEmpty);
|
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 2f, delegate { isPrep = false; })
|
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void DoubleTap(float beat)
|
|
|
|
{
|
2022-07-25 02:04:55 +00:00
|
|
|
isPrep = true;
|
2022-02-28 00:17:12 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("tapTrial/ookook", beat),
|
2022-02-28 17:17:50 +00:00
|
|
|
new MultiSound.Sound("tapTrial/ookook", beat + 0.5f)
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2023-02-14 16:31:51 +00:00
|
|
|
player.anim.DoScaledAnimationAsync("DoubleTapPrepare", 0.5f);
|
2022-02-28 17:17:50 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
2022-02-28 00:17:12 +00:00
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
new BeatAction.Action(beat, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTapPrepare", 0.5f); }),
|
|
|
|
new BeatAction.Action(beat + .5f, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTapPrepare_2", 0.5f); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTap", 0.6f); particleEffectMonkeys(); }),
|
|
|
|
new BeatAction.Action(beat + 1.5f, delegate { monkeys[0].DoScaledAnimationAsync("DoubleTap", 0.6f); particleEffectMonkeys(); }),
|
|
|
|
new BeatAction.Action(beat + 1.99f, delegate {monkeys[0].Play("Idle", 0, 0); }),
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-07-25 02:04:55 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
new BeatAction.Action(beat, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTapPrepare", 0.5f); }),
|
|
|
|
new BeatAction.Action(beat + .5f, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTapPrepare_2", 0.5f); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTap", 0.6f); }),
|
|
|
|
new BeatAction.Action(beat + 1.5f, delegate { monkeys[1].DoScaledAnimationAsync("DoubleTap", 0.6f); }),
|
|
|
|
new BeatAction.Action(beat + 1.99f, delegate {monkeys[1].Play("Idle", 0, 0); }),
|
2022-07-11 05:53:25 +00:00
|
|
|
});
|
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
new BeatAction.Action(beat + 1.99f, delegate { isPrep = false; })
|
2022-07-25 02:04:55 +00:00
|
|
|
});
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
|
|
|
|
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void TripleTap(float beat)
|
|
|
|
{
|
2022-07-25 02:04:55 +00:00
|
|
|
isPrep = true;
|
2022-02-28 00:17:12 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("tapTrial/ooki1", beat),
|
2022-02-28 17:17:50 +00:00
|
|
|
new MultiSound.Sound("tapTrial/ooki2", beat + 0.5f)
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-02-28 17:17:50 +00:00
|
|
|
player.tripleOffset = 0;
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
2022-02-28 00:17:12 +00:00
|
|
|
{
|
2022-07-11 05:53:25 +00:00
|
|
|
new BeatAction.Action(beat, delegate { player.anim.Play("PosePrepare_1", 0, 0);}),
|
|
|
|
new BeatAction.Action(beat + .5f, delegate { player.anim.Play("PosePrepare_2", 0, 0);}),
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-07-11 05:53:25 +00:00
|
|
|
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { monkeys[0].Play("PostPrepare_1", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat + .5f, delegate { monkeys[0].Play("PostPrepare_2", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat + 2f, delegate { monkeys[0].Play("PostTap", 0, 0); }),
|
2022-07-25 02:04:55 +00:00
|
|
|
new BeatAction.Action(beat + 2.5f, delegate { monkeys[0].Play("PostTap_2", 0, 0); }),
|
2022-07-11 05:53:25 +00:00
|
|
|
new BeatAction.Action(beat + 3f, delegate { monkeys[0].Play("PostTap", 0, 0);}),
|
|
|
|
});
|
|
|
|
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { monkeys[1].Play("PostPrepare_1", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat + .5f, delegate { monkeys[1].Play("PostPrepare_2", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat + 2f, delegate { monkeys[1].Play("PostTap", 0, 0); }),
|
2022-07-25 02:04:55 +00:00
|
|
|
new BeatAction.Action(beat + 2.5f, delegate { monkeys[1].Play("PostTap_2", 0, 0);}),
|
2022-07-11 05:53:25 +00:00
|
|
|
new BeatAction.Action(beat + 3f, delegate { monkeys[1].Play("PostTap", 0, 0);}),
|
|
|
|
});
|
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 2f, delegate { particleEffectMonkeys(); }),
|
|
|
|
new BeatAction.Action(beat + 2.5f, delegate { particleEffectMonkeys(); }),
|
|
|
|
new BeatAction.Action(beat + 3f, delegate { particleEffectMonkeys(); }),
|
|
|
|
});
|
2022-07-11 05:53:25 +00:00
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, OnTripleTap, OnTapMiss, OnEmpty);
|
|
|
|
ScheduleInput(beat, 2.5f, InputType.STANDARD_DOWN, OnTripleTap, OnTapMiss, OnEmpty);
|
|
|
|
ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, OnTripleTap, OnTapMiss, OnEmpty);
|
2022-07-11 05:53:25 +00:00
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 4f, delegate { isPrep = false; })
|
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void JumpTap(float beat)
|
|
|
|
{
|
2022-07-25 02:04:55 +00:00
|
|
|
isPrep = true;
|
|
|
|
hasJumped = true;
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/jumptap1");
|
|
|
|
|
|
|
|
player.anim.Play("JumpTap", 0, 0);
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate {jumpStartTime = Conductor.instance.songPositionInBeats;}),
|
|
|
|
new BeatAction.Action(beat, delegate {monkeys[0].Play("JumpTap", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat, delegate {monkeys[1].Play("JumpTap", 0, 0); }),
|
2023-03-19 17:49:17 +00:00
|
|
|
new BeatAction.Action(beat + 1f, delegate { particleEffectMonkeys(); monkeys[0].Play("Jumpactualtap", 0, 0); monkeys[1].Play("Jumpactualtap", 0, 0); }),
|
2022-07-25 02:04:55 +00:00
|
|
|
new BeatAction.Action(beat + 1f, delegate { particleEffectMonkeys_2(); }),
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScheduleInput(beat, .95f, InputType.STANDARD_DOWN, OnJumpTap, OnJumpTapMiss, OnEmpty); //why .95f? no idea, doesn't sound right w/ 1f
|
|
|
|
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 2f, delegate { isPrep = false; })
|
|
|
|
});
|
|
|
|
}
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
public void JumpTapPrep(float beat)
|
|
|
|
{
|
|
|
|
isPrep = true;
|
|
|
|
monkeys[0].Play("JumpPrepare", 0, 0);
|
|
|
|
monkeys[1].Play("JumpPrepare", 0, 0);
|
|
|
|
player.anim.Play("JumpPrepare", 0, 0);
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void FinalJumpTap(float beat)
|
|
|
|
{
|
2022-07-25 02:04:55 +00:00
|
|
|
isPrep = true;
|
|
|
|
hasJumped = true;
|
|
|
|
isFinalJump = true;
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/jumptap2");
|
|
|
|
|
|
|
|
player.anim.Play("FinalJump");
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate {jumpStartTime = Conductor.instance.songPositionInBeats;}),
|
|
|
|
new BeatAction.Action(beat, delegate {monkeys[0].Play("Jump", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat, delegate {monkeys[1].Play("Jump", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { monkeys[0].Play("FinalJumpTap", 0, 0); particleEffectMonkeys(); particleEffectMonkeys_2(); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { monkeys[1].Play("FinalJumpTap", 0, 0); }),
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ScheduleInput(beat, .95f, InputType.STANDARD_DOWN, OnJumpFinalTap, OnFinalJumpTapMiss, OnEmpty);
|
|
|
|
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 2f, delegate { isPrep = false; })
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-02-14 16:31:51 +00:00
|
|
|
public void giraffeEvent(bool instant)
|
2022-07-25 02:04:55 +00:00
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
float animTime = 0;
|
|
|
|
if (instant) animTime = 1;
|
|
|
|
if (!giraffeIsIn)
|
2022-07-25 02:04:55 +00:00
|
|
|
{
|
|
|
|
giraffe.SetActive(true);
|
2023-02-14 16:31:51 +00:00
|
|
|
giraffe.GetComponent<Animator>().Play("Enter", 0, animTime);
|
2022-07-25 02:04:55 +00:00
|
|
|
giraffeIsIn = true;
|
|
|
|
}
|
2023-02-14 16:31:51 +00:00
|
|
|
else if (giraffeIsIn)
|
2022-07-25 02:04:55 +00:00
|
|
|
{
|
2023-02-14 16:31:51 +00:00
|
|
|
giraffe.GetComponent<Animator>().Play("Exit", 0, animTime);
|
2022-07-25 02:04:55 +00:00
|
|
|
giraffeIsIn = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void scrollEvent(bool isScrolling, bool flashToWhite)
|
|
|
|
{
|
|
|
|
if (isScrolling)
|
|
|
|
{
|
|
|
|
if (!crIsRunning) // if coroutine is not running, play the following once
|
|
|
|
{
|
|
|
|
if (flashToWhite)
|
|
|
|
{
|
|
|
|
Sequence sequence = DOTween.Sequence();
|
|
|
|
sequence.Append(flash.DOColor(new Color(flash.color.r, flash.color.g, flash.color.b, .8f), 2f));
|
|
|
|
//sequence.Kill();
|
|
|
|
}
|
|
|
|
StartCoroutine(timer());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else //should be the reverse of the code above
|
|
|
|
{
|
|
|
|
scrollBG.enabled = false;
|
|
|
|
scrollBG.scrollSpeedY = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region Player Action Scripts
|
|
|
|
public void OnTap(PlayerActionEvent caller, float beat)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tap");
|
2023-02-14 16:31:51 +00:00
|
|
|
player.anim.DoScaledAnimationAsync("Tap", 0.6f);
|
2022-07-25 02:04:55 +00:00
|
|
|
player_effects[0].GetComponent<ParticleSystem>().Play();
|
|
|
|
}
|
|
|
|
public void OnDoubleTap(PlayerActionEvent caller, float beat)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tap");
|
2023-02-14 16:31:51 +00:00
|
|
|
player.anim.DoScaledAnimationAsync("DoubleTap", 0.6f);
|
2022-07-25 02:04:55 +00:00
|
|
|
player_effects[1].GetComponent<ParticleSystem>().Play();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnTapMiss(PlayerActionEvent caller)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnJumpTapMiss(PlayerActionEvent caller)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
|
|
|
|
player.anim.Play("JumpTap_Miss", 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnFinalJumpTapMiss(PlayerActionEvent caller)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
|
|
|
|
player.anim.Play("FinalJump_Miss", 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnEmpty(PlayerActionEvent caller)
|
|
|
|
{
|
|
|
|
//empty
|
|
|
|
}
|
|
|
|
public void OnTripleTap(PlayerActionEvent caller, float beat)
|
|
|
|
{
|
|
|
|
if (player.tripleOffset % 2 == 0)
|
|
|
|
{
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { player.anim.Play("PoseTap_L", 0, 0); })
|
|
|
|
});
|
|
|
|
player.tripleOffset += 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { player.anim.Play("PoseTap_R", 0, 0); })
|
|
|
|
});
|
|
|
|
player.tripleOffset += 1;
|
|
|
|
}
|
|
|
|
player_effects[0].GetComponent<ParticleSystem>().Play();
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tap");
|
|
|
|
}
|
|
|
|
public void OnJumpTap(PlayerActionEvent caller, float beat)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tap");
|
|
|
|
player.anim.Play("JumpTap_Success", 0, 0);
|
|
|
|
player_effects[0].GetComponent<ParticleSystem>().Play();
|
|
|
|
player_effects[1].GetComponent<ParticleSystem>().Play();
|
|
|
|
}
|
|
|
|
public void OnJumpFinalTap(PlayerActionEvent caller, float beat)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("tapTrial/tap");
|
|
|
|
player.anim.Play("FinalJump_Tap");
|
|
|
|
player_effects[0].GetComponent<ParticleSystem>().Play();
|
|
|
|
player_effects[1].GetComponent<ParticleSystem>().Play();
|
|
|
|
isFinalJump = false;
|
|
|
|
}
|
|
|
|
#endregion
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
#region Misc. Functions
|
|
|
|
public void particleEffectMonkeys()
|
|
|
|
{
|
|
|
|
monkey_effects[0].GetComponent<ParticleSystem>().Play();
|
|
|
|
monkey_effects[1].GetComponent<ParticleSystem>().Play();
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
2022-02-28 17:17:50 +00:00
|
|
|
|
2022-07-25 02:04:55 +00:00
|
|
|
public void particleEffectMonkeys_2()
|
2022-02-28 17:17:50 +00:00
|
|
|
{
|
2022-07-25 02:04:55 +00:00
|
|
|
monkey_effects[2].GetComponent<ParticleSystem>().Play();
|
|
|
|
monkey_effects[3].GetComponent<ParticleSystem>().Play();
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumerator timer()
|
|
|
|
{
|
|
|
|
crIsRunning = true;
|
|
|
|
while (scroll.scrollSpeedY < 20)
|
|
|
|
{
|
|
|
|
scroll.scrollSpeedY += 5f;
|
|
|
|
yield return new WaitForSecondsRealtime(.5f);
|
|
|
|
}
|
2022-02-28 17:17:50 +00:00
|
|
|
}
|
2022-07-25 02:04:55 +00:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
//this is the orig way for input handling
|
|
|
|
//public void CreateTap(float beat, int type = 0)
|
|
|
|
//{
|
|
|
|
// GameObject _tap = Instantiate(tap);
|
|
|
|
// _tap.transform.parent = tap.transform.parent;
|
|
|
|
// _tap.SetActive(true);
|
|
|
|
// Tap t = _tap.GetComponent<Tap>();
|
|
|
|
// t.startBeat = beat;
|
|
|
|
// t.type = type;
|
|
|
|
//}
|
2022-02-19 18:51:46 +00:00
|
|
|
}
|
|
|
|
}
|