mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 11:37:40 +02:00
Power Calligraphy fixed #Feature Complete (#794)
* Power Calligraphy (WIP) * modified: Assets/Scripts/Games/PowerCalligraphy/Writing.cs * comma * onore * sweep * sun * kokoro * Power Calligraphy (WIP) * Changed object to prefab * Force Prepare * Changed so that the next paper is set correctly. * updated controllers * Red hand * Paper shift * Chounin (WIP) * Power Calligraphy #Feature Complete * Fixed Animations to 30fps
This commit is contained in:
@ -47,6 +47,7 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
}
|
||||
|
||||
public double startBeat;
|
||||
public double ongoingBeat = Double.MinValue;
|
||||
public double nextBeat;
|
||||
[SerializeField] PatternItem[] AnimPattern;
|
||||
|
||||
@ -75,7 +76,6 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
public void Play()
|
||||
{
|
||||
paperSort.sortingOrder++;
|
||||
|
||||
var sounds = new List<MultiSound.Sound>();
|
||||
var actions = new List<BeatAction.Action>();
|
||||
|
||||
@ -124,7 +124,7 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
current_anim_num_1 = anim_num;
|
||||
actions.Add(new BeatAction.Action(itemBeat, delegate {
|
||||
Halt(); stroke = StrokeType.TOME; process_num = current_anim_num_1;}));
|
||||
actions.Add(new BeatAction.Action(itemBeat, delegate { onGoing = true;}));
|
||||
actions.Add(new BeatAction.Action(itemBeat, delegate { onGoing = true; ongoingBeat = itemBeat;}));
|
||||
game.ScheduleInput(itemBeat, 1f, PowerCalligraphy.InputAction_BasicPress, writeSuccess, writeMiss, Empty, CanSuccess);
|
||||
break;
|
||||
case StrokeType.HANE:
|
||||
@ -132,7 +132,7 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
current_anim_num_1 = anim_num;
|
||||
actions.Add(new BeatAction.Action(itemBeat, delegate {
|
||||
Sweep(); stroke = StrokeType.HANE; process_num = current_anim_num_1;}));
|
||||
actions.Add(new BeatAction.Action(itemBeat+1, delegate { onGoing = true;}));
|
||||
actions.Add(new BeatAction.Action(itemBeat+1, delegate { onGoing = true; ongoingBeat = itemBeat + 1;}));
|
||||
game.ScheduleInput(itemBeat, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
|
||||
break;
|
||||
case StrokeType.HARAI:
|
||||
@ -140,7 +140,7 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
current_anim_num_1 = anim_num;
|
||||
actions.Add(new BeatAction.Action(itemBeat, delegate {
|
||||
Sweep(); stroke = StrokeType.HARAI; process_num = current_anim_num_1;}));
|
||||
actions.Add(new BeatAction.Action(itemBeat+1, delegate { onGoing = true;}));
|
||||
actions.Add(new BeatAction.Action(itemBeat+1, delegate { onGoing = true; ongoingBeat = itemBeat + 1;}));
|
||||
game.ScheduleInput(itemBeat, 2f, PowerCalligraphy.InputAction_FlickPress, writeSuccess, writeMiss, Empty, CanSuccess);
|
||||
break;
|
||||
default:
|
||||
@ -168,24 +168,29 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
private void Finish()
|
||||
{
|
||||
isFinish = true;
|
||||
paperSort.sortingOrder++;
|
||||
transform.SetParent(game.paperHolder.transform, true);
|
||||
game.fudeAnim.Play("fude-none");
|
||||
paperAnim.enabled = false;
|
||||
}
|
||||
|
||||
private void writeSuccess(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (state >= 1f)
|
||||
if (state >= 1f) {
|
||||
ProcessInput("late");
|
||||
else if (state <= -1f)
|
||||
game.ChouninMiss();
|
||||
} else if (state <= -1f) {
|
||||
ProcessInput("fast");
|
||||
else
|
||||
game.ChouninMiss();
|
||||
} else {
|
||||
ProcessInput("just");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void writeMiss(PlayerActionEvent caller)
|
||||
{
|
||||
if (onGoing)
|
||||
Miss();
|
||||
if (onGoing) Miss();
|
||||
}
|
||||
|
||||
private void Empty(PlayerActionEvent caller) { }
|
||||
@ -219,17 +224,15 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
|
||||
case "late":
|
||||
case "fast":
|
||||
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
|
||||
switch (stroke) { // WIP
|
||||
case StrokeType.TOME:
|
||||
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
|
||||
SoundByte.PlayOneShotGame("powerCalligraphy/8");
|
||||
break;
|
||||
case StrokeType.HANE:
|
||||
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
|
||||
SoundByte.PlayOneShotGame("powerCalligraphy/6");
|
||||
break;
|
||||
case StrokeType.HARAI:
|
||||
game.fudeAnim.DoScaledAnimationAsync("fude-none", 0.5f);
|
||||
SoundByte.PlayOneShotGame("powerCalligraphy/9");
|
||||
break;
|
||||
}
|
||||
@ -262,6 +265,7 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
string pattern = num.ToString() + str;
|
||||
|
||||
game.fudePosAnim.DoScaledAnimationAsync(pattern, 0.5f);
|
||||
game.shiftAnim.DoScaledAnimationAsync(pattern, 0.5f);
|
||||
paperAnim.DoScaledAnimationAsync(pattern, 0.5f);
|
||||
}
|
||||
|
||||
@ -271,6 +275,12 @@ namespace HeavenStudio.Games.Scripts_PowerCalligraphy
|
||||
|
||||
if (cond.isPlaying && !cond.isPaused)
|
||||
{
|
||||
if (ongoingBeat > 0)
|
||||
{
|
||||
float normalizedBeat = cond.GetPositionFromBeat(ongoingBeat, 1);
|
||||
float redRate = (normalizedBeat <= 0.5f) ? normalizedBeat/0.5f : (1.5f-normalizedBeat);
|
||||
if (game is not null) game.playerFude.redRate = redRate;
|
||||
}
|
||||
if (isFinish)
|
||||
{
|
||||
double beat = cond.songPositionInBeats;
|
||||
|
Reference in New Issue
Block a user