diff --git a/Assets/Resources/Games/totemClimb.prefab b/Assets/Resources/Games/totemClimb.prefab index 5d16c7cb7..7289251e8 100644 --- a/Assets/Resources/Games/totemClimb.prefab +++ b/Assets/Resources/Games/totemClimb.prefab @@ -795,6 +795,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _totemTransform: {fileID: 2892683027369623692} + _frogTransform: {fileID: 5749667637740173319} _xDistance: 3.838 _yDistance: 1.45 _totemAmount: 12 @@ -2213,6 +2214,8 @@ MonoBehaviour: offset: {x: 0, y: 0, z: 0} _jumpDistanceX: 3.838 _jumpDistanceY: 1.45 + _jumpDistanceSmallX: 1.919 + _jumpDistanceSmallY: 0.725 _jumpOffsetY: 0.1 _jumpHeight: 2 --- !u!95 &7450811870195608846 diff --git a/Assets/Resources/Sfx/games/totemClimb/beatchange.wav b/Assets/Resources/Sfx/games/totemClimb/beatchange.wav new file mode 100644 index 000000000..c95cf7aff Binary files /dev/null and b/Assets/Resources/Sfx/games/totemClimb/beatchange.wav differ diff --git a/Assets/Resources/Sfx/games/totemClimb/outa.wav.meta b/Assets/Resources/Sfx/games/totemClimb/beatchange.wav.meta similarity index 91% rename from Assets/Resources/Sfx/games/totemClimb/outa.wav.meta rename to Assets/Resources/Sfx/games/totemClimb/beatchange.wav.meta index 5610495c2..2090077bc 100644 --- a/Assets/Resources/Sfx/games/totemClimb/outa.wav.meta +++ b/Assets/Resources/Sfx/games/totemClimb/beatchange.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b5b7c591a7c8c1f4cb53eb5153b33033 +guid: 02b778489dea902468a7c8d98f34ea78 AudioImporter: externalObjects: {} serializedVersion: 6 diff --git a/Assets/Resources/Sfx/games/totemClimb/chargejump.wav b/Assets/Resources/Sfx/games/totemClimb/chargejump.wav new file mode 100644 index 000000000..f1fc21cdd Binary files /dev/null and b/Assets/Resources/Sfx/games/totemClimb/chargejump.wav differ diff --git a/Assets/Resources/Sfx/games/totemClimb/intoa.wav.meta b/Assets/Resources/Sfx/games/totemClimb/chargejump.wav.meta similarity index 91% rename from Assets/Resources/Sfx/games/totemClimb/intoa.wav.meta rename to Assets/Resources/Sfx/games/totemClimb/chargejump.wav.meta index bf70bec84..984324a5e 100644 --- a/Assets/Resources/Sfx/games/totemClimb/intoa.wav.meta +++ b/Assets/Resources/Sfx/games/totemClimb/chargejump.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0e89e71edcbeb794083ce7ac4f217b27 +guid: baeec70ef00e0bd418c62054725d7c2a AudioImporter: externalObjects: {} serializedVersion: 6 diff --git a/Assets/Resources/Sfx/games/totemClimb/intoa.wav b/Assets/Resources/Sfx/games/totemClimb/intoa.wav deleted file mode 100644 index 63056d552..000000000 Binary files a/Assets/Resources/Sfx/games/totemClimb/intoa.wav and /dev/null differ diff --git a/Assets/Resources/Sfx/games/totemClimb/intob.wav b/Assets/Resources/Sfx/games/totemClimb/intob.wav deleted file mode 100644 index 5ce319a9e..000000000 Binary files a/Assets/Resources/Sfx/games/totemClimb/intob.wav and /dev/null differ diff --git a/Assets/Resources/Sfx/games/totemClimb/intob.wav.meta b/Assets/Resources/Sfx/games/totemClimb/intob.wav.meta deleted file mode 100644 index df376768e..000000000 --- a/Assets/Resources/Sfx/games/totemClimb/intob.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: 4e6227f24ca07b74bbf00ec321a0967e -AudioImporter: - externalObjects: {} - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - ambisonic: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/Sfx/games/totemClimb/outa.wav b/Assets/Resources/Sfx/games/totemClimb/outa.wav deleted file mode 100644 index 3bb1c1a9a..000000000 Binary files a/Assets/Resources/Sfx/games/totemClimb/outa.wav and /dev/null differ diff --git a/Assets/Resources/Sfx/games/totemClimb/outb.wav b/Assets/Resources/Sfx/games/totemClimb/outb.wav deleted file mode 100644 index 6253e770f..000000000 Binary files a/Assets/Resources/Sfx/games/totemClimb/outb.wav and /dev/null differ diff --git a/Assets/Resources/Sfx/games/totemClimb/superjumpgood.wav b/Assets/Resources/Sfx/games/totemClimb/superjumpgood.wav new file mode 100644 index 000000000..9eda53b81 Binary files /dev/null and b/Assets/Resources/Sfx/games/totemClimb/superjumpgood.wav differ diff --git a/Assets/Resources/Sfx/games/totemClimb/outb.wav.meta b/Assets/Resources/Sfx/games/totemClimb/superjumpgood.wav.meta similarity index 91% rename from Assets/Resources/Sfx/games/totemClimb/outb.wav.meta rename to Assets/Resources/Sfx/games/totemClimb/superjumpgood.wav.meta index 7cbd05563..3fc64cdf5 100644 --- a/Assets/Resources/Sfx/games/totemClimb/outb.wav.meta +++ b/Assets/Resources/Sfx/games/totemClimb/superjumpgood.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6e3f859a92751884abdd001657e7a3d5 +guid: 2b1e0837efb91884d9c8ef57e4cf4266 AudioImporter: externalObjects: {} serializedVersion: 6 diff --git a/Assets/Resources/Sfx/games/totemClimb/totemlandb.wav b/Assets/Resources/Sfx/games/totemClimb/totemlandb.wav index 99bc6a55a..84b1888c6 100644 Binary files a/Assets/Resources/Sfx/games/totemClimb/totemlandb.wav and b/Assets/Resources/Sfx/games/totemClimb/totemlandb.wav differ diff --git a/Assets/Scripts/Games/TotemClimb/TCJumper.cs b/Assets/Scripts/Games/TotemClimb/TCJumper.cs index b3f5102c3..b93d1014b 100644 --- a/Assets/Scripts/Games/TotemClimb/TCJumper.cs +++ b/Assets/Scripts/Games/TotemClimb/TCJumper.cs @@ -10,6 +10,8 @@ namespace HeavenStudio.Games.Scripts_TotemClimb { [SerializeField] private float _jumpDistanceX; [SerializeField] private float _jumpDistanceY; + [SerializeField] private float _jumpDistanceSmallX; + [SerializeField] private float _jumpDistanceSmallY; [SerializeField] private float _jumpOffsetY; [SerializeField] private float _jumpHeight = 2f; @@ -35,11 +37,20 @@ namespace HeavenStudio.Games.Scripts_TotemClimb }; } - public void StartJumping(double beat) + public void StartJumping(double beat, bool inTriple = false) { - StartCoroutine(JumpCo(beat)); + bool nextIsTriple = _game.IsTripleBeat(beat + 1); + StartCoroutine(JumpCo(beat, 1f, nextIsTriple && !inTriple)); if (beat + 1 >= _game.EndBeat) return; - _game.ScheduleInput(beat, 1, Minigame.InputAction_BasicPress, Just, Miss, Empty); + + _game.ScheduleInput(beat, 1, Minigame.InputAction_BasicPress, nextIsTriple ? JustTripleEnter : Just, nextIsTriple ? MissTripleEnter : Miss, Empty); + } + + public void StartTripleJumping(double beat, bool exit) + { + StartCoroutine(JumpCo(beat, 0.5f, true)); + if (beat + 0.5 >= _game.EndBeat) return; + _game.ScheduleInput(beat, 0.5, Minigame.InputAction_BasicPress, exit ? Just : JustTripleExit, exit ? Miss : MissTripleExit, Empty); } public void Bop() @@ -47,15 +58,15 @@ namespace HeavenStudio.Games.Scripts_TotemClimb _anim.DoScaledAnimationAsync("Bop", 0.5f); } - private IEnumerator JumpCo(double beat) + private IEnumerator JumpCo(double beat, float length = 1f, bool small = false) { - _path.positions[0].duration = 1 - (float)Conductor.instance.SecsToBeats(Minigame.justEarlyTime, Conductor.instance.GetBpmAtBeat(beat + 1)); + _path.positions[0].duration = length - (float)Conductor.instance.SecsToBeats(Minigame.justEarlyTime, Conductor.instance.GetBpmAtBeat(beat + length)); _anim.Play("Jump", 0, 0); float normalizedBeat = Conductor.instance.GetPositionFromBeat(beat, _path.positions[0].duration); bool playedFall = false; - while(normalizedBeat < 1) + while(normalizedBeat < 1f) { transform.localPosition = GetPathPositionFromBeat(_path, Math.Min(Conductor.instance.songPositionInBeatsAsDouble, beat + _path.positions[0].duration), beat); @@ -68,19 +79,40 @@ namespace HeavenStudio.Games.Scripts_TotemClimb normalizedBeat = Conductor.instance.GetPositionFromBeat(beat, _path.positions[0].duration); yield return null; } - _path.positions[0].pos += new Vector3(_jumpDistanceX, _jumpDistanceY); - _path.positions[1].pos += new Vector3(_jumpDistanceX, _jumpDistanceY); + _path.positions[0].pos += small ? new Vector3(_jumpDistanceSmallX, _jumpDistanceSmallY) : new Vector3(_jumpDistanceX, _jumpDistanceY); + _path.positions[1].pos += small ? new Vector3(_jumpDistanceSmallX, _jumpDistanceSmallY) : new Vector3(_jumpDistanceX, _jumpDistanceY); _anim.Play("Idle", 0, 0); } private void Just(PlayerActionEvent caller, float state) { - StartJumping(caller.startBeat + caller.timer); + bool isTriple = _game.IsTripleBeat(caller.startBeat + caller.timer); + StartJumping(caller.startBeat + caller.timer, isTriple); _game.BopTotemAtBeat(caller.startBeat + caller.timer); if (state >= 1f || state <= -1f) { return; } + SoundByte.PlayOneShotGame(isTriple ? "totemClimb/totemlandb" : "totemClimb/totemland"); + } + + private void JustTripleEnter(PlayerActionEvent caller, float state) + { + StartTripleJumping(caller.startBeat + caller.timer, false); + if (state >= 1f || state <= -1f) + { + return; + } + SoundByte.PlayOneShotGame("totemClimb/totemland"); + } + + private void JustTripleExit(PlayerActionEvent caller, float state) + { + StartTripleJumping(caller.startBeat + caller.timer, true); + if (state >= 1f || state <= -1f) + { + return; + } SoundByte.PlayOneShotGame("totemClimb/totemland"); } @@ -90,6 +122,16 @@ namespace HeavenStudio.Games.Scripts_TotemClimb _game.BopTotemAtBeat(caller.startBeat + caller.timer); } + private void MissTripleEnter(PlayerActionEvent caller) + { + StartTripleJumping(caller.startBeat + caller.timer, false); + } + + private void MissTripleExit(PlayerActionEvent caller) + { + StartTripleJumping(caller.startBeat + caller.timer, true); + } + private void Empty(PlayerActionEvent caller) { } } } diff --git a/Assets/Scripts/Games/TotemClimb/TCTotemManager.cs b/Assets/Scripts/Games/TotemClimb/TCTotemManager.cs index e04a8086a..98100f32c 100644 --- a/Assets/Scripts/Games/TotemClimb/TCTotemManager.cs +++ b/Assets/Scripts/Games/TotemClimb/TCTotemManager.cs @@ -8,6 +8,7 @@ namespace HeavenStudio.Games.Scripts_TotemClimb public class TCTotemManager : MonoBehaviour { [SerializeField] private Transform _totemTransform; + [SerializeField] private Transform _frogTransform; [SerializeField] private float _xDistance; [SerializeField] private float _yDistance; [SerializeField] private int _totemAmount = 12; @@ -16,6 +17,7 @@ namespace HeavenStudio.Games.Scripts_TotemClimb private float _totemStartX; private float _totemStartY; private List _totems = new(); + private List _frogs = new(); private int _totemIndex = 0; private TotemClimb _game; @@ -34,6 +36,22 @@ namespace HeavenStudio.Games.Scripts_TotemClimb } } + private class Frog + { + public double beat; + public Transform transform; + public Animator anim, anim1, anim2; + + public Frog(Transform mTransform, Animator mAnim, Animator mAnim1, Animator mAnim2, double mBeat) + { + transform = mTransform; + anim = mAnim; + anim1 = mAnim1; + anim2 = mAnim2; + beat = mBeat; + } + } + private void Awake() { _game = TotemClimb.instance; @@ -58,6 +76,18 @@ namespace HeavenStudio.Games.Scripts_TotemClimb _totems[i].beat = startBeat + i; _totems[i].transform.gameObject.SetActive(_totems[i].beat - 1 < _game.EndBeat && !_game.IsTripleBeat(_totems[i].beat)); } + + foreach (var e in _game._tripleEvents) + { + for (int i = 0; i < e.length; i += 2) + { + double beat = e.beat + i; + Transform spawnedFrog = Instantiate(_frogTransform, transform); + spawnedFrog.transform.localPosition += new Vector3(_xDistance * (float)(beat - startBeat), _yDistance * (float)(beat - startBeat)); + spawnedFrog.gameObject.SetActive(true); + _frogs.Add(new Frog(spawnedFrog, null, null, null, beat)); + } + } } public void BopTotemAtBeat(double beat) diff --git a/Assets/Scripts/Games/TotemClimb/TotemClimb.cs b/Assets/Scripts/Games/TotemClimb/TotemClimb.cs index 0c302e8d0..805e86b74 100644 --- a/Assets/Scripts/Games/TotemClimb/TotemClimb.cs +++ b/Assets/Scripts/Games/TotemClimb/TotemClimb.cs @@ -22,6 +22,7 @@ namespace HeavenStudio.Games.Loaders }, new("triple", "Triple Jumping") { + preFunction = delegate { TotemClimb.TripleJumpSound(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, defaultLength = 2f, resizable = true }, @@ -196,6 +197,19 @@ namespace HeavenStudio.Games if (_tripleEvents.Count == 0) return false; return _tripleEvents.Find(x => beat >= x.beat && beat < x.beat + x.length) != null; } + + public static void TripleJumpSound(double beat, float length) + { + length = Mathf.Max(length, 2f); + MultiSound.Play(new MultiSound.Sound[] + { + new("totemClimb/beatchange", beat - 2), + new("totemClimb/beatchange", beat - 1.5f), + new("totemClimb/beatchange", beat - 1f), + new("totemClimb/beatchange", beat + length - 2), + new("totemClimb/beatchange", beat + length - 1), + }, true); + } } }