diff --git a/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/ButtonAnim.controller b/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/ButtonAnim.controller
index 4e66a522b..162aa4d90 100644
--- a/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/ButtonAnim.controller
+++ b/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/ButtonAnim.controller
@@ -27,7 +27,7 @@ AnimatorStateMachine:
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
- m_DefaultState: {fileID: 2356851186644941636}
+ m_DefaultState: {fileID: 2414215807086146777}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@@ -57,7 +57,7 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
- m_Name: Idle
+ m_Name: PopUp
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
diff --git a/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Flash.anim b/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Flash.anim
index 78b619f88..1b86821fc 100644
--- a/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Flash.anim
+++ b/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Flash.anim
@@ -14,121 +14,84 @@ AnimationClip:
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
- m_PositionCurves: []
- m_ScaleCurves: []
- m_FloatCurves:
+ m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
- value: 1
- inSlope: Infinity
- outSlope: Infinity
- tangentMode: 103
+ value: {x: 0, y: 0.701, z: 0}
+ inSlope: {x: 0, y: 0, z: 0}
+ outSlope: {x: 0, y: 0, z: 0}
+ tangentMode: 0
weightedMode: 0
- inWeight: 0
- outWeight: 0
+ inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
+ outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
- value: 0
- inSlope: Infinity
- outSlope: Infinity
- tangentMode: 103
+ value: {x: 0, y: 0.798, z: 0}
+ inSlope: {x: 0, y: 0, z: 0}
+ outSlope: {x: 0, y: 0, z: 0}
+ tangentMode: 0
weightedMode: 0
- inWeight: 0
- outWeight: 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
- attribute: m_IsActive
- path: FlashButton
- classID: 1
- script: {fileID: 0}
+ path: Button
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
- value: 1
- inSlope: 0
- outSlope: 0
- tangentMode: 136
+ value: {x: 0, y: 0.346, z: 0}
+ inSlope: {x: 0, y: 0, z: 0}
+ outSlope: {x: 0, y: 0, z: 0}
+ tangentMode: 0
weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
+ inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
+ outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
- value: 0
- inSlope: 0
- outSlope: 0
- tangentMode: 136
+ value: {x: 0, y: 0.44299993, z: 0}
+ inSlope: {x: 0, y: 0, z: 0}
+ outSlope: {x: 0, y: 0, z: 0}
+ tangentMode: 0
weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
+ 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
- attribute: m_Color.a
- path: FlashButton/ButtonBottom
- classID: 212
- script: {fileID: 0}
+ path: ButtonBottom
+ m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
- value: 1
- inSlope: 0
- outSlope: 0
- tangentMode: 136
+ value: {x: 1.15, y: 1.15, z: 1}
+ inSlope: {x: 0, y: 0, z: 0}
+ outSlope: {x: 0, y: 0, z: 0}
+ tangentMode: 0
weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
+ inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
+ outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
- value: 0
- inSlope: 0
- outSlope: 0
- tangentMode: 136
+ value: {x: 1, y: 1, z: 1}
+ inSlope: {x: 0, y: 0, z: 0}
+ outSlope: {x: 0, y: 0, z: 0}
+ tangentMode: 0
weightedMode: 0
- inWeight: 0.33333334
- outWeight: 0.33333334
+ 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
- attribute: m_Color.a
- path: FlashButton/Button
- 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}
+ path:
+ m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
@@ -138,31 +101,24 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
- path: 3277295360
- attribute: 2086281974
+ path: 1034594571
+ attribute: 1
script: {fileID: 0}
- typeID: 1
+ typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
- path: 2811717293
- attribute: 304273561
+ path: 2540107028
+ attribute: 1
script: {fileID: 0}
- typeID: 212
+ typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
- path: 702311069
- attribute: 304273561
+ path: 0
+ attribute: 3
script: {fileID: 0}
- typeID: 212
- customType: 0
- isPPtrCurve: 0
- - serializedVersion: 2
- path: 329815409
- attribute: 304273561
- script: {fileID: 0}
- typeID: 212
+ typeID: 4
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
@@ -192,28 +148,56 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
- value: 1
- inSlope: Infinity
- outSlope: Infinity
- tangentMode: 103
+ value: 1.15
+ inSlope: 0
+ outSlope: 0
+ tangentMode: 136
weightedMode: 0
- inWeight: 0
- outWeight: 0
+ inWeight: 0.33333334
+ outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
- value: 0
- inSlope: Infinity
- outSlope: Infinity
- tangentMode: 103
+ value: 1
+ inSlope: 0
+ outSlope: 0
+ tangentMode: 136
weightedMode: 0
- inWeight: 0
- outWeight: 0
+ inWeight: 0.33333334
+ outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_IsActive
- path: FlashButton
- classID: 1
+ attribute: m_LocalScale.x
+ path:
+ 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}
- curve:
serializedVersion: 2
@@ -229,7 +213,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
- value: 0
+ value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -239,16 +223,16 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Color.a
- path: FlashButton/ButtonBottom
- classID: 212
+ attribute: m_LocalScale.z
+ path:
+ classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
- value: 1
+ value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -267,16 +251,44 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Color.a
- path: FlashButton/Button
- classID: 212
+ attribute: m_LocalPosition.x
+ path: Button
+ classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
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
outSlope: 0
tangentMode: 136
@@ -295,9 +307,93 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
- attribute: m_Color.a
- path: FlashButton/Button/ButtonSheen
- classID: 212
+ attribute: m_LocalPosition.z
+ path: Button
+ 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}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
diff --git a/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Press.anim b/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Press.anim
index 3d148bf74..58803d2f1 100644
--- a/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Press.anim
+++ b/Assets/Resources/Sprites/Games/SlotMonster/Animations/Button/Press.anim
@@ -15,22 +15,6 @@ AnimationClip:
m_CompressedRotationCurves: []
m_EulerCurves: []
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:
serializedVersion: 2
m_Curve:
@@ -43,15 +27,6 @@ AnimationClip:
weightedMode: 0
inWeight: {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_PostInfinity: 2
m_RotationOrder: 4
@@ -73,13 +48,6 @@ AnimationClip:
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- - serializedVersion: 2
- path: 1034594571
- attribute: 1
- script: {fileID: 0}
- typeID: 4
- customType: 0
- isPPtrCurve: 0
- serializedVersion: 2
path: 2540107028
attribute: 0
@@ -88,7 +56,7 @@ AnimationClip:
customType: 23
isPPtrCurve: 1
- serializedVersion: 2
- path: 2540107028
+ path: 1034594571
attribute: 1
script: {fileID: 0}
typeID: 4
@@ -101,12 +69,12 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
- m_StopTime: 0.16666667
+ m_StopTime: 0.016666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
- m_LoopTime: 0
+ m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
@@ -117,63 +85,6 @@ AnimationClip:
m_HeightFromFeet: 0
m_Mirror: 0
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:
serializedVersion: 2
m_Curve:
@@ -186,15 +97,6 @@ AnimationClip:
weightedMode: 0
inWeight: 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_PostInfinity: 2
m_RotationOrder: 4
@@ -214,15 +116,6 @@ AnimationClip:
weightedMode: 0
inWeight: 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_PostInfinity: 2
m_RotationOrder: 4
@@ -242,15 +135,6 @@ AnimationClip:
weightedMode: 0
inWeight: 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_PostInfinity: 2
m_RotationOrder: 4
diff --git a/Assets/Scripts/Games/SlotMonster/SlotMonster.cs b/Assets/Scripts/Games/SlotMonster/SlotMonster.cs
index 0b75d9607..3bda11078 100644
--- a/Assets/Scripts/Games/SlotMonster/SlotMonster.cs
+++ b/Assets/Scripts/Games/SlotMonster/SlotMonster.cs
@@ -7,6 +7,7 @@ using HeavenStudio.InputSystem;
using Jukebox;
using System.Linq;
+using System.ComponentModel;
namespace HeavenStudio.Games.Loaders
{
@@ -19,6 +20,13 @@ namespace HeavenStudio.Games.Loaders
{
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 {
if (eventCaller.gameManager.minigameObj.TryGetComponent(out SlotMonster instance)) {
var e = eventCaller.currentEntity;
@@ -27,21 +35,26 @@ namespace HeavenStudio.Games.Loaders
},
defaultLength = 3f,
resizable = true,
+ preFunctionLength = 1,
+ priority = 2,
parameters = new List()
{
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."),
},
- priority = 2,
},
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,
+ priority = 1,
parameters = new List()
{
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")
{
@@ -62,6 +75,8 @@ namespace HeavenStudio.Games.Loaders
instance.ButtonColor(new Color[] { e["button1"], e["button2"], e["button3"] }, e["flash"]);
}
},
+ defaultLength = 1f,
+ priority = 1,
parameters = new List()
{
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("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] Animator[] buttonAnims;
+ private double[] buttonstartBeats;
// used to ease between button colors and button flash colors! wow
private Color[] buttonColors;
private Color buttonFlashColor;
@@ -120,9 +134,9 @@ namespace HeavenStudio.Games
private Sound rollingSound;
private int currentEyeSprite = 1;
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()
{
@@ -131,9 +145,14 @@ namespace HeavenStudio.Games
private void Update()
{
- if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress)) {
+ if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress) && !buttonAnims[GetCurrentButton()].IsPlayingAnimationNames("Press")) {
_ = HitButton();
+ ScoreMiss();
}
+
+ // if (smPrepareBeat <= conductor.songPositionInBeatsAsDouble) {
+
+ // }
}
public override void OnPlay(double beat)
@@ -144,9 +163,16 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(double beat)
{
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;
}
+ 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)
{
List 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 sounds = new();
List actions = new();
maxButtons = Mathf.Min(slotActions.Count, 3);
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;
RiqEntity slot = slotActions[whichSlot];
if (slot.beat < gameSwitchBeat) continue;
@@ -203,9 +236,9 @@ namespace HeavenStudio.Games
// Debug.Log(sfx);
sounds.Add(new(sfx + "DrumNTR", slot.beat));
actions.Add(new(slot.beat, delegate {
- // if (buttonAnims[whichSlot].IsAnimationNotPlaying()) {
- // buttonAnims[whichSlot].DoScaledAnimationAsync("Flash", 0.5f);
- // }
+ if (buttonAnims[whichSlot].IsAnimationNotPlaying()) {
+ buttonAnims[whichSlot].DoScaledAnimationAsync("Flash", 0.5f);
+ }
}));
}
MultiSound.Play(sounds.ToArray(), false);
@@ -240,11 +273,18 @@ namespace HeavenStudio.Games
int whichSlot = i;
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));
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);
}
@@ -261,7 +301,7 @@ namespace HeavenStudio.Games
// private void ButtonMiss(PlayerActionEvent caller)
// {
-
+ //
// }
public void ButtonColor(Color[] baseColors, Color flashColor)