xray16 1.4.0 → 1.5.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.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/types/xr_ai/xr_action.d.ts +1321 -29
  3. package/types/xr_ai/xr_alife.d.ts +1336 -32
  4. package/types/xr_ai/xr_enemy_evaluation.d.ts +112 -19
  5. package/types/xr_ai/xr_goap.d.ts +450 -3
  6. package/types/xr_ai/xr_graph.d.ts +94 -6
  7. package/types/xr_ai/xr_memory.d.ts +240 -6
  8. package/types/xr_lib/xr_animation.d.ts +185 -14
  9. package/types/xr_lib/xr_bitwise.d.ts +20 -8
  10. package/types/xr_lib/xr_color.d.ts +103 -6
  11. package/types/xr_lib/xr_debug.d.ts +110 -12
  12. package/types/xr_lib/xr_dialog.d.ts +99 -7
  13. package/types/xr_lib/xr_flags.d.ts +78 -15
  14. package/types/xr_lib/xr_fs.d.ts +395 -5
  15. package/types/xr_lib/xr_game.d.ts +101 -0
  16. package/types/xr_lib/xr_hit.d.ts +84 -0
  17. package/types/xr_lib/xr_ini.d.ts +60 -2
  18. package/types/xr_lib/xr_level.d.ts +182 -39
  19. package/types/xr_lib/xr_luabind.d.ts +37 -11
  20. package/types/xr_lib/xr_map.d.ts +137 -6
  21. package/types/xr_lib/xr_math.d.ts +56 -0
  22. package/types/xr_lib/xr_multiplayer.d.ts +729 -1
  23. package/types/xr_lib/xr_profile.d.ts +80 -0
  24. package/types/xr_lib/xr_properties.d.ts +159 -4
  25. package/types/xr_lib/xr_relation.d.ts +147 -0
  26. package/types/xr_lib/xr_render.d.ts +99 -3
  27. package/types/xr_lib/xr_save.d.ts +110 -4
  28. package/types/xr_lib/xr_sound.d.ts +373 -9
  29. package/types/xr_lib/xr_stats.ts +33 -4
  30. package/types/xr_lib/xr_task.d.ts +277 -0
  31. package/types/xr_lib/xr_time.d.ts +11 -0
  32. package/types/xr_object/client/xr_anomaly.d.ts +20 -0
  33. package/types/xr_object/client/xr_artefact.d.ts +57 -2
  34. package/types/xr_object/client/xr_client_object.d.ts +131 -0
  35. package/types/xr_object/client/xr_creature.d.ts +79 -0
  36. package/types/xr_object/client/xr_item.d.ts +108 -2
  37. package/types/xr_object/client/xr_level.d.ts +482 -14
  38. package/types/xr_object/client/xr_physic.d.ts +459 -29
  39. package/types/xr_object/client/xr_zone.d.ts +38 -0
  40. package/types/xr_object/script/xr_script_interface.d.ts +236 -1
  41. package/types/xr_object/script/xr_script_object.d.ts +3402 -82
  42. package/types/xr_object/script/xr_script_trade.d.ts +25 -15
  43. package/types/xr_object/server/xr_server_object.d.ts +707 -15
  44. package/types/xr_ui/xr_ui_asset.d.ts +241 -6
  45. package/types/xr_ui/xr_ui_core.d.ts +327 -9
  46. package/types/xr_ui/xr_ui_event.d.ts +1067 -1
  47. package/types/xr_ui/xr_ui_interface.d.ts +1563 -17
  48. package/types/xr_ui/xr_ui_menu.d.ts +259 -16
  49. package/types/xrf_plugin.d.ts +44 -14
@@ -1,40 +1,132 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Script rules attached to a dialog phrase.
4
+ *
3
5
  * @source C++ class CPhraseScript
4
6
  * @customConstructor CPhraseScript
5
7
  * @group xr_dialog
