mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 12:57:40 +02:00
Auto-Swing (#827)
* BurstLinq make BGM resync when changing pitch (to test) * autoswing some game implementations, most games already work fine * more game tweaks * 16th note swing more game fixes make pitch change resync optional in the API * suppress some common warnings * Update Credits.txt
This commit is contained in:
@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
|
||||
void Update()
|
||||
{
|
||||
double beat = conductor.songPositionInBeatsAsDouble;
|
||||
double beat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
double height = 0f;
|
||||
if (pathStartBeat > double.MinValue)
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
game.ScheduleInput(beat, 1f, DoubleDate.InputAction_FlickPress, Just, Miss, Empty);
|
||||
path = game.GetPath("BasketBallIn");
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = beat - 1f;
|
||||
pathStartBeat = Conductor.instance.GetUnSwungBeat(beat - 1f);
|
||||
|
||||
Vector3 pos = GetPathPositionFromBeat(path, pathStartBeat, pathStartBeat);
|
||||
transform.position = pos;
|
||||
@ -65,7 +65,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
}),
|
||||
});
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
path = game.GetPath("BasketBallNg" + (state > 0 ? "Late" : "Early"));
|
||||
@ -80,7 +80,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
void Hit()
|
||||
{
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
path = game.GetPath("BasketBallJust");
|
||||
game.Kick(true, false, true, _jump);
|
||||
SoundByte.PlayOneShotGame("doubleDate/kick");
|
||||
|
@ -261,8 +261,7 @@ namespace HeavenStudio.Games
|
||||
|
||||
void Update()
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
if (cond.isPlaying && !cond.isPaused)
|
||||
if (conductor.isPlaying && !conductor.isPaused)
|
||||
{
|
||||
if (queuedBalls.Count != 0)
|
||||
{
|
||||
@ -286,7 +285,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!cond.isPaused) && queuedBalls.Count != 0)
|
||||
if ((!conductor.isPaused) && queuedBalls.Count != 0)
|
||||
{
|
||||
queuedBalls.Clear();
|
||||
}
|
||||
@ -352,7 +351,7 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
boyAnim.DoScaledAnimationAsync(_isStaring ? "IdleBop2" : "IdleBop", _animSpeed);
|
||||
}
|
||||
if (Conductor.instance.songPositionInBeatsAsDouble > lastGirlGacha)
|
||||
if (conductor.songPositionInBeatsAsDouble > lastGirlGacha)
|
||||
girlAnim.DoScaledAnimationAsync("GirlBop", _animSpeed);
|
||||
weasels.Bop();
|
||||
}
|
||||
@ -365,7 +364,7 @@ namespace HeavenStudio.Games
|
||||
if (jump)
|
||||
{
|
||||
weasels.Jump();
|
||||
lastGirlGacha = Conductor.instance.songPositionInBeatsAsDouble + 0.5f;
|
||||
lastGirlGacha = conductor.songPositionInBeatsAsDouble + 0.5f;
|
||||
girlAnim.DoScaledAnimationAsync("GirlLookUp", _animSpeed);
|
||||
}
|
||||
else if (weaselsHappy) weasels.Happy();
|
||||
@ -373,7 +372,7 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(Conductor.instance.songPositionInBeatsAsDouble + 1f, delegate
|
||||
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 1f, delegate
|
||||
{
|
||||
leaves.Play();
|
||||
treeAnim.DoScaledAnimationAsync("TreeRustle", _animSpeed);
|
||||
@ -470,11 +469,11 @@ namespace HeavenStudio.Games
|
||||
|
||||
public void MissKick(double beat, bool hit = false)
|
||||
{
|
||||
lastGirlGacha = Conductor.instance.songPositionInBeatsAsDouble + 1.5f;
|
||||
lastGirlGacha = conductor.songPositionInBeatsAsDouble + 1.5f;
|
||||
girlAnim.DoScaledAnimationAsync("GirlSad", _animSpeed);
|
||||
if (hit)
|
||||
{
|
||||
lastHitWeasel = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
lastHitWeasel = conductor.songPositionInBeatsAsDouble;
|
||||
BeatAction.New(this, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat - (0.25f/3f), delegate { weasels.Hit(beat); }),
|
||||
@ -482,7 +481,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
else
|
||||
{
|
||||
lastHitWeasel = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
lastHitWeasel = conductor.songPositionInBeatsAsDouble;
|
||||
BeatAction.New(this, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat + 0.25, delegate { weasels.Hide(beat + 0.25f); }),
|
||||
|
@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
|
||||
void Update()
|
||||
{
|
||||
double beat = conductor.songPositionInBeatsAsDouble;
|
||||
double beat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
double height = 0f;
|
||||
if (pathStartBeat > double.MinValue)
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
game.ScheduleInput(beat, 1.5f, DoubleDate.InputAction_FlickPress, Just, Miss, Empty);
|
||||
path = game.GetPath("FootBallInNoHit"); // there's a second path for footballs that hit the weasels, use that if the weasels haven't been hit recently
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = beat - 1f;
|
||||
pathStartBeat = Conductor.instance.GetUnSwungBeat(beat - 1f);
|
||||
|
||||
Vector3 pos = GetPathPositionFromBeat(path, pathStartBeat, pathStartBeat);
|
||||
transform.position = pos;
|
||||
@ -60,7 +60,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
path = game.GetPath("FootBallNg" + (state > 0 ? "Late" : "Early"));
|
||||
SoundByte.PlayOneShot("miss");
|
||||
game.Kick(false);
|
||||
@ -84,7 +84,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
transform.localScale *= 0.25f;
|
||||
path = game.GetPath("FootBallFall");
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble + 1f;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble + 1f;
|
||||
}),
|
||||
new BeatAction.Action(conductor.songPositionInBeatsAsDouble + 12f, delegate
|
||||
{
|
||||
@ -96,7 +96,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
void Hit()
|
||||
{
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
path = game.GetPath("FootBallJust");
|
||||
game.Kick(true, true, jump: _jump);
|
||||
SoundByte.PlayOneShotGame("doubleDate/footballKick");
|
||||
|
@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
|
||||
void Update()
|
||||
{
|
||||
double beat = conductor.songPositionInBeatsAsDouble;
|
||||
double beat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
double height = 0f;
|
||||
if (pathStartBeat > double.MinValue)
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
game.ScheduleInput(beat, 1f, DoubleDate.InputAction_FlickPress, Just, Miss, Empty);
|
||||
path = game.GetPath("SoccerIn");
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = beat - 1f;
|
||||
pathStartBeat = Conductor.instance.GetUnSwungBeat(beat - 1f);
|
||||
|
||||
Vector3 pos = GetPathPositionFromBeat(path, pathStartBeat, pathStartBeat);
|
||||
transform.position = pos;
|
||||
@ -65,7 +65,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
}),
|
||||
});
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
path = game.GetPath("SoccerNg" + (state > 0 ? "Late" : "Early"));
|
||||
@ -80,7 +80,7 @@ namespace HeavenStudio.Games.Scripts_DoubleDate
|
||||
void Hit()
|
||||
{
|
||||
UpdateLastRealPos();
|
||||
pathStartBeat = conductor.songPositionInBeatsAsDouble;
|
||||
pathStartBeat = conductor.unswungSongPositionInBeatsAsDouble;
|
||||
path = game.GetPath("SoccerJust");
|
||||
game.Kick(true, false, true, _jump);
|
||||
SoundByte.PlayOneShotGame("doubleDate/kick");
|
||||
|
Reference in New Issue
Block a user