@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
@@ -22,6 +22,11 @@ export const SOUND_NAME = {
22
22
  SYSTEM_STARTED: 'system_started.mp3',
23
23
  WARNING_ALERT_THIS_IS_NOT_A_TEST: 'warning_alert_this_is_not_a_test.mp3',
24
24
  WINNER_LAUGH: 'winner_laugh.mp3',
25
+ TUTORIAL_COUNTDOWN: 'tutorial/3,2,1 GO.mp3',
25
26
  TUTORIAL_WELCOME: 'tutorial/welcome_to_battle_racing.mp3',
27
+ TUTORIAL_SECURE_BELONGINGS: 'tutorial/secure_belongins.mp3',
28
+ TUTORIAL_BUCKLE_UP: 'tutorial/buckle_up.mp3',
26
29
  TUTORIAL_GAS_PEDAL: 'tutorial/gas_pedal.mp3',
30
+ TUTORIAL_BUTTON_PRESS: 'tutorial/button_press.mp3',
31
+ TUTORIAL_FINAL: 'tutorial/final_tutorial.mp3',
27
32
  } as const;
@@ -41,6 +41,7 @@ export const TUTORIAL_PHASE_ID = {
41
41
 
42
42
  export const TUTORIAL_LISTEN_EVENT_ON = {
43
43
  TIMEOUT: 'timeout',
44
+ OPERATOR: 'operator',
44
45
  WHEEL_BUTTON: 'wheelButton',
45
46
  CHECKPOINT: 'checkpoint',
46
47
  } as const;
@@ -52,6 +52,7 @@ export const tutorialPhaseIdSchema = z.enum([
52
52
 
53
53
  export const tutorialListenEventOnSchema = z.enum([
54
54
  TUTORIAL_LISTEN_EVENT_ON.TIMEOUT,
55
+ TUTORIAL_LISTEN_EVENT_ON.OPERATOR,
55
56
  TUTORIAL_LISTEN_EVENT_ON.WHEEL_BUTTON,
56
57
  TUTORIAL_LISTEN_EVENT_ON.CHECKPOINT,
57
58
  ]);
@@ -118,6 +119,7 @@ export const tutorialParticipantSchema = z.object({
118
119
  kartGuid: z.string().min(1),
119
120
  playerId: z.string().optional(),
120
121
  status: tutorialStatusSchema,
122
+ skipOrder: z.number().int().positive().optional(),
121
123
  currentPhaseId: tutorialPhaseIdSchema,
122
124
  currentStep: tutorialScreenStepSchema,
123
125
  revision: z.number().int().nonnegative(),
@@ -125,7 +127,9 @@ export const tutorialParticipantSchema = z.object({
125
127
  latestCheckpointId: z.string().optional(),
126
128
  latestCheckpointProgress: z.number().optional(),
127
129
  coins: z.number().int().default(0),
128
- currentLap: z.number().int().default(1),
130
+ currentLap: z.number().int().default(0),
131
+ totalProgress: z.number().default(0),
132
+ latestCheckpointTimeISO: z.iso.datetime().optional(),
129
133
  totalLaps: z.number().int().default(1),
130
134
  position: z
131
135
  .object({
@@ -157,3 +161,7 @@ const startTutorialOptionsSchema = z.object({
157
161
  export const startRaceTutorialSchema = startRaceSchema.extend(startTutorialOptionsSchema.shape);
158
162
 
159
163
  export const startBattleTutorialSchema = startBattleSchema.extend(startTutorialOptionsSchema.shape);
164
+
165
+ export const skipTutorialKartSchema = z.object({
166
+ tutorialSessionId: z.string().min(1),
167
+ });
@@ -16,6 +16,7 @@ import {
16
16
  tutorialSessionSchema,
17
17
  startRaceTutorialSchema,
18
18
  startBattleTutorialSchema,
19
+ skipTutorialKartSchema,
19
20
  } from './Tutorial.schema';
20
21
 
21
22
  export type TutorialScreenStep = z.infer<typeof tutorialScreenStepSchema>;
@@ -34,3 +35,4 @@ export type TutorialParticipant = z.infer<typeof tutorialParticipantSchema>;
34
35
  export type TutorialSession = z.infer<typeof tutorialSessionSchema>;
35
36
  export type StartRaceTutorial = z.infer<typeof startRaceTutorialSchema>;
36
37
  export type StartBattleTutorial = z.infer<typeof startBattleTutorialSchema>;
38
+ export type SkipTutorialKart = z.infer<typeof skipTutorialKartSchema>;
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { allCommandsConfigSchema } from '../command/Command.schema';
3
+ import { playSoundOptionsSchema } from '../hardware/sound';
3
4
  import { TUTORIAL_LISTEN_EVENT_ON } from './Tutorial.const';
4
5
  import {
5
6
  tutorialCheckpointTargetSchema,
@@ -13,6 +14,10 @@ export const tutorialTimeoutListenEventSchema = z.object({
13
14
  durationMs: z.number().int().positive(),
14
15
  });
15
16
 
17
+ export const tutorialOperatorListenEventSchema = z.object({
18
+ on: z.literal(TUTORIAL_LISTEN_EVENT_ON.OPERATOR),
19
+ });
20
+
16
21
  export const tutorialWheelButtonListenEventSchema = z.object({
17
22
  on: z.literal(TUTORIAL_LISTEN_EVENT_ON.WHEEL_BUTTON),
18
23
  button: tutorialSteeringWheelButtonSchema,
@@ -25,6 +30,7 @@ export const tutorialCheckpointListenEventSchema = z.object({
25
30
 
26
31
  export const tutorialListenEventSchema = z.discriminatedUnion('on', [
27
32
  tutorialTimeoutListenEventSchema,
33
+ tutorialOperatorListenEventSchema,
28
34
  tutorialWheelButtonListenEventSchema,
29
35
  tutorialCheckpointListenEventSchema,
30
36
  ]);
@@ -43,6 +49,7 @@ export const tutorialPhaseConfigSchema = z.object({
43
49
  id: tutorialPhaseIdSchema,
44
50
  name: z.string().min(1),
45
51
  index: z.number().int().nonnegative(),
52
+ inputFeedbackSound: playSoundOptionsSchema.optional(),
46
53
  steps: z.array(tutorialStepConfigSchema).min(1),
47
54
  });
48
55