8
+ *
9
+ * @remarks
10
+ * Phrase scripts are evaluated by the dialog engine against the current actor/NPC speakers. Info portion checks use
11
+ * the actor info registry.
6
12
  */
7
13
  export class CPhraseScript {
8
- public AddAction(value: string): void;
14
+ /**
15
+ * Run a script action after the phrase is spoken.
16
+ *
17
+ * @remarks
18
+ * In active two-speaker dialogs the function receives `(speaker, listener, dialog_id, phrase_id)`. In simpler
19
+ * dialog checks it receives `(speaker, dialog_id)`.
20
+ *
21
+ * @throws If the function name cannot be resolved.
22
+ *
23
+ * @param function_name - Script function name.
24
+ */
25
+ public AddAction(function_name: string): void;
9
26
 
10
- public AddDisableInfo(value: string): void;
27
+ /**
28
+ * Disable an info portion when phrase actions run.
29
+ *
30
+ * @remarks
31
+ * Applied after the phrase is accepted and its actions run.
32
+ *
33
+ * @param info_portion - Info portion id.
34
+ */
35
+ public AddDisableInfo(info_portion: string): void;
11
36
 
12
- public AddDontHasInfo(value: string): void;
37
+ /**
38
+ * Require an info portion to be absent before the phrase is available.
39
+ *
40
+ * @param info_portion - Info portion id.
41
+ */
42
+ public AddDontHasInfo(info_portion: string): void;
13
43
 
14
- public AddGiveInfo(value: string): void;
44
+ /**
45
+ * Give an info portion when phrase actions run.
46
+ *
47
+ * @remarks
48
+ * Applied after the phrase is accepted and its actions run.
49
+ *
50
+ * @param info_portion - Info portion id.
51
+ */
52
+ public AddGiveInfo(info_portion: string): void;
15
53
 
16
- public AddHasInfo(value: string): void;
54
+ /**
55
+ * Require an info portion before the phrase is available.
56
+ *
57
+ * @param info_portion - Info portion id.
58
+ */
59
+ public AddHasInfo(info_portion: string): void;
17
60
 
18
- public AddPrecondition(value: string): void;
61
+ /**
62
+ * Add a script predicate checked before the phrase is available.
63
+ *
64
+ * @remarks
65
+ * In active two-speaker dialogs the function receives `(speaker, listener, dialog_id, phrase_id, next_phrase_id)`.
66
+ * It should return `true` when the phrase may be shown.
67
+ *
68
+ * @throws If the function name cannot be resolved.
69
+ *
70
+ * @param function_name - Script function name.
71
+ */
72
+ public AddPrecondition(function_name: string): void;
19
73
 
20
- public SetScriptText(value: string): void;
74
+ /**
75
+ * Use a script function to provide phrase text.
76
+ *
77
+ * @remarks
78
+ * The function is called when the dialog asks for phrase text. Use it for text that depends on the current speaker
79
+ * or dialog state.
80
+ *
81
+ * @throws If the function name cannot be resolved.
82
+ *
83
+ * @param function_name - Script function name.
84
+ */
85
+ public SetScriptText(function_name: string): void;
21
86
  }
22
87
 
23
88
  /**
89
+ * Runtime phrase in a phrase dialog.
90
+ *
24
91
  * @source C++ class CPhrase
25
92
  * @customConstructor CPhrase
26
93
  * @group xr_dialog
94
+ *
95
+ * @remarks
96
+ * Phrase instances are owned by the dialog graph. Script code usually configures them immediately after
97
+ * `CPhraseDialog.AddPhrase`.
27
98
  */
28
99
  export class CPhrase {
100
+ /**
101
+ * @returns Script helper used to configure phrase conditions and actions.
102
+ */
29
103
  public GetPhraseScript(): CPhraseScript;
30
104
  }
31
105
 
