@battle-racing/br-common-lib 6.2.1-rc.0 → 6.2.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/data/all-tutorial-steps.js +44 -4
  2. package/dist/domains/command/Command.schema.d.ts +100 -3
  3. package/dist/domains/command/Command.schema.js +1 -1
  4. package/dist/domains/damage/Damage.schema.d.ts +5 -0
  5. package/dist/domains/flow/Flow.schema.d.ts +45 -1
  6. package/dist/domains/hardware/KartHardwareState.schema.d.ts +4 -1
  7. package/dist/domains/hardware/KartHardwareState.schema.js +2 -1
  8. package/dist/domains/hardware/ModuleStatus.schema.d.ts +5 -0
  9. package/dist/domains/hardware/rgb/RGB.const.d.ts +4 -0
  10. package/dist/domains/hardware/rgb/RGB.const.js +5 -1
  11. package/dist/domains/hardware/rgb/RGB.schema.d.ts +21 -0
  12. package/dist/domains/hardware/rgb/RGB.schema.js +8 -1
  13. package/dist/domains/hardware/rgb/RGB.types.d.ts +3 -1
  14. package/dist/domains/hardware/screen/ScreenDebug.schema.d.ts +4 -1
  15. package/dist/domains/hardware/screen/ScreenTutorial.schema.d.ts +27 -0
  16. package/dist/domains/hardware/screen/ScreenTutorial.schema.js +3 -1
  17. package/dist/domains/hardware/sound/Sound.const.d.ts +4 -0
  18. package/dist/domains/hardware/sound/Sound.const.js +5 -1
  19. package/dist/domains/hardware/sound/Sound.schema.d.ts +9 -0
  20. package/dist/domains/hardware/sound/Sound.schema.js +1 -0
  21. package/dist/domains/kart/Kart.schema.d.ts +4 -1
  22. package/dist/domains/powerUp/PowerUp.schema.d.ts +135 -3
  23. package/dist/domains/sounds/Sounds.const.d.ts +5 -0
  24. package/dist/domains/sounds/Sounds.const.js +5 -0
  25. package/dist/domains/sounds/Sounds.schema.d.ts +5 -0
  26. package/dist/domains/tutorial/Tutorial.const.d.ts +1 -0
  27. package/dist/domains/tutorial/Tutorial.const.js +1 -0
  28. package/dist/domains/tutorial/Tutorial.schema.d.ts +10 -0
  29. package/dist/domains/tutorial/Tutorial.schema.js +9 -2
  30. package/dist/domains/tutorial/Tutorial.types.d.ts +2 -1
  31. package/dist/domains/tutorial/TutorialConfig.schema.d.ts +224 -3
  32. package/dist/domains/tutorial/TutorialConfig.schema.js +7 -1
  33. package/package.json +1 -1
  34. package/src/data/all-tutorial-steps.ts +46 -4
  35. package/src/domains/command/Command.schema.ts +1 -1
  36. package/src/domains/hardware/KartHardwareState.schema.ts +3 -2
  37. package/src/domains/hardware/rgb/RGB.const.ts +5 -0
  38. package/src/domains/hardware/rgb/RGB.schema.ts +10 -1
  39. package/src/domains/hardware/rgb/RGB.types.ts +4 -0
  40. package/src/domains/hardware/screen/ScreenTutorial.schema.ts +3 -1
  41. package/src/domains/hardware/sound/Sound.const.ts +5 -0
  42. package/src/domains/hardware/sound/Sound.schema.ts +2 -1
  43. package/src/domains/sounds/Sounds.const.ts +5 -0
  44. package/src/domains/tutorial/Tutorial.const.ts +1 -0
  45. package/src/domains/tutorial/Tutorial.schema.ts +9 -1
  46. package/src/domains/tutorial/Tutorial.types.ts +2 -0
  47. package/src/domains/tutorial/TutorialConfig.schema.ts +7 -0
@@ -3,6 +3,9 @@ export declare const tutorialTimeoutListenEventSchema: z.ZodObject<{
3
3
  on: z.ZodLiteral<"timeout">;
4
4
  durationMs: z.ZodNumber;
5
5
  }, z.core.$strip>;
