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,795 +0,0 @@
1
- declare module "xray16" {
2
- /**
3
- * Global helpers for the currently loaded level.
4
- *
5
- * This namespace covers object lookup, time/weather control, navigation queries, map spots, and effectors.
6
- *
7
- * @source namespace level
8
- * @group xr_level
9
- */
10
- export interface IXR_level {
11
- /**
12
- * Register a conditional level callback.
13
- *
14
- * @remarks
15
- * The physics commander polls this callback pair. Remove it with the same condition and action callbacks when the
16
- * owner no longer needs it.
17
- *
18
- * @param condition - Callback polled by the engine.
19
- * @param action - Callback called when the condition is satisfied.
20
- */
21
- add_call(this: void, condition: (this: void) => boolean, action: (this: void) => boolean): void;
22
-
23
- /**
24
- * Register a conditional level callback owned by an object.
25
- *
26
- * @remarks
27
- * The owner is used only for callback lookup and bulk removal. Keep the object alive while the callback can run.
28
- *
29
- * @param object - Owner object used for later removal.
30
- * @param condition - Callback polled by the engine.
31
- * @param action - Callback called when the condition is satisfied.
32
- */
33
- add_call(this: void, object: object, condition: (this: void) => boolean, action: (this: void) => boolean): void;
34
-
35
- /**
36
- * Register named object methods as a conditional level callback.
37
- *
38
- * @remarks
39
- * This overload registers a unique callback pair for the object and method names.
40
- *
41
- * @param object - Owner object used for callback lookup and removal.
42
- * @param condition - Method name used as condition callback.
43
- * @param action - Method name called when the condition is satisfied.
44
- */
45
- add_call(this: void, object: object, condition: string, action: string): void;
46
-
47
- /**
48
- * Start a camera effector.
49
- *
50
- * @remarks
51
- * Requires an actor. The binding adds the effector to `Actor().Cameras()`.
52
- *
53
- * @param effect - Camera effector animation file.
54
- * @param id - Effector id used for replacement and removal.
55
- * @param is_cyclic - Whether the effector loops.
56
- * @param callback - Lua callback name called when the effector finishes.
57
- * @returns Effector animation length.
58
- */
59
- add_cam_effector(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string): f32;
60
-
61
- /**
62
- * Start a camera effector with custom field of view.
63
- *
64
- * @since OpenXRay 2019-05-07, 2d1b946a, PR #382
65
- *
66
- * @remarks
67
- * Requires an actor. The binding adds the effector to `Actor().Cameras()`.
68
- *
69
- * @param effect - Camera effector animation file.
70
- * @param id - Effector id used for replacement and removal.
71
- * @param is_cyclic - Whether the effector loops.
72
- * @param callback - Lua callback name called when the effector finishes.
73
- * @param camera_fov - Optional field of view for the effector.
74
- * @returns Effector animation length.
75
- */
76
- add_cam_effector2(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string, camera_fov?: f32): f32;
77
-
78
- /**
79
- * Start a named complex effector.
80
- *
81
- * @remarks
82
- * Requires an actor. The effector is attached to the current actor object.
83
- *
84
- * @param section - Effector section name.
85
- * @param id - Effector id used for replacement and removal.
86
- */
87
- add_complex_effector(this: void, section: string, id: i32): void;
88
-
89
- /**
90
- * Add a dialog window to the render list.
91
- *
92
- * @param window - Dialog window to render.
93
- */
94
- add_dialog_to_render(this: void, window: CUIDialogWnd): void;
95
-
96
- /**
97
- * Start a post-process effector.
98
- *
99
- * @remarks
100
- * Requires an actor. The effector is attached to the actor camera manager.
101
- *
102
- * @param file_name - Post-process effector file.
103
- * @param id - Effector id used for replacement and removal.
104
- * @param is_cyclic - Whether the effector loops.
105
- */
106
- add_pp_effector(this: void, file_name: string, id: i32, is_cyclic: boolean): void;
107
-
108
- /**
109
- * Move game time forward.
110
- *
111
- * @remarks
112
- * Works only on a single-player server with ALife available. Otherwise the binding returns without changing time.
113
- *
114
- * @param days - Days to add.
115
- * @param hours - Hours to add.
116
- * @param minutes - Minutes to add.
117
- */
118
- change_game_time(this: void, days: u32, hours: u32, minutes: u32): void;
119
-
120
- /**
121
- * Validate a game object pointer in the engine.
122
- *
123
- * @remarks
124
- * Exported only in debug builds.
125
- *
126
- * @param object - Object to check.
127
- */
128
- check_object(this: void, object: game_object): void;
129
-
130
- /**
131
- * Get the level client spawn manager.
132
- *
133
- * @returns Client spawn manager.
134
- */
135
- client_spawn_manager(this: void): client_spawn_manager;
136
-
137
- /**
138
- * Get actor object used by debug helpers.
139
- *
140
- * @remarks
141
- * Exported only in debug builds.
142
- *
143
- * @returns Actor game object.
144
- */
145
- debug_actor(this: void): game_object;
146
-
147
- /**
148
- * Find an object by debug name.
149
- *
150
- * @remarks
151
- * Exported only in debug builds.
152
- *
153
- * @param name - Object name.
154
- * @returns Matching game object.
155
- */
156
- debug_object(this: void, name: string): game_object;
157
-
158
- /**
159
- * Disable player input.
160
- *
161
- * @remarks
162
- * Does nothing while the actor exists and permanent god mode is enabled.
163
- */
164
- disable_input(this: void): void;
165
-
166
- /**
167
- * Enable player input.
168
- */
169
- enable_input(this: void): void;
170
-
171
- /**
172
- * Get the active environment object.
173
- *
174
- * @returns Engine environment object.
175
- */
176
- environment(this: void): unknown /* XR_CEnvironment */;
177
-
178
- /**
179
- * Get current game state id.
180
- *
181
- * @returns Game id bitmask.
182
- */
183
- game_id(this: void): TXR_EGameID;
184
-
185
- /**
186
- * Get active camera id.
187
- *
188
- * @since OpenXRay 2015-07-07, 6e703b4c
189
- *
190
- * @remarks
191
- * Returns `255` when the current view entity is not an actor.
192
- *
193
- * @returns Camera id.
194
- */
195
- get_active_cam(this: void): u8;
196
-
197
- /**
198
- * Get the level bounding box.
199
- *
200
- * @returns Level bounds.
201
- */
202
- get_bounding_volume(this: void): Fbox;
203
-
204
- /**
205
- * Get active single-player difficulty.
206
- *
207
- * @returns Difficulty id.
208
- */
209
- get_game_difficulty(this: void): TXR_game_difficulty;
210
-
211
- /**
212
- * Get sound volume.
213
- *
214
- * @returns Sound volume.
215
- */
216
- get_snd_volume(this: void): f32;
217
-
218
- /**
219
- * Get distance to the object or surface under the crosshair.
220
- *
221
- * @since OpenXRay 2014-12-27, c82669625
222
- *
223
- * @returns Target distance.
224
- */
225
- get_target_dist(this: void): f32;
226
-
227
- /**
228
- * Get targeted model element under the crosshair.
229
- *
230
- * @since OpenXRay 2015-06-03, 7213550c
231
- *
232
- * @remarks
233
- * Returns `0` when the current ray query has no model element.
234
- *
235
- * @returns Target element id.
236
- */
237
- get_target_element(this: void): u32;
238
-
239
- /**
240
- * Get the object under the crosshair.
241
- *
242
- * @since OpenXRay 2014-12-27, c82669625
243
- *
244
- * @returns Target object, or `null` when nothing is targeted.
245
- */
246
- get_target_obj(this: void): game_object | null;
247
-
248
- /**
249
- * Get current game day count.
250
- *
251
- * @returns Current day count.
252
- */
253
- get_time_days(this: void): u32;
254
-
255
- /**
256
- * Get game time speed multiplier.
257
- *
258
- * @returns Time factor.
259
- */
260
- get_time_factor(this: void): f32;
261
-
262
- /**
263
- * Get current game hour.
264
- *
265
- * @returns Hour of day.
266
- */
267
- get_time_hours(this: void): u32;
268
-
269
- /**
270
- * Get current game minute.
271
- *
272
- * @returns Minute of hour.
273
- */
274
- get_time_minutes(this: void): u32;
275
-
276
- /**
277
- * Get current weather cycle name.
278
- *
279
- * @returns Weather name.
280
- */
281
- get_weather(this: void): string;
282
-
283
- /**
284
- * Get active weather effect time.
285
- *
286
- * @returns Weather effect time.
287
- */
288
- get_wfx_time(this: void): f32;
289
-
290
- /**
291
- * Hide HUD indicators.
292
- *
293
- * @remarks
294
- * Also enables the runtime god-mode flag used while HUD indicators are hidden.
295
- */
296
- hide_indicators(this: void): void;
297
-
298
- /**
299
- * Hide HUD indicators if the HUD is available.
300
- *
301
- * @remarks
302
- * Also enables the runtime god-mode flag used while HUD indicators are hidden.
303
- */
304
- hide_indicators_safe(this: void): void;
305
-
306
- /**
307
- * Sample high cover from a level vertex in a direction.
308
- *
309
- * @param vertex_id - Level vertex id.
310
- * @param direction - Direction to sample.
311
- * @returns Cover value.
312
- */
313
- high_cover_in_direction(this: void, vertex_id: u32, direction: vector): f32;
314
-
315
- /**
316
- * Check whether a weather effect is playing.
317
- *
318
- * @returns Whether a weather effect is active.
319
- */
320
- is_wfx_playing(this: void): boolean;
321
-
322
- /**
323
- * Iterate objects currently online on the level.
324
- *
325
- * @since OpenXRay 2019-04-28, 13c5c022
326
- *
327
- * @param cb - Callback called for each online object.
328
- */
329
- iterate_online_objects(this: void, cb: (this: void, object: game_object) => void | boolean): void;
330
-
331
- /**
332
- * Iterate sounds from a sound collection.
333
- *
334
- * @remarks
335
- * `section` may contain a comma-separated list of base names. The callback receives each existing sound name found
336
- * in `$game_sounds$`, including numbered variants from `0` up to `max_count - 1`.
337
- *
338
- * @param section - Sound collection section.
339
- * @param max_count - Numbered suffixes to probe for each base name.
340
- * @param cb - Callback called with each sound name.
341
- */
342
- iterate_sounds(this: void, section: string, max_count: u32, cb: (this: void, name: string) => void): void;
343
-
344
- /**
345
- * Iterate sounds from a sound collection with an owner object.
346
- *
347
- * @remarks
348
- * `section` may contain a comma-separated list of base names. The callback receives each existing sound name found
349
- * in `$game_sounds$`, including numbered variants from `0` up to `max_count - 1`.
350
- *
351
- * @param section - Sound collection section.
352
- * @param max_count - Numbered suffixes to probe for each base name.
353
- * @param object - Owner object.
354
- * @param cb - Callback called with each sound name.
355
- */
356
- iterate_sounds(
357
- this: void,
358
- section: string,
359
- max_count: u32,
360
- object: object,
361
- cb: (this: void, name: string) => void
362
- ): void;
363
-
364
- /**
365
- * Sample low cover from a level vertex in a direction.
366
- *
367
- * @param vertex_id - Level vertex id.
368
- * @param direction - Direction to sample.
369
- * @returns Cover value.
370
- */
371
- low_cover_in_direction(this: void, vertex_id: u32, direction: vector): f32;
372
-
373
- /**
374
- * Get the main UI input receiver.
375
- *
376
- * @returns Active dialog window.
377
- */
378
- main_input_receiver(this: void): CUIDialogWnd;
379
-
380
- /**
381
- * Add a PDA map spot for an object.
382
- *
383
- * @param object_id - Target object id.
384
- * @param spot_type - Spot type from map spot config.
385
- * @param hint - Spot hint text.
386
- */
387
- map_add_object_spot(this: void, object_id: u16, spot_type: string, hint: string): void;
388
-
389
- /**
390
- * Add a serialized PDA map spot for an object.
391
- *
392
- * @param object_id - Target object id.
393
- * @param spot_type - Spot type from map spot config.
394
- * @param hint - Spot hint text.
395
- */
396
- map_add_object_spot_ser(this: void, object_id: u16, spot_type: string, hint: string): void;
397
-
398
- /**
399
- * Change hint text for an object map spot.
400
- *
401
- * @remarks
402
- * Does nothing when the object does not have a matching map spot.
403
- *
404
- * @param object_id - Target object id.
405
- * @param spot_type - Spot type from map spot config.
406
- * @param hint - New hint text.
407
- */
408
- map_change_spot_hint(this: void, object_id: u16, spot_type: string, hint: string): void;
409
-
410
- /**
411
- * Check if an object has a map spot registered with provided selector.
412
- *
413
- * @param object_id - Game object id to check.
414
- * @param spot_type - Map spot type.
415
- * @returns Non-zero count when the spot exists.
416
- */
417
- map_has_object_spot(this: void, object_id: u16, spot_type: string): u16;
418
-
419
- /**
420
- * Remove an object map spot if it exists.
421
- *
422
- * @param object_id - Game object id to update.
423
- * @param spot_type - Map spot type.
424
- */
425
- map_remove_object_spot(this: void, object_id: u16, spot_type: string): void;
426
-
427
- /**
428
- * Get current level name.
429
- *
430
- * @returns Level name.
431
- */
432
- name<T extends string = string>(this: void): T;
433
-
434
- /**
435
- * Find an online object by id.
436
- *
437
- * @param object_id - Game object id.
438
- * @returns Matching object, or `null` when it is not online.
439
- */
440
- object_by_id(this: void, object_id: u16): game_object | null;
441
-
442
- /**
443
- * Check whether a patrol path exists on this level.
444
- *
445
- * @param path_name - Patrol path name.
446
- * @returns Whether the patrol path exists.
447
- */
448
- patrol_path_exists(this: void, path_name: string): boolean;
449
-
450
- /**
451
- * Get the level physics world.
452
- *
453
- * @returns Physics world object.
454
- */
455
- physics_world(this: void): physics_world;
456
-
457
- /**
458
- * Preload a sound resource.
459
- *
460
- * @param sound - Sound resource name.
461
- */
462
- prefetch_sound(this: void, sound: string): void;
463
-
464
- /**
465
- * Check whether a game level is loaded.
466
- *
467
- * @returns Whether a level is present.
468
- */
469
- present(this: void): boolean;
470
-
471
- /**
472
- * Get current rain intensity.
473
- *
474
- * @returns Rain intensity, or `0` when no rain is active.
475
- */
476
- rain_factor(this: void): f32;
477
-
478
- /**
479
- * Remove a conditional level callback.
480
- *
481
- * @remarks
482
- * The callbacks must match the original registered pair.
483
- *
484
- * @param condition - Condition callback originally registered.
485
- * @param action - Action callback originally registered.
486
- */
487
- remove_call(this: void, condition: (this: void) => boolean, action: (this: void) => void): void;
488
-
489
- /**
490
- * Remove an object-owned conditional level callback.
491
- *
492
- * @remarks
493
- * The owner and callbacks must match the original registered pair.
494
- *
495
- * @param object - Owner object.
496
- * @param condition - Condition callback originally registered.
497
- * @param action - Action callback originally registered.
498
- */
499
- remove_call(this: void, object: object, condition: (this: void) => boolean, action: (this: void) => void): void;
500
-
501
- /**
502
- * Remove named object methods registered as a level callback.
503
- *
504
- * @remarks
505
- * The owner and method names must match the original registered pair.
506
- *
507
- * @param object - Owner object.
508
- * @param condition - Condition method name.
509
- * @param action - Action method name.
510
- */
511
- remove_call(this: void, object: object, condition: string, action: string): void;
512
-
513
- /**
514
- * Remove all registered level callbacks for an object.
515
- *
516
- * @param object - Owner object.
517
- */
518
- remove_calls_for_object(this: void, object: object): void;
519
-
520
- /**
521
- * Stop a camera effector.
522
- *
523
- * @remarks
524
- * Requires an actor. The binding removes the effector from `Actor().Cameras()`.
525
- *
526
- * @param id - Effector id.
527
- */
528
- remove_cam_effector(this: void, id: i32): void;
529
-
530
- /**
531
- * Stop a complex effector.
532
- *
533
- * @remarks
534
- * Requires an actor. The binding removes the effector from the current actor object.
535
- *
536
- * @param id - Effector id.
537
- */
538
- remove_complex_effector(this: void, id: i32): void;
539
-
540
- /**
541
- * Remove a dialog window from the render list.
542
- *
543
- * @param window - Dialog window to stop rendering.
544
- */
545
- remove_dialog_to_render(this: void, window: CUIDialogWnd): void;
546
-
547
- /**
548
- * Stop a post-process effector.
549
- *
550
- * @remarks
551
- * Requires an actor. Does nothing when no post-process effector exists for the id.
552
- *
553
- * @param id - Effector id.
554
- */
555
- remove_pp_effector(this: void, id: i32): void;
556
-
557
- /**
558
- * Send a network packet through the level.
559
- *
560
- * @since OpenXRay 2014-12-27, c82669625
561
- *
562
- * @param packet - Packet to send.
563
- * @param reliable - Whether the packet is reliable.
564
- * @param sequential - Whether the packet is sequential.
565
- * @param high_priority - Whether to send with high priority.
566
- * @param send_immediately - Whether to flush immediately.
567
- */
568
- send(
569
- this: void,
570
- packet: net_packet,
571
- reliable: boolean,
572
- sequential: boolean,
573
- high_priority: boolean,
574
- send_immediately: boolean
575
- ): void;
576
-
577
- /**
578
- * Set active camera id.
579
- *
580
- * @since OpenXRay 2015-07-07, 6e703b4c
581
- *
582
- * @remarks
583
- * Does nothing when the current view entity is not an actor or when the id is outside the actor camera range.
584
- *
585
- * @param id - Camera id.
586
- */
587
- set_active_cam(this: void, id: u8): void;
588
-
589
- /**
590
- * Set active single-player difficulty.
591
- *
592
- * @remarks
593
- * Updates the global difficulty and notifies the active single-player game state.
594
- *
595
- * @throws If the active game state is not single-player.
596
- *
597
- * @param difficulty - Difficulty id.
598
- */
599
- set_game_difficulty(this: void, difficulty: unknown /* Enum ESingleGameDifficulty */): void;
600
-
601
- /**
602
- * Set a post-process effector factor.
603
- *
604
- * @remarks
605
- * Requires an actor. Does nothing when no post-process effector exists for the id.
606
- *
607
- * @param id - Effector id.
608
- * @param factor - Target factor.
609
- * @param speed - Optional transition speed.
610
- */
611
- set_pp_effector_factor(this: void, id: i32, factor: f32, speed?: f32): void;
612
-
613
- /**
614
- * Set sound volume.
615
- *
616
- * @remarks
617
- * The engine clamps the value to the `0..1` range.
618
- *
619
- * @param volume - Sound volume.
620
- */
621
- set_snd_volume(this: void, volume: f32): void;
622
-
623
- /**
624
- * Set game time speed multiplier.
625
- *
626
- * @remarks
627
- * Works only on the server and outside editor mode. Otherwise the binding returns without changing the time factor.
628
- *
629
- * @param factor - Time factor.
630
- */
631
- set_time_factor(this: void, factor: f32): void;
632
-
633
- /**
634
- * Change active game weather.
635
- *
636
- * @remarks
637
- * Does nothing in editor mode.
638
- *
639
- * @param weather_name - Name of weather config to apply.
640
- * @param is_forced - Whether weather change should be forced.
641
- */
642
- set_weather(this: void, weather_name: string, is_forced: boolean): void;
643
-
644
- /**
645
- * Start a weather effect by name.
646
- *
647
- * @remarks
648
- * Returns `false` in editor mode.
649
- *
650
- * @param weather_fx_name - Weather effect config name.
651
- * @returns Whether the effect started.
652
- */
653
- set_weather_fx(this: void, weather_fx_name: string): boolean;
654
-
655
- /**
656
- * Show HUD indicators.
657
- *
658
- * @remarks
659
- * Clears the runtime god-mode flag set by `hide_indicators()` and `hide_indicators_safe()`.
660
- */
661
- show_indicators(this: void): void;
662
-
663
- /**
664
- * Show or hide actor weapon.
665
- *
666
- * @remarks
667
- * Does nothing while the actor exists and permanent god mode is enabled.
668
- *
669
- * @param is_visible - Whether weapon should be visible.
670
- */
671
- show_weapon(this: void, is_visible: boolean): void;
672
-
673
- /**
674
- * Spawn an item on the level.
675
- *
676
- * @since OpenXRay 2015-01-18, 3ee7401d
677
- *
678
- * @remarks
679
- * Uses the level spawn path, which is suitable for sections that are unsafe to create through `alife():create()`,
680
- * such as bolts, phantoms, and ammo.
681
- *
682
- * @param section - Item section name.
683
- * @param position - Spawn position.
684
- * @param level_vertex_id - Target level vertex.
685
- * @param parent_id - Parent object id, or `0xffff` for none.
686
- * @param return_item - Engine spawn flag passed through to `Level().spawn_item`.
687
- */
688
- spawn_item(
689
- this: void,
690
- section: string,
691
- position: vector,
692
- level_vertex_id: u32,
693
- parent_id: u16,
694
- return_item: boolean
695
- ): void;
696
-
697
- /**
698
- * Spawn a phantom at a position.
699
- *
700
- * @param position - Spawn position.
701
- */
702
- spawn_phantom(this: void, position: vector): void;
703
-
704
- /**
705
- * Start or stop a menu dialog.
706
- *
707
- * @remarks
708
- * Hides the dialog when it is already shown. Otherwise shows it and applies `should_hide_indicators`.
709
- *
710
- * @param dialog - Dialog window.
711
- * @param should_hide_indicators - Whether showing the dialog should hide HUD indicators.
712
- */
713
- start_stop_menu(this: void, dialog: CUIDialogWnd, should_hide_indicators: boolean): void;
714
-
715
- /**
716
- * Start a weather effect from a specific time.
717
- *
718
- * @remarks
719
- * Returns `false` in editor mode.
720
- *
721
- * @param weather_fx_name - Weather effect config name.
722
- * @param time - Start time.
723
- * @returns Whether the effect started.
724
- */
725
- start_weather_fx_from_time(this: void, weather_fx_name: string, time: f32): boolean;
726
-
727
- /**
728
- * Stop the active weather effect.
729
- */
730
- stop_weather_fx(this: void): void;
731
-
732
- /**
733
- * Get nearest level vertex for a position.
734
- *
735
- * @remarks
736
- * The binding preserves original Lua behavior for invalid vertices and returns `4294967296` instead of `u32(-1)`.
737
- *
738
- * @param position - World position.
739
- * @returns Level vertex id.
740
- */
741
- vertex_id(this: void, position: vector): u64;
742
-
743
- /**
744
- * Move from a level vertex in a direction.
745
- *
746
- * @remarks
747
- * Returns the original vertex when the engine cannot find a valid vertex in the requested direction.
748
- *
749
- * @param vertex_id - Start level vertex id.
750
- * @param direction - Direction to move.
751
- * @param distance - Distance to move.
752
- * @returns Result level vertex id.
753
- */
754
- vertex_in_direction(this: void, vertex_id: u32, direction: vector, distance: f32): u32;
755
-
756
- /**
757
- * Get world position of a level vertex.
758
- *
759
- * @param id - Level vertex id.
760
- * @returns Vertex position.
761
- */
762
- vertex_position(this: void, id: u32): vector;
763
-
764
- /**
765
- * Cast a ray through the level collision world.
766
- *
767
- * @remarks
768
- * `result` is updated only when this returns `true`.
769
- *
770
- * @param position - Ray origin.
771
- * @param direction - Ray direction.
772
- * @param range - Ray range.
773
- * @param target - Ray query target flags.
774
- * @param result - Ray query result placeholder.
775
- * @param ignore_object - Object ignored by the query, or `null`.
776
- * @returns Whether the ray hit anything.
777
- */
778
- ray_pick(
779
- this: void,
780
- position: vector,
781
- direction: vector,
782
- range: f32,
783
- target: unknown,
784
- result: unknown,
785
- ignore_object: game_object | null
786
- ): boolean;
787
- }
788
-
789
- /**
790
- * Global engine `level` namespace.
791
- *
792
- * @group xr_level
793
- */
794
- export const level: IXR_level;
795
- }