xray16 1.5.4 → 1.6.1

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 (55) hide show
  1. package/README.md +6 -0
  2. package/package.json +12 -6
  3. package/plugins/optimize_return_ternary.d.ts +6 -0
  4. package/plugins/optimize_return_ternary.js +65 -0
  5. package/xray16.d.ts +30847 -0
  6. package/types/index.d.ts +0 -55
  7. package/types/xr_ai/xr_action.d.ts +0 -1802
  8. package/types/xr_ai/xr_alife.d.ts +0 -1870
  9. package/types/xr_ai/xr_enemy_evaluation.d.ts +0 -134
  10. package/types/xr_ai/xr_goap.d.ts +0 -1116
  11. package/types/xr_ai/xr_graph.d.ts +0 -135
  12. package/types/xr_ai/xr_memory.d.ts +0 -382
  13. package/types/xr_lib/xr_animation.d.ts +0 -252
  14. package/types/xr_lib/xr_bitwise.d.ts +0 -44
  15. package/types/xr_lib/xr_color.d.ts +0 -142
  16. package/types/xr_lib/xr_debug.d.ts +0 -181
  17. package/types/xr_lib/xr_dialog.d.ts +0 -132
  18. package/types/xr_lib/xr_flags.d.ts +0 -592
  19. package/types/xr_lib/xr_fs.d.ts +0 -615
  20. package/types/xr_lib/xr_game.d.ts +0 -362
  21. package/types/xr_lib/xr_hit.d.ts +0 -125
  22. package/types/xr_lib/xr_ini.d.ts +0 -473
  23. package/types/xr_lib/xr_level.d.ts +0 -795
  24. package/types/xr_lib/xr_luabind.d.ts +0 -90
  25. package/types/xr_lib/xr_map.d.ts +0 -192
  26. package/types/xr_lib/xr_math.d.ts +0 -871
  27. package/types/xr_lib/xr_multiplayer.d.ts +0 -1079
  28. package/types/xr_lib/xr_profile.d.ts +0 -272
  29. package/types/xr_lib/xr_properties.d.ts +0 -610
  30. package/types/xr_lib/xr_relation.d.ts +0 -231
  31. package/types/xr_lib/xr_render.d.ts +0 -167
  32. package/types/xr_lib/xr_save.d.ts +0 -833
  33. package/types/xr_lib/xr_sound.d.ts +0 -515
  34. package/types/xr_lib/xr_stats.ts +0 -49
  35. package/types/xr_lib/xr_task.d.ts +0 -388
  36. package/types/xr_lib/xr_time.d.ts +0 -177
  37. package/types/xr_lib/xr_type.d.ts +0 -75
  38. package/types/xr_object/client/xr_anomaly.d.ts +0 -70
  39. package/types/xr_object/client/xr_artefact.d.ts +0 -153
  40. package/types/xr_object/client/xr_client_object.d.ts +0 -207
  41. package/types/xr_object/client/xr_creature.d.ts +0 -243
  42. package/types/xr_object/client/xr_item.d.ts +0 -370
  43. package/types/xr_object/client/xr_level.d.ts +0 -753
  44. package/types/xr_object/client/xr_physic.d.ts +0 -644
  45. package/types/xr_object/client/xr_zone.d.ts +0 -85
  46. package/types/xr_object/script/xr_script_interface.d.ts +0 -819
  47. package/types/xr_object/script/xr_script_object.d.ts +0 -5719
  48. package/types/xr_object/script/xr_script_trade.d.ts +0 -51
  49. package/types/xr_object/server/xr_server_object.d.ts +0 -1486
  50. package/types/xr_ui/xr_ui_asset.d.ts +0 -364
  51. package/types/xr_ui/xr_ui_core.d.ts +0 -424
  52. package/types/xr_ui/xr_ui_event.d.ts +0 -1449
  53. package/types/xr_ui/xr_ui_interface.d.ts +0 -2447
  54. package/types/xr_ui/xr_ui_menu.d.ts +0 -385
  55. package/types/xrf_plugin.d.ts +0 -109
