xray16 1.3.4 → 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 (84) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +112 -106
  3. package/package.json +45 -42
  4. package/plugins/built_at_info.d.ts +1 -1
  5. package/plugins/from_cast_utils.d.ts +1 -1
  6. package/plugins/global_declarations_transform.d.ts +1 -1
  7. package/plugins/inject_file_meta.d.ts +1 -1
  8. package/plugins/inject_tracy_zones.d.ts +1 -1
  9. package/plugins/inject_tracy_zones.js +2 -2
  10. package/plugins/strip_lua_logger.d.ts +1 -1
  11. package/plugins/strip_lua_logger.js +1 -1
  12. package/plugins/transform_luabind_class/plugin.d.ts +1 -1
  13. package/plugins/transform_luabind_class/transformation/class_declaration.d.ts +3 -3
  14. package/plugins/transform_luabind_class/transformation/decorators.d.ts +5 -2
  15. package/plugins/transform_luabind_class/transformation/decorators.js +3 -0
  16. package/plugins/transform_luabind_class/transformation/members/accessors.d.ts +1 -1
  17. package/plugins/transform_luabind_class/transformation/members/constructor.d.ts +2 -2
  18. package/plugins/transform_luabind_class/transformation/members/constructor.js +2 -2
  19. package/plugins/transform_luabind_class/transformation/members/fields.d.ts +5 -2
  20. package/plugins/transform_luabind_class/transformation/members/fields.js +5 -2
  21. package/plugins/transform_luabind_class/transformation/members/method.d.ts +6 -3
  22. package/plugins/transform_luabind_class/transformation/members/method.js +4 -1
  23. package/plugins/transform_luabind_class/transformation/new.d.ts +7 -3
  24. package/plugins/transform_luabind_class/transformation/new.js +5 -1
  25. package/plugins/transform_luabind_class/transformation/setup.d.ts +9 -3
  26. package/plugins/transform_luabind_class/transformation/setup.js +22 -6
  27. package/plugins/transform_luabind_class/transformation/super.d.ts +19 -3
  28. package/plugins/transform_luabind_class/transformation/super.js +17 -1
  29. package/plugins/transform_luabind_class/transformation/utils.d.ts +27 -4
  30. package/plugins/transform_luabind_class/transformation/utils.js +25 -2
  31. package/plugins/utils/ast.d.ts +1 -1
  32. package/plugins/utils/diagnostics.d.ts +9 -5
  33. package/plugins/utils/diagnostics.js +5 -1
  34. package/plugins/utils/tracy.d.ts +1 -1
  35. package/types/index.d.ts +55 -55
  36. package/types/xr_ai/xr_action.d.ts +1802 -510
  37. package/types/xr_ai/xr_alife.d.ts +1870 -566
  38. package/types/xr_ai/xr_enemy_evaluation.d.ts +134 -41
  39. package/types/xr_ai/xr_goap.d.ts +1116 -668
  40. package/types/xr_ai/xr_graph.d.ts +135 -47
  41. package/types/xr_ai/xr_memory.d.ts +382 -148
  42. package/types/xr_lib/xr_animation.d.ts +252 -81
  43. package/types/xr_lib/xr_bitwise.d.ts +44 -21
  44. package/types/xr_lib/xr_color.d.ts +142 -40
  45. package/types/xr_lib/xr_debug.d.ts +181 -77
  46. package/types/xr_lib/xr_dialog.d.ts +132 -40
  47. package/types/xr_lib/xr_flags.d.ts +592 -148
  48. package/types/xr_lib/xr_fs.d.ts +539 -148
  49. package/types/xr_lib/xr_game.d.ts +362 -158
  50. package/types/xr_lib/xr_hit.d.ts +125 -41
  51. package/types/xr_lib/xr_ini.d.ts +473 -188
  52. package/types/xr_lib/xr_level.d.ts +795 -225
  53. package/types/xr_lib/xr_luabind.d.ts +90 -59
  54. package/types/xr_lib/xr_map.d.ts +192 -61
  55. package/types/xr_lib/xr_math.d.ts +871 -233
  56. package/types/xr_lib/xr_multiplayer.d.ts +1079 -351
  57. package/types/xr_lib/xr_profile.d.ts +272 -160
  58. package/types/xr_lib/xr_properties.d.ts +610 -166
  59. package/types/xr_lib/xr_relation.d.ts +231 -84
  60. package/types/xr_lib/xr_render.d.ts +167 -69
  61. package/types/xr_lib/xr_save.d.ts +833 -223
  62. package/types/xr_lib/xr_sound.d.ts +515 -151
  63. package/types/xr_lib/xr_stats.ts +49 -20
  64. package/types/xr_lib/xr_task.d.ts +388 -111
  65. package/types/xr_lib/xr_time.d.ts +177 -61
  66. package/types/xr_lib/xr_type.d.ts +75 -75
  67. package/types/xr_object/client/xr_anomaly.d.ts +70 -50
  68. package/types/xr_object/client/xr_artefact.d.ts +153 -98
  69. package/types/xr_object/client/xr_client_object.d.ts +207 -76
  70. package/types/xr_object/client/xr_creature.d.ts +243 -164
  71. package/types/xr_object/client/xr_item.d.ts +370 -264
  72. package/types/xr_object/client/xr_level.d.ts +753 -285
  73. package/types/xr_object/client/xr_physic.d.ts +644 -214
  74. package/types/xr_object/client/xr_zone.d.ts +85 -47
  75. package/types/xr_object/script/xr_script_interface.d.ts +819 -584
  76. package/types/xr_object/script/xr_script_object.d.ts +5728 -1390
  77. package/types/xr_object/script/xr_script_trade.d.ts +51 -26
  78. package/types/xr_object/server/xr_server_object.d.ts +1486 -792
  79. package/types/xr_ui/xr_ui_asset.d.ts +364 -123
  80. package/types/xr_ui/xr_ui_core.d.ts +424 -97
  81. package/types/xr_ui/xr_ui_event.d.ts +1449 -381
  82. package/types/xr_ui/xr_ui_interface.d.ts +2447 -903
  83. package/types/xr_ui/xr_ui_menu.d.ts +385 -142
  84. package/types/xrf_plugin.d.ts +89 -51