6
+ export declare const tutorialOperatorListenEventSchema: z.ZodObject<{
7
+ on: z.ZodLiteral<"operator">;
8
+ }, z.core.$strip>;
6
9
  export declare const tutorialWheelButtonListenEventSchema: z.ZodObject<{
7
10
  on: z.ZodLiteral<"wheelButton">;
8
11
  button: z.ZodEnum<{
@@ -23,6 +26,8 @@ export declare const tutorialCheckpointListenEventSchema: z.ZodObject<{
23
26
  export declare const tutorialListenEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
27
  on: z.ZodLiteral<"timeout">;
25
28
  durationMs: z.ZodNumber;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ on: z.ZodLiteral<"operator">;
26
31
  }, z.core.$strip>, z.ZodObject<{
27
32
  on: z.ZodLiteral<"wheelButton">;
28
33
  button: z.ZodEnum<{
@@ -67,6 +72,8 @@ export declare const tutorialStepConfigSchema: z.ZodObject<{
67
72
  listenEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
73
  on: z.ZodLiteral<"timeout">;
69
74
  durationMs: z.ZodNumber;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ on: z.ZodLiteral<"operator">;
70
77
  }, z.core.$strip>, z.ZodObject<{
71
78
  on: z.ZodLiteral<"wheelButton">;
72
79
  button: z.ZodEnum<{
@@ -324,6 +331,10 @@ export declare const tutorialStepConfigSchema: z.ZodObject<{
324
331
  }>;
325
332
  brightness: z.ZodNumber;
326
333
  effectTime: z.ZodNumber;
334
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
335
+ readonly FRONT: "front";
336
+ readonly BACK: "back";
337
+ }>>>;
327
338
  }, z.core.$strip>;
328
339
  }, z.core.$strip>, z.ZodObject<{
329
340
  module: z.ZodLiteral<"rgb">;
@@ -349,6 +360,10 @@ export declare const tutorialStepConfigSchema: z.ZodObject<{
349
360
  readonly EMERGENCY_EFFECT: "Emergency Effect";
350
361
  readonly WAIT_EFFECT: "Wait Effect";
351
362
  }>;
363
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
364
+ readonly FRONT: "front";
365
+ readonly BACK: "back";
366
+ }>>>;
352
367
  }, z.core.$strip>;
353
368
  }, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
354
369
  module: z.ZodLiteral<"speed">;
@@ -963,6 +978,33 @@ export declare const tutorialStepConfigSchema: z.ZodObject<{
963
978
  revision: z.ZodOptional<z.ZodNumber>;
964
979
  presentationRevision: z.ZodOptional<z.ZodNumber>;
965
980
  step: z.ZodLiteral<"TutorialCompleted">;
981
+ hud: z.ZodOptional<z.ZodObject<{
982
+ coins: z.ZodNonOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
983
+ position: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
984
+ current: z.ZodNullable<z.ZodNumber>;
985
+ total: z.ZodNullable<z.ZodNumber>;
986
+ }, z.core.$strip>>>;
987
+ laps: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
988
+ current: z.ZodNullable<z.ZodNumber>;
989
+ total: z.ZodNullable<z.ZodNumber>;
990
+ }, z.core.$strip>>>;
991
+ gameTimeLeft: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
992
+ minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
993
+ seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
994
+ }, z.core.$strip>>>;
995
+ powerUp: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
996
+ readonly BATTLE_GOD: "Battle God";
997
+ readonly BATTLE_STAR: "Battle Star";
998
+ readonly BATTLE_SHOT: "Battle Shot";
999
+ readonly BATTLE_NITRO: "Battle Nitro";
1000
+ readonly BATTLE_PULSE: "Battle Pulse";
1001
+ readonly BATTLE_TRAP: "Battle Trap";
1002
+ readonly BATTLE_SHIELD: "Battle Shield";
1003
+ readonly BATTLE_TURBO: "Battle Turbo";
1004
+ readonly BATTLE_BLUE_SHOT: "Battle Blue Shot";
1005
+ }>, z.ZodLiteral<"Clear PowerUp">]>>>;
1006
+ powerUpAnimationTimeSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1007
+ }, z.core.$strip>>;
966
1008
  }, z.core.$strip>], "step">;
967
1009
  }, z.core.$strip>, z.ZodObject<{
968
1010
  module: z.ZodLiteral<"screen">;
@@ -1028,10 +1070,19 @@ export declare const tutorialStepConfigSchema: z.ZodObject<{
1028
1070
  readonly SYSTEM_STARTED: "system_started.mp3";
1029
1071
  readonly WARNING_ALERT_THIS_IS_NOT_A_TEST: "warning_alert_this_is_not_a_test.mp3";
1030
1072
  readonly WINNER_LAUGH: "winner_laugh.mp3";
1073
+ readonly TUTORIAL_COUNTDOWN: "tutorial/3,2,1 GO.mp3";
1031
1074
  readonly TUTORIAL_WELCOME: "tutorial/welcome_to_battle_racing.mp3";
1075
+ readonly TUTORIAL_SECURE_BELONGINGS: "tutorial/secure_belongins.mp3";
1076
+ readonly TUTORIAL_BUCKLE_UP: "tutorial/buckle_up.mp3";
1032
1077
  readonly TUTORIAL_GAS_PEDAL: "tutorial/gas_pedal.mp3";
1078
+ readonly TUTORIAL_BUTTON_PRESS: "tutorial/button_press.mp3";
1079
+ readonly TUTORIAL_FINAL: "tutorial/final_tutorial.mp3";
1033
1080
  }>;
1034
- durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
1081
+ channel: z.ZodOptional<z.ZodEnum<{
1082
+ readonly MAIN: "main";
1083
+ readonly EFFECT: "effect";
1084
+ }>>;
1085
+ durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
1035
1086
  }, z.core.$strip>;
1036
1087
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
1037
1088
  module: z.ZodLiteral<"emergency">;
@@ -1078,6 +1129,45 @@ export declare const tutorialPhaseConfigSchema: z.ZodObject<{
1078
1129
  }>;
1079
1130
  name: z.ZodString;
1080
1131
  index: z.ZodNumber;