32
106
  /**
107
+ * Phrase dialog built or extended from scripts.
108
+ *
33
109
  * @source C++ class CPhraseDialog
34
110
  * @customConstructor CPhraseDialog
35
111
  * @group xr_dialog
112
+ *
113
+ * @remarks
114
+ * A phrase dialog is a directed phrase graph. Phrase id `"0"` is the start phrase used by loaded XML dialogs.
36
115
  */
37
116
  export class CPhraseDialog {
117
+ /**
118
+ * Add a phrase to the dialog tree.
119
+ *
120
+ * @remarks
121
+ * `prev_phrase_id` creates the edge from the previous phrase to the new one. Pass an empty string for a root phrase.
122
+ * Reusing an existing `phrase_id` returns the existing phrase and still links it from `prev_phrase_id`.
123
+ *
124
+ * @param text - Text or string table id.
125
+ * @param phrase_id - New phrase id.
126
+ * @param prev_phrase_id - Parent phrase id, or an empty string.
127
+ * @param goodwill_level - Goodwill value used when the engine orders available replies.
128
+ * @returns Created phrase.
129
+ */
38
130
  public AddPhrase(text: string, phrase_id: string, prev_phrase_id: string, goodwill_level: i32): CPhrase;
39
131
  }
40
132
  }
