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,47 +1,135 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Game graph vertex binding.
4
+ *
3
5
  * @source C++ class GameGraph__CVertex
4
6
  * @customConstructor GameGraph__CVertex
5
7
  * @group xr_graph
8
+ *
9
+ * @remarks
10
+ * Engine-owned descriptor returned by {@link CGameGraph.vertex}. Keep it as a short-lived view of graph data,
11
+ * not as persistent game state.
6
12
  */
7
13
  export class GameGraph__CVertex extends EngineBinding {
14
+ /**
15
+ * Engine-created game-graph vertex descriptor.
16
+ */
8
17
  protected constructor();
9
18
 
19
+ /**
20
+ * Get the level-graph vertex this game-graph point maps to.
21
+ *
22
+ * @returns Level vertex id inside the owning level.
23
+ */
10
24
  public level_vertex_id(): u32;
11
25
 
26
+ /**
27
+ * Get the id of the level that owns this graph point.
28
+ *
29
+ * @returns Level id.
30
+ */
12
31
  public level_id(): u8;
13
32
 
33
+ /**
34
+ * Get this point position in global game space.
35
+ *
36
+ * @returns Game-space position.
37
+ */
14
38
  public game_point(): vector;
15
39
 
40
+ /**
41
+ * Get this point position in its level.
42
+ *
43
+ * @returns Level-space position.
44
+ */
16
45
  public level_point(): vector;
17
46
  }
18
47
 
19
48
  /**
49
+ * Game graph access binding.
50
+ *
20
51
  * @source C++ class CGameGraph
21
52
  * @customConstructor CGameGraph
22
53
  * @group xr_graph
54
+ *
55
+ * @remarks
56
+ * Represents the global AI game graph. Validate ids before resolving vertices, and restore accessibility changes
57
+ * when they are only needed temporarily.
23
58
  */
24
59
  export class CGameGraph {
25
- public valid_vertex_id(value: u32): boolean;
60
+ /**
61
+ * Check whether a game-graph vertex id exists.
62
+ *
63
+ * @param vertexId - Game-graph vertex id.
64
+ * @returns Whether the id can be used with graph methods.
65
+ */
66
+ public valid_vertex_id(vertexId: u32): boolean;
26
67
 
68
+ /**
69
+ * Get a game-graph vertex by id.
70
+ *
71
+ * @remarks
72
+ * Call {@link CGameGraph.valid_vertex_id} first. Native code expects a valid id and can fail hard on invalid
73
+ * graph references.
74
+ *
75
+ * @param vertexId - Game-graph vertex id.
76
+ * @returns Graph vertex descriptor.
77
+ */
27
78
  public vertex(vertexId: u32): GameGraph__CVertex;
28
79
 
29
- public vertex_id(graph: CGameGraph): u16;
80
+ /**
81
+ * Resolve a graph vertex back to its id.
82
+ *
83
+ * @remarks
84
+ * Pass only vertices returned by this graph instance.
85
+ *
86
+ * @param vertex - Vertex returned by {@link CGameGraph.vertex}.
87
+ * @returns Game-graph vertex id.
88
+ */
89
+ public vertex_id(vertex: GameGraph__CVertex): u16;
30
90
 
31
- public accessible(value: u32): boolean;
91
+ /**
92
+ * Check whether a game-graph vertex can be used for AI travel.
93
+ *
94
+ * @remarks
95
+ * This is pathing accessibility, not whether the vertex exists.
96
+ *
97
+ * @param vertexId - Game-graph vertex id.
98
+ * @returns Whether the vertex is currently accessible.
99
+ */
100
+ public accessible(vertexId: u32): boolean;
32
101
 
33
- public accessible(value1: u32, value2: boolean): void;
102
+ /**
103
+ * Mark a game-graph vertex as accessible or blocked.
104
+ *
105
+ * @remarks
106
+ * Blocking vertices affects AI travel through the game graph. Prefer narrow, reversible changes.
107
+ *
108
+ * @param vertexId - Game-graph vertex id.
109
+ * @param value - New accessibility state.
110
+ */
111
+ public accessible(vertexId: u32, value: boolean): void;
34
112
 
35
113
  /**
36
- * Method to iterate over game levels registered in `all.spawn`.
114
+ * Iterate over game levels registered in `all.spawn`.
115
+ *
116
+ * @remarks
117
+ * Iterates graph-level descriptors, not currently loaded level objects.
37
118
  *
38
- * @returns Level abstract object with every iteration.
119
+ * @returns Level object on every iteration.
39
120
  */
40
121
  public levels(): LuaIterable<cse_abstract>;
41
122
  }
