diff --git a/Assets/Resources/Games/fillbots.prefab b/Assets/Resources/Games/fillbots.prefab index b6689ba11..38d34b3ba 100644 --- a/Assets/Resources/Games/fillbots.prefab +++ b/Assets/Resources/Games/fillbots.prefab @@ -409,7 +409,7 @@ Transform: - {fileID: 7119416205577292686} - {fileID: 821380393148258481} m_Father: {fileID: 5681901217470064799} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &6733705841755800000 Animator: @@ -907,90 +907,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!1 &5753021240781299655 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5118038246686077097} - - component: {fileID: 4722927507178925978} - m_Layer: 0 - m_Name: ref - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &5118038246686077097 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5753021240781299655} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.395, y: 1.395, z: 1.395} - m_ConstrainProportionsScale: 1 - m_Children: [] - m_Father: {fileID: 5681901217470064799} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!212 &4722927507178925978 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5753021240781299655} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 3 - m_Sprite: {fileID: 21300000, guid: 0f6862a559f12a84488f618e606bec2e, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 0.41960785} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 6.4, y: 3.6} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 --- !u!1 &6012583447299209878 GameObject: m_ObjectHideFlags: 0 @@ -1189,7 +1105,6 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1588626132168789274} - - {fileID: 5118038246686077097} - {fileID: 1945548446059564651} m_Father: {fileID: 0} m_RootOrder: 0 diff --git a/Assets/Resources/Sprites/Games/Fillbots/ref.png b/Assets/Resources/Sprites/Games/Fillbots/ref.png deleted file mode 100644 index 74d0d97f8..000000000 Binary files a/Assets/Resources/Sprites/Games/Fillbots/ref.png and /dev/null differ diff --git a/Assets/Resources/Sprites/Games/Fillbots/ref.png.meta b/Assets/Resources/Sprites/Games/Fillbots/ref.png.meta deleted file mode 100644 index 52cfffbd6..000000000 --- a/Assets/Resources/Sprites/Games/Fillbots/ref.png.meta +++ /dev/null @@ -1,123 +0,0 @@ -fileFormatVersion: 2 -guid: e2107d00b7f359746b7b1acd361a36a1 -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 12 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - vTOnly: 0 - ignoreMasterTextureLimit: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - flipbookRows: 1 - flipbookColumns: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - ignorePngGamma: 0 - applyGammaDecoding: 0 - cookieLightType: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Server - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - nameFileIdTable: {} - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/Sprites/Games/Fillbots/ref001.png b/Assets/Resources/Sprites/Games/Fillbots/ref001.png deleted file mode 100644 index 7d9f56b19..000000000 Binary files a/Assets/Resources/Sprites/Games/Fillbots/ref001.png and /dev/null differ diff --git a/Assets/Resources/Sprites/Games/Fillbots/ref001.png.meta b/Assets/Resources/Sprites/Games/Fillbots/ref001.png.meta deleted file mode 100644 index a7cdc5708..000000000 --- a/Assets/Resources/Sprites/Games/Fillbots/ref001.png.meta +++ /dev/null @@ -1,123 +0,0 @@ -fileFormatVersion: 2 -guid: 0f6862a559f12a84488f618e606bec2e -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 12 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - vTOnly: 0 - ignoreMasterTextureLimit: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 1 - aniso: 1 - mipBias: 0 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - flipbookRows: 1 - flipbookColumns: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - ignorePngGamma: 0 - applyGammaDecoding: 0 - cookieLightType: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Server - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - nameFileIdTable: {} - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Games/Fillbots/Fillbots.cs b/Assets/Scripts/Games/Fillbots/Fillbots.cs index 36a6c2bab..2161514ee 100644 --- a/Assets/Scripts/Games/Fillbots/Fillbots.cs +++ b/Assets/Scripts/Games/Fillbots/Fillbots.cs @@ -378,13 +378,13 @@ namespace HeavenStudio.Games })); actions.Add(new BeatAction.Action(beat, delegate { - if (conveyerStartBeat != -1) conveyerNormalizedOffset = Conductor.instance.GetPositionFromBeat(conveyerStartBeat, 1); + if (conveyerStartBeat != -1) conveyerNormalizedOffset = (conveyerNormalizedOffset + Conductor.instance.GetPositionFromBeat(conveyerStartBeat, 1)) % 1; conveyerStartBeat = -2; })); } else { actions.Add(new BeatAction.Action(beat - 0.5, delegate { - if (conveyerStartBeat != -1) conveyerNormalizedOffset = Conductor.instance.GetPositionFromBeat(conveyerStartBeat, 1); + if (conveyerStartBeat != -1) conveyerNormalizedOffset = (conveyerNormalizedOffset + Conductor.instance.GetPositionFromBeat(conveyerStartBeat, 1)) % 1; conveyerStartBeat = -2; })); } @@ -488,27 +488,6 @@ namespace HeavenStudio.Games } UpdateBackgroundColor(); - - // this.bg.color = BG; - // foreach (var renderer in otherRenderer) - // { - // renderer.color = BG; - // } - // if (separate) - // { - // var colors = new Color[] {meter1, meter2, meter3, meter4, meter5, meter6}; - // for (int i = 0; i < metersFuel.Length; i++) - // { - // metersFuel[i].color = colors[i]; - // } - // } - // else - // { - // for (int i = 0; i < metersFuel.Length; i++) - // { - // metersFuel[i].color = meters; - // } - // } } public void ObjectColorSet(Color fuelColor, Color lampColorOff, Color lampColorOn, Color impact, Color filler, Color conveyer) { diff --git a/Assets/Scripts/Games/Fillbots/NtrFillbot.cs b/Assets/Scripts/Games/Fillbots/NtrFillbot.cs index 7e240236d..fc73531ab 100644 --- a/Assets/Scripts/Games/Fillbots/NtrFillbot.cs +++ b/Assets/Scripts/Games/Fillbots/NtrFillbot.cs @@ -213,124 +213,16 @@ namespace HeavenStudio.Games.Scripts_Fillbots { if (startBeat != -1) { - if (!legsHaveFallen) - { - float normalizedBeat = cond.GetPositionFromBeat(startBeat - 0.25, 0.25); - float lerpedY = Mathf.Lerp(legsPosY + limbFallHeight, legsPosY, normalizedBeat); - legsTrans.position = new Vector3(legsTrans.position.x, Mathf.Clamp(lerpedY, legsPosY, legsPosY + limbFallHeight)); - } - if (!bodyHasFallen) - { - float normalizedBeat = cond.GetPositionFromBeat(startBeat - 0.25 + 1, 0.25); - float lerpedY = Mathf.Lerp(bodyPosY + limbFallHeight, bodyPosY, normalizedBeat); - bodyTrans.position = new Vector3(bodyTrans.position.x, Mathf.Clamp(lerpedY, bodyPosY, bodyPosY + limbFallHeight)); - } - if (!headHasFallen) - { - float normalizedBeat = cond.GetPositionFromBeat(startBeat - 0.25 + 2, 0.25); - float lerpedY = Mathf.Lerp(headPosY + limbFallHeight, headPosY, normalizedBeat); - headTrans.position = new Vector3(headTrans.position.x, Mathf.Clamp(lerpedY, headPosY, headPosY + limbFallHeight)); - } - if (isStack) - { - float normalizedBeat = cond.GetPositionFromBeat(stackBeat, stackLength); - if (normalizedBeat >= 0 && normalizedBeat < 1) - { - MoveConveyer(normalizedBeat, lerpDistance*stackDistanceRate); - } - else if (normalizedBeat >= 1) - { - MoveConveyer(1, lerpDistance*stackDistanceRate); - StopConveyer(); - isStack = false; - } - } - if (headHasFallen && bodyHasFallen && legsHaveFallen) - { - if (this.conveyerStartBeat >= 0) - { - float normalizedBeat = cond.GetPositionFromBeat(this.conveyerStartBeat, conveyerLength); - if (normalizedBeat >= 0) - { - if (_botState is BotState.Ace) MoveConveyer(normalizedBeat, lerpDistance, flyDistance); - else if (_botState is BotState.Idle) MoveConveyer(normalizedBeat, lerpIdleDistance); - else MoveConveyer(normalizedBeat, lerpDistance); - } - } - else - { - StopConveyer(); - } - } + if (!legsHaveFallen) UpdateLimbPosition(cond, startBeat, legsTrans, legsPosY); + if (!bodyHasFallen) UpdateLimbPosition(cond, startBeat + 1, bodyTrans, bodyPosY); + if (!headHasFallen) UpdateLimbPosition(cond, startBeat + 2, headTrans, headPosY); + if (isStack) HandleStacking(cond); + if (headHasFallen && bodyHasFallen && legsHaveFallen) HandleConveyer(cond); } if (_botState is BotState.Holding) { - float normalizedBeat = cond.GetPositionFromBeat(startBeat + 4, holdLength); - float normalizedExplodeBeat = cond.GetPositionFromBeat(startBeat + 4, holdLength + 0.25); - - if (!isExplode && beepEvent != null && beepEvent.enabled && ReportBeat(ref beepEvent.lastReportedBeat)) - { - if (beepEvent.lastReportedBeat < beepEvent.startBeat + beepEvent.length) - { - SoundByte.PlayOneShotGame("fillbots/beep"); - } - fullBody.DoScaledAnimationAsync("HoldBeat", 1f); - - string sizeSuffix = game.fillerPosition switch - { - BotSize.Small => "Small", - BotSize.Medium => "Medium", - BotSize.Large => "Large", - _ => throw new System.NotImplementedException() - }; - game.filler.DoScaledAnimationAsync("HoldBeat" + sizeSuffix, 1f); - } - - fillAnim.DoNormalizedAnimation("Fill", Mathf.Clamp(normalizedBeat, 0, 1)); - if (!isExplode && !game.IsExpectingInputNow(Fillbots.InputAction_BasicRelease) && normalizedExplodeBeat >= 1f) - { - isExplode = true; - fullBody.Play("Beyond", 0, 0); - BeatAction.New(game, new List() - { - new BeatAction.Action(startBeat + holdLength + 5.5, delegate { - game.fillerHolding = false; - SoundByte.PlayOneShotGame("fillbots/explosion"); - game.currentBots.Remove(this); - Destroy(gameObject); - }), - }); - } - else if (PlayerInput.GetIsAction(Fillbots.InputAction_BasicRelease) && !game.IsExpectingInputNow(Fillbots.InputAction_BasicRelease)) - { - if (normalizedBeat < 1) - { - fullBody.Play("Dead", 0, 0); - SoundByte.PlayOneShotGame("fillbots/miss"); - } - else if (!isExplode) - { - fullBody.DoScaledAnimationAsync("ReleaseLate", 0.5f); - SoundByte.PlayOneShotGame("fillbots/miss"); - } - fillSound.KillLoop(0); - beepEvent.enabled = false; - _botState = BotState.Ng; - game.fillerHolding = false; - normalizedFill = normalizedBeat; - if (conveyerRestartLength >= 0) - { - this.conveyerStartBeat = cond.songPositionInBeats + conveyerRestartLength; - if (game.conveyerStartBeat == -1) game.conveyerStartBeat = this.conveyerStartBeat; - } - else - { - this.conveyerStartBeat = -1; - game.conveyerStartBeat = -1; - } - releaseEvent.Disable(); - } + HandleHolding(cond); } else { @@ -339,6 +231,125 @@ namespace HeavenStudio.Games.Scripts_Fillbots } } + private void UpdateLimbPosition(Conductor cond, double targetBeat, Transform limbTrans, float limbPosY) + { + float normalizedBeat = cond.GetPositionFromBeat(targetBeat - 0.25, 0.25); + float lerpedY = Mathf.Lerp(limbPosY + limbFallHeight, limbPosY, normalizedBeat); + limbTrans.position = new Vector3(limbTrans.position.x, Mathf.Clamp(lerpedY, limbPosY, limbPosY + limbFallHeight)); + } + + private void HandleStacking(Conductor cond) + { + float normalizedBeat = cond.GetPositionFromBeat(stackBeat, stackLength); + if (normalizedBeat >= 0 && normalizedBeat < 1) + { + MoveConveyer(normalizedBeat, lerpDistance * stackDistanceRate); + } + else if (normalizedBeat >= 1) + { + MoveConveyer(1, lerpDistance * stackDistanceRate); + StopConveyer(); + isStack = false; + } + } + + private void HandleConveyer(Conductor cond) + { + if (this.conveyerStartBeat >= 0) + { + float normalizedBeat = cond.GetPositionFromBeat(this.conveyerStartBeat, conveyerLength); + if (normalizedBeat >= 0) + { + if (_botState is BotState.Ace) MoveConveyer(normalizedBeat, lerpDistance, flyDistance); + else if (_botState is BotState.Idle) MoveConveyer(normalizedBeat, lerpIdleDistance); + else MoveConveyer(normalizedBeat, lerpDistance); + } + } + else + { + StopConveyer(); + } + } + + private void HandleHolding(Conductor cond) + { + float normalizedBeat = cond.GetPositionFromBeat(startBeat + 4, holdLength); + float normalizedExplodeBeat = cond.GetPositionFromBeat(startBeat + 4, holdLength + 0.25); + + if (!isExplode && beepEvent != null && beepEvent.enabled && ReportBeat(ref beepEvent.lastReportedBeat)) + { + if (beepEvent.lastReportedBeat < beepEvent.startBeat + beepEvent.length) + { + SoundByte.PlayOneShotGame("fillbots/beep"); + } + fullBody.DoScaledAnimationAsync("HoldBeat", 1f); + string sizeSuffix = game.fillerPosition switch + { + BotSize.Small => "Small", + BotSize.Medium => "Medium", + BotSize.Large => "Large", + _ => throw new System.NotImplementedException() + }; + game.filler.DoScaledAnimationAsync("HoldBeat" + sizeSuffix, 1f); + } + + fillAnim.DoNormalizedAnimation("Fill", Mathf.Clamp(normalizedBeat, 0, 1)); + + if (!isExplode && !game.IsExpectingInputNow(Fillbots.InputAction_BasicRelease) && normalizedExplodeBeat >= 1f) + { + HandleExplosion(cond); + } + else if (PlayerInput.GetIsAction(Fillbots.InputAction_BasicRelease) && !game.IsExpectingInputNow(Fillbots.InputAction_BasicRelease)) + { + HandleRelease(cond, normalizedBeat); + } + } + + private void HandleExplosion(Conductor cond) + { + isExplode = true; + fullBody.Play("Beyond", 0, 0); + BeatAction.New(game, new List() + { + new BeatAction.Action(startBeat + holdLength + 5.5, delegate { + game.fillerHolding = false; + SoundByte.PlayOneShotGame("fillbots/explosion"); + game.currentBots.Remove(this); + Destroy(gameObject); + }), + }); + } + + private void HandleRelease(Conductor cond, float normalizedBeat) + { + if (normalizedBeat < 1) + { + fullBody.Play("Dead", 0, 0); + SoundByte.PlayOneShotGame("fillbots/miss"); + } + else if (!isExplode) + { + fullBody.DoScaledAnimationAsync("ReleaseLate", 0.5f); + SoundByte.PlayOneShotGame("fillbots/miss"); + } + fillSound.KillLoop(0); + beepEvent.enabled = false; + _botState = BotState.Ng; + game.fillerHolding = false; + normalizedFill = normalizedBeat; + if (conveyerRestartLength >= 0) + { + this.conveyerStartBeat = cond.songPositionInBeats + conveyerRestartLength; + if (game.conveyerStartBeat == -1) game.conveyerStartBeat = this.conveyerStartBeat; + } + else + { + this.conveyerStartBeat = -1; + game.conveyerStartBeat = -1; + } + releaseEvent.Disable(); + } + private void JustHold(PlayerActionEvent caller, float state) { string sizeSuffix = game.fillerPosition switch @@ -356,9 +367,10 @@ namespace HeavenStudio.Games.Scripts_Fillbots fullBody.Play("HoldBarely", 0, 0); return; } - if (game.conveyerStartBeat != -1) game.conveyerNormalizedOffset = Conductor.instance.GetPositionFromBeat(game.conveyerStartBeat, 1); + if (game.conveyerStartBeat != -1) game.conveyerNormalizedOffset = (game.conveyerNormalizedOffset + Conductor.instance.GetPositionFromBeat(game.conveyerStartBeat, 1)) % 1; game.conveyerStartBeat = -1; conveyerLength = 1; + transform.position = new Vector3(0, transform.position.y, 0); _botState = BotState.Holding; game.fillerHolding = true; @@ -416,7 +428,7 @@ namespace HeavenStudio.Games.Scripts_Fillbots return; } - if ((endAnim is EndAnim.Both && state == 0) || endAnim is EndAnim.Ace) + if ( ((endAnim is EndAnim.Both && state == 0) || endAnim is EndAnim.Ace) && conveyerRestartLength >= 0 ) { _botState = BotState.Ace; BeatAction.New(game, new List() @@ -449,6 +461,7 @@ namespace HeavenStudio.Games.Scripts_Fillbots } } + game.fillerHolding = false; game.filler.DoScaledAnimationAsync("Release" + sizeSuffix, 0.5f); SoundByte.PlayOneShotGame("fillbots/armRetraction"); @@ -475,7 +488,7 @@ namespace HeavenStudio.Games.Scripts_Fillbots fullBody.DoScaledAnimationAsync("Success", 0.5f); } - public bool ReportBeat(ref double lastReportedBeat) + private bool ReportBeat(ref double lastReportedBeat) { var cond = Conductor.instance; bool result = cond.songPositionInBeats >= (lastReportedBeat) + 1f;