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,135 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * Game graph vertex binding.
4
- *
5
- * @source C++ class GameGraph__CVertex
6
- * @customConstructor GameGraph__CVertex
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.
12
- */
13
- export class GameGraph__CVertex extends EngineBinding {
14
- /**
15
- * Engine-created game-graph vertex descriptor.
16
- */
17
- protected constructor();
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
- */
24
- public level_vertex_id(): u32;
25
-
26
- /**
27
- * Get the id of the level that owns this graph point.
28
- *
29
- * @returns Level id.
30
- */
31
- public level_id(): u8;
32
-
33
- /**
34
- * Get this point position in global game space.
35
- *
36
- * @returns Game-space position.
37
- */
38
- public game_point(): vector;
39
-
40
- /**
41
- * Get this point position in its level.
42
- *
43
- * @returns Level-space position.
44
- */
45
- public level_point(): vector;
46
- }
47
-
48
- /**
49
- * Game graph access binding.
50
- *
51
- * @source C++ class CGameGraph
52
- * @customConstructor CGameGraph
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.
58
- */
59
- export class CGameGraph {
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;
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
- */
78
- public vertex(vertexId: u32): GameGraph__CVertex;
79
-
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;
90
-
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;
101
-
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;
112
-
113
- /**
114
- * Iterate over game levels registered in `all.spawn`.
115
- *
116
- * @remarks
117
- * Iterates graph-level descriptors, not currently loaded level objects.
118
- *
119
- * @returns Level object on every iteration.
120
- */
121
- public levels(): LuaIterable<cse_abstract>;
122
- }
123
-
124
- /**
125
- * Get the global game graph used by AI navigation.
126
- *
127
- * @group xr_graph
128
- *
129
- * @remarks
130
- * Available after the engine has loaded AI graph data.
131
- *
132
- * @returns Game graph singleton.
133
- */
134
- export function game_graph(this: void): CGameGraph;
135
- }
@@ -1,382 +0,0 @@
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
- }