1132
+ inputFeedbackSound: z.ZodOptional<z.ZodObject<{
1133
+ soundName: z.ZodEnum<{
1134
+ readonly BATTLE_GOD_ACTIVATION: "battle_god_activation.mp3";
1135
+ readonly BATTLE_LASER_ACTIVATION: "battle_laser_activation.mp3";
1136
+ readonly BATTLE_LASER_DAMAGE: "battle_laser_damage.mp3";
1137
+ readonly BATTLE_PULSE_ACTIVATION: "battle_pulse_activation.mp3";
1138
+ readonly BATTLE_PULSE_DAMAGE: "battle_pulse_damage.mp3";
1139
+ readonly BATTLE_SHIELD_ACTIVATION: "battle_shield_activation.mp3";
1140
+ readonly BATTLE_SHOT_ACTIVATION: "battle_shot_activation.mp3";
1141
+ readonly BATTLE_SHOT_DAMAGE: "battle_shot_damage.mp3";
1142
+ readonly BATTLE_STAR_DAMAGE: "battle_star_damage.mp3";
1143
+ readonly BATTLE_TRAP_ACTIVATION: "battle_trap_activation.mp3";
1144
+ readonly BATTLE_TRAP_DAMAGE: "battle_trap_damage.mp3";
1145
+ readonly BATTLE_TURBO_ACTIVATION: "battle_turbo_activation.mp3";
1146
+ readonly COUNTDOWN_3_2_1: "countdown_3_2_1.mp3";
1147
+ readonly EMERGENCY_ALERT: "emergency_alert.mp3";
1148
+ readonly ENGINE_START: "engine_start.mp3";
1149
+ readonly FINAL_LAP_MARIO_KART: "final_lap_mario_kart.mp3";
1150
+ readonly KART_SKIDING: "kart_skiding.mp3";
1151
+ readonly PICK_COIN_X2: "pick_coin_x2.mp3";
1152
+ readonly POWER_UP_SELECTION: "power_up_selection.mp3";
1153
+ readonly SAD_TRUMPET_LOSER: "sad_trumpet_loser.mp3";
1154
+ readonly SYSTEM_STARTED: "system_started.mp3";
1155
+ readonly WARNING_ALERT_THIS_IS_NOT_A_TEST: "warning_alert_this_is_not_a_test.mp3";
1156
+ readonly WINNER_LAUGH: "winner_laugh.mp3";
1157
+ readonly TUTORIAL_COUNTDOWN: "tutorial/3,2,1 GO.mp3";
1158
+ readonly TUTORIAL_WELCOME: "tutorial/welcome_to_battle_racing.mp3";
1159
+ readonly TUTORIAL_SECURE_BELONGINGS: "tutorial/secure_belongins.mp3";
1160
+ readonly TUTORIAL_BUCKLE_UP: "tutorial/buckle_up.mp3";
1161
+ readonly TUTORIAL_GAS_PEDAL: "tutorial/gas_pedal.mp3";
1162
+ readonly TUTORIAL_BUTTON_PRESS: "tutorial/button_press.mp3";
1163
+ readonly TUTORIAL_FINAL: "tutorial/final_tutorial.mp3";
1164
+ }>;
1165
+ durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>>;
1166
+ channel: z.ZodOptional<z.ZodEnum<{
1167
+ readonly MAIN: "main";
1168
+ readonly EFFECT: "effect";
1169
+ }>>;
1170
+ }, z.core.$strip>>;
1081
1171
  steps: z.ZodArray<z.ZodObject<{
1082
1172
  id: z.ZodString;
1083
1173
  index: z.ZodNumber;
@@ -1106,6 +1196,8 @@ export declare const tutorialPhaseConfigSchema: z.ZodObject<{
1106
1196
  listenEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1107
1197
  on: z.ZodLiteral<"timeout">;
1108
1198
  durationMs: z.ZodNumber;
1199
+ }, z.core.$strip>, z.ZodObject<{
1200
+ on: z.ZodLiteral<"operator">;
1109
1201
  }, z.core.$strip>, z.ZodObject<{
1110
1202
  on: z.ZodLiteral<"wheelButton">;
1111
1203
  button: z.ZodEnum<{
@@ -1363,6 +1455,10 @@ export declare const tutorialPhaseConfigSchema: z.ZodObject<{
1363
1455
  }>;
1364
1456
  brightness: z.ZodNumber;
1365
1457
  effectTime: z.ZodNumber;
1458
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1459
+ readonly FRONT: "front";
1460
+ readonly BACK: "back";
1461
+ }>>>;
1366
1462
  }, z.core.$strip>;
1367
1463
  }, z.core.$strip>, z.ZodObject<{
1368
1464
  module: z.ZodLiteral<"rgb">;
@@ -1388,6 +1484,10 @@ export declare const tutorialPhaseConfigSchema: z.ZodObject<{
1388
1484
  readonly EMERGENCY_EFFECT: "Emergency Effect";
1389
1485
  readonly WAIT_EFFECT: "Wait Effect";
1390
1486
  }>;
1487
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1488
+ readonly FRONT: "front";
1489
+ readonly BACK: "back";
1490
+ }>>>;
1391
1491
  }, z.core.$strip>;
1392
1492
  }, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
1393
1493
  module: z.ZodLiteral<"speed">;