42
123
 
43
124
  /**
125
+ * Get the global game graph used by AI navigation.
126
+ *
44
127
  * @group xr_graph
128
+ *
129
+ * @remarks
130
+ * Available after the engine has loaded AI graph data.
131
+ *
132
+ * @returns Game graph singleton.
45
133
  */
46
134
  export function game_graph(this: void): CGameGraph;
47
135
  }
@@ -1,139 +1,373 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Base memory record with timing information.
4
+ *
3
5
  * @source C++ class memory_object
4
6
  * @customConstructor memory_object
5
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.
6
12
  */
7
13
  export class memory_object extends EngineBinding {
14
+ /**
15
+ * Previous level time recorded for this memory entry.
16
+ */
8
17
  public readonly last_level_time: u32;
18
+
19
+ /**
20
+ * Level time when this memory entry was last updated.
21
+ */
9
22
  public readonly level_time: u32;
10
23
 
24
+ /**
25
+ * Engine-created memory record.
26
+ */
11
27
  protected constructor();
12
28
  }
13
29
 
14
30
  /**
31
+ * Memory record that points to a living entity.
32
+ *
15
33
  * @source C++ class entity_memory_object : memory_object
16
34
  * @customConstructor entity_memory_object
17
35
  * @group xr_memory
36
+ *
37
+ * @remarks
38
+ * Used for entity-alive memories such as hit records.
18
39
  */
19
40
  export class entity_memory_object extends memory_object {
20
- public readonly object_info: object;
21
- public readonly self_info: 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;
22
50
 
51
+ /**
52
+ * Engine-created entity memory record.
53
+ */
23
54
  protected constructor();
24
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
+ */
25
64
  public object(): game_object;
26
65
  }
27
66
 
28
67
  /**
68
+ * Position and level-vertex snapshot for a remembered object.
69
+ *
29
70
  * @source C++ class object_params
30
71
  * @customConstructor object_params
31
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.
32
76
  */
33
77
  export class object_params {
78
+ /**
79
+ * Level graph vertex recorded for the object.
80
+ */
34
81
  public level_vertex: u32;
82
+
83
+ /**
84
+ * World position recorded for the object.
85
+ */
35
86
  public position: vector;
36
87
 
88
+ /**
89
+ * Engine-created object memory snapshot.
90
+ */
37
91
  private constructor();
38
92
  }
39
93
 
40
94
  /**
95
+ * Memory record for a hit received by an entity.
96
+ *
41
97
  * @source C++ class hit_memory_object : entity_memory_object
42
98
  * @customConstructor hit_memory_object
43
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.
44
104
  */
45
105
  export class hit_memory_object extends entity_memory_object {
106
+ /**
107
+ * Hit power remembered by AI.
108
+ */
46
109
  public readonly amount: f32;
110
+
111
+ /**
112
+ * Bone that received the hit.
113
+ */
47
114
  public readonly bone_index: u16;
115
+
116
+ /**
117
+ * Hit direction.
118
+ */
48
119
  public readonly direction: vector;
49
120
 
121
+ /**
122
+ * Engine-created hit memory record.
123
+ */
50
124
  protected constructor();
51
125
  }
52
126
 
53
127
  /**
128
+ * Memory record that points to a game object.
129
+ *
54
130
  * @source C++ class game_memory_object : memory_object
55
131
  * @customConstructor game_memory_object
56
132
  * @group xr_memory
133
+ *
134
+ * @remarks
135
+ * Used for visual and sound memories of game objects.
57
136
  */
58
137
  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>& */
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
+ */
61
156
  public object(): game_object;
62
157
 
158
+ /**
159
+ * Engine-created game object memory record.
160
+ */
63
161
  protected constructor();
64
162
  }
65
163
 
66
164
  /**
165
+ * Visual memory candidate that has not become fully visible yet.
166
+ *
67
167
  * @source C++ class not_yet_visible_object
68
168
  * @customConstructor not_yet_visible_object
69
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.
70
174
  */
71
175
  export class not_yet_visible_object extends EngineBinding {
176
+ /**
177
+ * Engine-created pending visibility record.
178
+ */
72
179
  protected constructor();
73
180
 
181
+ /**
182
+ * Visibility score accumulated for this candidate.
183
+ */
74
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
+ */
75
194
  public object(): game_object;
76
195
  }
77
196
 