@@ -5,10 +5,13 @@ declare module "xray16" {
5
5
  * @source C++ class flags8
6
6
  * @customConstructor flags8
7
7
  * @group xr_flags
8
+ *
9
+ * @remarks
10
+ * Use `zero()`, `one()`, or `assign()` when you need an explicit initial state.
8
11
  */
9
12
  export class flags8 {
10
13
  /**
11
- * Create an empty mask.
14
+ * Create a flag mask.
12
15
  */
13
16
  public constructor();
14
17
 
@@ -85,9 +88,9 @@ declare module "xray16" {
85
88
  public invert(value: flags8): flags8;
86
89
 
87
90
  /**
88
- * Replace this mask with inverted raw value.
91
+ * Toggle selected bits in this mask.
89
92
  *
90
- * @param value - Raw mask value.
93
+ * @param value - Bits to toggle.
91
94
  * @returns This mask.
92
95
  */
93
96
  public invert(value: u8): flags8;
@@ -95,6 +98,9 @@ declare module "xray16" {
95
98
  /**
96
99
  * Check whether all selected bits are set in a source mask.
97
100
  *
101
+ * @remarks
102
+ * This is stricter than `is_any()` and `test()`: every bit from `mask` must be present.
103
+ *
98
104
  * @param value - Source mask.
99
105
  * @param mask - Bits to test.
100
106
  * @returns Whether all bits are set.
@@ -104,6 +110,9 @@ declare module "xray16" {
104
110
  /**
105
111
  * Check whether all selected bits are set in this mask.
106
112
  *
113
+ * @remarks
114
+ * This is stricter than `is_any()` and `test()`: every bit from `mask` must be present.
115
+ *
107
116
  * @param mask - Bits to test.
108
117
  * @returns Whether all bits are set.
109
118
  */
@@ -112,6 +121,9 @@ declare module "xray16" {
112
121
  /**
113
122
  * Check whether any selected bit is set in a source mask.
114
123
  *
124
+ * @remarks
125
+ * Use this for overlap checks. For an all-bits check, use `is()`.
126
+ *
115
127
  * @param value - Source mask.
116
128
  * @param mask - Bits to test.
117
129
  * @returns Whether any bit is set.
@@ -121,6 +133,9 @@ declare module "xray16" {
121
133
  /**
122
134
  * Check whether any selected bit is set in this mask.
123
135
  *
136
+ * @remarks
137
+ * Use this for overlap checks. For an all-bits check, use `is()`.
138
+ *
124
139
  * @param mask - Bits to test.
125
140
  * @returns Whether any bit is set.
126
141
  */
@@ -129,6 +144,9 @@ declare module "xray16" {
129
144
  /**
130
145
  * Set all bits.
131
146
  *
147
+ * @remarks
148
+ * Sets all 8 bits to `1`.
149
+ *
132
150
  * @returns This mask.
133
151
  */
134
152
  public one(): flags8;
@@ -160,10 +178,13 @@ declare module "xray16" {
160
178
  public set(mask: u8, enabled: boolean): flags8;
161
179
 
162
180
  /**
163
- * Test whether selected bits are set.
181
+ * Test whether any selected bit is set.
182
+ *
183
+ * @remarks
184
+ * Equivalent to `is_any(mask)`.
164
185
  *
165
186
  * @param mask - Bits to test.
166
- * @returns Whether selected bits are set.
187
+ * @returns Whether any selected bit is set.
167
188
  */
168
189
  public test(mask: u8): boolean;
169
190
 
@@ -181,10 +202,13 @@ declare module "xray16" {
181
202
  * @source C++ class flags16
182
203
  * @customConstructor flags16
183
204
  * @group xr_flags
205
+ *
206
+ * @remarks
207
+ * Use `zero()`, `one()`, or `assign()` when you need an explicit initial state.
184
208
  */
185
209
  export class flags16 {
186
210
  /**
187
- * Create an empty mask.
211
+ * Create a flag mask.
188
212
  */
189
213
  public constructor();
190
214
 
@@ -261,9 +285,9 @@ declare module "xray16" {
261
285
  public invert(value: flags16): flags16;
262
286
 
263
287
  /**
264
- * Replace this mask with inverted raw value.
288
+ * Toggle selected bits in this mask.
265
289
  *
266
- * @param value - Raw mask value.
290
+ * @param value - Bits to toggle.
267
291
  * @returns This mask.
268
292
  */
269
293
  public invert(value: u16): flags16;
@@ -271,6 +295,9 @@ declare module "xray16" {
271
295
  /**
272
296
  * Check whether all selected bits are set in a source mask.
273
297
  *
298
+ * @remarks
299
+ * This is stricter than `is_any()` and `test()`: every bit from `mask` must be present.
300
+ *
274
301
  * @param value - Source mask.
275
302
  * @param mask - Bits to test.
276
303
  * @returns Whether all bits are set.
@@ -280,6 +307,9 @@ declare module "xray16" {
280
307
  /**
281
308
  * Check whether all selected bits are set in this mask.
282
309
  *
310
+ * @remarks
311
+ * This is stricter than `is_any()` and `test()`: every bit from `mask` must be present.
312
+ *
283
313
  * @param mask - Bits to test.
284
314
  * @returns Whether all bits are set.
285
315
  */
@@ -288,6 +318,9 @@ declare module "xray16" {
288
318
  /**
289
319
  * Check whether any selected bit is set in a source mask.
290
320
  *
321
+ * @remarks
322
+ * Use this for overlap checks. For an all-bits check, use `is()`.
323
+ *
291
324
  * @param value - Source mask.
292
325
  * @param mask - Bits to test.
293
326
  * @returns Whether any bit is set.
@@ -297,6 +330,9 @@ declare module "xray16" {
297
330
  /**
298
331
  * Check whether any selected bit is set in this mask.
299
332
  *
333
+ * @remarks
334
+ * Use this for overlap checks. For an all-bits check, use `is()`.
335
+ *
300
336
  * @param mask - Bits to test.
301
337
  * @returns Whether any bit is set.
302
338
  */
@@ -305,6 +341,9 @@ declare module "xray16" {
305
341
  /**
306
342
  * Set all bits.
307
343
  *
344
+ * @remarks
345
+ * Sets all 16 bits to `1`.
346
+ *
308
347
  * @returns This mask.
309
348
  */
310
349
  public one(): flags16;
@@ -336,10 +375,13 @@ declare module "xray16" {
336
375
  public set(mask: u16, enabled: boolean): flags16;
337
376
 
338
377
  /**
339
- * Test whether selected bits are set.
378
+ * Test whether any selected bit is set.
379
+ *
380
+ * @remarks
381
+ * Equivalent to `is_any(mask)`.
340
382
  *
341
383
  * @param mask - Bits to test.
342
- * @returns Whether selected bits are set.
384
+ * @returns Whether any selected bit is set.
343
385
  */
344
386
  public test(mask: u16): boolean;
345
387
 
@@ -357,10 +399,13 @@ declare module "xray16" {
357
399
  * @source C++ class flags32
358
400
  * @customConstructor flags32
359
401
  * @group xr_flags
402
+ *
403
+ * @remarks
404
+ * Use `zero()`, `one()`, or `assign()` when you need an explicit initial state.
360
405
  */
361
406
  export class flags32 {
362
407
  /**
363
- * Create an empty mask.
408
+ * Create a flag mask.
364
409
  */
365
410
  public constructor();
366
411
 
@@ -437,9 +482,9 @@ declare module "xray16" {
437
482
  public invert(value: flags32): flags32;
438
483
 
439
484
  /**
440
- * Replace this mask with inverted raw value.
485
+ * Toggle selected bits in this mask.
441
486
  *
442
- * @param value - Raw mask value.
487
+ * @param value - Bits to toggle.
443
488
  * @returns This mask.
444
489
  */
445
490
  public invert(value: u32): flags32;
@@ -447,6 +492,9 @@ declare module "xray16" {
447
492
  /**
448
493
  * Check whether all selected bits are set in a source mask.
449
494
  *
495
+ * @remarks
496
+ * This is stricter than `is_any()` and `test()`: every bit from `mask` must be present.
497
+ *
450
498
  * @param value - Source mask.
451
499
  * @param mask - Bits to test.
452
500
  * @returns Whether all bits are set.
@@ -456,6 +504,9 @@ declare module "xray16" {
456
504
  /**
457
505
  * Check whether all selected bits are set in this mask.
458
506
  *
507
+ * @remarks
508
+ * This is stricter than `is_any()` and `test()`: every bit from `mask` must be present.
509
+ *
459
510
  * @param mask - Bits to test.
460
511
  * @returns Whether all bits are set.
461
512
  */
@@ -464,6 +515,9 @@ declare module "xray16" {
464
515
  /**
465
516
  * Check whether any selected bit is set in a source mask.
466
517
  *
518
+ * @remarks
519
+ * Use this for overlap checks. For an all-bits check, use `is()`.
520
+ *
467
521
  * @param value - Source mask.
468
522
  * @param mask - Bits to test.
469
523
  * @returns Whether any bit is set.
@@ -473,6 +527,9 @@ declare module "xray16" {
473
527
  /**
474
528
  * Check whether any selected bit is set in this mask.
475
529
  *
530
+ * @remarks
531
+ * Use this for overlap checks. For an all-bits check, use `is()`.
532
+ *
476
533
  * @param mask - Bits to test.
477
534
  * @returns Whether any bit is set.
478
535
  */
@@ -481,6 +538,9 @@ declare module "xray16" {
481
538
  /**
482
539
  * Set all bits.
483
540
  *
541
+ * @remarks
542
+ * Sets all 32 bits to `1`.
543
+ *
484
544
  * @returns This mask.
485
545
  */
486
546
  public one(): flags32;
@@ -512,10 +572,13 @@ declare module "xray16" {
512
572
  public set(mask: u32, enabled: boolean): flags32;
513
573
 
514
574
  /**
515
- * Test whether selected bits are set.
575
+ * Test whether any selected bit is set.
576
+ *
577
+ * @remarks
578
+ * Equivalent to `is_any(mask)`.
516
579
  *
517
580
  * @param mask - Bits to test.
518
- * @returns Whether selected bits are set.
581
+ * @returns Whether any selected bit is set.
519
582
  */
520
583
  public test(mask: u32): boolean;
521
584