@@ -2002,6 +2102,33 @@ export declare const tutorialPhaseConfigSchema: z.ZodObject<{
2002
2102
  revision: z.ZodOptional<z.ZodNumber>;
2003
2103
  presentationRevision: z.ZodOptional<z.ZodNumber>;
2004
2104
  step: z.ZodLiteral<"TutorialCompleted">;
2105
+ hud: z.ZodOptional<z.ZodObject<{
2106
+ coins: z.ZodNonOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
2107
+ position: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
2108
+ current: z.ZodNullable<z.ZodNumber>;
2109
+ total: z.ZodNullable<z.ZodNumber>;
2110
+ }, z.core.$strip>>>;
2111
+ laps: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
2112
+ current: z.ZodNullable<z.ZodNumber>;
2113
+ total: z.ZodNullable<z.ZodNumber>;
2114
+ }, z.core.$strip>>>;
2115
+ gameTimeLeft: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
2116
+ minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2117
+ seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2118
+ }, z.core.$strip>>>;
2119
+ powerUp: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
2120
+ readonly BATTLE_GOD: "Battle God";
2121
+ readonly BATTLE_STAR: "Battle Star";
2122
+ readonly BATTLE_SHOT: "Battle Shot";
2123
+ readonly BATTLE_NITRO: "Battle Nitro";
2124
+ readonly BATTLE_PULSE: "Battle Pulse";
2125
+ readonly BATTLE_TRAP: "Battle Trap";
2126
+ readonly BATTLE_SHIELD: "Battle Shield";
2127
+ readonly BATTLE_TURBO: "Battle Turbo";
2128
+ readonly BATTLE_BLUE_SHOT: "Battle Blue Shot";
2129
+ }>, z.ZodLiteral<"Clear PowerUp">]>>>;
2130
+ powerUpAnimationTimeSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2131
+ }, z.core.$strip>>;
2005
2132
  }, z.core.$strip>], "step">;
2006
2133
  }, z.core.$strip>, z.ZodObject<{
2007
2134
  module: z.ZodLiteral<"screen">;
@@ -2067,10 +2194,19 @@ export declare const tutorialPhaseConfigSchema: z.ZodObject<{
2067
2194
  readonly SYSTEM_STARTED: "system_started.mp3";
2068
2195
  readonly WARNING_ALERT_THIS_IS_NOT_A_TEST: "warning_alert_this_is_not_a_test.mp3";
2069
2196
  readonly WINNER_LAUGH: "winner_laugh.mp3";
2197
+ readonly TUTORIAL_COUNTDOWN: "tutorial/3,2,1 GO.mp3";
2070
2198
  readonly TUTORIAL_WELCOME: "tutorial/welcome_to_battle_racing.mp3";
2199
+ readonly TUTORIAL_SECURE_BELONGINGS: "tutorial/secure_belongins.mp3";
2200
+ readonly TUTORIAL_BUCKLE_UP: "tutorial/buckle_up.mp3";
2071
2201
  readonly TUTORIAL_GAS_PEDAL: "tutorial/gas_pedal.mp3";
2202
+ readonly TUTORIAL_BUTTON_PRESS: "tutorial/button_press.mp3";
2203
+ readonly TUTORIAL_FINAL: "tutorial/final_tutorial.mp3";
2072
2204
  }>;
2073
- durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
2205
+ channel: z.ZodOptional<z.ZodEnum<{
2206
+ readonly MAIN: "main";
2207
+ readonly EFFECT: "effect";
2208
+ }>>;
2209
+ durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
2074
2210
  }, z.core.$strip>;
2075
2211
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
2076
2212
  module: z.ZodLiteral<"emergency">;
@@ -2121,6 +2257,45 @@ export declare const tutorialMasterConfigSchema: z.ZodObject<{
2121
2257
  }>;
2122
2258
  name: z.ZodString;
2123
2259
  index: z.ZodNumber;