@@ -1,515 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * Current playback parameters for a launched sound.
4
- *
5
- * @source C++ class sound_params
6
- * @customConstructor sound_params
7
- * @group xr_sound
8
- */
9
- export class sound_params {
10
- /**
11
- * Playback frequency multiplier.
12
- */
13
- public frequency: f32;
14
-
15
- /**
16
- * Maximum audible distance in meters.
17
- */
18
- public max_distance: f32;
19
-
20
- /**
21
- * Minimum distance before attenuation starts.
22
- */
23
- public min_distance: f32;
24
-
25
- /**
26
- * Current sound position.
27
- */
28
- public position: vector;
29
-
30
- /**
31
- * Playback volume.
32
- */
33
- public volume: f32;
34
-
35
- /**
36
- * Engine-created playback parameters.
37
- */
38
- private constructor();
39
- }
40
-
41
- /**
42
- * Play an engine sound resource from scripts.
43
- *
44
- * @source C++ class sound_object
45
- * @customConstructor sound_object
46
- * @group xr_sound
47
- *
48
- * @remarks
49
- * Most playback and parameter APIs require the sound resource to exist, unless the engine is running with sound
50
- * disabled. Missing files are logged at construction and fail later when playback starts.
51
- */
52
- export class sound_object {
53
- /**
54
- * Spatial 3D playback.
55
- */
56
- public static s3d: 0;
57
-
58
- /**
59
- * Keep playing until stopped.
60
- */
61
- public static looped: 1;
62
-
63
- /**
64
- * Screen-space 2D playback.
65
- */
66
- public static s2d: 2;
67
-
68
- /**
69
- * Playback frequency multiplier.
70
- */
71
- public frequency: f32;
72
-
73
- /**
74
- * Maximum audible distance in meters.
75
- */
76
- public max_distance: f32;
77
-
78
- /**
79
- * Minimum distance before attenuation starts.
80
- */
81
- public min_distance: f32;
82
-
83
- /**
84
- * Playback volume.
85
- */
86
- public volume: f32;
87
-
88
- /**
89
- * Create a sound from `$game_sounds$/<sound_path>.ogg`.
90
- *
91
- * @remarks
92
- * Missing sound files are logged during construction. Playback methods will throw later if the sound handle was
93
- * not created.
94
- *
95
- * @param sound_path - Sound resource path without extension.
96
- */
97
- public constructor(sound_path: string);
98
-
99
- /**
100
- * Create a typed sound from `$game_sounds$/<sound_path>.ogg`.
101
- *
102
- * @remarks
103
- * Missing sound files are logged during construction. Playback methods will throw later if the sound handle was
104
- * not created.
105
- *
106
- * @param sound_path - Sound resource path without extension.
107
- * @param type - Sound category used by AI sound memory.
108
- */
109
- public constructor(sound_path: string, type: TXR_snd_type);
110
-
111
- /**
112
- * Get sound length in milliseconds.
113
- *
114
- * @remarks
115
- * Reads the engine sound handle. Do not use it as a file-existence check after construction logged a missing file.
116
- *
117
- * @returns Sound duration.
118
- */
119
- public length(): u32;
120
-
121
- /**
122
- * Check whether the sound has active playback feedback.
123
- *
124
- * @remarks
125
- * Sounds started with `play_no_feedback` are intentionally not tracked by feedback.
126
- *
127
- * @returns Whether the sound is currently playing.
128
- */
129
- public playing(): boolean;
130
-
131
- /**
132
- * Get the current playback position.
133
- *
134
- * @remarks
135
- * Logs an engine script error and returns a zero vector if the sound was not launched.
136
- *
137
- * @returns Current sound position.
138
- */
139
- public get_position(): vector;
140
-
141
- /**
142
- * Move the sound emitter.
143
- *
144
- * @throws If the sound handle was not created.
145
- *
146
- * @param position - New world position.
147
- */
148
- public set_position(position: vector): void;
149
-
150
- /**
151
- * Append a tail sound played after this sound ends.
152
- *
153
- * @remarks
154
- * The tail path is passed to the engine sound handle as-is. Use a game sound resource path without extension.
155
- *
156
- * @param sound_path - Sound resource path without extension.
157
- */
158
- public attach_tail(sound_path: string): void;
159
-
160
- /**
161
- * Play the sound attached to an object, or globally when `object` is null.
162
- *
163
- * @throws If the sound handle was not created.
164
- *
165
- * @param object - Object used as sound owner.
166
- */
167
- public play(object: game_object | null): void;
168
-
169
- /**
170
- * Play the sound after a delay.
171
- *
172
- * @throws If the sound handle was not created.
173
- *
174
- * @param object - Object used as sound owner.
175
- * @param delay - Delay in seconds.
176
- */
177
- public play(object: game_object | null, delay: f32): void;
178
-
179
- /**
180
- * Play the sound with engine sound flags.
181
- *
182
- * @throws If the sound handle was not created.
183
- *
184
- * @param object - Object used as sound owner.
185
- * @param delay - Delay in seconds.
186
- * @param flags - Playback flags such as `sound_object.looped` or `sound_object.s2d`.
187
- */
188
- public play(object: game_object | null, delay: f32, flags: i32): void;
189
-
190
- /**
191
- * Play the sound at a fixed world position.
192
- *
193
- * @throws If the sound handle was not created.
194
- *
195
- * @param object - Optional object used as sound owner.
196
- * @param position - World position for playback.
197
- */
198
- public play_at_pos(object: game_object | null, position: vector): void;
199
-
200
- /**
201
- * Play the sound at a fixed world position after a delay.
202
- *
203
- * @throws If the sound handle was not created.
204
- *
205
- * @param object - Optional object used as sound owner.
206
- * @param position - World position for playback.
207
- * @param delay - Delay in seconds.
208
- */
209
- public play_at_pos(object: game_object | null, position: vector, delay: f32): void;
210
-
211
- /**
212
- * Play the sound at a fixed world position with engine sound flags.
213
- *
214
- * @throws If the sound handle was not created.
215
- *
216
- * @param object - Optional object used as sound owner.
217
- * @param position - World position for playback.
218
- * @param delay - Delay in seconds.
219
- * @param flags - Playback flags such as `sound_object.looped` or `sound_object.s2d`.
220
- */
221
- public play_at_pos(object: game_object | null, position: vector, delay: f32, flags: i32): void;
222
-
223
- /**
224
- * Play without tracking feedback.
225
- *
226
- * @remarks
227
- * This starts playback without storing feedback on the `sound_object`, so `playing()` will not describe this
228
- * playback instance.
229
- *
230
- * @throws If the sound handle was not created.
231
- *
232
- * @param object - Optional object used as sound owner.
233
- * @param flags - Playback flags.
234
- * @param delay - Delay in seconds.
235
- * @param position - Optional playback position.
236
- * @param volume - Optional playback volume.
237
- */
238
- public play_no_feedback(object: game_object | null, flags: i32, delay: f32, position: vector, volume: f32): void;
239
-
240
- /**
241
- * Stop playback immediately.
242
- *
243
- * @throws If the sound handle was not created.
244
- */
245
- public stop(): void;
246
-
247
- /**
248
- * Stop playback through the engine deferred-stop path.
249
- *
250
- * @remarks
251
- * Legacy misspelled alias for `stop_deferred`.
252
- *
253
- * @throws If the sound handle was not created.
254
- */
255
- public stop_deffered(): void;
256
-
257
- /**
258
- * Stop playback through the engine deferred-stop path.
259
- *
260
- * @remarks
261
- * Preferred spelling. `stop_deffered` is kept for script compatibility.
262
- *
263
- * @throws If the sound handle was not created.
264
- */
265
- public stop_deferred(): void;
266
- }
267
-
268
- /**
269
- * @group xr_sound
270
- */
271
- export type TXR_sound_object_type = EnumeratedStaticsValues<typeof sound_object>;
272
-
273
- /**
274
- * Sound category constants used by AI sound memory and sound playback.
275
- *
276
- * @source C++ class snd_type
277
- * @customConstructor snd_type
278
- * @group xr_sound
279
- */
280
- export class snd_type {
281
- /**
282
- * Engine enum value for `snd_type.ambient`.
283
- */
284
- public static ambient: 128;
285
- /**
286
- * Engine enum value for `snd_type.anomaly`.
287
- */
288
- public static anomaly: 268435456;
289
- /**
290
- * Engine enum value for `snd_type.anomaly_idle`.
291
- */
292
- public static anomaly_idle: 268437504;
293
- /**
294
- * Engine enum value for `snd_type.attack`.
295
- */
296
- public static attack: 8192;
297
- /**
298
- * Engine enum value for `snd_type.bullet_hit`.
299
- */
300
- public static bullet_hit: 524288;
301
- /**
302
- * Engine enum value for `snd_type.die`.
303
- */
304
- public static die: 131072;
305
- /**
306
- * Engine enum value for `snd_type.drop`.
307
- */
308
- public static drop: 33554432;
309
- /**
310
- * Engine enum value for `snd_type.eat`.
311
- */
312
- public static eat: 4096;
313
- /**
314
- * Engine enum value for `snd_type.empty`.
315
- */
316
- public static empty: 1048576;
317
- /**
318
- * Engine enum value for `snd_type.hide`.
319
- */
320
- public static hide: 16777216;
321
- /**
322
- * Engine enum value for `snd_type.idle`.
323
- */
324
- public static idle: 2048;
325
- /**
326
- * Engine enum value for `snd_type.injure`.
327
- */
328
- public static injure: 65536;
329
- /**
330
- * Engine enum value for `snd_type.item`.
331
- */
332
- public static item: 1073741824;
333
- /**
334
- * Engine enum value for `snd_type.item_drop`.
335
- */
336
- public static item_drop: 1107296256;
337
- /**
338
- * Engine enum value for `snd_type.item_hide`.
339
- */
340
- public static item_hide: 1090519040;
341
- /**
342
- * Engine enum value for `snd_type.item_pick_up`.
343
- */
344
- public static item_pick_up: 1140850688;
345
- /**
346
- * Engine enum value for `snd_type.item_take`.
347
- */
348
- public static item_take: 1082130432;
349
- /**
350
- * Engine enum value for `snd_type.item_use`.
351
- */
352
- public static item_use: 1077936128;
353
- /**
354
- * Engine enum value for `snd_type.monster`.
355
- */
356
- public static monster: 536870912;
357
- /**
358
- * Engine enum value for `snd_type.monster_attack`.
359
- */
360
- public static monster_attack: 536879104;
361
- /**
362
- * Engine enum value for `snd_type.monster_die`.
363
- */
364
- public static monster_die: 537001984;
365
- /**
366
- * Engine enum value for `snd_type.monster_eat`.
367
- */
368
- public static monster_eat: 536875008;
369
- /**
370
- * Engine enum value for `snd_type.monster_injure`.
371
- */
372
- public static monster_injure: 536936448;
373
- /**
374
- * Engine enum value for `snd_type.monster_step`.
375
- */
376
- public static monster_step: 536903680;
377
- /**
378
- * Engine enum value for `snd_type.monster_talk`.
379
- */
380
- public static monster_talk: 536887296;
381
- /**
382
- * Engine enum value for `snd_type.no_sound`.
383
- */
384
- public static no_sound: 0;
385
- /**
386
- * Engine enum value for `snd_type.object_break`.
387
- */
388
- public static object_break: 1024;
389
- /**
390
- * Engine enum value for `snd_type.object_collide`.
391
- */
392
- public static object_collide: 512;
393
- /**
394
- * Engine enum value for `snd_type.object_explode`.
395
- */
396
- public static object_explode: 256;
397
- /**
398
- * Engine enum value for `snd_type.pick_up`.
399
- */
400
- public static pick_up: 67108864;
401
- /**
402
- * Engine enum value for `snd_type.reload`.
403
- */
404
- public static reload: 262144;
405
- /**
406
- * Engine enum value for `snd_type.shoot`.
407
- */
408
- public static shoot: 2097152;
409
- /**
410
- * Engine enum value for `snd_type.step`.
411
- */
412
- public static step: 32768;
413
- /**
414
- * Engine enum value for `snd_type.take`.
415
- */
416
- public static take: 8388608;
417
- /**
418
- * Engine enum value for `snd_type.talk`.
419
- */
420
- public static talk: 16384;
421
- /**
422
- * Engine enum value for `snd_type.use`.
423
- */
424
- public static use: 4194304;
425
- /**
426
- * Engine enum value for `snd_type.weapon`.
427
- */
428
- public static weapon: -2147483648;
429
- /**
430
- * Engine enum value for `snd_type.weapon_bullet_hit`.
431
- */
432
- public static weapon_bullet_hit: -2146959360;
433
- /**
434
- * Engine enum value for `snd_type.weapon_empty`.
435
- */
436
- public static weapon_empty: -2146435072;
437
- /**
438
- * Engine enum value for `snd_type.weapon_reload`.
439
- */
440
- public static weapon_reload: -2147221504;
441
- /**
442
- * Engine enum value for `snd_type.weapon_shoot`.
443
- */
444
- public static weapon_shoot: -2145386496;
445
- /**
446
- * Engine enum value for `snd_type.world`.
447
- */
448
- public static world: 134217728;
449
- /**
450
- * Engine enum value for `snd_type.world_ambient`.
451
- */
452
- public static world_ambient: 134217856;
453
- /**
454
- * Engine enum value for `snd_type.world_object_break`.
455
- */
456
- public static world_object_break: 134218752;
457
- /**
458
- * Engine enum value for `snd_type.world_object_collide`.
459
- */
460
- public static world_object_collide: 134218240;
461
- /**
462
- * Engine enum value for `snd_type.world_object_explode`.
463
- */
464
- public static world_object_explode: 134217984;
465
-
466
- /**
467
- * Engine-owned sound category constants.
468
- */
469
- private constructor();
470
- }
471
-
472
- /**
473
- * @group xr_sound
474
- */
475
- export type TXR_snd_type = EnumeratedStaticsValues<typeof snd_type>;
476
-
477
- /**
478
- * Last sound perceived by an object.
479
- *
480
- * @source C++ class SoundInfo
481
- * @customConstructor SoundInfo
482
- * @group xr_sound
483
- */
484
- export class SoundInfo {
485
- /**
486
- * Whether the sound is considered dangerous.
487
- */
488
- public danger: i32;
489
-
490
- /**
491
- * Sound origin position.
492
- */
493
- public position: vector;
494
-
495
- /**
496
- * Perceived sound power.
497
- */
498
- public power: f32;
499
-
500
- /**
501
- * Level time when the sound was perceived.
502
- */
503
- public time: i32;
504
-
505
- /**
506
- * Object that produced the sound.
507
- */
508
- public who: game_object;
509
-
510
- /**
511
- * Engine-created perceived sound info.
512
- */
513
- private constructor();
514
- }
515
- }
@@ -1,49 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * Actor statistics helpers exposed through the `actor_stats` namespace.
4
- *
5
- * @group xr_stats
6
- */
7
- export interface IXR_actor_stats {
8
- /**
9
- * Add actor statistic points with a string value.
10
- *
11
- * @param section - Statistic section id.
12
- * @param detail_key - Detail key inside the section.
13
- * @param value - String value to add.
14
- */
15
- add_points_str(this: void, section: string, detail_key: string, value: string): void;
16
-
17
- /**
18
- * Get total actor points for a statistic section.
19
- *
20
- * @param section - Statistic section id.
21
- * @returns Section points.
22
- */
23
- get_points(this: void, section: string): i32;
24
-
25
- /**
26
- * Add actor statistic points with count and score.
27
- *
28
- * @param section - Statistic section id.
29
- * @param detail_key - Detail key inside the section.
30
- * @param count - Count to add.
31
- * @param points - Points to add.
32
- */
33
- add_points(this: void, section: string, detail_key: string, count: i32, points: i32): void;
34
-
35
- /**
36
- * Remove an object from actor ranking when this optional binding exists.
37
- *
38
- * @param object_id - Object id to remove.
39
- */
40
- remove_from_ranking(this: void, object_id: number): void | null;
41
- }
42
-
43
- /**
44
- * Actor statistics namespace.
45
- *
46
- * @group xr_stats
47
- */
48
- export const actor_stats: IXR_actor_stats;
49
- }