READY FOR RECORDING

particles, win animation, etc.
This commit is contained in:
AstrlJelly 2024-02-15 22:03:56 -05:00
parent a8c585bd93
commit b01361cc0c
13 changed files with 5465 additions and 88 deletions

File diff suppressed because it is too large Load diff

View file

@ -28,8 +28,8 @@ AnimationClip:
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: {x: 0, y: 0.845, z: 0}
time: 0.06666667
value: {x: 0, y: 0.798, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@ -53,7 +53,7 @@ AnimationClip:
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
time: 0.06666667
value: {x: 0, y: 0.44299993, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
@ -79,7 +79,7 @@ AnimationClip:
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
time: 0.06666667
value: {x: 1, y: 1, z: 1}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
@ -156,7 +156,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 1
inSlope: 0
outSlope: 0
@ -184,7 +184,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 1
inSlope: 0
outSlope: 0
@ -212,7 +212,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 1
inSlope: 0
outSlope: 0
@ -240,7 +240,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 0
inSlope: 0
outSlope: 0
@ -268,8 +268,8 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.845
time: 0.06666667
value: 0.798
inSlope: 0
outSlope: 0
tangentMode: 136
@ -296,7 +296,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 0
inSlope: 0
outSlope: 0
@ -324,7 +324,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 0
inSlope: 0
outSlope: 0
@ -352,7 +352,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 0.44299993
inSlope: 0
outSlope: 0
@ -380,7 +380,7 @@ AnimationClip:
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
time: 0.06666667
value: 0
inSlope: 0
outSlope: 0

View file

@ -145,7 +145,26 @@ AnimationClip:
m_RotationOrder: 4
path: Hand
m_ScaleCurves: []
m_FloatCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
@ -175,6 +194,13 @@ AnimationClip:
typeID: 4
customType: 4
isPPtrCurve: 0
- serializedVersion: 2
path: 2485469132
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
@ -611,6 +637,25 @@ AnimationClip:
path: Hand
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2

View file

@ -160,7 +160,26 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
path: Head
m_FloatCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
@ -176,6 +195,13 @@ AnimationClip:
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2485469132
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
@ -782,6 +808,25 @@ AnimationClip:
path: Body
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2

View file

@ -179,7 +179,26 @@ AnimationClip:
m_RotationOrder: 4
path: Head
m_ScaleCurves: []
m_FloatCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
@ -223,6 +242,13 @@ AnimationClip:
typeID: 4
customType: 4
isPPtrCurve: 0
- serializedVersion: 2
path: 2485469132
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
@ -778,6 +804,25 @@ AnimationClip:
path: Head
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2

View file

@ -288,6 +288,25 @@ AnimationClip:
path: Head/Mouth
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
@ -373,6 +392,13 @@ AnimationClip:
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 2485469132
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
@ -1259,6 +1285,25 @@ AnimationClip:
path: Head/Mouth
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2

View file

@ -544,7 +544,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 1
value: 700
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
@ -595,6 +595,44 @@ AnimationClip:
path: Head/Mouth
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 725
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_SortingOrder
path: Head
classID: 212
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
@ -700,6 +738,20 @@ AnimationClip:
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 2485469132
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 3762991556
script: {fileID: 0}
typeID: 212
customType: 26
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
@ -2393,7 +2445,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 1
value: 700
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
@ -2444,6 +2496,44 @@ AnimationClip:
path: Head/Mouth
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 725
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_SortingOrder
path: Head
classID: 212
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2

View file

@ -459,7 +459,26 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
path: Head
m_FloatCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
@ -531,6 +550,13 @@ AnimationClip:
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 2485469132
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
@ -1962,6 +1988,25 @@ AnimationClip:
path: Hand
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Head/HeadCover
classID: 1
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2

View file

@ -902,6 +902,27 @@ TextureImporter:
indices:
edges: []
weights: []
- serializedVersion: 2
name: SlotMonster_29
rect:
serializedVersion: 2
x: 1530
y: 1374
width: 277
height: 346
alignment: 9
pivot: {x: 0.5, y: 0.351}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: e0c73a35dd3facd4480bf264b49d929d
internalID: -32620696
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []

View file

@ -11,51 +11,66 @@ namespace HeavenStudio.Games.Scripts_SlotMonster
public class SlotButton : MonoBehaviour
{
public bool pressed;
// public double timing;
public Color color; // used to ease between button colors and button flash colors! wow
public PlayerActionEvent input;
public bool missed;
[Header("Components")]
public Animator anim;
public SpriteRenderer[] srs;
[SerializeField] SpriteRenderer[] srs;
private bool flashing;
const int FLASH_FRAMES = 4;
private const float FLASH_FRAMES = 4f;
private int currentFrame;
private SlotMonster game;
public void Init(SlotMonster instance)
{
color = srs[0].color;
game = instance;
pressed = true;
color = srs[0].color;
}
private void LateUpdate()
{
if (flashing) {
foreach (var sr in srs) {
// sr.color = Color.Lerp(color, game.buttonFlashColor, currentFrame / FRAMES);
Color newColor = color;
if (pressed) {
newColor = Color.LerpUnclamped(color, Color.black, 0.5f);
} else if (flashing) {
float normalized = currentFrame / FLASH_FRAMES;
var normalized = currentFrame / FLASH_FRAMES;
Debug.Log("normalized : " + normalized);
float newR = EasingFunction.Linear(game.buttonFlashColor.r, color.r, normalized);
float newG = EasingFunction.Linear(game.buttonFlashColor.g, color.g, normalized);
float newB = EasingFunction.Linear(game.buttonFlashColor.b, color.b, normalized);
float newR = EasingFunction.Linear(game.buttonFlashColor.r, color.r, normalized);
float newG = EasingFunction.Linear(game.buttonFlashColor.g, color.g, normalized);
float newB = EasingFunction.Linear(game.buttonFlashColor.b, color.b, normalized);
sr.color = new Color(newR, newG, newB);
Debug.Log("sr.color : " + sr.color);
Debug.Log("currentFrame : " + currentFrame);
}
} else {
foreach (var sr in srs) {
sr.color = color;
}
newColor = new Color(newR, newG, newB);
// Debug.Log("currentFrame / FLASH_FRAMES : " + currentFrame + "/" + FLASH_FRAMES);
// newColor = Color.LerpUnclamped(color, game.buttonFlashColor, normalized);
// Debug.Log("color : " + color);
// Debug.Log("newColor : " + newColor);
}
foreach (var sr in srs) {
sr.color = newColor;
}
// Color newColor = Color.LerpUnclamped(color, tempColor, 0.45f);
// foreach (var sr in srs) {
// sr.color = color;
// }
}
public void Press()
public void Press(bool isHit)
{
anim.DoScaledAnimationAsync("Press", 0.5f);
pressed = true;
if (!isHit) {
missed = true;
input.Disable();
input.CleanUp();
}
}
public void TryFlash()

View file

@ -22,7 +22,7 @@ namespace HeavenStudio.Games.Loaders
function = delegate {
if (eventCaller.gameManager.minigameObj.TryGetComponent(out SlotMonster instance)) {
var e = eventCaller.currentEntity;
instance.StartInterval(e.beat, e.length, e["auto"], e["eyeType"], 0);
instance.StartInterval(e, e["auto"], e["eyeType"], 0);
}
},
defaultLength = 3f,
@ -77,6 +77,24 @@ namespace HeavenStudio.Games.Loaders
new Param("flash", new Color(1f, 1f, 0.68f), "Button Flash Color", "Set the color of the flash of the buttons."),
},
},
new GameAction("gameplayModifiers", "Gameplay Modifiers")
{
function = delegate {
if (eventCaller.gameManager.minigameObj.TryGetComponent(out SlotMonster instance)) {
var e = eventCaller.currentEntity;
instance.GameplayModifiers(e["lottery"], e["stars"]);
}
},
defaultLength = 0.5f,
priority = 1,
parameters = new List<Param>()
{
new Param("lottery", true, "Lottery", "Toggle if the win particles should play after a successful sequence.", new() {
new Param.CollapseParam((x, _) => (bool)x, new string[] { "stars" }),
}),
new Param("stars", false, "Use Stars", "Use stars instead of coins? (From the Korean version of RH DS)"),
},
},
}
);
}
@ -85,6 +103,7 @@ namespace HeavenStudio.Games.Loaders
namespace HeavenStudio.Games
{
using System.Linq;
using Scripts_SlotMonster;
public class SlotMonster : Minigame
{
@ -114,10 +133,13 @@ namespace HeavenStudio.Games
[SerializeField] Animator smAnim;
[SerializeField] Animator[] eyeAnims;
[Header("Objects")]
[SerializeField] SlotButton[] buttons;
public Color buttonFlashColor;
[SerializeField] ParticleSystem winParticles;
public Color buttonFlashColor = new(1f, 1f, 0.68f);
private List<RiqEntity> gameEntities;
private bool doWin = true;
private Sound rollingSound;
private int currentEyeSprite = 1;
@ -146,9 +168,9 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(double beat)
{
gameEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == "slotMonster");
gameEntities = gameManager.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == "slotMonster");
foreach (RiqEntity e in gameEntities.FindAll(e => e.datamodel == "slotMonster/startInterval" && e.beat < beat && e.beat + e.length > beat)) {
StartInterval(e.beat, e.length, e["auto"], e["eyeType"], beat);
StartInterval(e, e["auto"], e["eyeType"], beat);
}
}
@ -160,26 +182,22 @@ namespace HeavenStudio.Games
int thisButton = GetCurrentButton();
if (thisButton == -1) return false;
bool isLast = thisButton == maxButtons - 1;
string hitSfx = "slotMonster/stop_" + (isLast && isHit ? "hit" : (thisButton + 1));
SoundByte.PlayOneShotGame(hitSfx, forcePlay: true);
for (int i = thisButton; i < (isLast ? 3 : thisButton + 1); i++)
{
buttons[thisButton].Press();
buttons[thisButton].Press(isHit);
if (eyeAnims[thisButton].IsPlayingAnimationNames("Spin")) {
int eyeSprite = currentEyeSprite;
string anim = "EyeItem";
if (!isHit) {
do {
eyeSprite = UnityEngine.Random.Range(0, 9);
} while (eyeSprite == (currentEyeSprite - 1));
anim += eyeSprite + 1;
} else {
if (timing == 1) {
eyeSprite = UnityEngine.Random.Range(1, 9);
if (eyeSprite >= currentEyeSprite) eyeSprite++;
anim += eyeSprite;
} else { // only do all this if it's actually a hit
if (timing == -1) { // if the timing is early
eyeSprite = (eyeSprite + 1) % 9;
}
anim += eyeSprite + 1;
if (timing != 0) {
// string += lol
if (timing != 0) { // if it's a barely
anim += "Barely";
}
}
@ -187,19 +205,27 @@ namespace HeavenStudio.Games
eyeAnims[thisButton].Play(anim, 0, 0);
}
}
bool isMiss = buttons.Any(x => x.missed);
string hitSfx = "slotMonster/stop_" + (isLast && isHit && !isMiss ? "hit" : (thisButton + 1));
SoundByte.PlayOneShotGame(hitSfx, forcePlay: true);
if (isLast) {
if (rollingSound != null) rollingSound.Stop();
if (isHit && doWin) {
SoundByte.PlayOneShotGame("slotMonster/win");
winParticles.Play();
}
}
currentButton++;
return isLast && isHit;
}
public void StartInterval(double beat, float length, bool autoPass, int eyeSprite, double gameSwitchBeat)
public void StartInterval(RiqEntity si, bool autoPass, int eyeSprite, double gameSwitchBeat)
{
List<RiqEntity> slotActions = gameEntities.FindAll(e => e.datamodel == "slotMonster/slot" && e.beat >= beat && e.beat < beat + length);
List<RiqEntity> slotActions = gameEntities.FindAll(e => e.datamodel == "slotMonster/slot" && e.beat >= si.beat && e.beat < si.beat + si.length);
if (slotActions.Count <= 0) return;
SoundByte.PlayOneShotGame("slotMonster/start_touch", forcePlay: true);
smAnim.DoScaledAnimationFromBeatAsync("Prepare", 0.5f, beat);
smAnim.DoScaledAnimationFromBeatAsync("Prepare", 0.5f, si.beat);
foreach (var button in buttons) {
button.anim.Play("PopUp", 0, 1);
}
@ -232,14 +258,14 @@ namespace HeavenStudio.Games
BeatAction.New(this, actions);
if (autoPass) {
BeatAction.New(this, new() { new(beat + length, delegate {
BeatAction.New(this, new() { new(si.beat + si.length, delegate {
currentEyeSprite = eyeSprite == 0 ? UnityEngine.Random.Range(1, 10) : eyeSprite;
PassTurn(beat + length, 1, beat, slotActions);
PassTurn(si.beat + si.length, 1, si.beat, si, slotActions);
})});
}
}
public void PassTurn(double beat, float length, double startBeat = -1, List<RiqEntity> slotActions = null)
public void PassTurn(double beat, float length, double startBeat = -1, RiqEntity startInterval = null, List<RiqEntity> slotActions = null)
{
smAnim.DoScaledAnimationFromBeatAsync("Release", 0.5f, beat);
for (int i = 0; i < eyeAnims.Length; i++) {
@ -247,11 +273,12 @@ namespace HeavenStudio.Games
}
SoundByte.PlayOneShotGame("slotMonster/start_rolling", forcePlay: true);
rollingSound = SoundByte.PlayOneShotGame("slotMonster/rolling", looping: true, forcePlay: true);
if (startBeat < 0 || slotActions == null) {
var startInterval = gameEntities.FindLast(e => e.datamodel == "slotMonster/startInterval" && e.beat + e.length < beat);
startInterval ??= gameEntities.FindLast(e => e.datamodel == "slotMonster/startInterval" && e.beat + e.length < beat);
if (startBeat < 0) {
startBeat = startInterval.beat;
slotActions ??= gameEntities.FindAll(e => e.datamodel == "slotMonster/slot" && e.beat >= startInterval.beat && e.beat < startInterval.beat + startInterval.length);
}
slotActions ??= gameEntities.FindAll(e => e.datamodel == "slotMonster/slot" && e.beat >= startInterval.beat && e.beat < startInterval.beat + startInterval.length);
List<BeatAction.Action> actions = new();
for (int i = 0; i < Mathf.Min(slotActions.Count, 3); i++) // limit to 3 actions
@ -263,12 +290,16 @@ namespace HeavenStudio.Games
buttons[whichSlot].TryFlash();
}));
PlayerActionEvent input = ScheduleInput(beat, slotBeat - startBeat + length, InputAction_BasicPress, ButtonHit, null, null);
// input.IsHittable = () => { // ugh this breaks the input check
// int currentButton = GetCurrentButton();
// return currentButton == whichSlot && !buttonsPressed[whichSlot];
// };
PlayerActionEvent input = ScheduleInput(beat, slotBeat - startBeat + length, InputAction_BasicPress, ButtonHit, null, null, () => {
return GetCurrentButton() == whichSlot && !buttons[whichSlot].pressed;
});
}
actions.Add(new(beat + length + startInterval.beat + startInterval.length, delegate {
if (rollingSound != null) rollingSound.Stop();
if (buttons.Any(x => x.missed)) { // if it's a miss
smAnim.DoScaledAnimationAsync("Lose", 0.5f);
}
}));
BeatAction.New(this, actions);
}
@ -294,5 +325,11 @@ namespace HeavenStudio.Games
}
buttonFlashColor = flashColor;
}
public void GameplayModifiers(bool lottery, bool stars)
{
// var sheetAnim = winParticles.textureSheetAnimation;
doWin = lottery;
}
}
}