2260
+ inputFeedbackSound: z.ZodOptional<z.ZodObject<{
2261
+ soundName: z.ZodEnum<{
2262
+ readonly BATTLE_GOD_ACTIVATION: "battle_god_activation.mp3";
2263
+ readonly BATTLE_LASER_ACTIVATION: "battle_laser_activation.mp3";
2264
+ readonly BATTLE_LASER_DAMAGE: "battle_laser_damage.mp3";
2265
+ readonly BATTLE_PULSE_ACTIVATION: "battle_pulse_activation.mp3";
2266
+ readonly BATTLE_PULSE_DAMAGE: "battle_pulse_damage.mp3";
2267
+ readonly BATTLE_SHIELD_ACTIVATION: "battle_shield_activation.mp3";
2268
+ readonly BATTLE_SHOT_ACTIVATION: "battle_shot_activation.mp3";
2269
+ readonly BATTLE_SHOT_DAMAGE: "battle_shot_damage.mp3";
2270
+ readonly BATTLE_STAR_DAMAGE: "battle_star_damage.mp3";
2271
+ readonly BATTLE_TRAP_ACTIVATION: "battle_trap_activation.mp3";
2272
+ readonly BATTLE_TRAP_DAMAGE: "battle_trap_damage.mp3";
2273
+ readonly BATTLE_TURBO_ACTIVATION: "battle_turbo_activation.mp3";
2274
+ readonly COUNTDOWN_3_2_1: "countdown_3_2_1.mp3";
2275
+ readonly EMERGENCY_ALERT: "emergency_alert.mp3";
2276
+ readonly ENGINE_START: "engine_start.mp3";
2277
+ readonly FINAL_LAP_MARIO_KART: "final_lap_mario_kart.mp3";
2278
+ readonly KART_SKIDING: "kart_skiding.mp3";
2279
+ readonly PICK_COIN_X2: "pick_coin_x2.mp3";
2280
+ readonly POWER_UP_SELECTION: "power_up_selection.mp3";
2281
+ readonly SAD_TRUMPET_LOSER: "sad_trumpet_loser.mp3";
2282
+ readonly SYSTEM_STARTED: "system_started.mp3";
2283
+ readonly WARNING_ALERT_THIS_IS_NOT_A_TEST: "warning_alert_this_is_not_a_test.mp3";
2284
+ readonly WINNER_LAUGH: "winner_laugh.mp3";
2285
+ readonly TUTORIAL_COUNTDOWN: "tutorial/3,2,1 GO.mp3";
2286
+ readonly TUTORIAL_WELCOME: "tutorial/welcome_to_battle_racing.mp3";
2287
+ readonly TUTORIAL_SECURE_BELONGINGS: "tutorial/secure_belongins.mp3";
2288
+ readonly TUTORIAL_BUCKLE_UP: "tutorial/buckle_up.mp3";
2289
+ readonly TUTORIAL_GAS_PEDAL: "tutorial/gas_pedal.mp3";
2290
+ readonly TUTORIAL_BUTTON_PRESS: "tutorial/button_press.mp3";
2291
+ readonly TUTORIAL_FINAL: "tutorial/final_tutorial.mp3";
2292
+ }>;
2293
+ durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>>;
2294
+ channel: z.ZodOptional<z.ZodEnum<{
2295
+ readonly MAIN: "main";
2296
+ readonly EFFECT: "effect";
2297
+ }>>;
2298
+ }, z.core.$strip>>;
2124
2299
  steps: z.ZodArray<z.ZodObject<{
2125
2300
  id: z.ZodString;
2126
2301
  index: z.ZodNumber;
@@ -2149,6 +2324,8 @@ export declare const tutorialMasterConfigSchema: z.ZodObject<{
2149
2324
  listenEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
2150
2325
  on: z.ZodLiteral<"timeout">;
2151
2326
  durationMs: z.ZodNumber;
2327
+ }, z.core.$strip>, z.ZodObject<{
2328
+ on: z.ZodLiteral<"operator">;
2152
2329
  }, z.core.$strip>, z.ZodObject<{
2153
2330
  on: z.ZodLiteral<"wheelButton">;
2154
2331
  button: z.ZodEnum<{
@@ -2406,6 +2583,10 @@ export declare const tutorialMasterConfigSchema: z.ZodObject<{
2406
2583
  }>;
2407
2584
  brightness: z.ZodNumber;
2408
2585
  effectTime: z.ZodNumber;
2586
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2587
+ readonly FRONT: "front";
2588
+ readonly BACK: "back";
2589
+ }>>>;
2409
2590
  }, z.core.$strip>;
2410
2591
  }, z.core.$strip>, z.ZodObject<{
2411
2592
  module: z.ZodLiteral<"rgb">;
@@ -2431,6 +2612,10 @@ export declare const tutorialMasterConfigSchema: z.ZodObject<{
2431
2612
  readonly EMERGENCY_EFFECT: "Emergency Effect";
2432
2613
  readonly WAIT_EFFECT: "Wait Effect";
2433
2614
  }>;
2615
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2616
+ readonly FRONT: "front";
2617
+ readonly BACK: "back";
2618
+ }>>>;
2434
2619
  }, z.core.$strip>;
2435
2620
  }, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
2436
2621
  module: z.ZodLiteral<"speed">;
@@ -3045,6 +3230,33 @@ export declare const tutorialMasterConfigSchema: z.ZodObject<{
3045
3230
  revision: z.ZodOptional<z.ZodNumber>;
3046
3231
  presentationRevision: z.ZodOptional<z.ZodNumber>;
3047
3232
  step: z.ZodLiteral<"TutorialCompleted">;
3233
+ hud: z.ZodOptional<z.ZodObject<{
3234
+ coins: z.ZodNonOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
3235
+ position: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
3236
+ current: z.ZodNullable<z.ZodNumber>;
3237
+ total: z.ZodNullable<z.ZodNumber>;
3238
+ }, z.core.$strip>>>;
3239
+ laps: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
3240
+ current: z.ZodNullable<z.ZodNumber>;
3241
+ total: z.ZodNullable<z.ZodNumber>;
3242
+ }, z.core.$strip>>>;
3243
+ gameTimeLeft: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
3244
+ minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3245
+ seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3246
+ }, z.core.$strip>>>;
3247
+ powerUp: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
3248
+ readonly BATTLE_GOD: "Battle God";
3249
+ readonly BATTLE_STAR: "Battle Star";
3250
+ readonly BATTLE_SHOT: "Battle Shot";
3251
+ readonly BATTLE_NITRO: "Battle Nitro";
3252
+ readonly BATTLE_PULSE: "Battle Pulse";
3253
+ readonly BATTLE_TRAP: "Battle Trap";
3254
+ readonly BATTLE_SHIELD: "Battle Shield";
3255
+ readonly BATTLE_TURBO: "Battle Turbo";
3256
+ readonly BATTLE_BLUE_SHOT: "Battle Blue Shot";
3257
+ }>, z.ZodLiteral<"Clear PowerUp">]>>>;
3258
+ powerUpAnimationTimeSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3259
+ }, z.core.$strip>>;
3048
3260
  }, z.core.$strip>], "step">;