@@ -1,148 +1,382 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class memory_object
4
- * @customConstructor memory_object
5
- * @group xr_memory
6
- */
7
- export class memory_object extends EngineBinding {
8
- public readonly last_level_time: u32;
9
- public readonly level_time: u32;
10
-
11
- protected constructor();
12
- }
13
-
14
- /**
15
- * @source C++ class entity_memory_object : memory_object
16
- * @customConstructor entity_memory_object
17
- * @group xr_memory
18
- */
19
- export class entity_memory_object extends memory_object {
20
- public readonly object_info: object;
21
- public readonly self_info: object;
22
-
23
- protected constructor();
24
-
25
- public object(): game_object;
26
- }
27
-
28
- /**
29
- * @source C++ class object_params
30
- * @customConstructor object_params
31
- * @group xr_memory
32
- */
33
- export class object_params {
34
- public level_vertex: u32;
35
- public position: vector;
36
-
37
- private constructor();
38
- }
39
-
40
- /**
41
- * @source C++ class hit_memory_object : entity_memory_object
42
- * @customConstructor hit_memory_object
43
- * @group xr_memory
44
- */
45
- export class hit_memory_object extends entity_memory_object {
46
- public readonly amount: f32;
47
- public readonly bone_index: u16;
48
- public readonly direction: vector;
49
-
50
- protected constructor();
51
- }
52
-
53
- /**
54
- * @source C++ class game_memory_object : memory_object
55
- * @customConstructor game_memory_object
56
- * @group xr_memory
57
- */
58
- export class game_memory_object extends memory_object {
59
- public object_info: unknown; /* MemorySpace::CObjectParams<class CGameObject>& */
60
- public self_info: unknown; /* MemorySpace::CObjectParams<class CGameObject>& */
61
- public object(): game_object;
62
-
63
- protected constructor();
64
- }
65
-
66
- /**
67
- * @source C++ class not_yet_visible_object
68
- * @customConstructor not_yet_visible_object
69
- * @group xr_memory
70
- */
71
- export class not_yet_visible_object extends EngineBinding {
72
- protected constructor();
73
-
74
- public value: f32;
75
- public object(): game_object;
76
- }
77
-
78
- /**
79
- * @source C++ class visible_memory_object
80
- * @customConstructor visible_memory_object
81
- * @group xr_memory
82
- */
83
- export class visible_memory_object extends game_memory_object {
84
- protected constructor();
85
- }
86
-
87
- /**
88
- * @source C++ class memory_info : visible_memory_object
89
- * @customConstructor visible_memory_object
90
- * @group xr_memory
91
- */
92
- export class memory_info extends visible_memory_object {
93
- public readonly hit_info: boolean;
94
- public readonly sound_info: boolean;
95
- public readonly visual_info: boolean;
96
-
97
- protected constructor();
98
- }
99
-
100
- /**
101
- * @source C++ class sound_memory_object : game_memory_object
102
- * @customConstructor sound_memory_object
103
- * @group xr_memory
104
- */
105
- export class sound_memory_object extends game_memory_object {
106
- public readonly power: f32;
107
-
108
- protected constructor();
109
-
110
- public type(): i32;
111
- }
112
-
113
- /**
114
- * @source C++ class danger_object
115
- * @customConstructor danger_object
116
- * @group xr_memory
117
- */
118
- export class danger_object {
119
- public static attack_sound: 1;
120
- public static attacked: 5;
121
- public static bullet_ricochet: 0;
122
- public static enemy_sound: 7;
123
- public static entity_attacked: 2;
124
- public static entity_corpse: 4;
125
- public static entity_death: 3;
126
- public static grenade: 6;
127
- public static hit: 2;
128
- public static sound: 1;
129
- public static visual: 0;
130
-
131
- public type(): TXR_danger_object;
132
- public time(): u32;
133
- public position(): vector;
134
- public object(): game_object;
135
- public perceive_type(): number; /* CDangerObject::EDangerPerceiveType */
136
- public dependent_object(): game_object;
137
- }
138
-
139
- /**
140
- * @group xr_memory
141
- */
142
- export type TXR_danger_objects = typeof danger_object;
143
-
144
- /**
145
- * @group xr_memory
146
- */
147
- export type TXR_danger_object = EnumeratedStaticsValues<TXR_danger_objects>;
148
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Base memory record with timing information.
4
+ *
5
+ * @source C++ class memory_object
6
+ * @customConstructor memory_object
7
+ * @group xr_memory
8
+ *
9
+ * @remarks
10
+ * Memory records are snapshots owned by the AI memory managers. Treat them as short-lived views of current memory
11
+ * state.
12
+ */
13
+ export class memory_object extends EngineBinding {
14
+ /**
15
+ * Previous level time recorded for this memory entry.
16
+ */
17
+ public readonly last_level_time: u32;
18
+
19
+ /**
20
+ * Level time when this memory entry was last updated.
21
+ */
22
+ public readonly level_time: u32;
23
+
24
+ /**
25
+ * Engine-created memory record.
26
+ */
27
+ protected constructor();
28
+ }
29
+
30
+ /**
31
+ * Memory record that points to a living entity.
32
+ *
33
+ * @source C++ class entity_memory_object : memory_object
34
+ * @customConstructor entity_memory_object
35
+ * @group xr_memory
36
+ *
37
+ * @remarks
38
+ * Used for entity-alive memories such as hit records.
39
+ */
40
+ export class entity_memory_object extends memory_object {
41
+ /**
42
+ * Snapshot of the remembered entity.
43
+ */
44
+ public readonly object_info: object_params;
45
+
46
+ /**
47
+ * Snapshot of the object that owns this memory.
48
+ */
49
+ public readonly self_info: object_params;
50
+
51
+ /**
52
+ * Engine-created entity memory record.
53
+ */
54
+ protected constructor();
55
+
56
+ /**
57
+ * Get the remembered entity.
58
+ *
59
+ * @remarks
60
+ * The binding expects the native memory record to still point to a live object.
61
+ *
62
+ * @returns Remembered game object.
63
+ */
64
+ public object(): game_object;
65
+ }
66
+
67
+ /**
68
+ * Position and level-vertex snapshot for a remembered object.
69
+ *
70
+ * @source C++ class object_params
71
+ * @customConstructor object_params
72
+ * @group xr_memory
73
+ *
74
+ * @remarks
75
+ * Filled from the object's AI location and center position at the moment the memory record was updated.
76
+ */
77
+ export class object_params {
78
+ /**
79
+ * Level graph vertex recorded for the object.
80
+ */
81
+ public level_vertex: u32;
82
+
83
+ /**
84
+ * World position recorded for the object.
85
+ */
86
+ public position: vector;
87
+
88
+ /**
89
+ * Engine-created object memory snapshot.
90
+ */
91
+ private constructor();
92
+ }
93
+
94
+ /**
95
+ * Memory record for a hit received by an entity.
96
+ *
97
+ * @source C++ class hit_memory_object : entity_memory_object
98
+ * @customConstructor hit_memory_object
99
+ * @group xr_memory
100
+ *
101
+ * @remarks
102
+ * Exposed through stalker/monster hit memory. The direction and amount describe the remembered hit, not the current
103
+ * object state.
104
+ */
105
+ export class hit_memory_object extends entity_memory_object {
106
+ /**
107
+ * Hit power remembered by AI.
108
+ */
109
+ public readonly amount: f32;
110
+
111
+ /**
112
+ * Bone that received the hit.
113
+ */
114
+ public readonly bone_index: u16;
115
+
116
+ /**
117
+ * Hit direction.
118
+ */
119
+ public readonly direction: vector;
120
+
121
+ /**
122
+ * Engine-created hit memory record.
123
+ */
124
+ protected constructor();
125
+ }
126
+
127
+ /**
128
+ * Memory record that points to a game object.
129
+ *
130
+ * @source C++ class game_memory_object : memory_object
131
+ * @customConstructor game_memory_object
132
+ * @group xr_memory
133
+ *
134
+ * @remarks
135
+ * Used for visual and sound memories of game objects.
136
+ */
137
+ export class game_memory_object extends memory_object {
138
+ /**
139
+ * Snapshot of the remembered object.
140
+ */
141
+ public readonly object_info: object_params;
142
+
143
+ /**
144
+ * Snapshot of the object that owns this memory.
145
+ */
146
+ public readonly self_info: object_params;
147
+
148
+ /**
149
+ * Get the remembered object.
150
+ *
151
+ * @remarks
152
+ * The binding expects the native memory record to still point to a live object.
153
+ *
154
+ * @returns Remembered game object.
155
+ */
156
+ public object(): game_object;
157
+
158
+ /**
159
+ * Engine-created game object memory record.
160
+ */
161
+ protected constructor();
162
+ }
163
+
164
+ /**
165
+ * Visual memory candidate that has not become fully visible yet.
166
+ *
167
+ * @source C++ class not_yet_visible_object
168
+ * @customConstructor not_yet_visible_object
169
+ * @group xr_memory
170
+ *
171
+ * @remarks
172
+ * Created by the visual memory manager while an object is accumulating visibility but has not entered full visual
173
+ * memory.
174
+ */
175
+ export class not_yet_visible_object extends EngineBinding {
176
+ /**
177
+ * Engine-created pending visibility record.
178
+ */
179
+ protected constructor();
180
+
181
+ /**
182
+ * Visibility score accumulated for this candidate.
183
+ */
184
+ public value: f32;
185
+
186
+ /**
187
+ * Get the visibility candidate object.
188
+ *
189
+ * @remarks
190
+ * The binding expects the candidate to still point to a live object.
191
+ *
192
+ * @returns Candidate game object.
193
+ */
194
+ public object(): game_object;
195
+ }
196
+
197
+ /**
198
+ * Memory record for a visible object.
199
+ *
200
+ * @source C++ class visible_memory_object
201
+ * @customConstructor visible_memory_object
202
+ * @group xr_memory
203
+ *
204
+ * @remarks
205
+ * Describes an object currently tracked by visual memory.
206
+ */
207
+ export class visible_memory_object extends game_memory_object {
208
+ /**
209
+ * Engine-created visible object record.
210
+ */
211
+ protected constructor();
212
+ }
213
+
214
+ /**
215
+ * Combined visible, sound, and hit memory flags for one object.
216
+ *
217
+ * @source C++ class memory_info : visible_memory_object
218
+ * @customConstructor visible_memory_object
219
+ * @group xr_memory
220
+ *
221
+ * @remarks
222
+ * Returned by memory lookups to tell which memory channels currently have data for the object.
223
+ */
224
+ export class memory_info extends visible_memory_object {
225
+ /**
226
+ * Whether hit memory is available for this object.
227
+ */
228
+ public readonly hit_info: boolean;
229
+
230
+ /**
231
+ * Whether sound memory is available for this object.
232
+ */
233
+ public readonly sound_info: boolean;
234
+
235
+ /**
236
+ * Whether visual memory is available for this object.
237
+ */
238
+ public readonly visual_info: boolean;
239
+
240
+ /**
241
+ * Engine-created combined memory record.
242
+ */
243
+ protected constructor();
244
+ }
245
+
246
+ /**
247
+ * Memory record for a heard object or sound event.
248
+ *
249
+ * @source C++ class sound_memory_object : game_memory_object
250
+ * @customConstructor sound_memory_object
251
+ * @group xr_memory
252
+ *
253
+ * @remarks
254
+ * Sound memory stores the object that produced or is associated with the sound plus the perceived sound type.
255
+ */
256
+ export class sound_memory_object extends game_memory_object {
257
+ /**
258
+ * Remembered sound power.
259
+ */
260
+ public readonly power: f32;
261
+
262
+ /**
263
+ * Engine-created sound memory record.
264
+ */
265
+ protected constructor();
266
+
267
+ /**
268
+ * Get the engine sound type id.
269
+ *
270
+ * @returns Sound type id.
271
+ */
272
+ public type(): i32;
273
+ }
274
+
275
+ /**
276
+ * AI danger event remembered by an object.
277
+ *
278
+ * @source C++ class danger_object
279
+ * @customConstructor danger_object
280
+ * @group xr_memory
281
+ *
282
+ * @remarks
283
+ * Danger memory can represent visual, sound, or hit perception. Unlike other memory records, its source object can
284
+ * be absent.
285
+ */
286
+ export class danger_object {
287
+ /**
288
+ * Engine enum value for `danger_object.attack_sound`.
289
+ */
290
+ public static attack_sound: 1;
291
+ /**
292
+ * Engine enum value for `danger_object.attacked`.
293
+ */
294
+ public static attacked: 5;
295
+ /**
296
+ * Engine enum value for `danger_object.bullet_ricochet`.
297
+ */
298
+ public static bullet_ricochet: 0;
299
+ /**
300
+ * Engine enum value for `danger_object.enemy_sound`.
301
+ */
302
+ public static enemy_sound: 7;
303
+ /**
304
+ * Engine enum value for `danger_object.entity_attacked`.
305
+ */
306
+ public static entity_attacked: 2;
307
+ /**
308
+ * Engine enum value for `danger_object.entity_corpse`.
309
+ */
310
+ public static entity_corpse: 4;
311
+ /**
312
+ * Engine enum value for `danger_object.entity_death`.
313
+ */
314
+ public static entity_death: 3;
315
+ /**
316
+ * Engine enum value for `danger_object.grenade`.
317
+ */
318
+ public static grenade: 6;
319
+ /**
320
+ * Engine enum value for `danger_object.hit`.
321
+ */
322
+ public static hit: 2;
323
+ /**
324
+ * Engine enum value for `danger_object.sound`.
325
+ */
326
+ public static sound: 1;
327
+ /**
328
+ * Engine enum value for `danger_object.visual`.
329
+ */
330
+ public static visual: 0;
331
+
332
+ /**
333
+ * @returns Danger type.
334
+ */
335
+ public type(): TXR_danger_object;
336
+
337
+ /**
338
+ * @returns Game time when the danger was registered.
339
+ */
340
+ public time(): u32;
341
+
342
+ /**
343
+ * @returns Danger position.
344
+ */
345
+ public position(): vector;
346
+
347
+ /**
348
+ * Get the danger source object.
349
+ *
350
+ * @remarks
351
+ * Returns `null` when the danger was stored without a living entity source.
352
+ *
353
+ * @returns Source object, or `null` when the source is not a game object.
354
+ */
355
+ public object(): game_object | null;
356
+
357
+ /**
358
+ * @returns How the danger was perceived.
359
+ */
360
+ public perceive_type(): number; /* CDangerObject::EDangerPerceiveType */
361
+
362
+ /**
363
+ * Get the object attached to this danger event.
364
+ *
365
+ * @remarks
366
+ * Returns `null` when there is no dependent object, or when the dependent native object is not a game object.
367
+ *
368
+ * @returns Dependent object, or `null` when there is none.
369
+ */
370
+ public dependent_object(): game_object | null;
371
+ }
372
+
373
+ /**
374
+ * @group xr_memory
375
+ */
376
+ export type TXR_danger_objects = typeof danger_object;
377
+
378
+ /**
379
+ * @group xr_memory
380
+ */
381
+ export type TXR_danger_object = EnumeratedStaticsValues<TXR_danger_objects>;
382
+ }