push before i revert the prepare

This commit is contained in:
AstrlJelly 2024-02-08 20:24:14 -05:00
parent 5e92ac09d1
commit 7c8dc8603f
4 changed files with 282 additions and 262 deletions

View file

@ -27,7 +27,7 @@ AnimatorStateMachine:
m_EntryPosition: {x: 50, y: 120, z: 0} m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 2356851186644941636} m_DefaultState: {fileID: 2414215807086146777}
--- !u!91 &9100000 --- !u!91 &9100000
AnimatorController: AnimatorController:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -57,7 +57,7 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Idle m_Name: PopUp
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions: []

View file

@ -14,121 +14,84 @@ AnimationClip:
m_RotationCurves: [] m_RotationCurves: []
m_CompressedRotationCurves: [] m_CompressedRotationCurves: []
m_EulerCurves: [] m_EulerCurves: []
m_PositionCurves: [] m_PositionCurves:
m_ScaleCurves: []
m_FloatCurves:
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 1 value: {x: 0, y: 0.701, z: 0}
inSlope: Infinity inSlope: {x: 0, y: 0, z: 0}
outSlope: Infinity outSlope: {x: 0, y: 0, z: 0}
tangentMode: 103 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: 0 outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 0.05 time: 0.05
value: 0 value: {x: 0, y: 0.798, z: 0}
inSlope: Infinity inSlope: {x: 0, y: 0, z: 0}
outSlope: Infinity outSlope: {x: 0, y: 0, z: 0}
tangentMode: 103 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: 0 outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_IsActive path: Button
path: FlashButton
classID: 1
script: {fileID: 0}
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 1 value: {x: 0, y: 0.346, z: 0}
inSlope: 0 inSlope: {x: 0, y: 0, z: 0}
outSlope: 0 outSlope: {x: 0, y: 0, z: 0}
tangentMode: 136 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: 0.33333334 outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 0.05 time: 0.05
value: 0 value: {x: 0, y: 0.44299993, z: 0}
inSlope: 0 inSlope: {x: 0, y: 0, z: 0}
outSlope: 0 outSlope: {x: 0, y: 0, z: 0}
tangentMode: 136 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: 0.33333334 outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_Color.a path: ButtonBottom
path: FlashButton/ButtonBottom m_ScaleCurves:
classID: 212
script: {fileID: 0}
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 1 value: {x: 1.15, y: 1.15, z: 1}
inSlope: 0 inSlope: {x: 0, y: 0, z: 0}
outSlope: 0 outSlope: {x: 0, y: 0, z: 0}
tangentMode: 136 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: 0.33333334 outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 0.05 time: 0.05
value: 0 value: {x: 1, y: 1, z: 1}
inSlope: 0 inSlope: {x: 0, y: 0, z: 0}
outSlope: 0 outSlope: {x: 0, y: 0, z: 0}
tangentMode: 136 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: 0.33333334 outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_Color.a path:
path: FlashButton/Button m_FloatCurves: []
classID: 212
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.a
path: FlashButton/Button/ButtonSheen
classID: 212
script: {fileID: 0}
m_PPtrCurves: [] m_PPtrCurves: []
m_SampleRate: 60 m_SampleRate: 60
m_WrapMode: 0 m_WrapMode: 0
@ -138,31 +101,24 @@ AnimationClip:
m_ClipBindingConstant: m_ClipBindingConstant:
genericBindings: genericBindings:
- serializedVersion: 2 - serializedVersion: 2
path: 3277295360 path: 1034594571
attribute: 2086281974 attribute: 1
script: {fileID: 0} script: {fileID: 0}
typeID: 1 typeID: 4
customType: 0 customType: 0
isPPtrCurve: 0 isPPtrCurve: 0
- serializedVersion: 2 - serializedVersion: 2
path: 2811717293 path: 2540107028
attribute: 304273561 attribute: 1
script: {fileID: 0} script: {fileID: 0}
typeID: 212 typeID: 4
customType: 0 customType: 0
isPPtrCurve: 0 isPPtrCurve: 0
- serializedVersion: 2 - serializedVersion: 2
path: 702311069 path: 0
attribute: 304273561 attribute: 3
script: {fileID: 0} script: {fileID: 0}
typeID: 212 typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 329815409
attribute: 304273561
script: {fileID: 0}
typeID: 212
customType: 0 customType: 0
isPPtrCurve: 0 isPPtrCurve: 0
pptrCurveMapping: [] pptrCurveMapping: []
@ -192,28 +148,56 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 1 value: 1.15
inSlope: Infinity inSlope: 0
outSlope: Infinity outSlope: 0
tangentMode: 103 tangentMode: 136
weightedMode: 0 weightedMode: 0
inWeight: 0 inWeight: 0.33333334
outWeight: 0 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.05 time: 0.05
value: 0 value: 1
inSlope: Infinity inSlope: 0
outSlope: Infinity outSlope: 0
tangentMode: 103 tangentMode: 136
weightedMode: 0 weightedMode: 0
inWeight: 0 inWeight: 0.33333334
outWeight: 0 outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_IsActive attribute: m_LocalScale.x
path: FlashButton path:
classID: 1 classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1.15
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path:
classID: 4
script: {fileID: 0} script: {fileID: 0}
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
@ -229,7 +213,7 @@ AnimationClip:
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.05 time: 0.05
value: 0 value: 1
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -239,16 +223,16 @@ AnimationClip:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_Color.a attribute: m_LocalScale.z
path: FlashButton/ButtonBottom path:
classID: 212 classID: 4
script: {fileID: 0} script: {fileID: 0}
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 1 value: 0
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -267,16 +251,44 @@ AnimationClip:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_Color.a attribute: m_LocalPosition.x
path: FlashButton/Button path: Button
classID: 212 classID: 4
script: {fileID: 0} script: {fileID: 0}
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 1 value: 0.701
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.798
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Button
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -295,9 +307,93 @@ AnimationClip:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_Color.a attribute: m_LocalPosition.z
path: FlashButton/Button/ButtonSheen path: Button
classID: 212 classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: ButtonBottom
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.346
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.44299993
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: ButtonBottom
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: ButtonBottom
classID: 4
script: {fileID: 0} script: {fileID: 0}
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0