3049
3261
  }, z.core.$strip>, z.ZodObject<{
3050
3262
  module: z.ZodLiteral<"screen">;
@@ -3110,10 +3322,19 @@ export declare const tutorialMasterConfigSchema: z.ZodObject<{
3110
3322
  readonly SYSTEM_STARTED: "system_started.mp3";
3111
3323
  readonly WARNING_ALERT_THIS_IS_NOT_A_TEST: "warning_alert_this_is_not_a_test.mp3";
3112
3324
  readonly WINNER_LAUGH: "winner_laugh.mp3";
3325
+ readonly TUTORIAL_COUNTDOWN: "tutorial/3,2,1 GO.mp3";
3113
3326
  readonly TUTORIAL_WELCOME: "tutorial/welcome_to_battle_racing.mp3";
3327
+ readonly TUTORIAL_SECURE_BELONGINGS: "tutorial/secure_belongins.mp3";
3328
+ readonly TUTORIAL_BUCKLE_UP: "tutorial/buckle_up.mp3";
3114
3329
  readonly TUTORIAL_GAS_PEDAL: "tutorial/gas_pedal.mp3";
3330
+ readonly TUTORIAL_BUTTON_PRESS: "tutorial/button_press.mp3";
3331
+ readonly TUTORIAL_FINAL: "tutorial/final_tutorial.mp3";
3115
3332
  }>;
3116
- durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
3333
+ channel: z.ZodOptional<z.ZodEnum<{
3334
+ readonly MAIN: "main";
3335
+ readonly EFFECT: "effect";
3336
+ }>>;
3337
+ durationMs: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"infinite">]>, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodString]>]>>;
3117
3338
  }, z.core.$strip>;
3118
3339
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
3119
3340
  module: z.ZodLiteral<"emergency">;
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tutorialMasterConfigSchema = exports.tutorialPhaseConfigSchema = exports.tutorialStepConfigSchema = exports.tutorialListenEventSchema = exports.tutorialCheckpointListenEventSchema = exports.tutorialWheelButtonListenEventSchema = exports.tutorialTimeoutListenEventSchema = void 0;
3
+ exports.tutorialMasterConfigSchema = exports.tutorialPhaseConfigSchema = exports.tutorialStepConfigSchema = exports.tutorialListenEventSchema = exports.tutorialCheckpointListenEventSchema = exports.tutorialWheelButtonListenEventSchema = exports.tutorialOperatorListenEventSchema = exports.tutorialTimeoutListenEventSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const Command_schema_1 = require("../command/Command.schema");
6
+ const sound_1 = require("../hardware/sound");
6
7
  const Tutorial_const_1 = require("./Tutorial.const");
7
8
  const Tutorial_schema_1 = require("./Tutorial.schema");
8
9
  exports.tutorialTimeoutListenEventSchema = zod_1.z.object({
9
10
  on: zod_1.z.literal(Tutorial_const_1.TUTORIAL_LISTEN_EVENT_ON.TIMEOUT),
10
11
  durationMs: zod_1.z.number().int().positive(),
11
12
  });
13
+ exports.tutorialOperatorListenEventSchema = zod_1.z.object({
14
+ on: zod_1.z.literal(Tutorial_const_1.TUTORIAL_LISTEN_EVENT_ON.OPERATOR),
15
+ });
12
16
  exports.tutorialWheelButtonListenEventSchema = zod_1.z.object({
13
17
  on: zod_1.z.literal(Tutorial_const_1.TUTORIAL_LISTEN_EVENT_ON.WHEEL_BUTTON),
14
18
  button: Tutorial_schema_1.tutorialSteeringWheelButtonSchema,
@@ -19,6 +23,7 @@ exports.tutorialCheckpointListenEventSchema = zod_1.z.object({
19
23
  });
20
24
  exports.tutorialListenEventSchema = zod_1.z.discriminatedUnion('on', [
21
25
  exports.tutorialTimeoutListenEventSchema,
26
+ exports.tutorialOperatorListenEventSchema,
22
27
  exports.tutorialWheelButtonListenEventSchema,
23
28
  exports.tutorialCheckpointListenEventSchema,
24
29
  ]);
@@ -35,6 +40,7 @@ exports.tutorialPhaseConfigSchema = zod_1.z.object({
35
40
  id: Tutorial_schema_1.tutorialPhaseIdSchema,
36
41
  name: zod_1.z.string().min(1),
37
42
  index: zod_1.z.number().int().nonnegative(),
43
+ inputFeedbackSound: sound_1.playSoundOptionsSchema.optional(),
38
44
  steps: zod_1.z.array(exports.tutorialStepConfigSchema).min(1),
39
45
  });
40
46
  exports.tutorialMasterConfigSchema = zod_1.z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "6.2.1-rc.0",
3
+ "version": "6.2.1-rc.2",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  AllCommandsConfig,
3
+ PLAY_SOUND_DURATION,
3
4
  POWER_UP_NAME,
5
+ SOUND_CHANNEL,
4
6
  SOUND_NAME,
5
7
  ScreenTutorialHud,
6
8
  TUTORIAL_LISTEN_EVENT_ON,
@@ -72,6 +74,13 @@ export const allTutorialConfig: TutorialMasterConfig = {
72
74
  step: TUTORIAL_SCREEN_STEP.COUNTDOWN,
73
75
  },
74
76
  },
77
+ {
78
+ module: 'sound',
79
+ action: 'play',
80
+ params: {
81
+ soundName: SOUND_NAME.TUTORIAL_COUNTDOWN,
82
+ },
83
+ },
75
84
  ],
76
85
  },
