diff --git a/Assets/Resources/Models/Games/RhythmRally/Paddler.controller b/Assets/Resources/Models/Games/RhythmRally/Paddler.controller index 98c9c5a1c..8e7cc5f0e 100644 --- a/Assets/Resources/Models/Games/RhythmRally/Paddler.controller +++ b/Assets/Resources/Models/Games/RhythmRally/Paddler.controller @@ -22,6 +22,33 @@ AnimatorStateTransition: m_InterruptionSource: 0 m_OrderedInterruption: 1 m_CanTransitionToSelf: 1 +--- !u!1102 &-7660928310954623538 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UnReady1 + m_Speed: -4 + m_CycleOffset: 1 + m_Transitions: + - {fileID: 5805743421897320861} + 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: -4791534359250169297, guid: cebeb8610d89fb34688750080a285ddb, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!1102 &-3986917046676279002 AnimatorState: serializedVersion: 6 @@ -59,16 +86,16 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: 6416047872712211942} - m_Position: {x: 240, y: 260, z: 0} + m_Position: {x: 200, y: 240, z: 0} - serializedVersion: 1 m_State: {fileID: 4424825005415695879} m_Position: {x: 320, y: 50, z: 0} - serializedVersion: 1 m_State: {fileID: -3986917046676279002} - m_Position: {x: 460, y: 190, z: 0} + m_Position: {x: 200, y: 290, z: 0} - serializedVersion: 1 m_State: {fileID: 124654373728809099} - m_Position: {x: 510, y: 260, z: 0} + m_Position: {x: 420, y: 190, z: 0} - serializedVersion: 1 m_State: {fileID: 7339080780637248285} m_Position: {x: 550, y: 330, z: 0} @@ -78,6 +105,9 @@ AnimatorStateMachine: - serializedVersion: 1 m_State: {fileID: 7618035723044257044} m_Position: {x: 270, y: 120, z: 0} + - serializedVersion: 1 + m_State: {fileID: -7660928310954623538} + m_Position: {x: 630, y: 190, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -162,6 +192,28 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1101 &5805743421897320861 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 7618035723044257044} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 --- !u!1102 &6416047872712211942 AnimatorState: serializedVersion: 6 diff --git a/Assets/Resources/Prefabs/Editor/SettingsMenu/ControllerSetup.prefab b/Assets/Resources/Prefabs/Editor/SettingsMenu/ControllerSetup.prefab index 3b82da31a..7caa1c5e7 100644 --- a/Assets/Resources/Prefabs/Editor/SettingsMenu/ControllerSetup.prefab +++ b/Assets/Resources/Prefabs/Editor/SettingsMenu/ControllerSetup.prefab @@ -771,6 +771,80 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 +--- !u!1 &1388028344216826847 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8931925833886898116} + - component: {fileID: 8187487577289273397} + - component: {fileID: 1129948637867395467} + m_Layer: 5 + m_Name: UseInputExpansion + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &8931925833886898116 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388028344216826847} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.00008, y: 1.00008, z: 1.00008} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1424841260046386091} + - {fileID: 6127762978588141374} + m_Father: {fileID: 3918594454598345480} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 602.5, y: -169.002} + m_SizeDelta: {x: 1165, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8187487577289273397 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388028344216826847} + m_CullTransparentMesh: 1 +--- !u!114 &1129948637867395467 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1388028344216826847} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 10 + m_Bottom: 10 + m_ChildAlignment: 0 + m_Spacing: 10 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &1805243853809551032 GameObject: m_ObjectHideFlags: 0 @@ -1318,6 +1392,104 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 +--- !u!1 &1982234244914939222 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6127762978588141374} + - component: {fileID: 9223020690446517615} + m_Layer: 5 + m_Name: Toggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6127762978588141374 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1982234244914939222} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8660056431775407846} + m_Father: {fileID: 8931925833886898116} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 330, y: -10} + m_SizeDelta: {x: 30, y: 30} + m_Pivot: {x: 0, y: 1} +--- !u!114 &9223020690446517615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1982234244914939222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 6903400336302113654} + toggleTransition: 1 + graphic: {fileID: 7815274143235031435} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: HeavenStudio.Editor.EditorSettings, Assembly-CSharp + m_MethodName: + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_IsOn: 1 --- !u!1 &2034840868618852683 GameObject: m_ObjectHideFlags: 0 @@ -2342,7 +2514,7 @@ RectTransform: m_GameObject: {fileID: 3150519645405769653} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.0000798, y: 1.0000798, z: 1.0000798} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2986771144006556445} @@ -2532,6 +2704,219 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &3323996391507515166 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7453481712552360843} + - component: {fileID: 4585733612167735329} + - component: {fileID: 7815274143235031435} + m_Layer: 5 + m_Name: Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7453481712552360843 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3323996391507515166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8660056431775407846} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4585733612167735329 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3323996391507515166} + m_CullTransparentMesh: 1 +--- !u!114 &7815274143235031435 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3323996391507515166} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &3332710794412869504 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1424841260046386091} + - component: {fileID: 97903789572829078} + - component: {fileID: 8407686572462022785} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1424841260046386091 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3332710794412869504} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8931925833886898116} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: -25} + m_SizeDelta: {x: 320, y: 30} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &97903789572829078 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3332710794412869504} + m_CullTransparentMesh: 1 +--- !u!114 &8407686572462022785 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3332710794412869504} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Expanded Input + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8597c35f18a008c428fc5870aec75766, type: 2} + m_sharedMaterial: {fileID: -6562250930271150993, guid: 8597c35f18a008c428fc5870aec75766, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 32 + m_fontSizeBase: 32 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 3 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &3718862281069217461 GameObject: m_ObjectHideFlags: 0 @@ -3137,7 +3522,7 @@ RectTransform: - {fileID: 3918594455780710548} - {fileID: 3918594455337952163} m_Father: {fileID: 3918594454598345480} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -3718,7 +4103,7 @@ RectTransform: - {fileID: 3918594454379110541} - {fileID: 3918594455983756500} m_Father: {fileID: 3918594454598345480} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4002,6 +4387,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 2986771144006556445} + - {fileID: 8931925833886898116} - {fileID: 3918594454557351925} - {fileID: 3918594455809915007} - {fileID: 3918594454393827276} @@ -6457,7 +6843,7 @@ RectTransform: - {fileID: 3918594455165826550} - {fileID: 3918594454453368362} m_Father: {fileID: 3918594454598345480} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -7379,7 +7765,7 @@ RectTransform: - {fileID: 9026175551012134334} - {fileID: 1125639618448182589} m_Father: {fileID: 3918594454598345480} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -9481,6 +9867,83 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5644547737876301921 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8660056431775407846} + - component: {fileID: 8308539996994095635} + - component: {fileID: 6903400336302113654} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8660056431775407846 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5644547737876301921} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7453481712552360843} + m_Father: {fileID: 6127762978588141374} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8308539996994095635 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5644547737876301921} + m_CullTransparentMesh: 1 +--- !u!114 &6903400336302113654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5644547737876301921} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &5719176897546899144 GameObject: m_ObjectHideFlags: 0 @@ -9926,7 +10389,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 5518843884416884346, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} + m_Sprite: {fileID: 3724681018647327355, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -10364,7 +10827,7 @@ RectTransform: m_GameObject: {fileID: 6858963091896668988} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.9998709, y: 0.9998709, z: 0.9998709} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 6031012690915954592} @@ -11923,7 +12386,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 3724681018647327355, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} + m_Sprite: {fileID: 5518843884416884346, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 diff --git a/Assets/Resources/Sprites/Games/SneakySpirits/Animations/Bow.controller b/Assets/Resources/Sprites/Games/SneakySpirits/Animations/Bow.controller index aeebd6fbe..93312780d 100644 --- a/Assets/Resources/Sprites/Games/SneakySpirits/Animations/Bow.controller +++ b/Assets/Resources/Sprites/Games/SneakySpirits/Animations/Bow.controller @@ -26,6 +26,32 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: +--- !u!1102 &-2101240853689792580 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BowRelease + m_Speed: -1 + m_CycleOffset: 1 + 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: fcb659b28562414419f0b631484e6c3f, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: --- !u!91 &9100000 AnimatorController: m_ObjectHideFlags: 0 @@ -85,13 +111,16 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: -2988285179875158312} - m_Position: {x: 200, y: 0, z: 0} + m_Position: {x: 250, y: 120, z: 0} - serializedVersion: 1 m_State: {fileID: 1975330077407404661} - m_Position: {x: 235, y: 65, z: 0} + m_Position: {x: 250, y: 170, z: 0} - serializedVersion: 1 m_State: {fileID: 8713020708790600204} - m_Position: {x: 270, y: 130, z: 0} + m_Position: {x: 250, y: 220, z: 0} + - serializedVersion: 1 + m_State: {fileID: -2101240853689792580} + m_Position: {x: 460, y: 170, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] diff --git a/Assets/Scripts/Games/AirRally/AirRally.cs b/Assets/Scripts/Games/AirRally/AirRally.cs index 34cd3ba2b..2d2ab14af 100644 --- a/Assets/Scripts/Games/AirRally/AirRally.cs +++ b/Assets/Scripts/Games/AirRally/AirRally.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using UnityEngine; using HeavenStudio.Util; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Loaders { using static Minigames; - + public static class RvlBadmintonLoader { public static Minigame AddGame(EventCaller e) @@ -16,16 +17,16 @@ namespace HeavenStudio.Games.Loaders { new GameAction("rally", "Rally") { - preFunction = delegate { AirRally.PreStartRally(e.currentEntity.beat); }, - defaultLength = 2f, + preFunction = delegate { AirRally.PreStartRally(e.currentEntity.beat); }, + defaultLength = 2f, preFunctionLength = 1 }, new GameAction("ba bum bum bum", "Ba Bum Bum Bum") { preFunction = delegate { AirRally.PreStartBaBumBumBum(e.currentEntity.beat, e.currentEntity["toggle"], e.currentEntity["toggle2"]); }, - defaultLength = 6f, + defaultLength = 6f, parameters = new List() - { + { new Param("toggle", true, "Count", "Make Forthington Count"), new Param("toggle2", false, "Alternate Voiceline") }, @@ -94,9 +95,9 @@ namespace HeavenStudio.Games.Loaders new GameAction("forthington voice lines", "Count") { function = delegate { AirRally.instance.ForthVoiceDo(e.currentEntity.beat); }, - preFunction = delegate { AirRally.ForthVoice(e.currentEntity.beat, e.currentEntity["type"]); }, + preFunction = delegate { AirRally.ForthVoice(e.currentEntity.beat, e.currentEntity["type"]); }, parameters = new List() - { + { new Param("type", AirRally.CountSound.one, "Type", "The number Forthington will say"), }, }, @@ -130,7 +131,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("day", "Day/Night Cycle") { - function = delegate + function = delegate { AirRally.instance.SetDayNightCycle(e.currentEntity.beat, e.currentEntity.length, (AirRally.DayNightCycle)e.currentEntity["start"], (AirRally.DayNightCycle)e.currentEntity["end"], @@ -148,7 +149,7 @@ namespace HeavenStudio.Games.Loaders { function = delegate { - AirRally.instance.SetCloudRates(e.currentEntity.beat, e.currentEntity.length, e.currentEntity["main"], e.currentEntity["side"], e.currentEntity["top"], + AirRally.instance.SetCloudRates(e.currentEntity.beat, e.currentEntity.length, e.currentEntity["main"], e.currentEntity["side"], e.currentEntity["top"], e.currentEntity["speed"], e.currentEntity["endSpeed"], e.currentEntity["ease"]); }, resizable = true, @@ -166,7 +167,7 @@ namespace HeavenStudio.Games.Loaders { function = delegate { - AirRally.instance.SetSnowflakeRates(e.currentEntity.beat, e.currentEntity.length, e.currentEntity["cps"], + AirRally.instance.SetSnowflakeRates(e.currentEntity.beat, e.currentEntity.length, e.currentEntity["cps"], e.currentEntity["speed"], e.currentEntity["endSpeed"], e.currentEntity["ease"]); }, resizable = true, @@ -220,9 +221,9 @@ namespace HeavenStudio.Games.Loaders resizable = true, } }, - new List() {"rvl", "normal"}, + new List() { "rvl", "normal" }, "rvlbadminton", "en", - new List() {"en"} + new List() { "en" } ); } } @@ -377,12 +378,23 @@ namespace HeavenStudio.Games { InitClouds(0); } - } + } // Update is called once per frame void Update() { - if(PlayerInput.Pressed() && !IsExpectingInputNow()) + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch && !GameManager.instance.autoplay) + { + if (PlayerInput.GetIsAction(InputAction_BasicPress)) + { + Baxter.DoScaledAnimationAsync(GetDistanceStringAtBeat(Conductor.instance.songPositionInBeatsAsDouble, false, true) + "Ready", 0.5f); + } + if (PlayerInput.GetIsAction(InputAction_BasicRelease)) + { + Baxter.DoScaledAnimationAsync("Idle", 0.5f); + } + } + if (PlayerInput.GetIsAction(InputAction_FlickRelease) && !IsExpectingInputNow(InputAction_FlickRelease)) { Baxter.DoScaledAnimationAsync("Hit", 0.5f); SoundByte.PlayOneShotGame("airRally/swing"); @@ -466,7 +478,7 @@ namespace HeavenStudio.Games spawnedBird.speedMultX = invert ? -xSpeed : xSpeed; spawnedBird.speedMultZ = zSpeed; spawnedBird.transform.position = - new Vector3(invert ? -spawnedBird.transform.position.x : spawnedBird.transform.position.x, + new Vector3(invert ? -spawnedBird.transform.position.x : spawnedBird.transform.position.x, spawnedBird.transform.position.y, startZ); spawnedBird.transform.localScale = new Vector3(invert ? -1 : 1, 1, 1); } @@ -785,7 +797,7 @@ namespace HeavenStudio.Games Forthington.DoScaledAnimationAsync("Hit", 0.5f); }) - }); + }); } public void ReturnObject(double beat, double targetBeat, bool type) @@ -910,13 +922,13 @@ namespace HeavenStudio.Games instance.ForthVoiceAction(beat) }); } - + public static void ForthVoice(double beat, int type) { float offset = countInOffsets[type]; DistanceSound distance = DistanceAtBeat(beat); - + switch (distance) { case DistanceSound.close: @@ -1010,11 +1022,11 @@ namespace HeavenStudio.Games private static bool TryGetLastDistanceEvent(double beat, out RiqEntity distanceEvent) { var allDistances = EventCaller.GetAllInGameManagerList("airRally", new string[] { "set distance" }).FindAll(x => x.beat <= beat); - if (allDistances.Count == 0) + if (allDistances.Count == 0) { distanceEvent = null; return false; - } + } distanceEvent = allDistances[^1]; return true; } @@ -1088,7 +1100,7 @@ namespace HeavenStudio.Games var cloudEvent = EventCaller.GetAllInGameManagerList("airRally", new string[] { "cloud" }).Find(x => x.beat == beat); if (cloudEvent != null) { - SetCloudRates(cloudEvent.beat, cloudEvent.length, cloudEvent["main"], cloudEvent["side"], cloudEvent["top"], + SetCloudRates(cloudEvent.beat, cloudEvent.length, cloudEvent["main"], cloudEvent["side"], cloudEvent["top"], cloudEvent["speed"], cloudEvent["endSpeed"], cloudEvent["ease"]); } cloudManagerMain.Init(); @@ -1099,7 +1111,7 @@ namespace HeavenStudio.Games var snowflakeEvent = EventCaller.GetAllInGameManagerList("airRally", new string[] { "snowflake" }).Find(x => x.beat == beat); if (snowflakeEvent != null) { - SetSnowflakeRates(snowflakeEvent.beat, snowflakeEvent.length, snowflakeEvent["cps"], snowflakeEvent["speed"], + SetSnowflakeRates(snowflakeEvent.beat, snowflakeEvent.length, snowflakeEvent["cps"], snowflakeEvent["speed"], snowflakeEvent["endSpeed"], snowflakeEvent["ease"]); } @@ -1217,7 +1229,7 @@ namespace HeavenStudio.Games string distanceString = GetDistanceStringAtBeat(beat); if (distanceString != "Close") SoundByte.PlayOneShotGame("airRally/whooshForth_" + distanceString, beat + 1, 1, 1, false, false, whooshOffsetsRally[(int)DistanceAtBeat(beat)]); - if (!(silent || isBaBumBeat) || (isCatch && !silent)) + if (!(silent || isBaBumBeat) || (isCatch && !silent)) SoundByte.PlayOneShotGame("airRally/nya_" + distanceString, beat, 1, 1, false, false, nyaOffsets[(int)DistanceAtBeat(beat)]); BeatAction.New(this, new List() @@ -1234,7 +1246,10 @@ namespace HeavenStudio.Games new BeatAction.Action(beat, delegate { string distanceString = GetDistanceStringAtBeat(beat); - Baxter.DoScaledAnimationAsync((distanceString == "Close") ? "CloseReady" : "FarReady", 0.5f); + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch || GameManager.instance.autoplay) + { + Baxter.DoScaledAnimationAsync((distanceString == "Close") ? "CloseReady" : "FarReady", 0.5f); + } SoundByte.PlayOneShotGame("airRally/hitForth_" + distanceString); }), new BeatAction.Action(beat + 1, delegate @@ -1243,9 +1258,9 @@ namespace HeavenStudio.Games }) }); - ScheduleInput(beat, 1f, InputType.STANDARD_DOWN, RallyOnHit, RallyOnMiss, RallyEmpty); - } - + ScheduleInput(beat, 1f, InputAction_FlickPress, RallyOnHit, RallyOnMiss, RallyEmpty); + } + private bool IsBaBumBeat(double beat) { return EventCaller.GetAllInGameManagerList("airRally", new string[] { "ba bum bum bum" }).Find(x => x.beat == beat) != null; @@ -1290,14 +1305,14 @@ namespace HeavenStudio.Games new MultiSound.Sound("airRally/baBumBumBum_" + GetDistanceStringAlt(beat) + "2", beat, offset: GetBaBumOffset(beat, 0)), new MultiSound.Sound("airRally/baBumBumBum_" + GetDistanceStringAlt(beat + 1f) + "3", beat + 1, offset: GetBaBumOffset(beat + 1, 0)), new MultiSound.Sound("airRally/baBumBumBum_" + GetDistanceStringAlt(beat + 2f) + "4", beat + 2, offset: GetBaBumOffset(beat + 2, 0)), - + }); - if (distanceStringTwoBeat != "Close") + if (distanceStringTwoBeat != "Close") { sounds.Add(new MultiSound.Sound("airRally/whooshForth_" + distanceStringTwoBeat + "2", beat + 4, 1, 1, false, whooshOffsetsBaBum[(int)DistanceAtBeat(beat + 2)])); sounds.Add(new MultiSound.Sound("airRally/hitForth_" + distanceStringTwoBeat + "2", beat + 2)); - } + } else { sounds.Add(new MultiSound.Sound("airRally/hitForth_Close", beat + 2)); @@ -1338,31 +1353,34 @@ namespace HeavenStudio.Games BeatAction.New(this, new List() { - new BeatAction.Action(beat, delegate + new BeatAction.Action(beat, delegate { if (isCatch) return; if (isBaBumBeat) BaBumBumBum(beat + 4, countBaBum, altBum); - else RallyRecursion(beat + 6); + else RallyRecursion(beat + 6); }), - new BeatAction.Action(beat + 1f, delegate - { + new BeatAction.Action(beat + 1f, delegate + { Forthington.DoScaledAnimationAsync("Ready", 0.5f); ServeObject(beat + 2f, beat + 4f, true); }), - new BeatAction.Action(beat + 2f, delegate - { - Baxter.DoScaledAnimationAsync(GetDistanceStringAtBeat(beat + 2f, false, true) + "Ready", 0.5f); - } ), + new BeatAction.Action(beat + 2f, delegate + { + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch || GameManager.instance.autoplay) + { + Baxter.DoScaledAnimationAsync(GetDistanceStringAtBeat(beat + 2f, false, true) + "Ready", 0.5f); + } + }), new BeatAction.Action(beat + 3f, delegate { Forthington.DoScaledAnimationAsync("TalkShort", 0.5f); }), new BeatAction.Action(beat + 3.5f, delegate { if(!count || isBaBumBeat) Forthington.DoScaledAnimationAsync("TalkShort", 0.5f); }), new BeatAction.Action(beat + 4f, delegate { Forthington.DoScaledAnimationAsync("Ready", 0.5f); }), }); - ScheduleInput(beat, 4f, InputType.STANDARD_DOWN, LongShotOnHit, RallyOnMiss, RallyEmpty); + ScheduleInput(beat, 4f, InputAction_FlickPress, LongShotOnHit, RallyOnMiss, RallyEmpty); } - private void CatchBirdie() + private void CatchBirdie() { Forthington.DoScaledAnimationAsync("Catch", 0.5f); SoundByte.PlayOneShotGame("airRally/birdieCatch"); @@ -1376,7 +1394,7 @@ namespace HeavenStudio.Games Baxter.DoScaledAnimationAsync("Hit", 0.5f); if (state >= 1 || state <= -1) - { + { ActiveShuttle.DoNearMiss(); hasMissed = true; shuttleActive = false; @@ -1416,7 +1434,7 @@ namespace HeavenStudio.Games Baxter.DoScaledAnimationAsync("Hit", 0.5f); if (state >= 1 || state <= -1) - { + { ActiveShuttle.DoThrough(); hasMissed = true; shuttleActive = false; diff --git a/Assets/Scripts/Games/CatchyTune/Fruit.cs b/Assets/Scripts/Games/CatchyTune/Fruit.cs index ee525f3df..41a16ec52 100644 --- a/Assets/Scripts/Games/CatchyTune/Fruit.cs +++ b/Assets/Scripts/Games/CatchyTune/Fruit.cs @@ -25,8 +25,6 @@ namespace HeavenStudio.Games.Scripts_CatchyTune private string soundText; - private Minigame.Eligible e = new Minigame.Eligible(); - private CatchyTune game; private float beatLength = 4f; @@ -35,8 +33,6 @@ namespace HeavenStudio.Games.Scripts_CatchyTune { game = CatchyTune.instance; - e.gameObject = this.gameObject; - var cond = Conductor.instance; var tempo = cond.songBpm; var playbackSpeed = cond.musicSource.pitch; diff --git a/Assets/Scripts/Games/CheerReaders/CheerReaders.cs b/Assets/Scripts/Games/CheerReaders/CheerReaders.cs index 953531fe6..30ba378ad 100644 --- a/Assets/Scripts/Games/CheerReaders/CheerReaders.cs +++ b/Assets/Scripts/Games/CheerReaders/CheerReaders.cs @@ -177,8 +177,8 @@ namespace HeavenStudio.Games float currentZoomCamLength; private List allCameraEvents = new List(); - const int IAAltDownCat = 4; - const int IAAltUpCat = 5; + const int IAAltDownCat = IAMAXCAT; + const int IAAltUpCat = IAMAXCAT + 1; protected static bool IA_PadAltPress(out double dt) { diff --git a/Assets/Scripts/Games/DogNinja/DogNinja.cs b/Assets/Scripts/Games/DogNinja/DogNinja.cs index b4139bb1c..b14379f2b 100644 --- a/Assets/Scripts/Games/DogNinja/DogNinja.cs +++ b/Assets/Scripts/Games/DogNinja/DogNinja.cs @@ -11,12 +11,13 @@ namespace HeavenStudio.Games.Loaders using static Minigames; public static class NtrDogNinjaLoader { - public static Minigame AddGame(EventCaller eventCaller) { + public static Minigame AddGame(EventCaller eventCaller) + { return new Minigame("dogNinja", "Dog Ninja", "554899", false, false, new List() { new GameAction("Bop", "Bop") { - function = delegate { DogNinja.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity["toggle"]); }, + function = delegate { DogNinja.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity["toggle"]); }, defaultLength = 0.5f, parameters = new List() { @@ -25,7 +26,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("Prepare", "Prepare") { - function = delegate { DogNinja.instance.Prepare(eventCaller.currentEntity.beat); }, + function = delegate { DogNinja.instance.Prepare(eventCaller.currentEntity.beat); }, defaultLength = 0.5f, }, new GameAction("ThrowObject", "Throw Object") @@ -44,7 +45,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("CutEverything", "Cut Everything!") { - function = delegate { var e = eventCaller.currentEntity; DogNinja.instance.CutEverything(e.beat, e["toggle"], e["text"]); }, + function = delegate { var e = eventCaller.currentEntity; DogNinja.instance.CutEverything(e.beat, e["toggle"], e["text"]); }, defaultLength = 0.5f, parameters = new List() { @@ -96,9 +97,9 @@ namespace HeavenStudio.Games.Loaders inactiveFunction = delegate { var e = eventCaller.currentEntity; DogNinja.QueueObject(e.beat, 2, e["typeL"], e["typeR"], true, false);}, }, }, - new List() {"ntr", "normal"}, + new List() { "ntr", "normal" }, "ntrninja", "en", - new List() {} + new List() { } ); } } @@ -119,11 +120,11 @@ namespace HeavenStudio.Games public string sfxNumL; public string sfxNumR; } - + [Header("Animators")] public Animator DogAnim; // dog misc animations public Animator BirdAnim; // bird flying in and out - + [Header("References")] [SerializeField] GameObject ObjectBase; [SerializeField] GameObject FullBird; @@ -131,7 +132,7 @@ namespace HeavenStudio.Games public SpriteRenderer WhichLeftHalf; public SpriteRenderer WhichRightHalf; [SerializeField] TMP_Text cutEverythingText; - + [Header("Curves")] [SerializeField] BezierCurve3D CurveFromLeft; [SerializeField] BezierCurve3D CurveFromRight; @@ -202,7 +203,8 @@ namespace HeavenStudio.Games void OnDestroy() { - if (!Conductor.instance.isPlaying || Conductor.instance.isPaused) { + if (!Conductor.instance.isPlaying || Conductor.instance.isPaused) + { if (queuedThrows.Count > 0) queuedThrows.Clear(); } foreach (var evt in scheduledInputs) @@ -219,12 +221,12 @@ namespace HeavenStudio.Games DogAnim.SetBool("needPrepare", true); } - if (PlayerInput.GetIsAction(InputAction_TouchPress)) + if (PlayerInput.GetIsAction(InputAction_TouchPress) && !GameManager.instance.autoplay) { DogAnim.SetBool("needPrepare", true); DogAnim.DoScaledAnimationAsync("Prepare", 0.5f); } - if (PlayerInput.GetIsAction(InputAction_TouchRelease) && !IsExpectingInputNow(InputAction_Press)) + if (PlayerInput.GetIsAction(InputAction_TouchRelease) && (!IsExpectingInputNow(InputAction_Press)) && (!GameManager.instance.autoplay)) { DogAnim.SetBool("needPrepare", false); DogAnim.DoScaledAnimationAsync("Bop", 0.5f); @@ -234,10 +236,13 @@ namespace HeavenStudio.Games { System.Random rd = new System.Random(); string slice; - int LorR = rd.Next(0,2); - if (LorR < 1) { + int LorR = rd.Next(0, 2); + if (LorR < 1) + { slice = "WhiffRight"; - } else { + } + else + { slice = "WhiffLeft"; } @@ -246,13 +251,14 @@ namespace HeavenStudio.Games DogAnim.SetBool("needPrepare", false); } - if (queuedThrows.Count > 0) { + if (queuedThrows.Count > 0) + { foreach (var obj in queuedThrows) { ThrowObject(obj.beat, obj.direction, obj.typeL, obj.typeR, obj.sfxNumL, obj.sfxNumR); } queuedThrows.Clear(); } } - private void LateUpdate() + private void LateUpdate() { if (Conductor.instance.ReportBeat(ref lastReportedBeat) && DogAnim.IsAnimationNotPlaying() && !dontBop) { @@ -268,27 +274,31 @@ namespace HeavenStudio.Games public static void QueueObject(double beat, int direction, int typeL, int typeR, bool prepare, bool muteThrow) { int ObjSprite = 1; - if (typeL == 0 || typeR == 0) { + if (typeL == 0 || typeR == 0) + { // random object code. it makes a random number from 1-7 and sets that as the sprite System.Random rd = new System.Random(); ObjSprite = rd.Next(1, 7); } - + string sfxNumL = "dogNinja/"; - if (direction is 0 or 2) { + if (direction is 0 or 2) + { sfxNumL += typeL < 7 ? "fruit" : Enum.GetName(typeof(ObjectType), typeL); if (typeL == 0) typeL = ObjSprite; - if (!muteThrow) SoundByte.PlayOneShotGame(sfxNumL+"1", forcePlay: true); - } - - string sfxNumR = "dogNinja/"; - if (direction is 1 or 2) { - sfxNumR += typeR < 7 ? "fruit" : Enum.GetName(typeof(ObjectType), typeR); - if (typeR == 0) typeR = ObjSprite; - if (!(direction == 2 && typeL == typeR) && !muteThrow) SoundByte.PlayOneShotGame(sfxNumR+"1", forcePlay: true); + if (!muteThrow) SoundByte.PlayOneShotGame(sfxNumL + "1", forcePlay: true); } - queuedThrows.Add(new QueuedThrow() { + string sfxNumR = "dogNinja/"; + if (direction is 1 or 2) + { + sfxNumR += typeR < 7 ? "fruit" : Enum.GetName(typeof(ObjectType), typeR); + if (typeR == 0) typeR = ObjSprite; + if (!(direction == 2 && typeL == typeR) && !muteThrow) SoundByte.PlayOneShotGame(sfxNumR + "1", forcePlay: true); + } + + queuedThrows.Add(new QueuedThrow() + { beat = beat, direction = direction, typeL = typeL, @@ -297,14 +307,15 @@ namespace HeavenStudio.Games sfxNumR = sfxNumR, }); - prepare = prepare && PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch && PlayerInput.PlayerHasControl(); + prepare = prepare && (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch || GameManager.instance.autoplay); if (prepare) DogNinja.instance.DogAnim.SetBool("needPrepare", true); } public void ThrowObject(double beat, int direction, int typeL, int typeR, string sfxNumL, string sfxNumR) { // instantiate a game object and give it its variables - if (direction is 0 or 2) { + if (direction is 0 or 2) + { WhichObject.sprite = ObjectTypes[typeL]; ThrowObject ObjectL = Instantiate(ObjectBase, gameObject.transform).GetComponent(); ObjectL.startBeat = beat; @@ -316,7 +327,8 @@ namespace HeavenStudio.Games if (direction == 2) ObjectL.shouldSfx = (typeL == typeR); } - if (direction is 1 or 2) { + if (direction is 1 or 2) + { WhichObject.sprite = ObjectTypes[typeR]; ThrowObject ObjectR = Instantiate(ObjectBase, gameObject.transform).GetComponent(); ObjectR.startBeat = beat; @@ -332,15 +344,19 @@ namespace HeavenStudio.Games public void CutEverything(double beat, bool sound, string customText) { // plays one anim with sfx when it's not on screen, plays a different anim with no sfx when on screen. ez - if (!birdOnScreen) { + if (!birdOnScreen) + { FullBird.SetActive(true); - if (sound) { - SoundByte.PlayOneShotGame(sfxNum+"bird_flap"); + if (sound) + { + SoundByte.PlayOneShotGame(sfxNum + "bird_flap"); } BirdAnim.Play("FlyIn", 0, 0); birdOnScreen = true; cutEverythingText.text = customText; - } else { + } + else + { BirdAnim.Play("FlyOut", 0, 0); birdOnScreen = false; } @@ -356,7 +372,7 @@ namespace HeavenStudio.Games public void HereWeGo(double beat) { MultiSound.Play(new MultiSound.Sound[] { - new MultiSound.Sound(sfxNum+"here", beat), + new MultiSound.Sound(sfxNum+"here", beat), new MultiSound.Sound(sfxNum+"we", beat + 0.5f), new MultiSound.Sound(sfxNum+"go", beat + 1f) }, forcePlay: true); diff --git a/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs b/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs index 011f88473..35daf7a56 100644 --- a/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs +++ b/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs @@ -184,7 +184,7 @@ namespace HeavenStudio.Games } public static FlipperFlop instance; - const int IAAltDownCat = 4; + const int IAAltDownCat = IAMAXCAT; protected static bool IA_TouchPress(out double dt) { diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs index e24b73802..bc792ccb3 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs @@ -50,11 +50,6 @@ namespace HeavenStudio.Games.Scripts_ForkLifter Stab(null); } - if (ForkLifter.instance.EligibleHits.Count == 0) - { - currentHitInList = 0; - } - if (Conductor.instance.ReportBeat(ref lastReportedBeat) && anim.IsAnimationNotPlaying() && shouldBop) { anim.DoScaledAnimationAsync("Player_Bop", 0.5f); diff --git a/Assets/Scripts/Games/GleeClub/ChorusKid.cs b/Assets/Scripts/Games/GleeClub/ChorusKid.cs index 29320763f..cae0aab32 100644 --- a/Assets/Scripts/Games/GleeClub/ChorusKid.cs +++ b/Assets/Scripts/Games/GleeClub/ChorusKid.cs @@ -11,7 +11,7 @@ namespace HeavenStudio.Games.Scripts_GleeClub [SerializeField] SpriteRenderer sr; [SerializeField] bool player; Sound currentSound; - + public float currentPitch = 1f; public float gameSwitchFadeOutTime = 0f; @@ -47,12 +47,12 @@ namespace HeavenStudio.Games.Scripts_GleeClub { disappeared = disappear; sr.color = new Color(1, 1, 1, 1); - if (player && !PlayerInput.Pressing() && !GameManager.instance.autoplay) + if (player && !PlayerInput.GetIsAction(GleeClub.InputAction_BasicPressing) && !GameManager.instance.autoplay) { StartSinging(); game.leftChorusKid.MissPose(); game.middleChorusKid.MissPose(); - } + } } } diff --git a/Assets/Scripts/Games/GleeClub/GleeClub.cs b/Assets/Scripts/Games/GleeClub/GleeClub.cs index 677bb8b85..f55421300 100644 --- a/Assets/Scripts/Games/GleeClub/GleeClub.cs +++ b/Assets/Scripts/Games/GleeClub/GleeClub.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using HeavenStudio.Util; +using HeavenStudio.InputSystem; using Jukebox; namespace HeavenStudio.Games.Loaders @@ -20,7 +21,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("sing", "Sing") { - function = delegate { var e = eventCaller.currentEntity; GleeClub.instance.Sing(e.beat, e.length, e["semiTones"], e["semiTones1"], e["semiTonesPlayer"], + function = delegate { var e = eventCaller.currentEntity; GleeClub.instance.Sing(e.beat, e.length, e["semiTones"], e["semiTones1"], e["semiTonesPlayer"], e["close"], e["repeat"], e["semiTonesLeft2"], e["semiTonesLeft3"], e["semiTonesMiddle2"]); }, resizable = true, parameters = new List() @@ -96,9 +97,9 @@ namespace HeavenStudio.Games.Loaders hidden = true }, }, - new List() {"ntr", "repeat"}, + new List() { "ntr", "repeat" }, "ntrchorus", "en", - new List() {"en"} + new List() { "en" } ); } } @@ -167,7 +168,7 @@ namespace HeavenStudio.Games void Start() { - if (!PlayerInput.Pressing() && Conductor.instance.isPlaying && !GameManager.instance.autoplay) + if (!PlayerInput.GetIsAction(InputAction_BasicPressing) && Conductor.instance.isPlaying && !GameManager.instance.autoplay) { playerChorusKid.StartSinging(); leftChorusKid.MissPose(); @@ -192,20 +193,30 @@ namespace HeavenStudio.Games { if (!playerChorusKid.disappeared) { - if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress)) { playerChorusKid.StopSinging(); leftChorusKid.MissPose(); middleChorusKid.MissPose(); ScoreMiss(); } - if (PlayerInput.PressedUp() && !IsExpectingInputNow(InputType.STANDARD_UP)) + if (PlayerInput.GetIsAction(InputAction_BasicRelease) && !IsExpectingInputNow(InputAction_BasicRelease)) { playerChorusKid.StartSinging(); leftChorusKid.MissPose(); middleChorusKid.MissPose(); ScoreMiss(); } + if (PlayerInput.GetIsAction(InputAction_FlickRelease) && !IsExpectingInputNow(InputAction_FlickRelease)) + { + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch) + { + playerChorusKid.StartYell(); + leftChorusKid.MissPose(); + middleChorusKid.MissPose(); + ScoreMiss(); + } + } } if (Conductor.instance.isPlaying && !Conductor.instance.isPaused) @@ -265,14 +276,14 @@ namespace HeavenStudio.Games playerChorusKid.currentPitch = SoundByte.GetPitchFromSemiTones(semiTonesPlayer, true); leftChorusKid.StartSinging(true); middleChorusKid.StartSinging(true); - if (!PlayerInput.Pressing() || GameManager.instance.autoplay) playerChorusKid.StartSinging(true); + if (!PlayerInput.GetIsAction(InputAction_BasicPressing) || GameManager.instance.autoplay) playerChorusKid.StartSinging(true); else missed = true; } public void TogetherNow(double beat, int semiTones, int semiTones1, int semiTonesPlayer, float conductorPitch) { - if (!playerChorusKid.disappeared) ScheduleInput(beat, 2.5f, InputType.STANDARD_UP, JustTogetherNow, Out, Out); - if (!playerChorusKid.disappeared) ScheduleInput(beat, 3.5f, InputType.STANDARD_DOWN, JustTogetherNowClose, MissBaton, Out); + if (!playerChorusKid.disappeared) ScheduleInput(beat, 2.5f, InputAction_FlickRelease, JustTogetherNow, Out, Out); + if (!playerChorusKid.disappeared) ScheduleInput(beat, 3.5f, InputAction_BasicPress, JustTogetherNowClose, MissBaton, Out); float pitch = SoundByte.GetPitchFromSemiTones(semiTones, true); float pitch1 = SoundByte.GetPitchFromSemiTones(semiTones1, true); currentYellPitch = SoundByte.GetPitchFromSemiTones(semiTonesPlayer, true); @@ -378,7 +389,7 @@ namespace HeavenStudio.Games { new BeatAction.Action(beat + length + sing.startBeat, delegate { - if (sing.closeMouth != (int)MouthOpenClose.OnlyClose) + if (sing.closeMouth != (int)MouthOpenClose.OnlyClose) { middleChorusKid.currentPitch = pitch; middleChorusKid.StartSinging(); @@ -387,15 +398,15 @@ namespace HeavenStudio.Games leftChorusKid.currentPitch = pitchLeft2; leftChorusKid.StartSinging(); } - } + } }), new BeatAction.Action(beat + length + sing.startBeat + sing.length, delegate { - if (sing.closeMouth != (int)MouthOpenClose.OnlyOpen) + if (sing.closeMouth != (int)MouthOpenClose.OnlyOpen) { middleChorusKid.StopSinging(); if (sing.repeating) leftChorusKid.StopSinging(); - } + } }), new BeatAction.Action(beat + length + sing.startBeat + beatInterval, delegate { @@ -440,7 +451,7 @@ namespace HeavenStudio.Games public void Baton(double beat) { missed = false; - if (!playerChorusKid.disappeared) ScheduleInput(beat, 1, InputType.STANDARD_DOWN, JustBaton, MissBaton, Out); + if (!playerChorusKid.disappeared) ScheduleInput(beat, 1, InputAction_BasicPress, JustBaton, MissBaton, Out); BeatAction.New(instance, new List() { new BeatAction.Action(beat, delegate diff --git a/Assets/Scripts/Games/GleeClub/GleeClubSingInput.cs b/Assets/Scripts/Games/GleeClub/GleeClubSingInput.cs index 968564460..89ff9b8a7 100644 --- a/Assets/Scripts/Games/GleeClub/GleeClubSingInput.cs +++ b/Assets/Scripts/Games/GleeClub/GleeClubSingInput.cs @@ -22,8 +22,8 @@ namespace HeavenStudio.Games.Scripts_GleeClub { shouldClose = close != (int)GleeClub.MouthOpenClose.OnlyOpen; shouldOpen = close != (int)GleeClub.MouthOpenClose.OnlyClose; - if (shouldOpen) game.ScheduleInput(beat - 1, 1, InputType.STANDARD_UP, Just, Miss, Out); - if (shouldClose) game.ScheduleInput(beat, length, InputType.STANDARD_DOWN, JustClose, MissClose, Out); + if (shouldOpen) game.ScheduleInput(beat - 1, 1, GleeClub.InputAction_BasicRelease, Just, Miss, Out); + if (shouldClose) game.ScheduleInput(beat, length, GleeClub.InputAction_BasicPress, JustClose, MissClose, Out); } public void Just(PlayerActionEvent caller, float state) diff --git a/Assets/Scripts/Games/KarateMan/KarateManJoe.cs b/Assets/Scripts/Games/KarateMan/KarateManJoe.cs index ae59caaf3..1273c56c3 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManJoe.cs @@ -42,8 +42,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan bool canEmote = false; public int wantFace = 0; - public bool inSpecial { get { return inCombo || lockedInCombo || - Conductor.instance.GetPositionFromBeat(lastChargeTime, 2.75f) <= 0.25f || inNuriLock; } } + public bool inSpecial + { + get + { + return inCombo || lockedInCombo || + Conductor.instance.GetPositionFromBeat(lastChargeTime, 2.75f) <= 0.25f || inNuriLock; + } + } public bool inNuriLock { get { return (Conductor.instance.songPositionInBeatsAsDouble >= noNuriJabTime && Conductor.instance.songPositionInBeatsAsDouble < noNuriJabTime + 1f); } } private void Awake() @@ -73,7 +79,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (canEmote && wantFace >= 0) { SetFaceExpressionForced(wantFace); - if (wantFace == (int) KarateMan.KarateManFaces.Surprise) wantFace = -1; + if (wantFace == (int)KarateMan.KarateManFaces.Surprise) wantFace = -1; } if (cond.songPositionInBeatsAsDouble >= noNuriJabTime && cond.songPositionInBeatsAsDouble < noNuriJabTime + 1f) @@ -143,7 +149,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan SoundByte.PlayOneShotGame("karateman/swingNoHit", forcePlay: true); } } - + if (PlayerInput.AltPressed() && KarateMan.IsComboEnable && !inSpecial) { if (!KarateMan.instance.IsExpectingInputNow(InputType.STANDARD_ALT_DOWN)) @@ -284,12 +290,12 @@ namespace HeavenStudio.Games.Scripts_KarateMan new BeatAction.Action(beat + 0.75f, delegate { shouldComboId = -2; ComboMiss(beat + 0.75f); }), }); - MultiSound.Play(new MultiSound.Sound[] + MultiSound.Play(new MultiSound.Sound[] { - new MultiSound.Sound("karateman/swingNoHit", beat), - new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.25f), - new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.5f), - new MultiSound.Sound("karateman/comboMiss", beat + 0.75f), + new MultiSound.Sound("karateman/swingNoHit", beat), + new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.25f), + new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.5f), + new MultiSound.Sound("karateman/comboMiss", beat + 0.75f), }, forcePlay: true); } @@ -299,7 +305,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan unPrepareTime = double.MinValue; BeatAction.New(this, new List() { - new BeatAction.Action(beat, delegate { + new BeatAction.Action(beat, delegate { if (wantKick) { wantKick = false; diff --git a/Assets/Scripts/Games/KarateMan/KarateManPot.cs b/Assets/Scripts/Games/KarateMan/KarateManPot.cs index 9f8726a1e..c0635550d 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManPot.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManPot.cs @@ -34,7 +34,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan [SerializeField] Color[] ItemCookingLidMap; public bool KickBarrelContent = false; - public int OnHitExpression = (int) KarateMan.KarateManFaces.Normal; + public int OnHitExpression = (int)KarateMan.KarateManFaces.Normal; public int comboId = -1; static int _lastCombo = -1; @@ -42,7 +42,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan public static int GetNewCombo() { _lastCombo++; return _lastCombo; } public static void ResetLastCombo() { _lastCombo = -1; } - public enum ItemType { + public enum ItemType + { Pot, // path 1 Bulb, // path 1 Rock, // path 1 @@ -66,7 +67,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan CookingLid, //only used for hit } - public enum FlyStatus { + public enum FlyStatus + { Fly, Hit, NG, @@ -84,12 +86,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan public SpriteRenderer BulbLight; - public void SetBulbColor(Color c) { - effectTint = c; + public void SetBulbColor(Color c) + { + effectTint = c; BulbLight.color = c; } - float ProgressToHitPosition(float progress) { + float ProgressToHitPosition(float progress) + { return progress + (HitPositionOffset[path] - 0.5f); } @@ -103,7 +107,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan //https://www.desmos.com/calculator/ycn9v62i4f float offset = HitPositionOffset[path]; - float flyHeight = (progressToHitPosition*(progressToHitPosition-1f))/(offset*(offset-1f)); + float flyHeight = (progressToHitPosition * (progressToHitPosition - 1f)) / (offset * (offset - 1f)); float floorHeight = HitPosition[0].position.y; Vector3 startPosition = hitPosition + StartPositionOffset[path]; @@ -114,7 +118,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan Mathf.Lerp(startPosition.z, endPosition.z, progress) ); - if (progress >= 0.5f && flyPosition.y < HitPosition[0].position.y) { + if (progress >= 0.5f && flyPosition.y < HitPosition[0].position.y) + { flyPosition.y = floorHeight; } return flyPosition; @@ -154,7 +159,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan delta = KarateMan.ItemColor; break; } - for (int i = 0; i < cellRenderers.Length; i++) { + for (int i = 0; i < cellRenderers.Length; i++) + { SpriteRenderer r = cellRenderers[i]; if (r.material != null) { @@ -180,8 +186,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan switch (type) { case ItemType.ComboPot1: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboStartJustOrNg, ComboStartThrough, ComboStartOut, CanCombo); - OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboStartWrongAction, ComboStartOut, ComboStartOut, CanHit); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboStartJustOrNg, ComboStartThrough, ComboStartOut, CanCombo); + OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboStartWrongAction, ComboStartOut, ComboStartOut, CanHit); path = 1; break; case ItemType.ComboPot2: @@ -202,24 +208,24 @@ namespace HeavenStudio.Games.Scripts_KarateMan BeatAction.New(this, new List() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) }); break; case ItemType.ComboBarrel: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_UP, ComboEndJustOrNg, ComboEndThrough, ComboEndOut, CanComboEnd); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_UP, ComboEndJustOrNg, ComboEndThrough, ComboEndOut, CanComboEnd); path = 5; break; case ItemType.KickBarrel: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, KickChargeJustOrNg, ItemThrough, ItemOut, CanCombo); - OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut, CanCombo); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, KickChargeJustOrNg, ItemThrough, ItemOut, CanCombo); + OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut, CanCombo); path = 1; comboId = -1; break; case ItemType.KickBomb: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 0.75f, InputType.STANDARD_UP | InputType.DIRECTION_UP, KickJustOrNg, KickThrough, KickOut, CanKick); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 0.75f, InputType.STANDARD_UP | InputType.DIRECTION_UP, KickJustOrNg, KickThrough, KickOut, CanKick); CurrentCurve = ItemCurves[6]; curveTargetBeat = 2 * 0.75f; path = 1; comboId = -1; break; case ItemType.KickBall: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 0.75f, InputType.STANDARD_UP | InputType.DIRECTION_UP, KickJustOrNg, KickThrough, KickOut, CanKick); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 0.75f, InputType.STANDARD_UP | InputType.DIRECTION_UP, KickJustOrNg, KickThrough, KickOut, CanKick); CurrentCurve = ItemCurves[6]; curveTargetBeat = 2 * 0.75f; path = 1; @@ -233,14 +239,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan comboId = -1; break; case ItemType.Bomb: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut, CanHit); - OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut, CanHit); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut, CanHit); + OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut, CanHit); path = 1; comboId = -1; break; default: - OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut, CanHit); - OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut, CanHit); + OnHit = KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut, CanHit); + OnHitWrongAction = KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut, CanHit); path = 1; comboId = -1; break; @@ -283,7 +289,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan prog = cond.GetPositionFromBeat(startBeat, curveTargetBeat); transform.position = CurrentCurve.GetPoint(Mathf.Min(prog, 1f)); } - + if (type == ItemType.Bomb && cond.songPositionInBeatsAsDouble >= startBeat + 2f) { ParticleSystem p = Instantiate(HitParticles[7], transform.position, Quaternion.identity, KarateMan.instance.ItemHolder); @@ -293,7 +299,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan GameObject.Destroy(gameObject); return; } - else if (prog >= 2f || (ItemKickable() && prog >= 1f)) { + else if (prog >= 2f || (ItemKickable() && prog >= 1f)) + { if (type == ItemType.KickBomb) { ParticleSystem p = Instantiate(HitParticles[7], ItemCurves[6].GetPoint(1f), Quaternion.identity, KarateMan.instance.ItemHolder); @@ -303,12 +310,13 @@ namespace HeavenStudio.Games.Scripts_KarateMan GameObject.Destroy(gameObject); return; } - else if (CurrentCurve == null && prog < 1f - ItemSlipRt[path]) { - transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (125f * Time.deltaTime * (1/cond.pitchedSecPerBeat))); + else if (CurrentCurve == null && prog < 1f - ItemSlipRt[path]) + { + transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (125f * Time.deltaTime * (1 / cond.pitchedSecPerBeat))); } else if (CurrentCurve != null && prog < 1f) { - transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-90f * Time.deltaTime * (1/cond.pitchedSecPerBeat))); + transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-90f * Time.deltaTime * (1 / cond.pitchedSecPerBeat))); } break; case FlyStatus.Hit: @@ -324,7 +332,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan SoundByte.PlayOneShotGame("karateman/bombBreak", volume: 0.25f); return; } - else if (cond.songPositionInBeatsAsDouble >= startBeat + Mathf.Max(2f, curveTargetBeat) || CurrentCurve == null) { + else if (cond.songPositionInBeatsAsDouble >= startBeat + Mathf.Max(2f, curveTargetBeat) || CurrentCurve == null) + { if (type == ItemType.KickBomb) { @@ -333,16 +342,17 @@ namespace HeavenStudio.Games.Scripts_KarateMan } else if (type == ItemType.KickBall && cond.songPositionInBeatsAsDouble < startBeat + curveTargetBeat + 1f) return; - + GameObject.Destroy(ShadowInstance.gameObject); GameObject.Destroy(gameObject); return; } - else { + else + { if (prog <= 1f) { transform.position = CurrentCurve.GetPoint(prog); - transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-270f * Time.deltaTime * (1/cond.pitchedSecPerBeat))); + transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-270f * Time.deltaTime * (1 / cond.pitchedSecPerBeat))); } else { @@ -363,7 +373,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan GameObject.Destroy(gameObject); return; } - else if (cond.songPositionInBeatsAsDouble >= startBeat + Mathf.Max(2f, curveTargetBeat) || (ItemKickable() && prog >= 1f) || CurrentCurve == null) { + else if (cond.songPositionInBeatsAsDouble >= startBeat + Mathf.Max(2f, curveTargetBeat) || (ItemKickable() && prog >= 1f) || CurrentCurve == null) + { if (type == ItemType.KickBomb) { ParticleSystem p = Instantiate(HitParticles[7], ItemCurves[8].GetPoint(1f), Quaternion.identity, KarateMan.instance.ItemHolder); @@ -373,11 +384,12 @@ namespace HeavenStudio.Games.Scripts_KarateMan GameObject.Destroy(gameObject); return; } - else { + else + { if (prog <= 1f) { transform.position = CurrentCurve.GetPoint(prog); - transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-90f * Time.deltaTime * (1/cond.pitchedSecPerBeat))); + transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-90f * Time.deltaTime * (1 / cond.pitchedSecPerBeat))); } else { @@ -425,7 +437,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan hitMark.transform.localPosition = transform.position; else hitMark.transform.position = HitPosition[path].position; - + hitMark.SetActive(true); } @@ -439,7 +451,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan { case ItemType.Bulb: CurrentCurve = ItemCurves[straight ? 1 : 0]; - curveTargetBeat = straight ? 1f : 1.5f;; + curveTargetBeat = straight ? 1f : 1.5f; ; SoundByte.PlayOneShotGame("karateman/lightbulbHit", forcePlay: true); p = Instantiate(HitParticles[5], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), game.ItemHolder); @@ -673,7 +685,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan break; case ItemType.ComboPot3: joe.ComboSequence(0); - if (joe.GetComboId() != comboId) {} + if (joe.GetComboId() != comboId) { } else { ItemHitEffect(); @@ -681,7 +693,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan break; case ItemType.ComboPot4: //if the button isn't held anymore make Joe spin - if (joe.GetComboId() != comboId) { + if (joe.GetComboId() != comboId) + { joe.ComboMiss(startBeat + 1f); SoundByte.PlayOneShotGame("karateman/comboMiss", forcePlay: true); joe.SetShouldComboId(-2); @@ -695,7 +708,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan break; case ItemType.ComboPot5: joe.ComboSequence(2); - if (joe.GetComboId() != comboId) {} + if (joe.GetComboId() != comboId) { } else { ItemHitEffect(); @@ -708,7 +721,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan void DoHitExpression(double offset) { - if (OnHitExpression == (int) KarateMan.KarateManFaces.Normal) + if (OnHitExpression == (int)KarateMan.KarateManFaces.Normal) return; var joe = KarateMan.instance.Joe; BeatAction.New(joe, new List() @@ -732,7 +745,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan { if (GameManager.instance.currentGame != "karateman") return; var joe = KarateMan.instance.Joe; - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { bool straight = joe.Punch(ItemPunchHand()); startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; @@ -740,7 +754,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan SoundByte.PlayOneShot("miss"); status = FlyStatus.NG; - joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad); + joe.SetFaceExpression((int)KarateMan.KarateManFaces.Sad); BeatAction.New(joe, new List() { new BeatAction.Action(startBeat + 2f, delegate { @@ -750,7 +764,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan KarateMan.instance.Nori.DoNG(); } - else { + else + { if (KarateMan.instance.IsNoriActive) { if (ItemNeedNori() && KarateMan.instance.NoriPerformance < 0.6f) @@ -774,21 +789,23 @@ namespace HeavenStudio.Games.Scripts_KarateMan } public void ItemWrongAction(PlayerActionEvent caller, float state) - { + { if (GameManager.instance.currentGame != "karateman") return; if (!KarateMan.IsComboEnable) return; //hitting a normal object with the alt input //WHEN SCORING THIS IS A MISS var joe = KarateMan.instance.Joe; joe.ForceFailCombo(Conductor.instance.songPositionInBeatsAsDouble); - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); status = FlyStatus.NG; } - else { + else + { ItemHitEffect(); } @@ -804,7 +821,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan KarateMan.instance.Nori.DoThrough(); } - public void ItemOut(PlayerActionEvent caller) {} + public void ItemOut(PlayerActionEvent caller) { } public void ItemThrough(PlayerActionEvent caller) { @@ -813,7 +830,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (status != FlyStatus.Fly || gameObject == null) return; BeatAction.New(joe, new List() { - new BeatAction.Action(startBeat + 2f, delegate { + new BeatAction.Action(startBeat + 2f, delegate { joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise); SoundByte.PlayOneShotGame("karateman/karate_through", forcePlay: true); }), @@ -841,7 +858,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.Punch(1); joe.SetComboId(comboId); joe.SetShouldComboId(comboId); - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; @@ -850,14 +868,15 @@ namespace HeavenStudio.Games.Scripts_KarateMan KarateMan.instance.Nori.DoNG(); } - else { + else + { ItemHitEffect(); KarateMan.instance.Nori.DoHit(); - } + } } - public void ComboStartOut(PlayerActionEvent caller) {} - public void ComboStartThrough(PlayerActionEvent caller) + public void ComboStartOut(PlayerActionEvent caller) { } + public void ComboStartThrough(PlayerActionEvent caller) { var joe = KarateMan.instance.Joe; if (GameManager.instance.currentGame != "karateman") return; @@ -879,20 +898,22 @@ namespace HeavenStudio.Games.Scripts_KarateMan } public void ComboStartWrongAction(PlayerActionEvent caller, float state) - { + { if (GameManager.instance.currentGame != "karateman") return; //hitting a combo start with the normal input //WHEN SCORING THIS IS A MISS var joe = KarateMan.instance.Joe; bool straight = joe.Punch(ItemPunchHand()); - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); status = FlyStatus.NG; } - else { + else + { ItemHitEffect(straight); } KarateMan.instance.Nori.DoThrough(); @@ -912,7 +933,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.SetComboId(-1); joe.SetShouldComboId(-1); joe.ComboSequence(3); - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[5]; curveTargetBeat = 1f; @@ -931,14 +953,16 @@ namespace HeavenStudio.Games.Scripts_KarateMan KarateMan.instance.Nori.DoNG(); } - else { + else + { DoHitExpression(startBeat + 1.5f); ItemHitEffect(); KarateMan.instance.Nori.DoHit(); } } - public void ComboEndOut(PlayerActionEvent caller) { + public void ComboEndOut(PlayerActionEvent caller) + { if (GameManager.instance.currentGame != "karateman") return; var joe = KarateMan.instance.Joe; if (status == FlyStatus.Fly && joe.inCombo && joe.GetComboId() == comboId && joe.comboWaiting) @@ -952,7 +976,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan OnHit.CanHit(false); } - public void ComboEndThrough(PlayerActionEvent caller) + public void ComboEndThrough(PlayerActionEvent caller) { if (GameManager.instance.currentGame != "karateman") return; if (status != FlyStatus.Fly || gameObject == null) return; @@ -961,7 +985,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan { BeatAction.New(joe, new List() { - new BeatAction.Action(startBeat + 2f, delegate { + new BeatAction.Action(startBeat + 2f, delegate { joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise); }), new BeatAction.Action(startBeat + 5f, delegate { @@ -972,19 +996,19 @@ namespace HeavenStudio.Games.Scripts_KarateMan } else { - joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad); + joe.SetFaceExpression((int)KarateMan.KarateManFaces.VerySad); BeatAction.New(joe, new List() { - new BeatAction.Action(startBeat + 1.5f, delegate { + new BeatAction.Action(startBeat + 1.5f, delegate { joe.inCombo = false; joe.SetComboId(-1); joe.SetShouldComboId(-1); joe.ComboSequence(4); }), - new BeatAction.Action(startBeat + 2f, delegate { + new BeatAction.Action(startBeat + 2f, delegate { joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad); }), - new BeatAction.Action(startBeat + 5f, delegate { + new BeatAction.Action(startBeat + 5f, delegate { joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal); }) }); @@ -999,14 +1023,15 @@ namespace HeavenStudio.Games.Scripts_KarateMan var joe = KarateMan.instance.Joe; joe.Punch(ItemPunchHand()); - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); status = FlyStatus.NG; - joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad); + joe.SetFaceExpression((int)KarateMan.KarateManFaces.Sad); BeatAction.New(joe, new List() { new BeatAction.Action(startBeat + 2f, delegate { @@ -1015,7 +1040,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan }); KarateMan.instance.Nori.DoNG(); } - else { + else + { joe.StartKickCharge(startBeat + 1.25f); ItemHitEffect(); status = FlyStatus.Hit; @@ -1023,7 +1049,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan } } - public void KickChargeOut(PlayerActionEvent caller) {} + public void KickChargeOut(PlayerActionEvent caller) { } public void KickChargeThrough(PlayerActionEvent caller) { @@ -1058,7 +1084,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan var joe = KarateMan.instance.Joe; joe.Kick(Conductor.instance.songPositionInBeatsAsDouble); - if (state <= -1f || state >= 1f) { + if (state <= -1f || state >= 1f) + { startBeat = Conductor.instance.songPositionInBeatsAsDouble; CurrentCurve = ItemCurves[8]; curveTargetBeat = 1f; @@ -1079,7 +1106,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (type == ItemType.KickBomb) joe.RemoveBombGlow(startBeat + 0.75f); } - else { + else + { DoHitExpression(startBeat + 2f); ItemHitEffect(); status = FlyStatus.Hit; @@ -1090,7 +1118,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan } } - public void KickOut(PlayerActionEvent caller) {} + public void KickOut(PlayerActionEvent caller) { } public void KickThrough(PlayerActionEvent caller) { @@ -1098,10 +1126,10 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (status != FlyStatus.Fly || gameObject == null) return; BeatAction.New(KarateMan.instance.Joe, new List() { - new BeatAction.Action(startBeat + 2f, delegate { + new BeatAction.Action(startBeat + 2f, delegate { KarateMan.instance.Joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad); }), - new BeatAction.Action(startBeat + 4f, delegate { + new BeatAction.Action(startBeat + 4f, delegate { KarateMan.instance.Joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal); }) }); diff --git a/Assets/Scripts/Games/Kitties/Kitties.cs b/Assets/Scripts/Games/Kitties/Kitties.cs index d109ab58a..0d5019982 100644 --- a/Assets/Scripts/Games/Kitties/Kitties.cs +++ b/Assets/Scripts/Games/Kitties/Kitties.cs @@ -111,8 +111,8 @@ namespace HeavenStudio.Games public static Kitties instance; - const int IAAltDownCat = 4; - const int IAAltUpCat = 5; + const int IAAltDownCat = IAMAXCAT; + const int IAAltUpCat = IAMAXCAT + 1; protected static bool IA_PadAltPress(out double dt) { diff --git a/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs b/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs index da4cf7ec0..471458b8c 100644 --- a/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs +++ b/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs @@ -237,9 +237,9 @@ namespace HeavenStudio.Games Custom, } - const int IAAltDownCat = 4; - const int IALeft = 5; - const int IARight = 6; + const int IAAltDownCat = IAMAXCAT; + const int IALeft = IAMAXCAT + 1; + const int IARight = IAMAXCAT + 2; protected static bool IA_PadLeft(out double dt) { return PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt); diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index fd53c2775..53b8e9f2f 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -11,30 +11,17 @@ namespace HeavenStudio.Games { public class Minigame : MonoBehaviour { - public static double ngEarlyTime = 0.075f, justEarlyTime = 0.06f, aceEarlyTime = 0.01f, aceLateTime = 0.01f, justLateTime = 0.06f, ngLateTime = 0.075f; + public static double ngEarlyTime = 0.085f, justEarlyTime = 0.06f, aceEarlyTime = 0.01f, aceLateTime = 0.01f, justLateTime = 0.06f, ngLateTime = 0.085f; public static float rankHiThreshold = 0.8f, rankOkThreshold = 0.6f; [SerializeField] public SoundSequence.SequenceKeyValue[] SoundSequences; - public List EligibleHits = new List(); - - [System.Serializable] - public class Eligible - { - public GameObject gameObject; - public bool early; - public bool perfect; - public bool late; - public bool notPerfect() { return early || late; } - public bool eligible() { return early || perfect || late; } - public float createBeat; - } - #region Premade Input Actions protected const int IAEmptyCat = -1; protected const int IAPressCat = 0; protected const int IAReleaseCat = 1; protected const int IAPressingCat = 2; protected const int IAFlickCat = 3; + protected const int IAMAXCAT = 4; protected static bool IA_Empty(out double dt) { @@ -266,6 +253,7 @@ namespace HeavenStudio.Games //Get the scheduled input that should happen the **Soonest** //Can return null if there's no scheduled inputs // remark: need a check for specific button(s) + [Obsolete("Use GetClosestScheduledInput InputAction or InputAction category instead")] public PlayerActionEvent GetClosestScheduledInput(InputType input = InputType.ANY) { PlayerActionEvent closest = null; @@ -339,6 +327,7 @@ namespace HeavenStudio.Games //Hasn't been tested yet. *Should* work. //Can be used to detect if the user is expected to input something now or not //Useful for strict call and responses games like Tambourine + [Obsolete("Use IsExpectingInputNow InputAction or InputAction category instead")] public bool IsExpectingInputNow(InputType wantInput = InputType.ANY) { PlayerActionEvent input = GetClosestScheduledInput(wantInput); @@ -423,24 +412,6 @@ namespace HeavenStudio.Games } } - public int MultipleEventsAtOnce() - { - int sameTime = 0; - for (int i = 0; i < EligibleHits.Count; i++) - { - float createBeat = EligibleHits[i].createBeat; - if (EligibleHits.FindAll(c => c.createBeat == createBeat).Count > 0) - { - sameTime += 1; - } - } - - if (sameTime == 0 && EligibleHits.Count > 0) - sameTime = 1; - - return sameTime; - } - public static MultiSound PlaySoundSequence(string game, string name, double startBeat, params SoundSequence.SequenceParams[] args) { Minigames.Minigame gameInfo = GameManager.instance.GetGameInfo(game); diff --git a/Assets/Scripts/Games/PajamaParty/PajamaParty.cs b/Assets/Scripts/Games/PajamaParty/PajamaParty.cs index 8150e4db4..ca0ed79cc 100644 --- a/Assets/Scripts/Games/PajamaParty/PajamaParty.cs +++ b/Assets/Scripts/Games/PajamaParty/PajamaParty.cs @@ -112,8 +112,8 @@ namespace HeavenStudio.Games NoAwake, } - const int IAAltDownCat = 4; - const int IAAltUpCat = 5; + const int IAAltDownCat = IAMAXCAT; + const int IAAltUpCat = IAMAXCAT + 1; protected static bool IA_PadAltPress(out double dt) { diff --git a/Assets/Scripts/Games/PlayerActionEvent.cs b/Assets/Scripts/Games/PlayerActionEvent.cs index c08ffcb35..ccf9b9fcb 100644 --- a/Assets/Scripts/Games/PlayerActionEvent.cs +++ b/Assets/Scripts/Games/PlayerActionEvent.cs @@ -28,7 +28,7 @@ namespace HeavenStudio.Games public double timer; public bool isEligible = true; - public bool canHit = true; //Indicates if you can still hit the cue or not. If set to false, it'll guarantee a miss + public bool canHit = true; //Indicates if you can still hit the cue or not. If set to false, it'll guarantee a miss public bool enabled = true; //Indicates if the PlayerActionEvent is enabled. If set to false, it'll not trigger any events and destroy itself AFTER it's not relevant anymore public bool triggersAutoplay = true; bool lockedByEvent = false; @@ -41,11 +41,11 @@ namespace HeavenStudio.Games public InputType inputType; //The type of input. Check the InputType class to see a list of all of them public bool perfectOnly = false; //Indicates that the input only recognize perfect inputs. - + public bool countsForAccuracy = true; //Indicates if the input counts for the accuracy or not. If set to false, it'll not be counted in the accuracy calculation public void setHitCallback(ActionEventCallbackState OnHit) - { + { this.OnHit = OnHit; } @@ -59,7 +59,7 @@ namespace HeavenStudio.Games this.IsHittable = IsHittable; } - public void Enable() { enabled = true; } + public void Enable() { enabled = true; } public void Disable() { enabled = false; } public void QueueDeletion() { markForDeletion = true; } @@ -104,7 +104,7 @@ namespace HeavenStudio.Games public void Update() { if (markForDeletion) CleanUp(); - if(!Conductor.instance.NotStopped()) CleanUp(); // If the song is stopped entirely in the editor, destroy itself as we don't want duplicates + if (!Conductor.instance.NotStopped()) CleanUp(); // If the song is stopped entirely in the editor, destroy itself as we don't want duplicates if (noAutoplay && autoplayOnly) autoplayOnly = false; if (noAutoplay && triggersAutoplay) triggersAutoplay = false; @@ -128,7 +128,7 @@ namespace HeavenStudio.Games { return; } - + if (!autoplayOnly && (IsHittable == null || IsHittable != null && IsHittable()) && IsCorrectInput(out double dt)) { normalizedTime -= dt; @@ -148,8 +148,10 @@ namespace HeavenStudio.Games } } - public void LateUpdate() { - if (markForDeletion) { + public void LateUpdate() + { + if (markForDeletion) + { allEvents.Remove(this); OnDestroy(this); Destroy(this.gameObject); @@ -162,7 +164,7 @@ namespace HeavenStudio.Games private bool CheckEventLock() { - foreach(PlayerActionEvent toCompare in allEvents) + foreach (PlayerActionEvent toCompare in allEvents) { if (toCompare == this) continue; if (toCompare.autoplayOnly) continue; @@ -185,7 +187,7 @@ namespace HeavenStudio.Games // compare distance between current time and the events // events that happen at the exact same time with the exact same inputs will return true - if (Math.Abs(t1 - songPos) > Math.Abs(t2 - songPos)) + if (Math.Abs(t1 - songPos) > Math.Abs(t2 - songPos)) return false; else if (t1 != t2) // if they are the same time, we don't want to lock the event toCompare.lockedByEvent = true; @@ -195,7 +197,7 @@ namespace HeavenStudio.Games private void AutoplayInput(double normalizedTime, bool autoPlay = false) { - if (triggersAutoplay && (GameManager.instance.autoplay || autoPlay) && GameManager.instance.canInput && normalizedTime >= 1f - (Time.deltaTime*0.5f)) + if (triggersAutoplay && (GameManager.instance.autoplay || autoPlay) && GameManager.instance.canInput && normalizedTime >= 1f - (Time.deltaTime * 0.5f)) { AutoplayEvent(); if (!autoPlay) @@ -252,7 +254,7 @@ namespace HeavenStudio.Games } //The state parameter is either -1 -> Early, 0 -> Perfect, 1 -> Late - public void Hit(double state, double time) + public void Hit(double state, double time) { if (OnHit != null && enabled) { @@ -262,7 +264,7 @@ namespace HeavenStudio.Games int offset = Mathf.CeilToInt((float)normalized * 1000); GameManager.instance.AvgInputOffset = offset; state = System.Math.Max(-1.0, System.Math.Min(1.0, state)); - OnHit(this, (float) state); + OnHit(this, (float)state); CleanUp(); if (countsForAccuracy && !(noAutoplay || autoplayOnly) && isEligible) @@ -278,9 +280,10 @@ namespace HeavenStudio.Games GoForAPerfect.instance.Hit(); } } - } else + } + else { - Blank(); + Blank(); } } } @@ -348,7 +351,7 @@ namespace HeavenStudio.Games public void Blank() { - if(OnBlank != null && enabled && !autoplayOnly) + if (OnBlank != null && enabled && !autoplayOnly) { OnBlank(this); } diff --git a/Assets/Scripts/Games/RhythmRally/Paddlers.cs b/Assets/Scripts/Games/RhythmRally/Paddlers.cs index 20c9dc171..ece5cfebb 100644 --- a/Assets/Scripts/Games/RhythmRally/Paddlers.cs +++ b/Assets/Scripts/Games/RhythmRally/Paddlers.cs @@ -5,6 +5,7 @@ using UnityEngine; using DG.Tweening; using HeavenStudio.Util; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Scripts_RhythmRally { @@ -25,12 +26,25 @@ namespace HeavenStudio.Games.Scripts_RhythmRally void Update() { - if (!game.served || game.missed || !game.started) return; - - if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch && !GameManager.instance.autoplay) + { + if (PlayerInput.GetIsAction(RhythmRally.InputAction_BasicPress)) + { + playerAnim.Play("Ready1"); + } + if (PlayerInput.GetIsAction(RhythmRally.InputAction_BasicRelease)) + { + playerAnim.Play("UnReady1"); + } + } + else + { + if (!game.served || game.missed || !game.started) return; + } + if (PlayerInput.GetIsAction(RhythmRally.InputAction_FlickPress) && !game.IsExpectingInputNow(RhythmRally.InputAction_FlickPress)) { // Play "whoosh" sound here - playerAnim.DoScaledAnimationAsync("Swing", 0.5f); ; + playerAnim.DoScaledAnimationAsync("Swing", 0.5f); } } @@ -104,18 +118,19 @@ namespace HeavenStudio.Games.Scripts_RhythmRally public void Just(PlayerActionEvent caller, float state) { - if (state >= 1f || state <= -1f) { + if (state >= 1f || state <= -1f) + { NearMiss(state); - return; + return; } Ace(); } - public void Miss(PlayerActionEvent caller) + public void Miss(PlayerActionEvent caller) { MissBall(); } - public void Out(PlayerActionEvent caller) {} + public void Out(PlayerActionEvent caller) { } } } diff --git a/Assets/Scripts/Games/RhythmRally/RhythmRally.cs b/Assets/Scripts/Games/RhythmRally/RhythmRally.cs index aadf46099..2a114fa65 100644 --- a/Assets/Scripts/Games/RhythmRally/RhythmRally.cs +++ b/Assets/Scripts/Games/RhythmRally/RhythmRally.cs @@ -5,13 +5,15 @@ using NaughtyBezierCurves; using DG.Tweening; using HeavenStudio.Util; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Loaders { using static Minigames; public static class NtrPingpongLoader { - public static Minigame AddGame(EventCaller eventCaller) { + public static Minigame AddGame(EventCaller eventCaller) + { return new Minigame("rhythmRally", "Rhythm Rally", "ffffff", false, false, new List() { new GameAction("bop", "Bop") @@ -99,9 +101,9 @@ namespace HeavenStudio.Games.Loaders } }, }, - new List() {"ntr", "keep"}, + new List() { "ntr", "keep" }, "ntrpingpong", "en", - new List() {} + new List() { } ); } } @@ -152,7 +154,7 @@ namespace HeavenStudio.Games public GameEvent bop = new GameEvent(); private bool goBop = true; - + public static RhythmRally instance; private void Awake() @@ -170,7 +172,7 @@ namespace HeavenStudio.Games { var cond = Conductor.instance; var currentBeat = cond.songPositionInBeatsAsDouble; - + var hitBeat = serveBeat; // Beat when the last paddler hit the ball var beatDur1 = 1f; // From paddle to table var beatDur2 = 1f; // From table to other paddle @@ -314,8 +316,11 @@ namespace HeavenStudio.Games { if (served) { - if ((playerState.IsName("Swing") && playerAnim.IsAnimationNotPlaying()) || (!playerState.IsName("Swing") && !playerState.IsName("Ready1"))) - playerAnim.Play("Ready1"); + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch || GameManager.instance.autoplay) + { + if ((playerState.IsName("Swing") && playerAnim.IsAnimationNotPlaying()) || (!playerState.IsName("Swing") && !playerState.IsName("Ready1"))) + playerAnim.Play("Ready1"); + } } else if (!opponentServing) { @@ -334,7 +339,7 @@ namespace HeavenStudio.Games Toss(hitBeat + beatDur1, beatDur2, tossHeight); } } - + // If player never swung and is still in ready state, snap them out of it. if (missed && playerState.IsName("Ready1")) playerAnim.Play("Beat"); @@ -412,7 +417,7 @@ namespace HeavenStudio.Games started = true; opponentServing = true; tossing = false; - + serveBeat = beat; rallySpeed = speed; @@ -439,7 +444,7 @@ namespace HeavenStudio.Games MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("rhythmRally/Serve", serveBeat), new MultiSound.Sound("rhythmRally/ServeBounce", bounceBeat) }); paddlers.BounceFX(bounceBeat); - ScheduleInput(serveBeat, targetBeat, InputType.STANDARD_DOWN, paddlers.Just, paddlers.Miss, paddlers.Out); + ScheduleInput(serveBeat, targetBeat, InputAction_FlickPress, paddlers.Just, paddlers.Miss, paddlers.Out); } public void Toss(double beat, float length, float height, bool firstToss = false) @@ -448,7 +453,7 @@ namespace HeavenStudio.Games ballTrail.gameObject.SetActive(false); if (firstToss) - height *= length/2f; + height *= length / 2f; tossCurve.transform.localScale = new Vector3(1f, height, 1f); tossBeat = beat; @@ -521,7 +526,7 @@ namespace HeavenStudio.Games { List soundsToPlay = new List(); bool tink = false; - for (float i = 0; i < length; i += 0.5f) + for (float i = 0; i < length; i += 0.5f) { soundsToPlay.Add(new MultiSound.Sound(tink ? "rhythmRally/Tink" : "rhythmRally/Tonk", beat + i)); tink = !tink; @@ -536,7 +541,7 @@ namespace HeavenStudio.Games for (int i = 0; i < length; i += 2) { double beatToSpawn = beat + i; - servesToPerform.Add( new BeatAction.Action(beatToSpawn, delegate { Serve(beatToSpawn, RallySpeed.SuperFast); }) ); + servesToPerform.Add(new BeatAction.Action(beatToSpawn, delegate { Serve(beatToSpawn, RallySpeed.SuperFast); })); } BeatAction.New(this, servesToPerform); } diff --git a/Assets/Scripts/Games/Ringside/Ringside.cs b/Assets/Scripts/Games/Ringside/Ringside.cs index 6ba5bfbc4..58b1e72f8 100644 --- a/Assets/Scripts/Games/Ringside/Ringside.cs +++ b/Assets/Scripts/Games/Ringside/Ringside.cs @@ -163,7 +163,7 @@ namespace HeavenStudio.Games public static Ringside instance; - const int IAAltDownCat = 4; + const int IAAltDownCat = IAMAXCAT; protected static bool IA_PadAltPress(out double dt) { diff --git a/Assets/Scripts/Games/Rockers/Rockers.cs b/Assets/Scripts/Games/Rockers/Rockers.cs index f81796337..304a1e861 100644 --- a/Assets/Scripts/Games/Rockers/Rockers.cs +++ b/Assets/Scripts/Games/Rockers/Rockers.cs @@ -117,7 +117,7 @@ namespace HeavenStudio.Games.Loaders e["pS1"], e["pS2"], e["pS3"], - e["pS4"], + e["pS4"], }, e["moveCamera"] ); }, defaultLength = 11, @@ -190,8 +190,8 @@ namespace HeavenStudio.Games.Loaders { new Param("count", Rockers.CountIn.One, "Count", "Which voiceline?") }, - preFunction = delegate - { + preFunction = delegate + { var e = eventCaller.currentEntity; float offSet = 0; switch (e["count"]) @@ -207,7 +207,7 @@ namespace HeavenStudio.Games.Loaders offSet = 0.034f; break; } - SoundByte.PlayOneShot($"games/rockers/count/{e["count"]}", e.beat, 1, 1, false, null, offSet); + SoundByte.PlayOneShot($"games/rockers/count/{e["count"]}", e.beat, 1, 1, false, null, offSet); } }, new GameAction("voiceLine", "Together Voice Line") @@ -223,7 +223,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("prepareTogether", "Custom Together Prepare") { - function = delegate { var e = eventCaller.currentEntity; Rockers.instance.TogetherPrepare(e.beat, e["cmon"] == (int)Rockers.VoiceLineSelection.Cmon, e["cmon"] == (int)Rockers.VoiceLineSelection.None, + function = delegate { var e = eventCaller.currentEntity; Rockers.instance.TogetherPrepare(e.beat, e["cmon"] == (int)Rockers.VoiceLineSelection.Cmon, e["cmon"] == (int)Rockers.VoiceLineSelection.None, e["muteBeat"], e["middleBeat"], e["moveCamera"]); }, defaultLength = 3f, parameters = new List() @@ -564,8 +564,8 @@ namespace HeavenStudio.Games { var cond = Conductor.instance; - if (cond.isPlaying && !cond.isPaused) - { + if (cond.isPlaying && !cond.isPaused) + { if (PlayerInput.Pressed()) { Soshi.Mute(); @@ -768,7 +768,7 @@ namespace HeavenStudio.Games var e = togetherEvents[i]; if (togetherEvents[i].datamodel == "rockers/riffTogether") { - actions.Add(new BeatAction.Action(e.beat, delegate + actions.Add(new BeatAction.Action(e.beat, delegate { JJ.StrumStrings(e["gcJJ"], new int[6] { @@ -778,7 +778,7 @@ namespace HeavenStudio.Games e["4JJ"], e["5JJ"], e["6JJ"], - }, (PremadeSamples)e["sampleJJ"], e["pitchSampleJJ"]); + }, (PremadeSamples)e["sampleJJ"], e["pitchSampleJJ"]); })); actions.Add(new BeatAction.Action(e.beat + e.length, delegate { JJ.Mute(); })); RockersInput riffComp = Instantiate(rockerInputRef, transform); @@ -845,8 +845,8 @@ namespace HeavenStudio.Games List relevantInputs = GrabAllInputsBetween(beat, beat + length); List riffUsedBeats = new List(); List bendUsedBeats = new(); - foreach (var input in relevantInputs) - { + foreach (var input in relevantInputs) + { if (input.datamodel == "rockers/riff") { RiqEntity foundEvent = riffEvents.Find(x => x.beat == input.beat); @@ -1036,8 +1036,8 @@ namespace HeavenStudio.Games } } }), - new BeatAction.Action(beat, delegate - { + new BeatAction.Action(beat, delegate + { JJ.UnHold(); }) }); @@ -1047,7 +1047,7 @@ namespace HeavenStudio.Games private void JustMute(PlayerActionEvent caller, float state) { Soshi.Mute(); - } + } private void MuteMiss(PlayerActionEvent caller) { diff --git a/Assets/Scripts/Games/SamuraiSliceNtr/SamuraiSliceNtr.cs b/Assets/Scripts/Games/SamuraiSliceNtr/SamuraiSliceNtr.cs index 397a11225..e50fe1559 100644 --- a/Assets/Scripts/Games/SamuraiSliceNtr/SamuraiSliceNtr.cs +++ b/Assets/Scripts/Games/SamuraiSliceNtr/SamuraiSliceNtr.cs @@ -132,8 +132,8 @@ namespace HeavenStudio.Games public GameEvent bop = new GameEvent(); - const int IAAltDownCat = 4; - const int IAAltUpCat = 5; + const int IAAltDownCat = IAMAXCAT; + const int IAAltUpCat = IAMAXCAT + 1; protected static bool IA_PadAltPress(out double dt) { diff --git a/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs b/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs index e7387a776..d52f072bd 100644 --- a/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs +++ b/Assets/Scripts/Games/SneakySpirits/SneakySpirits.cs @@ -1,4 +1,5 @@ using HeavenStudio.Util; +using HeavenStudio.InputSystem; using System; using System.Collections.Generic; using UnityEngine; @@ -83,6 +84,7 @@ namespace HeavenStudio.Games [SerializeField] GameObject slowTree; private bool hasArrowLoaded; + private bool hasArrowDrawn; float movingLength; double movingStartBeat; bool isMoving; @@ -133,9 +135,23 @@ namespace HeavenStudio.Games var cond = Conductor.instance; if (cond.isPlaying && !cond.isPaused) { - if (PlayerInput.GetIsAction(InputAction_FlickPress, out _) && !IsExpectingInputNow(InputAction_FlickPress.inputLockCategory) && hasArrowLoaded) + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch) + { + if (PlayerInput.GetIsAction(InputAction_BasicPress) && hasArrowLoaded && !hasArrowDrawn) + { + hasArrowDrawn = true; + bowAnim.DoScaledAnimationAsync("BowDraw", 0.25f); + } + if (PlayerInput.GetIsAction(InputAction_BasicRelease) && hasArrowLoaded && hasArrowDrawn) + { + hasArrowDrawn = false; + bowAnim.DoScaledAnimationAsync("BowRelease", 0.5f); + } + } + if (PlayerInput.GetIsAction(InputAction_FlickPress) && !IsExpectingInputNow(InputAction_FlickPress) && hasArrowLoaded) { WhiffArrow(cond.songPositionInBeatsAsDouble); + hasArrowDrawn = false; } if (isMoving) { @@ -158,8 +174,16 @@ namespace HeavenStudio.Games public void ForceReload() { if (hasArrowLoaded) return; - bowAnim.DoScaledAnimationAsync("BowDraw", 0.25f); + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch && !GameManager.instance.autoplay) + { + bowAnim.DoScaledAnimationAsync("BowIdle", 1f); + } + else + { + bowAnim.DoScaledAnimationAsync("BowDraw", 0.25f); + } hasArrowLoaded = true; + hasArrowDrawn = false; } public void MoveBow(double beat, float length, bool enter, int ease) @@ -195,10 +219,20 @@ namespace HeavenStudio.Games { ScheduleInput(beat, length * 7, InputAction_FlickPress, JustNoSlowDown, Miss, Out); } - BeatAction.New(instance, new List() + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch && !GameManager.instance.autoplay) { - new BeatAction.Action(beat + length * 3, delegate { ForceReload(); }) - }); + BeatAction.New(instance, new List() + { + new BeatAction.Action(beat, delegate { ForceReload(); }) + }); + } + else + { + BeatAction.New(instance, new List() + { + new BeatAction.Action(beat + length * 3, delegate { ForceReload(); }) + }); + } List ghostSpawns = new List(); for(int i = 0; i < 7; i++) diff --git a/Assets/Scripts/Games/SpaceDance/SpaceDance.cs b/Assets/Scripts/Games/SpaceDance/SpaceDance.cs index 46f25f0d1..978a4d3eb 100644 --- a/Assets/Scripts/Games/SpaceDance/SpaceDance.cs +++ b/Assets/Scripts/Games/SpaceDance/SpaceDance.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using UnityEngine; using HeavenStudio.Common; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Loaders { @@ -164,6 +165,61 @@ namespace HeavenStudio.Games public static SpaceDance instance; + const int IA_TurnPress = IAMAXCAT; + const int IA_DownPress = IAMAXCAT + 1; + const int IA_PunchPress = IAMAXCAT + 2; + + protected static bool IA_PadTurnPress(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt); + } + protected static bool IA_BatonTurnPress(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.East, out dt) + && !instance.IsExpectingInputNow(InputAction_Punch); + } + protected static bool IA_TouchTurnPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && !(instance.IsExpectingInputNow(InputAction_Down) || instance.IsExpectingInputNow(InputAction_Punch)); + } + + protected static bool IA_PadDownPress(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt); + } + protected static bool IA_BatonDownPress(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.South, out dt) + && !instance.IsExpectingInputNow(InputAction_Punch); + } + protected static bool IA_TouchDownPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && instance.IsExpectingInputNow(InputAction_Down); + } + + protected static bool IA_BatonPunchPress(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.Face, out dt) + && instance.IsExpectingInputNow(InputAction_Punch); + } + protected static bool IA_TouchPunchPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && instance.IsExpectingInputNow(InputAction_Punch); + } + + public static PlayerInput.InputAction InputAction_Turn = + new("AgbSpaceDanceTurn", new int[] { IA_TurnPress, IA_TurnPress, IA_TurnPress }, + IA_PadTurnPress, IA_TouchTurnPress, IA_BatonTurnPress); + public static PlayerInput.InputAction InputAction_Down = + new("AgbSpaceDanceDown", new int[] { IA_DownPress, IA_DownPress, IA_DownPress }, + IA_PadDownPress, IA_TouchDownPress, IA_BatonDownPress); + public static PlayerInput.InputAction InputAction_Punch = + new("AgbSpaceDancePunch", new int[] { IA_PunchPress, IA_PunchPress, IA_PunchPress }, + IA_PadBasicPress, IA_TouchPunchPress, IA_BatonPunchPress); + // Start is called before the first frame update void Awake() { @@ -211,21 +267,21 @@ namespace HeavenStudio.Games } if (!DancerP.IsPlayingAnimationName("PunchDo") && !DancerP.IsPlayingAnimationName("TurnRightDo") && !DancerP.IsPlayingAnimationName("SitDownDo")) { - if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Punch) && !IsExpectingInputNow(InputAction_Punch)) { SoundByte.PlayOneShotGame("spaceDance/inputBad"); DancerP.DoScaledAnimationAsync("PunchDo", 0.5f); Gramps.Play("GrampsOhFuck", 0, 0); } - if (PlayerInput.GetSpecificDirectionDown(1) && !IsExpectingInputNow(InputType.DIRECTION_RIGHT_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Down) && !IsExpectingInputNow(InputAction_Down)) { - DancerP.DoScaledAnimationAsync("TurnRightDo", 0.5f); + DancerP.DoScaledAnimationAsync("SitDownDo", 0.5f); SoundByte.PlayOneShotGame("spaceDance/inputBad"); Gramps.Play("GrampsOhFuck", 0, 0); } - if (PlayerInput.GetSpecificDirectionDown(2) && !IsExpectingInputNow(InputType.DIRECTION_DOWN_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Turn) && !IsExpectingInputNow(InputAction_Turn)) { - DancerP.DoScaledAnimationAsync("SitDownDo", 0.5f); + DancerP.DoScaledAnimationAsync("TurnRightDo", 0.5f); SoundByte.PlayOneShotGame("spaceDance/inputBad"); Gramps.Play("GrampsOhFuck", 0, 0); } @@ -410,7 +466,7 @@ namespace HeavenStudio.Games { canBop = false; if (grampsTurns) grampsCanBop = false; - ScheduleInput(beat, 1f, InputType.DIRECTION_RIGHT_DOWN, JustRight, RightMiss, Empty); + ScheduleInput(beat, 1f, InputAction_Turn, JustRight, RightMiss, Empty); BeatAction.New(instance, new List() { @@ -479,7 +535,7 @@ namespace HeavenStudio.Games { canBop = false; if (grampsSits) grampsCanBop = false; - ScheduleInput(beat, 1f, InputType.DIRECTION_DOWN_DOWN, JustSit, SitMiss, Empty); + ScheduleInput(beat, 1f, InputAction_Down, JustSit, SitMiss, Empty); BeatAction.New(instance, new List() { @@ -554,7 +610,7 @@ namespace HeavenStudio.Games { canBop = false; if (grampsPunches) grampsCanBop = false; - ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, JustPunch, PunchMiss, Empty); + ScheduleInput(beat, 1.5f, InputAction_Punch, JustPunch, PunchMiss, Empty); BeatAction.New(instance, new List() { diff --git a/Assets/Scripts/Games/Spaceball/Spaceball.cs b/Assets/Scripts/Games/Spaceball/Spaceball.cs index ac8e40031..2b7cde0b0 100644 --- a/Assets/Scripts/Games/Spaceball/Spaceball.cs +++ b/Assets/Scripts/Games/Spaceball/Spaceball.cs @@ -121,10 +121,6 @@ namespace HeavenStudio.Games { for (int i = 1; i < BallsHolder.transform.childCount; i++) Destroy(BallsHolder.transform.GetChild(i).gameObject); - GameCamera.instance.camera.orthographic = false; - - if (EligibleHits.Count > 0) - EligibleHits.RemoveRange(0, EligibleHits.Count); } public override void OnTimeChange() diff --git a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs index 18bb2bf09..361355640 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs @@ -25,8 +25,6 @@ namespace HeavenStudio.Games.Scripts_Spaceball #region Private - private Minigame.Eligible e = new Minigame.Eligible(); - [SerializeField] private BezierCurve3D pitchLowCurve; [SerializeField] private BezierCurve3D pitchHighCurve; @@ -43,8 +41,6 @@ namespace HeavenStudio.Games.Scripts_Spaceball private void Awake() { - e.gameObject = this.gameObject; - startRot = Random.Range(0, 360); } diff --git a/Assets/Scripts/Games/Tambourine/Tambourine.cs b/Assets/Scripts/Games/Tambourine/Tambourine.cs index 00608f7bf..0c76a65d2 100644 --- a/Assets/Scripts/Games/Tambourine/Tambourine.cs +++ b/Assets/Scripts/Games/Tambourine/Tambourine.cs @@ -1,4 +1,5 @@ using HeavenStudio.Util; +using HeavenStudio.InputSystem; using System; using System.Collections.Generic; using UnityEngine; @@ -119,6 +120,34 @@ namespace HeavenStudio.Games public static Tambourine instance; + const int IA_AltPress = IAMAXCAT; + protected static bool IA_TouchNrmPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && !instance.IsExpectingInputNow(InputAction_Alt); + } + + protected static bool IA_PadAltPress(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.South, out dt); + } + protected static bool IA_BatonAltPress(out double dt) + { + return PlayerInput.GetSqueezeDown(out dt); + } + protected static bool IA_TouchAltPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && instance.IsExpectingInputNow(InputAction_Alt); + } + + public static PlayerInput.InputAction InputAction_Nrm = + new("RvlDrumAlt", new int[] { IAPressCat, IAPressCat, IAPressCat }, + IA_PadBasicPress, IA_TouchNrmPress, IA_BatonBasicPress); + public static PlayerInput.InputAction InputAction_Alt = + new("RvlDrumAlt", new int[] { IA_AltPress, IA_AltPress, IA_AltPress }, + IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress); + void Awake() { instance = this; @@ -144,7 +173,7 @@ namespace HeavenStudio.Games handsAnimator.Play("Bop", 0, 0); } } - if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Nrm) && !IsExpectingInputNow(InputAction_Nrm)) { handsAnimator.Play("Shake", 0, 0); SoundByte.PlayOneShotGame($"tambourine/player/shake/{UnityEngine.Random.Range(1, 6)}"); @@ -156,7 +185,7 @@ namespace HeavenStudio.Games sadFace.SetActive(true); } } - else if (PlayerInput.AltPressed() && !IsExpectingInputNow(InputType.STANDARD_ALT_DOWN)) + else if (PlayerInput.GetIsAction(InputAction_Alt) && !IsExpectingInputNow(InputAction_Alt)) { handsAnimator.Play("Smack", 0, 0); SoundByte.PlayOneShotGame($"tambourine/player/hit/{UnityEngine.Random.Range(1, 6)}"); @@ -324,8 +353,8 @@ namespace HeavenStudio.Games double inputBeat = relevantInputs[i].beat - intervalBeat; actions.Add(new BeatAction.Action(inputBeat, delegate { - if (isHit) ScheduleInput(beat + length, inputBeat, InputType.STANDARD_ALT_DOWN, JustHit, Miss, Nothing); - else ScheduleInput(beat + length, inputBeat, InputType.STANDARD_DOWN, JustShake, Miss, Nothing); + if (isHit) ScheduleInput(beat + length, inputBeat, InputAction_Alt, JustHit, Miss, Nothing); + else ScheduleInput(beat + length, inputBeat, InputAction_Nrm, JustShake, Miss, Nothing); Bop(beat + length + inputBeat, 1, (int)WhoBops.Monkey, (int)WhoBops.None); })); } diff --git a/Assets/Scripts/Games/TossBoys/TossBoys.cs b/Assets/Scripts/Games/TossBoys/TossBoys.cs index d8fc4eed2..92ba26420 100644 --- a/Assets/Scripts/Games/TossBoys/TossBoys.cs +++ b/Assets/Scripts/Games/TossBoys/TossBoys.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using HeavenStudio.Util; +using HeavenStudio.InputSystem; using Jukebox; namespace HeavenStudio.Games.Loaders @@ -150,6 +151,86 @@ namespace HeavenStudio.Games public GameEvent bop = new GameEvent(); float currentEventLength; + const int IAAka = IAMAXCAT; + const int IAAo = IAMAXCAT + 1; + const int IAKii = IAMAXCAT + 2; + + protected static bool IA_PadDir(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt) + || PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt); + } + protected static bool IA_PadAlt(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.South, out dt); + } + + protected static bool IA_TouchNrm(out double dt) + { + return PlayerInput.GetFlick(out dt) + && (instance.currentReceiver is WhichTossKid.Akachan + || (instance.lastReceiver is WhichTossKid.Akachan or WhichTossKid.None + && instance.currentReceiver is WhichTossKid.None) + || (instance.IsExpectingInputNow(InputAction_Aka) + && !(instance.IsExpectingInputNow(InputAction_Ao) || instance.IsExpectingInputNow(InputAction_Kii)))); + } + protected static bool IA_TouchDir(out double dt) + { + return PlayerInput.GetFlick(out dt) + && (instance.currentReceiver is WhichTossKid.Kiiyan + || (instance.lastReceiver is WhichTossKid.Kiiyan + && instance.currentReceiver is WhichTossKid.None) + || (instance.IsExpectingInputNow(InputAction_Kii) + && !(instance.IsExpectingInputNow(InputAction_Ao) || instance.IsExpectingInputNow(InputAction_Aka)))); + } + protected static bool IA_TouchAlt(out double dt) + { + return PlayerInput.GetFlick(out dt) + && (instance.currentReceiver is WhichTossKid.Aokun + || (instance.lastReceiver is WhichTossKid.Aokun + && instance.currentReceiver is WhichTossKid.None) + || (instance.IsExpectingInputNow(InputAction_Ao) + && !(instance.IsExpectingInputNow(InputAction_Aka) || instance.IsExpectingInputNow(InputAction_Kii)))); + } + + protected static bool IA_BatonNrm(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.Face, out dt) + && (instance.currentReceiver is WhichTossKid.Akachan + || (instance.lastReceiver is WhichTossKid.Akachan or WhichTossKid.None + && instance.currentReceiver is WhichTossKid.None) + || (instance.IsExpectingInputNow(InputAction_Aka) + && !(instance.IsExpectingInputNow(InputAction_Ao) || instance.IsExpectingInputNow(InputAction_Kii)))); + } + protected static bool IA_BatonDir(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.Face, out dt) + && (instance.currentReceiver is WhichTossKid.Kiiyan + || (instance.lastReceiver is WhichTossKid.Kiiyan + && instance.currentReceiver is WhichTossKid.None) + || (instance.IsExpectingInputNow(InputAction_Ao) + && !(instance.IsExpectingInputNow(InputAction_Aka) || instance.IsExpectingInputNow(InputAction_Kii)))); + } + protected static bool IA_BatonAlt(out double dt) + { + return PlayerInput.GetBatonDown(InputController.ActionsBaton.Face, out dt) + && (instance.currentReceiver is WhichTossKid.Aokun + || (instance.lastReceiver is WhichTossKid.Aokun + && instance.currentReceiver is WhichTossKid.None)); + } + + public static PlayerInput.InputAction InputAction_Aka = + new("BasicPress", new int[] { IAAka, IAAka, IAAka }, + IA_PadBasicPress, IA_TouchNrm, IA_BatonNrm); + public static PlayerInput.InputAction InputAction_Ao = + new("BasicPress", new int[] { IAAo, IAAo, IAAo }, + IA_PadAlt, IA_TouchAlt, IA_BatonAlt); + public static PlayerInput.InputAction InputAction_Kii = + new("BasicPress", new int[] { IAKii, IAKii, IAKii }, + IA_PadDir, IA_TouchDir, IA_BatonDir); + private void Awake() { instance = this; @@ -194,15 +275,54 @@ namespace HeavenStudio.Games SingleBop(); } } - if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + + if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch) + { + TossKid next = GetCurrentReceiver(); + if (currentReceiver == WhichTossKid.None && lastReceiver != WhichTossKid.None) + { + next = GetReceiver(lastReceiver); + } + else if (currentReceiver == WhichTossKid.None && lastReceiver == WhichTossKid.None) + { + next = akachan; + } + if (PlayerInput.GetIsAction(InputAction_BasicPress)) + { + if (currentBall != null && next != null) + { + if (currentBall.willBePopped) + { + next.PopBallPrepare(); + } + else + { + next.Crouch(); + } + } + else if (next != null) + { + next.Crouch(); + } + } + else if (PlayerInput.GetIsAction(InputAction_BasicRelease)) + { + if (next != null) + { + next.UnCrouch(); + } + } + } + + if (PlayerInput.GetIsAction(InputAction_Aka) && !IsExpectingInputNow(InputAction_Aka)) { akachan.HitBall(false); } - if (PlayerInput.AltPressed() && !IsExpectingInputNow(InputType.STANDARD_ALT_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Ao) && !IsExpectingInputNow(InputAction_Ao)) { aokun.HitBall(false); } - if (PlayerInput.GetAnyDirectionDown() && !IsExpectingInputNow(InputType.DIRECTION_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Kii) && !IsExpectingInputNow(InputAction_Kii)) { kiiyan.HitBall(false); } @@ -360,10 +480,12 @@ namespace HeavenStudio.Games } else if (passBallDict[beat + length].datamodel == "tossBoys/pop") { - BeatAction.New(instance, new List() - { - new BeatAction.Action(beat + length - 1, delegate { GetCurrentReceiver().PopBallPrepare(); }) - }); + currentBall.willBePopped = true; + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch) + BeatAction.New(instance, new List() + { + new BeatAction.Action(beat + length - 1, delegate { GetCurrentReceiver().PopBallPrepare(); }) + }); } } else @@ -436,10 +558,12 @@ namespace HeavenStudio.Games } if (passBallDict.ContainsKey(beat + currentEventLength) && passBallDict[beat + currentEventLength].datamodel == "tossBoys/pop") { - BeatAction.New(instance, new List() - { - new BeatAction.Action(beat + currentEventLength - 1, delegate { GetCurrentReceiver().PopBallPrepare(); }) - }); + currentBall.willBePopped = true; + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch) + BeatAction.New(instance, new List() + { + new BeatAction.Action(beat + currentEventLength - 1, delegate { GetCurrentReceiver().PopBallPrepare(); }) + }); } } @@ -978,7 +1102,10 @@ namespace HeavenStudio.Games specialKii.SetActive(false); if (currentSpecialKid != null) currentSpecialKid.crouch = false; currentSpecialKid = GetCurrentReceiver(); - GetCurrentReceiver().Crouch(); + + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch) + GetCurrentReceiver().Crouch(); + GetSpecialBasedOnReceiver().SetActive(true); switch (currentReceiver) { @@ -1044,23 +1171,21 @@ namespace HeavenStudio.Games currentReceiver = (WhichTossKid)who; } - InputType GetInputTypeBasedOnCurrentReceiver() + PlayerInput.InputAction GetInputTypeBasedOnCurrentReceiver() { return GetInputBasedOnTossKid(currentReceiver); } - InputType GetInputBasedOnTossKid(WhichTossKid tossKid) + PlayerInput.InputAction GetInputBasedOnTossKid(WhichTossKid tossKid) { switch (tossKid) { - case WhichTossKid.Akachan: - return InputType.STANDARD_DOWN; case WhichTossKid.Aokun: - return InputType.STANDARD_ALT_DOWN; + return InputAction_Ao; case WhichTossKid.Kiiyan: - return InputType.DIRECTION_DOWN; + return InputAction_Kii; default: - return InputType.ANY; + return InputAction_Aka; } } diff --git a/Assets/Scripts/Games/TossBoys/TossBoysBall.cs b/Assets/Scripts/Games/TossBoys/TossBoysBall.cs index db91276d0..492581062 100644 --- a/Assets/Scripts/Games/TossBoys/TossBoysBall.cs +++ b/Assets/Scripts/Games/TossBoys/TossBoysBall.cs @@ -40,6 +40,10 @@ namespace HeavenStudio.Games.Scripts_TossBoys YellowKeep } + public State BallState { get { return currentState; } } + + public bool willBePopped; + private State currentState; private double startBeat; diff --git a/Assets/Scripts/Games/TossBoys/TossKid.cs b/Assets/Scripts/Games/TossBoys/TossKid.cs index 0df551799..deba5d36c 100644 --- a/Assets/Scripts/Games/TossBoys/TossKid.cs +++ b/Assets/Scripts/Games/TossBoys/TossKid.cs @@ -35,6 +35,8 @@ namespace HeavenStudio.Games.Scripts_TossBoys DoAnimationScaledAsync("Whiff", 0.5f); SoundByte.PlayOneShotGame("tossBoys/whiff"); } + crouch = false; + preparing = false; } public void Bop() @@ -49,6 +51,12 @@ namespace HeavenStudio.Games.Scripts_TossBoys crouch = true; } + public void UnCrouch() + { + DoAnimationScaledAsync("Idle", 1f); + crouch = false; + } + public void PopBall() { DoAnimationScaledAsync("Slap", 0.5f); diff --git a/Assets/Scripts/Games/WorkingDough/PlayerEnterDoughBall.cs b/Assets/Scripts/Games/WorkingDough/PlayerEnterDoughBall.cs index 0b79b5f0d..379b3178c 100644 --- a/Assets/Scripts/Games/WorkingDough/PlayerEnterDoughBall.cs +++ b/Assets/Scripts/Games/WorkingDough/PlayerEnterDoughBall.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using UnityEngine; using NaughtyBezierCurves; using HeavenStudio.Util; +using HeavenStudio.InputSystem; namespace HeavenStudio.Games.Scripts_WorkingDough { @@ -51,8 +52,11 @@ namespace HeavenStudio.Games.Scripts_WorkingDough barelyPath = game.GetPath("PlayerBarely"); missPath = game.GetPath("PlayerMiss"); weakPath = game.GetPath("PlayerWeak"); - rightInput = game.ScheduleInput(beat, 1, isBig ? InputType.STANDARD_ALT_DOWN : InputType.STANDARD_DOWN, Just, Miss, Empty); - wrongInput = game.ScheduleUserInput(beat, 1, isBig ? InputType.STANDARD_DOWN : InputType.STANDARD_ALT_DOWN, WrongInput, Empty, Empty); + rightInput = game.ScheduleInput(beat, 1, isBig ? WorkingDough.InputAction_Alt : WorkingDough.InputAction_Nrm, Just, Miss, Empty); + + if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch) + wrongInput = game.ScheduleUserInput(beat, 1, isBig ? WorkingDough.InputAction_Nrm : WorkingDough.InputAction_Alt, WrongInput, Empty, Empty); + currentState = State.Entering; if (gandw != null) gandw.SetActive(hasGandw); Update(); @@ -112,7 +116,8 @@ namespace HeavenStudio.Games.Scripts_WorkingDough private void Just(PlayerActionEvent caller, float state) { - wrongInput.Disable(); + if (wrongInput != null) + wrongInput.Disable(); double beat = Conductor.instance.songPositionInBeats; startBeat = beat; game.playerImpact.SetActive(true); diff --git a/Assets/Scripts/Games/WorkingDough/WorkingDough.cs b/Assets/Scripts/Games/WorkingDough/WorkingDough.cs index a011cae0a..a1b225371 100644 --- a/Assets/Scripts/Games/WorkingDough/WorkingDough.cs +++ b/Assets/Scripts/Games/WorkingDough/WorkingDough.cs @@ -1,4 +1,5 @@ using HeavenStudio.Util; +using HeavenStudio.InputSystem; using System; using System.Collections.Generic; using UnityEngine; @@ -207,6 +208,34 @@ namespace HeavenStudio.Games public static WorkingDough instance; + const int IA_AltPress = IAMAXCAT; + protected static bool IA_TouchNrmPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && !instance.IsExpectingInputNow(InputAction_Alt); + } + + protected static bool IA_PadAltPress(out double dt) + { + return PlayerInput.GetPadDown(InputController.ActionsPad.South, out dt); + } + protected static bool IA_BatonAltPress(out double dt) + { + return PlayerInput.GetSqueezeDown(out dt); + } + protected static bool IA_TouchAltPress(out double dt) + { + return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt) + && instance.IsExpectingInputNow(InputAction_Alt); + } + + public static PlayerInput.InputAction InputAction_Nrm = + new("RvlDoughAlt", new int[] { IAPressCat, IAPressCat, IAPressCat }, + IA_PadBasicPress, IA_TouchNrmPress, IA_BatonBasicPress); + public static PlayerInput.InputAction InputAction_Alt = + new("RvlDoughAlt", new int[] { IA_AltPress, IA_AltPress, IA_AltPress }, + IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress); + void Awake() { instance = this; @@ -463,12 +492,12 @@ namespace HeavenStudio.Games } passedTurns.Clear(); } - if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN)) + if (PlayerInput.GetIsAction(InputAction_Nrm) && !IsExpectingInputNow(InputAction_Nrm)) { doughDudesPlayer.GetComponent().DoScaledAnimationAsync("SmallDoughJump", 0.5f); SoundByte.PlayOneShotGame("workingDough/smallPlayer"); } - else if (PlayerInput.AltPressed() && !IsExpectingInputNow(InputType.STANDARD_ALT_DOWN)) + else if (PlayerInput.GetIsAction(InputAction_Alt) && !IsExpectingInputNow(InputAction_Alt)) { doughDudesPlayer.GetComponent().DoScaledAnimationAsync("BigDoughJump", 0.5f); SoundByte.PlayOneShotGame("workingDough/bigPlayer");