End event fixes

This commit is contained in:
Rapandrasmus 2023-06-25 22:05:33 +02:00
parent 105d9ced55
commit 6cec0ab585
5 changed files with 155 additions and 17 deletions

View file

@ -166,7 +166,7 @@ MonoBehaviour:
heightAmount: 2
platformDistance: 3.8
playerXPos: -6.78
starLength: 17
starLength: 18
starHeight: 0.0625
platformCount: 24
--- !u!1 &955264990193298390
@ -965,8 +965,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
starRef: {fileID: -5335075775997835892, guid: 8df651ffe21e1dc4fb223e94fdc9f9cb, type: 3}
boundaryX: 23
boundaryY: 13
boundaryX: 20
boundaryY: 12
starCount: 96
blinkFrequency: 0.05
blinkAmount: 5

View file

@ -0,0 +1,98 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EndIdle
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Rod/light
classID: 1
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2539502518
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Rod/light
classID: 1
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8dacf991d9fecca4db0ae94c9300a66b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -126,6 +126,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: 5915228760359225873}
m_Position: {x: 620, y: 780, z: 0}
- serializedVersion: 1
m_State: {fileID: 4936875494368828117}
m_Position: {x: 655, y: 845, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -285,6 +288,32 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &4936875494368828117
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EndIdle
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 8dacf991d9fecca4db0ae94c9300a66b, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &5044809879433215610
AnimatorState:
serializedVersion: 6

View file

@ -39,6 +39,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
private double playYanFallBeat;
private bool isFish;
private bool isFinalBlock;
private bool isEndEvent;
public void StartInput(double beat, double hitBeat)
{
@ -53,7 +54,8 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
endBeat = hitBeat;
isFish = game.FishOnBeat(endBeat);
fish.gameObject.SetActive(isFish);
bool isEndEvent = game.endBeat == endBeat;
isEndEvent = game.endBeat == endBeat;
if (isEndEvent) anim.Play("EndIdle", 0, 0);
if (game.platformTypes.ContainsKey(hitBeat))
{
if (game.platformTypes[hitBeat].platformType == AgbNightWalk.PlatformType.Lollipop)
@ -123,7 +125,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
{
inputEvent = AgbNightWalk.instance.ScheduleInput(startBeat, endBeat - startBeat, InputType.STANDARD_DOWN, isEndEvent ? JustEnd : Just, Miss, Empty);
}
if (nextPlatformIsSameHeight)
if (nextPlatformIsSameHeight && !isEndEvent)
{
canKick = true;
BeatAction.New(gameObject, new List<BeatAction.Action>()
@ -152,6 +154,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
Update();
}
private bool startGlowing;
private void Update()
{
var cond = Conductor.instance;
@ -177,6 +180,12 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
float newPlayYanY = func(0, -12, normalizedFallBeat);
fallYan.transform.localPosition = new Vector3(0, newPlayYanY);
}
if (!startGlowing && isEndEvent && game.hitJumps >= game.requiredJumps && AgbNightWalk.hitJumpsPersist >= game.requiredJumpsP)
{
anim.DoScaledAnimationAsync("EndGlow", 0.5f);
startGlowing = true;
}
}
}
@ -235,13 +244,14 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
}
else if (isFinalBlock)
{
double missTime = 1 - Conductor.instance.SecsToBeats(Minigame.earlyTime, Conductor.instance.GetBpmAtBeat(beat));
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5, delegate
new BeatAction.Action(beat + missTime, delegate
{
game.ScoreMiss();
handler.StopAll();
game.playYan.Fall(beat + 0.5);
game.playYan.Fall(beat + missTime);
handler.DestroyPlatforms(caller.timer + caller.startBeat + 2, endBeat - 2, endBeat);
}),
@ -290,7 +300,7 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
{
anim.DoScaledAnimationAsync("EndPop", 0.5f);
handler.StopAll();
handler.DestroyPlatforms(caller.timer + caller.startBeat + 4, endBeat - 2, endBeat + 1);
handler.DestroyPlatforms(caller.timer + caller.startBeat + 2, endBeat - 2, endBeat + 1);
game.playYan.Float(Conductor.instance.songPositionInBeats);
handler.DevolveAll();
if (isFish)
@ -313,15 +323,8 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
}
else
{
game.playYan.Whiff(Conductor.instance.songPositionInBeats);
game.ScoreMiss();
if (!platform.activeSelf)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + Conductor.instance.SecsToBeats(Minigame.lateTime, Conductor.instance.GetBpmAtBeat(beat)), delegate { Miss(caller); })
});
}
handler.RaiseHeight(beat, lastAdditionalHeightInUnits, additionalHeightInUnits);
game.playYan.Jump(beat);
}
}