View file

@ -15,22 +15,6 @@ AnimationClip:
m_CompressedRotationCurves: [] m_CompressedRotationCurves: []
m_EulerCurves: [] m_EulerCurves: []
m_PositionCurves: m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.16666667
value: {x: 0, y: 0.319, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: ButtonBottom
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
@ -43,15 +27,6 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.16666667
value: {x: 0, y: 0.711, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -73,13 +48,6 @@ AnimationClip:
m_Extent: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant: m_ClipBindingConstant:
genericBindings: genericBindings:
- serializedVersion: 2
path: 1034594571
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2 - serializedVersion: 2
path: 2540107028 path: 2540107028
attribute: 0 attribute: 0
@ -88,7 +56,7 @@ AnimationClip:
customType: 23 customType: 23
isPPtrCurve: 1 isPPtrCurve: 1
- serializedVersion: 2 - serializedVersion: 2
path: 2540107028 path: 1034594571
attribute: 1 attribute: 1
script: {fileID: 0} script: {fileID: 0}
typeID: 4 typeID: 4
@ -101,12 +69,12 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 0.16666667 m_StopTime: 0.016666668
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
m_HasAdditiveReferencePose: 0 m_HasAdditiveReferencePose: 0
m_LoopTime: 0 m_LoopTime: 1
m_LoopBlend: 0 m_LoopBlend: 0
m_LoopBlendOrientation: 0 m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0 m_LoopBlendPositionY: 0
@ -117,63 +85,6 @@ AnimationClip:
m_HeightFromFeet: 0 m_HeightFromFeet: 0
m_Mirror: 0 m_Mirror: 0
m_EditorCurves: m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.16666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: ButtonBottom
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.16666667
value: 0.319
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: ButtonBottom
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0.16666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: ButtonBottom
classID: 4
script: {fileID: 0}
- curve: - curve:
serializedVersion: 2 serializedVersion: 2
m_Curve: m_Curve:
@ -186,15 +97,6 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.16666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -214,15 +116,6 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.16666667
value: 0.711
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -242,15 +135,6 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.16666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4

View file

@ -7,6 +7,7 @@ using HeavenStudio.InputSystem;
using Jukebox; using Jukebox;
using System.Linq; using System.Linq;
using System.ComponentModel;
namespace HeavenStudio.Games.Loaders namespace HeavenStudio.Games.Loaders
{ {
@ -19,6 +20,13 @@ namespace HeavenStudio.Games.Loaders
{ {
new GameAction("startInterval", "Start Interval") new GameAction("startInterval", "Start Interval")
{ {
preFunction = delegate {
var e = eventCaller.currentEntity;
SoundByte.PlayOneShotGame("slotMonster/start_touch", e.beat - 1, forcePlay: true);
if (eventCaller.gameManager.minigameObj.TryGetComponent(out SlotMonster instance)) {
instance.PreStartInterval(e.beat);
}
},
function = delegate { function = delegate {
if (eventCaller.gameManager.minigameObj.TryGetComponent(out SlotMonster instance)) { if (eventCaller.gameManager.minigameObj.TryGetComponent(out SlotMonster instance)) {
var e = eventCaller.currentEntity; var e = eventCaller.currentEntity;
@ -27,21 +35,26 @@ namespace HeavenStudio.Games.Loaders
}, },
defaultLength = 3f, defaultLength = 3f,
resizable = true, resizable = true,
preFunctionLength = 1,
priority = 2,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("auto", true, "Auto Pass Turn", "Toggle if the turn should be passed automatically at the end of the start interval."), new Param("auto", true, "Auto Pass Turn", "Toggle if the turn should be passed automatically at the end of the start interval."),
new Param("eyeType", SlotMonster.EyeTypes.Random, "Eye Sprite", "Set the eye sprite to be used."), new Param("eyeType", SlotMonster.EyeTypes.Random, "Eye Sprite", "Set the eye sprite to be used."),
}, },
priority = 2,
}, },
new GameAction("slot", "Slot") new GameAction("slot", "Slot")
{ {
inactiveFunction = delegate {
// SoundByte.PlayOneShotGame("slotMonster/start_touch", eventCaller.currentEntity.beat, forcePlay: true);
SoundByte.PlayOneShotGame("slotMonster/start_touch", forcePlay: true);
},
defaultLength = 0.5f, defaultLength = 0.5f,
priority = 1,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("drum", SlotMonster.DrumTypes.Default, "Drum SFX", "Set the drum SFX to be used. Default is Bass on the beat, and Snare off the beat.") new Param("drum", SlotMonster.DrumTypes.Default, "Drum SFX", "Set the drum SFX to be used. Default is Bass on the beat, and Snare off the beat.")
}, },
priority = 1,
}, },
new GameAction("passTurn", "Pass Turn") new GameAction("passTurn", "Pass Turn")
{ {
@ -62,6 +75,8 @@ namespace HeavenStudio.Games.Loaders
instance.ButtonColor(new Color[] { e["button1"], e["button2"], e["button3"] }, e["flash"]); instance.ButtonColor(new Color[] { e["button1"], e["button2"], e["button3"] }, e["flash"]);
} }
}, },
defaultLength = 1f,
priority = 1,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("button1", new Color(), "Button 1 Color", "Set the color of the first button."), new Param("button1", new Color(), "Button 1 Color", "Set the color of the first button."),
@ -69,8 +84,6 @@ namespace HeavenStudio.Games.Loaders
new Param("button3", new Color(), "Button 3 Color", "Set the color of the third button."), new Param("button3", new Color(), "Button 3 Color", "Set the color of the third button."),
new Param("flash", new Color(), "Button Flash Color", "Set the color of the flash of the buttons."), new Param("flash", new Color(), "Button Flash Color", "Set the color of the flash of the buttons."),
}, },
defaultLength = 1f,
priority = 1,
}, },
} }
); );
@ -111,6 +124,7 @@ namespace HeavenStudio.Games
[SerializeField] SpriteRenderer[] eyeSRs; [SerializeField] SpriteRenderer[] eyeSRs;
[SerializeField] Animator[] buttonAnims; [SerializeField] Animator[] buttonAnims;
private double[] buttonstartBeats;
// used to ease between button colors and button flash colors! wow // used to ease between button colors and button flash colors! wow
private Color[] buttonColors; private Color[] buttonColors;
private Color buttonFlashColor; private Color buttonFlashColor;
@ -120,9 +134,9 @@ namespace HeavenStudio.Games
private Sound rollingSound; private Sound rollingSound;
private int currentEyeSprite = 1; private int currentEyeSprite = 1;
private int maxButtons; private int maxButtons;
private int currentButton; private int currentButton { get => currentButton %= 3; set => currentButton = value; }
// private double smPrepareBeat;
// public static SlotMonster instance;
private void Awake() private void Awake()
{ {
@ -131,9 +145,14 @@ namespace HeavenStudio.Games
private void Update() private void Update()
{ {
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress)) { if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress) && !buttonAnims[GetCurrentButton()].IsPlayingAnimationNames("Press")) {
_ = HitButton(); _ = HitButton();
ScoreMiss();
} }
// if (smPrepareBeat <= conductor.songPositionInBeatsAsDouble) {
// }
} }
public override void OnPlay(double beat) public override void OnPlay(double beat)
@ -144,9 +163,16 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(double beat) public override void OnGameSwitch(double beat)
{ {
gameEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == "slotMonster"); gameEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == "slotMonster");
foreach (RiqEntity interval in gameEntities.FindAll(e => e.datamodel == "slotMonster/startInterval" && e.beat < beat && e.beat + e.length > beat)) foreach (RiqEntity e in gameEntities.FindAll(e => e.datamodel == "slotMonster/startInterval" && e.beat - 1 < beat && e.beat + e.length > beat))
{ {
StartInterval(interval.beat, interval.length, interval["auto"], interval["eyeType"], interval, beat); Debug.Log("im gonna explode : " + (e.beat - 0.5 > beat));
if (e.beat - 0.5 > beat) {
PreStartInterval(beat);
}
if (e.beat < beat) {
StartInterval(e.beat, e.length, e["auto"], e["eyeType"], e, beat);
}
// StartInterval(e.beat, e.length, e["auto"], e["eyeType"], e, beat);
} }
} }
@ -178,19 +204,26 @@ namespace HeavenStudio.Games
return lastButton && isHit; return lastButton && isHit;
} }
public void PreStartInterval(double beat)
{
// smPrepareBeat
smAnim.DoScaledAnimationFromBeatAsync("Prepare", 0.5f, beat - 1);
foreach (var anim in buttonAnims)
{
anim.Play("PopUp", 0, 1);
}
}
public void StartInterval(double beat, float length, bool autoPass, int eyeSprite, RiqEntity startInterval, double gameSwitchBeat) public void StartInterval(double beat, float length, bool autoPass, int eyeSprite, RiqEntity startInterval, double gameSwitchBeat)
{ {
List<RiqEntity> slotActions = gameEntities.FindAll(e => e.datamodel == "slotMonster/slot" && e.beat >= startInterval.beat && e.beat < startInterval.beat + startInterval.length); List<RiqEntity> slotActions = gameEntities.FindAll(e => e.datamodel == "slotMonster/slot" && e.beat >= startInterval.beat && e.beat < startInterval.beat + startInterval.length);
smAnim.DoScaledAnimationFromBeatAsync("Prepare", 0.5f, beat);
SoundByte.PlayOneShotGame("slotMonster/start_touch", forcePlay: true);
List<MultiSound.Sound> sounds = new(); List<MultiSound.Sound> sounds = new();
List<BeatAction.Action> actions = new(); List<BeatAction.Action> actions = new();
maxButtons = Mathf.Min(slotActions.Count, 3); maxButtons = Mathf.Min(slotActions.Count, 3);
for (int i = 0; i < maxButtons; i++) // limit to 3 actions for (int i = 0; i < maxButtons; i++) // limit to 3 actions
{ {
buttonAnims[i].Play("Idle", 0, 0); buttonAnims[i].Play("PopUp", 0, 0);
int whichSlot = i; int whichSlot = i;
RiqEntity slot = slotActions[whichSlot]; RiqEntity slot = slotActions[whichSlot];
if (slot.beat < gameSwitchBeat) continue; if (slot.beat < gameSwitchBeat) continue;
@ -203,9 +236,9 @@ namespace HeavenStudio.Games
// Debug.Log(sfx); // Debug.Log(sfx);
sounds.Add(new(sfx + "DrumNTR", slot.beat)); sounds.Add(new(sfx + "DrumNTR", slot.beat));
actions.Add(new(slot.beat, delegate { actions.Add(new(slot.beat, delegate {
// if (buttonAnims[whichSlot].IsAnimationNotPlaying()) { if (buttonAnims[whichSlot].IsAnimationNotPlaying()) {
// buttonAnims[whichSlot].DoScaledAnimationAsync("Flash", 0.5f); buttonAnims[whichSlot].DoScaledAnimationAsync("Flash", 0.5f);
// } }
})); }));
} }
MultiSound.Play(sounds.ToArray(), false); MultiSound.Play(sounds.ToArray(), false);
@ -240,11 +273,18 @@ namespace HeavenStudio.Games
int whichSlot = i; int whichSlot = i;
double slotBeat = slotActions[i].beat; double slotBeat = slotActions[i].beat;
// actions.Add(new(beat + length + slotBeat - startBeat, delegate { buttonAnims[whichSlot].DoScaledAnimationAsync("Flash"); })); actions.Add(new(beat + length + slotBeat - startBeat, delegate {
if (!buttonAnims[whichSlot].IsPlayingAnimationNames("Press")) {
buttonAnims[whichSlot].DoScaledAnimationAsync("Flash");
}
}));
// Debug.Log("input scheduled at : " + (beat + length + slotBeat - startBeat)); // Debug.Log("input scheduled at : " + (beat + length + slotBeat - startBeat));
PlayerActionEvent input = ScheduleInput(beat, slotBeat - startBeat + length, InputAction_BasicPress, ButtonHit, null, null); PlayerActionEvent input = ScheduleInput(beat, slotBeat - startBeat + length, InputAction_BasicPress, ButtonHit, null, null);
input.IsHittable = () => GetCurrentButton() == whichSlot; input.IsHittable = () => {
int currentButton = GetCurrentButton();
return currentButton == whichSlot && !buttonAnims[whichSlot].IsPlayingAnimationNames("Press");
};
} }
BeatAction.New(this, actions); BeatAction.New(this, actions);
} }
@ -261,7 +301,7 @@ namespace HeavenStudio.Games
// private void ButtonMiss(PlayerActionEvent caller) // private void ButtonMiss(PlayerActionEvent caller)
// { // {
//
// } // }
public void ButtonColor(Color[] baseColors, Color flashColor) public void ButtonColor(Color[] baseColors, Color flashColor)