78
197
  /**
198
+ * Memory record for a visible object.
199
+ *
79
200
  * @source C++ class visible_memory_object
80
201
  * @customConstructor visible_memory_object
81
202
  * @group xr_memory
203
+ *
204
+ * @remarks
205
+ * Describes an object currently tracked by visual memory.
82
206
  */
83
207
  export class visible_memory_object extends game_memory_object {
208
+ /**
209
+ * Engine-created visible object record.
210
+ */
84
211
  protected constructor();
85
212
  }
86
213
 
87
214
  /**
215
+ * Combined visible, sound, and hit memory flags for one object.
216
+ *
88
217
  * @source C++ class memory_info : visible_memory_object
89
218
  * @customConstructor visible_memory_object
90
219
  * @group xr_memory
220
+ *
221
+ * @remarks
222
+ * Returned by memory lookups to tell which memory channels currently have data for the object.
91
223
  */
92
224
  export class memory_info extends visible_memory_object {
225
+ /**
226
+ * Whether hit memory is available for this object.
227
+ */
93
228
  public readonly hit_info: boolean;
229
+
230
+ /**
231
+ * Whether sound memory is available for this object.
232
+ */
94
233
  public readonly sound_info: boolean;
234
+
235
+ /**
236
+ * Whether visual memory is available for this object.
237
+ */
95
238
  public readonly visual_info: boolean;
96
239
 
240
+ /**
241
+ * Engine-created combined memory record.
242
+ */
97
243
  protected constructor();
98
244
  }
99
245
 
100
246
  /**
247
+ * Memory record for a heard object or sound event.
248
+ *
101
249
  * @source C++ class sound_memory_object : game_memory_object
102
250
  * @customConstructor sound_memory_object
103
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.
104
255
  */
105
256
  export class sound_memory_object extends game_memory_object {
257
+ /**
258
+ * Remembered sound power.
259
+ */
106
260
  public readonly power: f32;
107
261
 
262
+ /**
263
+ * Engine-created sound memory record.
264
+ */
108
265
  protected constructor();
109
266
 
267
+ /**
268
+ * Get the engine sound type id.
269
+ *
270
+ * @returns Sound type id.
271
+ */
110
272
  public type(): i32;
111
273
  }
112
274
 
113
275
  /**
276
+ * AI danger event remembered by an object.
277
+ *
114
278
  * @source C++ class danger_object
115
279
  * @customConstructor danger_object
116
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.
117
285
  */
118
286
  export class danger_object {
287
+ /**
288
+ * Engine enum value for `danger_object.attack_sound`.
289
+ */
119
290
  public static attack_sound: 1;
291
+ /**
292
+ * Engine enum value for `danger_object.attacked`.
293
+ */
120
294
  public static attacked: 5;
295
+ /**
296
+ * Engine enum value for `danger_object.bullet_ricochet`.
297
+ */
121
298
  public static bullet_ricochet: 0;
299
+ /**
300
+ * Engine enum value for `danger_object.enemy_sound`.
301
+ */
122
302
  public static enemy_sound: 7;
303
+ /**
304
+ * Engine enum value for `danger_object.entity_attacked`.
305
+ */
123
306
  public static entity_attacked: 2;
307
+ /**
308
+ * Engine enum value for `danger_object.entity_corpse`.
309
+ */
124
310
  public static entity_corpse: 4;
311
+ /**
312
+ * Engine enum value for `danger_object.entity_death`.
313
+ */
125
314
  public static entity_death: 3;
315
+ /**
316
+ * Engine enum value for `danger_object.grenade`.
317
+ */
126
318
  public static grenade: 6;
319
+ /**
320
+ * Engine enum value for `danger_object.hit`.
321
+ */
127
322
  public static hit: 2;
323
+ /**
324
+ * Engine enum value for `danger_object.sound`.
325
+ */
128
326
  public static sound: 1;
327
+ /**
328
+ * Engine enum value for `danger_object.visual`.
329
+ */
129
330
  public static visual: 0;
130
331
 
332
+ /**
333
+ * @returns Danger type.
334
+ */
131
335
  public type(): TXR_danger_object;
336
+
337
+ /**
338
+ * @returns Game time when the danger was registered.
339
+ */
132
340
  public time(): u32;
341
+
342
+ /**
343
+ * @returns Danger position.
344
+ */
133
345
  public position(): vector;
134
- public object(): game_object;
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
+ */
135
360
  public perceive_type(): number; /* CDangerObject::EDangerPerceiveType */
136
- public dependent_object(): game_object;
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;
137
371
  }
138
372
 
139
373
  /**