77
86
  {
@@ -81,7 +90,7 @@ export const allTutorialConfig: TutorialMasterConfig = {
81
90
  screenStep: TUTORIAL_SCREEN_STEP.WELCOME,
82
91
  listenEvent: {
83
92
  on: TUTORIAL_LISTEN_EVENT_ON.TIMEOUT,
84
- durationMs: 6000,
93
+ durationMs: 5000,
85
94
  },
86
95
  triggerCommands: [
87
96
  ...stopKartCommands,
@@ -108,7 +117,7 @@ export const allTutorialConfig: TutorialMasterConfig = {
108
117
  screenStep: TUTORIAL_SCREEN_STEP.PERSONAL_ITEMS,
109
118
  listenEvent: {
110
119
  on: TUTORIAL_LISTEN_EVENT_ON.TIMEOUT,
111
- durationMs: 4000,
120
+ durationMs: 5000,
112
121
  },
113
122
  triggerCommands: [
114
123
  ...stopKartCommands,
@@ -119,6 +128,13 @@ export const allTutorialConfig: TutorialMasterConfig = {
119
128
  step: TUTORIAL_SCREEN_STEP.PERSONAL_ITEMS,
120
129
  },
121
130
  },
131
+ {
132
+ module: 'sound',
133
+ action: 'play',
134
+ params: {
135
+ soundName: SOUND_NAME.TUTORIAL_SECURE_BELONGINGS,
136
+ },
137
+ },
122
138
  ],
123
139
  },
124
140
  {
@@ -139,6 +155,13 @@ export const allTutorialConfig: TutorialMasterConfig = {
139
155
  step: TUTORIAL_SCREEN_STEP.SEAT_BELT,
140
156
  },
141
157
  },
158
+ {
159
+ module: 'sound',
160
+ action: 'play',
161
+ params: {
162
+ soundName: SOUND_NAME.TUTORIAL_BUCKLE_UP,
163
+ },
164
+ },
142
165
  ],
143
166
  },
