Rockers + Rhythm Tweezers Call and Response API (#444)

* rock hers

* Rockers is a real game and also color maps have been added

* little more set up

* anims and mor sprites

* First version of CallAndResponseHandler added

* You can mute now wow

* Got some stuff working

* anim city

* Fixed Inputs

* Visual goodies

* Changed how some events work

* Rockers is now stack proof

* Fixed a bug

* Bend early stages

* bendbendbendbendbendover

* bend fully implemented

* Removed "noise"

* pain

* Many animation

* Bend anims implemented

* strum effect implemented

* Made bends work way better

* dfgdfsgsdffsd

* Implemented strumstart and countin

* hi

* Made strumstart transition into strumidle

* Implemented samples

* All of the btsds samples are in now too

* many anim2

* A buggy version of the custom together system has been implemented

* Ok now it's unbuggified

* fixed a small thing

* lightning eff

* anim fixes

* oops

* you can now mute voiceline and also put in a standalone voiceline block

* Tweaks to dropdowns

* more tiny anim thing

* more animation stuff

* Bug fixes

* implemented mute and gotomiddle sliders for custom together event

* Default cmon and last one added

* You can chain last ones and cmons now

* Applause sounds added

* Fixed some bugs

* Made it so you can disable camera movement

* fixed an inconsistency

* Rhythm tweezers is actually kinda playable now, not finished though, i need to make beat offset work with this

* Rhythm tweezers now works between game switches

* Beat offset eradication

* Made eye size work properly

* Camera quad ease rather than quint

* Inactive intervals added

* Rockers works inactively too now

* Bug fix

* No peeking! No way!

* Alt smile added for tweezers

* early and late riff

* jj miss anim

* icon and miss

* Long hair works properly now

* Miss anims implemented for rockers

---------

Co-authored-by: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com>
Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
ev
2023-05-29 16:09:34 -04:00
committed by GitHub
parent 9caa3ecd29
commit 4d2bb8c782
277 changed files with 98607 additions and 195 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
using UnityEngine.UIElements;
namespace HeavenStudio.Games.Scripts_RhythmTweezers
{
@ -21,9 +22,9 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
private Sound pullSound;
PlayerActionEvent pluckEvent;
private float inputBeat;
PlayerActionEvent endEvent;
InputType endInput;
private void Awake()
{
@ -32,34 +33,31 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
tweezers = game.Tweezers;
}
private void Start() {
game.ScheduleInput(createBeat, game.tweezerBeatOffset + game.beatInterval, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, StartJust, StartMiss, Out);
public void StartInput(float beat, float length)
{
inputBeat = beat + length;
game.ScheduleInput(beat, length, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, StartJust, StartMiss, Out);
}
private void Update()
{
if (pluckState == 1)
{
bool input = PlayerInput.PressedUp();
if (endInput == InputType.DIRECTION_UP) input = PlayerInput.GetAnyDirectionUp();
if (input && !game.IsExpectingInputNow(endInput))
{
endEvent.isEligible = false;
EndEarly();
return;
}
Vector3 tst = tweezers.tweezerSpriteTrans.position;
var hairDirection = new Vector3(tst.x + 0.173f, tst.y) - holder.transform.position;
holder.transform.rotation = Quaternion.FromToRotation(Vector3.down, hairDirection);
float normalizedBeat = Conductor.instance.GetPositionFromBeat(createBeat + game.tweezerBeatOffset + game.beatInterval, 0.5f);
float normalizedBeat = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f);
anim.Play("LoopPull", 0, normalizedBeat);
tweezers.anim.Play("Tweezers_LongPluck", 0, normalizedBeat);
if (!game.IsExpectingInputNow(InputType.STANDARD_UP | InputType.DIRECTION_DOWN_UP) && PlayerInput.PressedUp(true) && normalizedBeat < 1f)
{
EndEarly();
endEvent.Disable();
}
// Auto-release if holding at release time.
if (normalizedBeat >= 1f)
endEvent.Hit(0f, 1f);
if (normalizedBeat >= 1f && !game.IsExpectingInputNow(InputType.STANDARD_UP | InputType.DIRECTION_DOWN_UP))
EndAce();
}
loop.transform.localScale = Vector2.one / holder.transform.localScale;
@ -67,6 +65,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
public void EndAce()
{
if (pluckState != 1) return;
tweezers.LongPluck(true, this);
tweezers.hitOnFrame++;
@ -78,9 +77,9 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
public void EndEarly()
{
var normalized = Conductor.instance.GetPositionFromBeat(createBeat + game.tweezerBeatOffset + game.beatInterval, 0.5f);
var normalized = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f);
anim.Play("LoopPullReverse", 0, normalized);
tweezers.anim.Play("Idle", 0, 0);
tweezers.anim.Play("Tweezers_Idle", 0, 0);
if (pullSound != null)
pullSound.Stop();
@ -95,17 +94,9 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
pluckState = -1;
return;
}
if (PlayerInput.GetAnyDirectionDown())
{
endInput = InputType.DIRECTION_UP;
}
else
{
endInput = InputType.STANDARD_UP;
}
pullSound = Jukebox.PlayOneShotGame($"rhythmTweezers/longPull{UnityEngine.Random.Range(1, 5)}");
pluckState = 1;
endEvent = game.ScheduleInput(createBeat, game.tweezerBeatOffset + game.beatInterval + 0.5f, endInput, EndJust, Out, Out);
endEvent = game.ScheduleInput(inputBeat, 0.5f, InputType.STANDARD_UP | InputType.DIRECTION_DOWN_UP, EndJust, Out, Out);
}
private void StartMiss(PlayerActionEvent caller)
@ -123,13 +114,5 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
}
EndAce();
}
void OnDestroy()
{
if (pluckEvent != null)
pluckEvent.Disable();
if (endEvent != null)
endEvent.Disable();
}
}
}