@battle-racing/br-common-lib 3.4.0 → 3.8.0
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.
- package/REFACTOR_README.md +185 -0
- package/br-common-lib.code-workspace +19 -0
- package/dist/constants/hardware/damage.d.ts +1 -0
- package/dist/constants/hardware/damage.js +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/payment-provider.d.ts +5 -0
- package/dist/constants/payment-provider.js +8 -0
- package/dist/constants/payment-status.d.ts +7 -0
- package/dist/constants/payment-status.js +10 -0
- package/dist/constants/user-role.d.ts +1 -0
- package/dist/constants/user-role.js +1 -0
- package/dist/data/all-damages.d.ts +2 -0
- package/dist/data/all-damages.js +54 -0
- package/dist/data/all-power-ups.d.ts +3 -0
- package/dist/data/all-power-ups.js +521 -0
- package/dist/data/index.d.ts +3 -1
- package/dist/data/index.js +3 -1
- package/dist/schemas/team.schema.d.ts +7 -0
- package/dist/schemas/team.schema.js +9 -0
- package/dist/types/damage/Damage.d.ts +1 -3
- package/dist/types/gameTrack/GameTrackKartConfig.d.ts +9 -0
- package/dist/types/gameTrack/index.d.ts +1 -0
- package/dist/types/gameTrack/index.js +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/pagination/Pagination.d.ts +3 -0
- package/dist/types/pagination/index.d.ts +2 -0
- package/dist/types/pagination/index.js +18 -0
- package/dist/types/pagination/pagination.schema.d.ts +14 -0
- package/dist/types/pagination/pagination.schema.js +16 -0
- package/dist/types/powerUp/PowerUp.d.ts +1 -1
- package/dist/types/powerUp/PowerUpName.d.ts +1 -1
- package/dist/types/racingTeam/RacingTeam.d.ts +6 -0
- package/dist/types/racingTeam/RacingTeam.schema.d.ts +44 -0
- package/dist/types/racingTeam/RacingTeam.schema.js +27 -0
- package/dist/types/racingTeam/RacingTeamMembership.d.ts +6 -0
- package/dist/types/racingTeam/RacingTeamMembership.schema.d.ts +31 -0
- package/dist/types/racingTeam/RacingTeamMembership.schema.js +27 -0
- package/dist/types/racingTeam/index.d.ts +4 -0
- package/dist/types/racingTeam/index.js +20 -0
- package/dist/types/socket/serverToClient/SocketKartServerToClientEventsParams.d.ts +3 -5
- package/dist/types/ticketing/GameTicket.d.ts +3 -0
- package/dist/types/ticketing/GameTicket.js +2 -0
- package/dist/types/ticketing/GameTurn.d.ts +4 -0
- package/dist/types/ticketing/GameTurn.js +2 -0
- package/dist/types/ticketing/GameTurn.schema.d.ts +92 -0
- package/dist/types/ticketing/GameTurn.schema.js +46 -0
- package/dist/types/ticketing/GameTurnTask.d.ts +3 -0
- package/dist/types/ticketing/GameTurnTask.js +2 -0
- package/dist/types/ticketing/GameTurnTask.schema.d.ts +34 -0
- package/dist/types/ticketing/GameTurnTask.schema.js +30 -0
- package/dist/types/ticketing/PaymentProvider.d.ts +34 -0
- package/dist/types/ticketing/PaymentProvider.js +2 -0
- package/dist/types/ticketing/PlayerTurn.d.ts +3 -0
- package/dist/types/ticketing/PlayerTurn.js +2 -0
- package/dist/types/ticketing/Purchase.d.ts +3 -0
- package/dist/types/ticketing/Purchase.js +2 -0
- package/dist/types/ticketing/index.d.ts +9 -0
- package/dist/types/ticketing/index.js +25 -0
- package/dist/types/ticketing/ticketing.schemas.d.ts +58 -0
- package/dist/types/ticketing/ticketing.schemas.js +41 -0
- package/dist/types/user/User.d.ts +4 -9
- package/dist/types/user/index.d.ts +3 -1
- package/dist/types/user/index.js +5 -1
- package/dist/types/user/user-type.schema.d.ts +9 -0
- package/dist/types/user/user-type.schema.js +12 -0
- package/dist/types/user/user.schema.d.ts +39 -0
- package/dist/types/user/user.schema.js +19 -0
- package/package.json +6 -2
- package/src/constants/hardware/damage.ts +1 -0
- package/src/constants/index.ts +2 -1
- package/src/constants/payment-provider.ts +5 -0
- package/src/constants/payment-status.ts +7 -0
- package/src/constants/user-role.ts +1 -0
- package/src/data/all-damages.ts +53 -0
- package/src/data/all-power-ups.ts +526 -0
- package/src/data/index.ts +4 -1
- package/src/schemas/team.schema.ts +9 -0
- package/src/types/damage/Damage.ts +2 -4
- package/src/types/gameTrack/GameTrackKartConfig.ts +10 -0
- package/src/types/gameTrack/index.ts +1 -0
- package/src/types/index.ts +3 -1
- package/src/types/pagination/Pagination.ts +4 -0
- package/src/types/pagination/index.ts +2 -0
- package/src/types/pagination/pagination.schema.ts +14 -0
- package/src/types/powerUp/PowerUp.ts +1 -1
- package/src/types/powerUp/PowerUpName.ts +2 -1
- package/src/types/racingTeam/RacingTeam.schema.ts +29 -0
- package/src/types/racingTeam/RacingTeam.ts +12 -0
- package/src/types/racingTeam/RacingTeamMembership.schema.ts +29 -0
- package/src/types/racingTeam/RacingTeamMembership.ts +12 -0
- package/src/types/racingTeam/index.ts +4 -0
- package/src/types/socket/serverToClient/SocketKartServerToClientEventsParams.ts +3 -4
- package/src/types/ticketing/GameTicket.ts +4 -0
- package/src/types/ticketing/GameTurn.schema.ts +49 -0
- package/src/types/ticketing/GameTurn.ts +6 -0
- package/src/types/ticketing/GameTurnTask.schema.ts +32 -0
- package/src/types/ticketing/GameTurnTask.ts +4 -0
- package/src/types/ticketing/PaymentProvider.ts +40 -0
- package/src/types/ticketing/Purchase.ts +4 -0
- package/src/types/ticketing/index.ts +9 -0
- package/src/types/ticketing/ticketing.schemas.ts +43 -0
- package/src/types/user/User.ts +4 -9
- package/src/types/user/index.ts +4 -1
- package/src/types/user/user-type.schema.ts +8 -0
- package/src/types/user/user.schema.ts +19 -0
- package/README.md +0 -3
- package/dist/types/hardware/screen/ScreenKartPosition.d.ts +0 -4
- package/dist/types/hardware/screen/ScreenRaceLaps.d.ts +0 -4
- package/dist/types/response/SuccesResponse.d.ts +0 -5
- package/dist/types/user/UserOrigin.d.ts +0 -1
- package/src/types/user/UserOrigin.ts +0 -1
- /package/dist/data/{RoleDefinitions.d.ts → role-definitions.d.ts} +0 -0
- /package/dist/data/{RoleDefinitions.js → role-definitions.js} +0 -0
- /package/dist/types/{hardware/screen/ScreenKartPosition.js → gameTrack/GameTrackKartConfig.js} +0 -0
- /package/dist/types/{hardware/screen/ScreenRaceLaps.js → pagination/Pagination.js} +0 -0
- /package/dist/types/{response/SuccesResponse.js → racingTeam/RacingTeam.js} +0 -0
- /package/dist/types/{user/UserOrigin.js → racingTeam/RacingTeamMembership.js} +0 -0
- /package/src/data/{RoleDefinitions.ts → role-definitions.ts} +0 -0
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
import { FLAG_MEDIA_NAME } from '../constants';
|
|
2
|
+
import type { PowerUp } from '../types';
|
|
3
|
+
|
|
4
|
+
export const allPowerUps: PowerUp[] = [
|
|
5
|
+
{
|
|
6
|
+
id: 'battle-god',
|
|
7
|
+
name: 'Battle God',
|
|
8
|
+
imageName: 'power-up-battle-god.png',
|
|
9
|
+
description: 'Increase speed, slow down enemies near, enable shortcuts',
|
|
10
|
+
level: 5,
|
|
11
|
+
shield: {
|
|
12
|
+
duration: 5,
|
|
13
|
+
},
|
|
14
|
+
assignationCommands: [
|
|
15
|
+
{
|
|
16
|
+
module: 'flag',
|
|
17
|
+
action: 'showMediaTemporarily',
|
|
18
|
+
params: {
|
|
19
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_HELMET,
|
|
20
|
+
screens: {
|
|
21
|
+
left: true,
|
|
22
|
+
right: true,
|
|
23
|
+
back: true,
|
|
24
|
+
front: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
module: 'sound',
|
|
30
|
+
action: 'play',
|
|
31
|
+
params: {
|
|
32
|
+
soundName: 'power_up_selection.mp3',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
module: 'rgb',
|
|
37
|
+
action: 'showEffect',
|
|
38
|
+
params: {
|
|
39
|
+
effect: 'Roulette Effect',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
activationCommands: [
|
|
44
|
+
{
|
|
45
|
+
module: 'speed',
|
|
46
|
+
action: 'change',
|
|
47
|
+
params: {
|
|
48
|
+
speed: '$kart.configuredSpeed * 2',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
module: 'rgb',
|
|
53
|
+
action: 'showEffect',
|
|
54
|
+
params: {
|
|
55
|
+
effect: 'Star Effect',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
module: 'sound',
|
|
60
|
+
action: 'play',
|
|
61
|
+
params: {
|
|
62
|
+
soundName: 'battle_god_activation.mp3',
|
|
63
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
module: 'leftStarBackLaser',
|
|
68
|
+
action: 'action',
|
|
69
|
+
params: {
|
|
70
|
+
laserAction: 'Init Attack',
|
|
71
|
+
starAction: 'Init Attack',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
module: 'rightStarFrontLaser',
|
|
76
|
+
action: 'action',
|
|
77
|
+
params: {
|
|
78
|
+
laserAction: 'Init Attack',
|
|
79
|
+
starAction: 'Init Attack',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
module: 'flag',
|
|
84
|
+
action: 'showMediaTemporarily',
|
|
85
|
+
params: {
|
|
86
|
+
mediaSourceName: FLAG_MEDIA_NAME.BR_CHANGE_COLOR,
|
|
87
|
+
screens: {
|
|
88
|
+
left: true,
|
|
89
|
+
right: true,
|
|
90
|
+
front: true,
|
|
91
|
+
back: true,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'battle-nitro',
|
|
99
|
+
name: 'Battle Nitro',
|
|
100
|
+
imageName: 'power-up-battle-nitro.png',
|
|
101
|
+
description: 'Double the speed of the user for 2 seconds.',
|
|
102
|
+
level: 1,
|
|
103
|
+
assignationCommands: [
|
|
104
|
+
{
|
|
105
|
+
module: 'flag',
|
|
106
|
+
action: 'showMediaTemporarily',
|
|
107
|
+
params: {
|
|
108
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_EXHAUST,
|
|
109
|
+
screens: {
|
|
110
|
+
left: true,
|
|
111
|
+
right: true,
|
|
112
|
+
back: true,
|
|
113
|
+
front: true,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
module: 'sound',
|
|
119
|
+
action: 'play',
|
|
120
|
+
params: {
|
|
121
|
+
soundName: 'power_up_selection.mp3',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
module: 'rgb',
|
|
126
|
+
action: 'showEffect',
|
|
127
|
+
params: {
|
|
128
|
+
effect: 'Roulette Effect',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
activationCommands: [
|
|
133
|
+
{
|
|
134
|
+
module: 'speed',
|
|
135
|
+
action: 'change',
|
|
136
|
+
params: {
|
|
137
|
+
speed: '$kart.configuredSpeed * 2',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
module: 'rgb',
|
|
142
|
+
action: 'showEffect',
|
|
143
|
+
params: {
|
|
144
|
+
effect: 'Speed Boost Effect',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
module: 'sound',
|
|
149
|
+
action: 'play',
|
|
150
|
+
params: {
|
|
151
|
+
soundName: 'battle_turbo_activation.mp3',
|
|
152
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
module: 'flag',
|
|
157
|
+
action: 'showMediaTemporarily',
|
|
158
|
+
params: {
|
|
159
|
+
mediaSourceName: FLAG_MEDIA_NAME.NITRO_BOTTLE,
|
|
160
|
+
screens: {
|
|
161
|
+
left: true,
|
|
162
|
+
right: true,
|
|
163
|
+
front: true,
|
|
164
|
+
back: true,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: 'battle-pulse',
|
|
172
|
+
name: 'Battle Pulse',
|
|
173
|
+
imageName: 'power-up-battle-pulse.png',
|
|
174
|
+
description: 'Slow down all the enemies for 2 seconds.',
|
|
175
|
+
level: 5,
|
|
176
|
+
networkDamage: {
|
|
177
|
+
name: 'Pulse Hit',
|
|
178
|
+
target: 'All',
|
|
179
|
+
},
|
|
180
|
+
assignationCommands: [
|
|
181
|
+
{
|
|
182
|
+
module: 'flag',
|
|
183
|
+
action: 'showMediaTemporarily',
|
|
184
|
+
params: {
|
|
185
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_LIGHTNING,
|
|
186
|
+
screens: {
|
|
187
|
+
left: true,
|
|
188
|
+
right: true,
|
|
189
|
+
back: true,
|
|
190
|
+
front: true,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
module: 'sound',
|
|
196
|
+
action: 'play',
|
|
197
|
+
params: {
|
|
198
|
+
soundName: 'power_up_selection.mp3',
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
module: 'rgb',
|
|
203
|
+
action: 'showEffect',
|
|
204
|
+
params: {
|
|
205
|
+
effect: 'Roulette Effect',
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
activationCommands: [
|
|
210
|
+
{
|
|
211
|
+
module: 'rgb',
|
|
212
|
+
action: 'showEffect',
|
|
213
|
+
params: {
|
|
214
|
+
effect: 'Ray Effect',
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
module: 'sound',
|
|
219
|
+
action: 'play',
|
|
220
|
+
params: {
|
|
221
|
+
soundName: 'battle_pulse_activation.mp3',
|
|
222
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
module: 'flag',
|
|
227
|
+
action: 'showMediaTemporarily',
|
|
228
|
+
params: {
|
|
229
|
+
mediaSourceName: FLAG_MEDIA_NAME.THUNDER_EXPLOSION,
|
|
230
|
+
screens: {
|
|
231
|
+
left: true,
|
|
232
|
+
right: true,
|
|
233
|
+
front: true,
|
|
234
|
+
back: true,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'battle-shield',
|
|
242
|
+
name: 'Battle Shield',
|
|
243
|
+
imageName: 'power-up-battle-shield.png',
|
|
244
|
+
description: 'A shield that blocks all the damage.',
|
|
245
|
+
level: 4,
|
|
246
|
+
shield: {
|
|
247
|
+
duration: 5,
|
|
248
|
+
},
|
|
249
|
+
assignationCommands: [
|
|
250
|
+
{
|
|
251
|
+
module: 'flag',
|
|
252
|
+
action: 'showMediaTemporarily',
|
|
253
|
+
params: {
|
|
254
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_SHIELD,
|
|
255
|
+
screens: {
|
|
256
|
+
left: true,
|
|
257
|
+
right: true,
|
|
258
|
+
back: true,
|
|
259
|
+
front: true,
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
module: 'sound',
|
|
265
|
+
action: 'play',
|
|
266
|
+
params: {
|
|
267
|
+
soundName: 'power_up_selection.mp3',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
module: 'rgb',
|
|
272
|
+
action: 'showEffect',
|
|
273
|
+
params: {
|
|
274
|
+
effect: 'Roulette Effect',
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
activationCommands: [
|
|
279
|
+
{
|
|
280
|
+
module: 'rgb',
|
|
281
|
+
action: 'showEffect',
|
|
282
|
+
params: {
|
|
283
|
+
effect: 'Shield Effect',
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
module: 'sound',
|
|
288
|
+
action: 'play',
|
|
289
|
+
params: {
|
|
290
|
+
soundName: 'battle_shield_activation.mp3',
|
|
291
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
module: 'flag',
|
|
296
|
+
action: 'showMediaTemporarily',
|
|
297
|
+
params: {
|
|
298
|
+
mediaSourceName: FLAG_MEDIA_NAME.SHIELD_BLUE_TO_PINK,
|
|
299
|
+
screens: {
|
|
300
|
+
left: true,
|
|
301
|
+
right: true,
|
|
302
|
+
front: true,
|
|
303
|
+
back: true,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: 'battle-shot',
|
|
311
|
+
name: 'Battle Shot',
|
|
312
|
+
imageName: 'power-up-battle-shot.png',
|
|
313
|
+
description: 'Slow Down Specifc Enemy for 2 seconds.',
|
|
314
|
+
level: 3,
|
|
315
|
+
assignationCommands: [
|
|
316
|
+
{
|
|
317
|
+
module: 'flag',
|
|
318
|
+
action: 'showMediaTemporarily',
|
|
319
|
+
params: {
|
|
320
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_FIREBALL,
|
|
321
|
+
screens: {
|
|
322
|
+
left: true,
|
|
323
|
+
right: true,
|
|
324
|
+
back: true,
|
|
325
|
+
front: true,
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
module: 'sound',
|
|
331
|
+
action: 'play',
|
|
332
|
+
params: {
|
|
333
|
+
soundName: 'power_up_selection.mp3',
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
module: 'rgb',
|
|
338
|
+
action: 'showEffect',
|
|
339
|
+
params: {
|
|
340
|
+
effect: 'Roulette Effect',
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
module: 'diskSensorBallShooter',
|
|
345
|
+
action: 'prepareShooter',
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
activationCommands: [
|
|
349
|
+
{
|
|
350
|
+
module: 'rgb',
|
|
351
|
+
action: 'showEffect',
|
|
352
|
+
params: {
|
|
353
|
+
effect: 'Ball Shot Effect',
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
module: 'diskSensorBallShooter',
|
|
358
|
+
action: 'shootBall',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
module: 'sound',
|
|
362
|
+
action: 'play',
|
|
363
|
+
params: {
|
|
364
|
+
soundName: 'battle_shot_activation.mp3',
|
|
365
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
module: 'flag',
|
|
370
|
+
action: 'showMediaTemporarily',
|
|
371
|
+
params: {
|
|
372
|
+
mediaSourceName: FLAG_MEDIA_NAME.FIREBALL,
|
|
373
|
+
|
|
374
|
+
screens: {
|
|
375
|
+
left: true,
|
|
376
|
+
right: true,
|
|
377
|
+
front: true,
|
|
378
|
+
back: true,
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
id: 'battle-trap',
|
|
386
|
+
name: 'Battle Trap',
|
|
387
|
+
imageName: 'power-up-battle-trap.png',
|
|
388
|
+
description: 'Slow Down Specifc Enemy for 3 seconds.',
|
|
389
|
+
level: 2,
|
|
390
|
+
assignationCommands: [
|
|
391
|
+
{
|
|
392
|
+
module: 'flag',
|
|
393
|
+
action: 'showMediaTemporarily',
|
|
394
|
+
params: {
|
|
395
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_OIL_DROP,
|
|
396
|
+
screens: {
|
|
397
|
+
left: true,
|
|
398
|
+
right: true,
|
|
399
|
+
back: true,
|
|
400
|
+
front: true,
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
|
|
405
|
+
{
|
|
406
|
+
module: 'sound',
|
|
407
|
+
action: 'play',
|
|
408
|
+
params: {
|
|
409
|
+
soundName: 'power_up_selection.mp3',
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
module: 'rgb',
|
|
414
|
+
action: 'showEffect',
|
|
415
|
+
params: {
|
|
416
|
+
effect: 'Roulette Effect',
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
],
|
|
420
|
+
activationCommands: [
|
|
421
|
+
{
|
|
422
|
+
module: 'ballSensorDiskThrower',
|
|
423
|
+
action: 'throwDisk',
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
module: 'sound',
|
|
427
|
+
action: 'play',
|
|
428
|
+
params: {
|
|
429
|
+
soundName: 'battle_trap_activation.mp3',
|
|
430
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
module: 'flag',
|
|
435
|
+
action: 'showMediaTemporarily',
|
|
436
|
+
params: {
|
|
437
|
+
mediaSourceName: FLAG_MEDIA_NAME.OIL_DROP_COLORS,
|
|
438
|
+
|
|
439
|
+
screens: {
|
|
440
|
+
left: true,
|
|
441
|
+
right: true,
|
|
442
|
+
front: true,
|
|
443
|
+
back: true,
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
},
|
|
449
|
+
// TODO: Change The media names
|
|
450
|
+
{
|
|
451
|
+
id: 'battle-blue-shot',
|
|
452
|
+
name: 'Battle Blue Shot',
|
|
453
|
+
imageName: 'power-up-battle-blue-shot.png',
|
|
454
|
+
description: 'Deal shot hit damage to the first player in the race.',
|
|
455
|
+
level: 4,
|
|
456
|
+
networkDamage: {
|
|
457
|
+
name: 'Blue Shot Hit',
|
|
458
|
+
target: 'First',
|
|
459
|
+
},
|
|
460
|
+
assignationCommands: [
|
|
461
|
+
{
|
|
462
|
+
module: 'flag',
|
|
463
|
+
action: 'showMediaTemporarily',
|
|
464
|
+
params: {
|
|
465
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_FIREBALL,
|
|
466
|
+
screens: {
|
|
467
|
+
left: true,
|
|
468
|
+
right: true,
|
|
469
|
+
back: true,
|
|
470
|
+
front: true,
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
module: 'sound',
|
|
476
|
+
action: 'play',
|
|
477
|
+
params: {
|
|
478
|
+
soundName: 'power_up_selection.mp3',
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
module: 'rgb',
|
|
483
|
+
action: 'showEffect',
|
|
484
|
+
params: {
|
|
485
|
+
effect: 'Roulette Effect',
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
],
|
|
489
|
+
activationCommands: [
|
|
490
|
+
{
|
|
491
|
+
module: 'rgb',
|
|
492
|
+
action: 'showEffect',
|
|
493
|
+
params: {
|
|
494
|
+
effect: 'Ray Effect',
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
module: 'sound',
|
|
499
|
+
action: 'play',
|
|
500
|
+
params: {
|
|
501
|
+
// TODO: Change to blue shot activation
|
|
502
|
+
soundName: 'battle_shot_activation.mp3',
|
|
503
|
+
durationMs: '$kart.powerUpTime * 1000',
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
module: 'flag',
|
|
508
|
+
action: 'showMediaTemporarily',
|
|
509
|
+
params: {
|
|
510
|
+
// TODO: Change to blue shot
|
|
511
|
+
mediaSourceName: FLAG_MEDIA_NAME.STATIC_FIREBALL,
|
|
512
|
+
screens: {
|
|
513
|
+
left: true,
|
|
514
|
+
right: true,
|
|
515
|
+
front: true,
|
|
516
|
+
back: true,
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
},
|
|
522
|
+
];
|
|
523
|
+
|
|
524
|
+
export const defaultPowerUps: PowerUp[] = allPowerUps.filter((powerUp) =>
|
|
525
|
+
['battle-god', 'battle-pulse', 'battle-shield', 'battle-nitro', 'battle-blue-shot'].includes(powerUp.id),
|
|
526
|
+
);
|
package/src/data/index.ts
CHANGED
|
@@ -6,11 +6,9 @@ import type { DamageTarget } from './DamageTarget';
|
|
|
6
6
|
export interface Damage {
|
|
7
7
|
name: DamageEffectName;
|
|
8
8
|
target: DamageTarget;
|
|
9
|
-
/** Time in seconds */
|
|
10
|
-
duration: number;
|
|
11
9
|
sound: SoundName;
|
|
12
10
|
rgbEffect: KartEffect;
|
|
13
|
-
/**
|
|
14
|
-
amount: number
|
|
11
|
+
/** Mainly used for coins reduction */
|
|
12
|
+
amount: number
|
|
15
13
|
flagMediaName: FlagMediaName;
|
|
16
14
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -13,11 +13,13 @@ export * from './gameTrack';
|
|
|
13
13
|
export * from './hardware';
|
|
14
14
|
export * from './kart';
|
|
15
15
|
export * from './kartTracking';
|
|
16
|
+
export * from './pagination';
|
|
16
17
|
export * from './powerUp';
|
|
18
|
+
export * from './racingTeam';
|
|
17
19
|
export * from './response';
|
|
18
20
|
export * from './role';
|
|
19
21
|
export * from './socket';
|
|
20
22
|
export * from './sounds';
|
|
23
|
+
export * from './ticketing';
|
|
21
24
|
export * from './user';
|
|
22
25
|
export * from './utils';
|
|
23
|
-
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const paginationMetadataSchema = z.object({
|
|
4
|
+
nextCursor: z.string().optional(),
|
|
5
|
+
hasMore: z.boolean().optional(),
|
|
6
|
+
limit: z.number(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const paginatedResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) => {
|
|
10
|
+
return z.object({
|
|
11
|
+
data: z.array(itemSchema),
|
|
12
|
+
meta: paginationMetadataSchema,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { paginatedResponseSchema } from '../pagination';
|
|
3
|
+
|
|
4
|
+
export const racingTeamSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
name: z.string().min(3).max(50),
|
|
7
|
+
imageUrl: z.string().url().optional(),
|
|
8
|
+
adminUserId: z.string(),
|
|
9
|
+
createdAt: z.date(),
|
|
10
|
+
updatedAt: z.date(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const createRacingTeamSchema = racingTeamSchema.omit({
|
|
14
|
+
id: true,
|
|
15
|
+
createdAt: true,
|
|
16
|
+
updatedAt: true,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const updateRacingTeamSchema = racingTeamSchema.partial();
|
|
20
|
+
|
|
21
|
+
export const filterRacingTeamSchema = z.object({
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
adminUserId: z.string().optional(),
|
|
24
|
+
page: z.number().min(1).default(1),
|
|
25
|
+
limit: z.number().min(1).max(100).default(10),
|
|
26
|
+
cursor: z.string().optional(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const paginatedRacingTeamSchema = paginatedResponseSchema(racingTeamSchema);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
createRacingTeamSchema,
|
|
4
|
+
paginatedRacingTeamSchema,
|
|
5
|
+
racingTeamSchema,
|
|
6
|
+
updateRacingTeamSchema,
|
|
7
|
+
} from './RacingTeam.schema';
|
|
8
|
+
|
|
9
|
+
export type RacingTeam = z.infer<typeof racingTeamSchema>;
|
|
10
|
+
export type CreateRacingTeamDto = z.infer<typeof createRacingTeamSchema>;
|
|
11
|
+
export type UpdateRacingTeamDto = z.infer<typeof updateRacingTeamSchema>;
|
|
12
|
+
export type PaginatedRacingTeam = z.infer<typeof paginatedRacingTeamSchema>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// libs/common/src/schemas/racing-team-membership.ts
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
export const joinRequestSchema = z.object({
|
|
6
|
+
id: z.string(),
|
|
7
|
+
racingTeamId: z.string(),
|
|
8
|
+
userId: z.string(),
|
|
9
|
+
status: z.enum(['PENDING', 'ACCEPTED', 'REJECTED'] as const),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const teamMemberSchema = z.object({
|
|
15
|
+
racingTeamId: z.string(),
|
|
16
|
+
userId: z.string(),
|
|
17
|
+
role: z.enum(['PILOT', 'TECHNICIAN', 'COACH'] as const),
|
|
18
|
+
joinedAt: z.date(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const createJoinRequestSchema = z.object({
|
|
22
|
+
racingTeamId: z.string(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const answerJoinRequestSchema = z.object({
|
|
26
|
+
racingTeamId: z.string(),
|
|
27
|
+
targetUserId: z.string(),
|
|
28
|
+
accepted: z.boolean(),
|
|
29
|
+
});
|