144
167
  {
@@ -195,6 +218,10 @@ export const allTutorialConfig: TutorialMasterConfig = {
195
218
  id: TUTORIAL_PHASE_ID.CONTROLS_AND_HUD,
196
219
  name: 'Controls and HUD',
197
220
  index: 1,
221
+ inputFeedbackSound: {
222
+ soundName: SOUND_NAME.TUTORIAL_BUTTON_PRESS,
223
+ channel: SOUND_CHANNEL.EFFECT,
224
+ },
198
225
  steps: [
199
226
  {
200
227
  id: 'step_wheel_0_of_2',
@@ -429,6 +456,13 @@ export const allTutorialConfig: TutorialMasterConfig = {
429
456
  hud: defaultTutorialHud,
430
457
  },
431
458
  },
459
+ {
460
+ module: 'sound',
461
+ action: 'play',
462
+ params: {
463
+ soundName: SOUND_NAME.POWER_UP_SELECTION,
464
+ },
465
+ },
432
466
  ],
433
467
  },
434
468
  {
@@ -466,8 +500,7 @@ export const allTutorialConfig: TutorialMasterConfig = {
466
500
  name: 'Tutorial Completed Screen',
467
501
  screenStep: TUTORIAL_SCREEN_STEP.TUTORIAL_COMPLETED,
468
502
  listenEvent: {
469
- on: TUTORIAL_LISTEN_EVENT_ON.TIMEOUT,
470
- durationMs: 5000,
503
+ on: TUTORIAL_LISTEN_EVENT_ON.OPERATOR,
471
504
  },
472
505
  triggerCommands: [
473
506
  ...stopKartCommands,
@@ -476,6 +509,15 @@ export const allTutorialConfig: TutorialMasterConfig = {
476
509
  action: 'showTutorialView',
477
510
  params: {
478
511
  step: TUTORIAL_SCREEN_STEP.TUTORIAL_COMPLETED,
512
+ hud: defaultTutorialHud,
513
+ },
514
+ },
515
+ {
516
+ module: 'sound',
517
+ action: 'play',
518
+ params: {
519
+ soundName: SOUND_NAME.TUTORIAL_FINAL,
520
+ durationMs: PLAY_SOUND_DURATION.INFINITE,
479
521
  },
480
522
  },
481
523
  ],
@@ -45,7 +45,7 @@ export const speedModuleCommandSchema = z.union([
45
45
 
46
46
  // --- Sound Commands ---
47
47
  export const playSoundActionCommandOptionsSchema = playSoundOptionsSchema.omit({ durationMs: true }).extend({
48
- durationMs: arithmeticOrNumberSchema.optional(),
48
+ durationMs: z.union([playSoundOptionsSchema.shape.durationMs.unwrap(), arithmeticExpressionSchema]).optional(),
49
49
  });
50
50
 
51
51
  export const soundModuleCommandSchema = z.object({
@@ -1,6 +1,6 @@
1
1
  import { checkpointTypeSchema } from '../checkpoint/Checkpoint.schema';
2
2
  import { flagStatusSchema } from './flag';
3
- import { rgbStatusSchema } from './rgb';
3
+ import { rgbModuleLabelSchema, rgbStatusSchema } from './rgb';
4
4
  import { steeringWheelModuleStatusSchema } from './steering-wheel';
5
5
  import { screenStatusSchema } from './screen';
6
6
  import { speedStatusSchema } from './speed';
@@ -14,7 +14,8 @@ export const kartHardwareStateSchema = z.object({
14
14
  configured: z.number(),
15
15
  })
16
16
  .nullable(),
17
- rgb: rgbStatusSchema.nullable(),
17
+ // Only the configured RGB modules have a key
18
+ rgb: z.partialRecord(rgbModuleLabelSchema, rgbStatusSchema),
18
19
  flag: z
19
20
  .object({
20
21
  status: flagStatusSchema,
@@ -11,3 +11,8 @@ export const RGB_ACTION_COMMANDS = {
11
11
  EXEC: 'Exec',
12
12
  CONFIGURE: 'Configure',
13
13
  } as const;
14
+
15
+ export const RGB_MODULE_LABEL = {
16
+ FRONT: 'front',
17
+ BACK: 'back',
18
+ } as const;
@@ -1,13 +1,20 @@
1
1
  import { z } from 'zod';
2
2
  import { colorNameSchema } from '../../color';
3
3
  import { kartEffectSchema } from '../../hardware/kart-effect';
4
- import { RGB_STATUS, RGB_ACTION_COMMANDS } from './RGB.const';
4
+ import { RGB_STATUS, RGB_ACTION_COMMANDS, RGB_MODULE_LABEL } from './RGB.const';
5
5
 
6
6
  export const rgbStatusSchema = z.enum(RGB_STATUS);
7
7
 
8
8
  export const rgbActionCommandSchema = z.enum(RGB_ACTION_COMMANDS);
9
9
 
10
+ export const rgbModuleLabelSchema = z.enum(RGB_MODULE_LABEL);
11
+
12
+ // When targets is missing the command goes to every configured RGB module
13
+ export const rgbTargetsSchema = z.array(rgbModuleLabelSchema).min(1).optional();
14
+
10
15
  export const rgbModuleStatusSchema = z.object({
16
+ label: rgbModuleLabelSchema,
17
+ address: z.number(),
11
18
  rgbStatus: rgbStatusSchema,
12
19
  kartColor: colorNameSchema,
13
20
  });
@@ -16,8 +23,10 @@ export const rgbConfigurationOptionsSchema = z.object({
16
23
  kartColor: colorNameSchema,
17
24
  brightness: z.number().min(0).max(100),
18
25
  effectTime: z.number().min(1).max(25),
26
+ targets: rgbTargetsSchema,
19
27
  });
20
28
 
21
29
  export const rgbShowEffectOptionsSchema = z.object({
22
30
  effect: kartEffectSchema,
31
+ targets: rgbTargetsSchema,
23
32
  });
@@ -2,9 +2,11 @@ import { z } from 'zod';
2
2
  import {
3
3
  rgbActionCommandSchema,
4
4
  rgbConfigurationOptionsSchema,
5
+ rgbModuleLabelSchema,
5
6
  rgbModuleStatusSchema,
6
7
  rgbShowEffectOptionsSchema,
7
8
  rgbStatusSchema,
9
+ rgbTargetsSchema,
8
10
  } from './RGB.schema';
9
11
 
10
12
  export type RGBStatus = z.infer<typeof rgbStatusSchema>;
@@ -12,3 +14,5 @@ export type RGBModuleStatus = z.infer<typeof rgbModuleStatusSchema>;
12
14
  export type RGBConfigurationOptions = z.infer<typeof rgbConfigurationOptionsSchema>;
13
15
  export type RGBShowEffectOptions = z.infer<typeof rgbShowEffectOptionsSchema>;
14
16
  export type RGBActionCommand = z.infer<typeof rgbActionCommandSchema>;
17
+ export type RGBModuleLabel = z.infer<typeof rgbModuleLabelSchema>;
18
+ export type RGBTargets = z.infer<typeof rgbTargetsSchema>;
@@ -60,5 +60,7 @@ export const screenTutorialViewInputSchema = z.discriminatedUnion('step', [
60
60
  createHudTutorialStepSchema(TUTORIAL_SCREEN_STEP.POWER_UP_NITRO_READY),
61
61
  createHudTutorialStepSchema(TUTORIAL_SCREEN_STEP.POWER_UP_RETURN_TO_HUD),
62
62
 
63
- createStaticTutorialStepSchema(TUTORIAL_SCREEN_STEP.TUTORIAL_COMPLETED),
63
+ createStaticTutorialStepSchema(TUTORIAL_SCREEN_STEP.TUTORIAL_COMPLETED).extend({
64
+ hud: screenTutorialHudSchema.optional(),
65
+ }),
64
66
  ]);
@@ -2,6 +2,11 @@ export const PLAY_SOUND_DURATION = {
2
2
  INFINITE: 'infinite',
3
3
  } as const;
4
4
 
5
+ export const SOUND_CHANNEL = {
6
+ MAIN: 'main',
7
+ EFFECT: 'effect',
8
+ } as const;
9
+
5
10
  export const SOUND_ACTION_COMMAND = {
6
11
  PLAY: 'Play',
7
12
  } as const;
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { soundNameSchema } from '../../sounds'; // Import from domains/sounds
3
- import { PLAY_SOUND_DURATION, SOUND_ACTION_COMMAND } from './Sound.const';
3
+ import { PLAY_SOUND_DURATION, SOUND_ACTION_COMMAND, SOUND_CHANNEL } from './Sound.const';
4
4
 
5
5
  export const soundActionCommandSchema = z.enum(SOUND_ACTION_COMMAND);
6
6
 
7
7
  export const playSoundOptionsSchema = z.object({
8
8
  soundName: soundNameSchema,
9
9
  durationMs: z.union([z.number(), z.literal(PLAY_SOUND_DURATION.INFINITE)]).optional(),
10
+ channel: z.enum(SOUND_CHANNEL).optional(),
10
11
  });