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,584 +1,819 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class cover_point
4
- * @customConstructor cover_point
5
- * @group xr_script_interface
6
- */
7
- export class cover_point {
8
- private constructor();
9
-
10
- public level_vertex_id(): u32;
11
-
12
- public is_smart_cover(): boolean;
13
-
14
- public position(): vector;
15
- }
16
-
17
- /**
18
- * @source C++ class MonsterHitInfo
19
- * @customConstructor MonsterHitInfo
20
- * @group xr_script_interface
21
- */
22
- export class MonsterHitInfo extends EngineBinding {
23
- private constructor();
24
-
25
- public direction: vector;
26
-
27
- public time: i32;
28
-
29
- public who: game_object;
30
- }
31
-
32
- /**
33
- * Visibility state of bloodsucker.
34
- * Possible values are:
35
- * - unset = -1,
36
- * - no_visibility = 0,
37
- * - partial_visibility = 1,
38
- * - full_visibility = 2
39
- *
40
- * @source C++ enum visibility_t
41
- * @group xr_script_interface
42
- */
43
- export type TXR_bloodsucker_visibility_state = -1 | 0 | 1 | 2;
44
-
45
- /**
46
- * @source C++ enum visibility_t
47
- * @group xr_script_interface
48
- */
49
- export type TXR_game_object_path = 0 | 1 | 2 | 3 | number;
50
-
51
- /**
52
- * @source C++ class callback
53
- * @customConstructor callback
54
- * @group xr_script_interface
55
- */
56
- export class callback {
57
- /**
58
- * Default x-ray 16 callbacks.
59
- */
60
- public static readonly trade_start: 0;
61
- public static readonly trade_stop: 1;
62
- public static readonly trade_sell_buy_item: 2;
63
- public static readonly trade_perform_operation: 3;
64
- public static readonly zone_enter: 4;
65
- public static readonly zone_exit: 5;
66
- public static readonly level_border_exit: 6;
67
- public static readonly level_border_enter: 7;
68
- public static readonly death: 8;
69
- public static readonly patrol_path_in_point: 9;
70
- public static readonly inventory_pda: 10;
71
- public static readonly inventory_info: 11;
72
- public static readonly article_info: 12;
73
- public static readonly task_state: 13;
74
- public static readonly map_location_added: 14;
75
- public static readonly use_object: 15;
76
- public static readonly hit: 16;
77
- public static readonly sound: 17;
78
- public static readonly action_movement: 18;
79
- public static readonly action_watch: 19;
80
- public static readonly action_removed: 20;
81
- public static readonly action_animation: 21;
82
- public static readonly action_sound: 22;
83
- public static readonly action_particle: 23;
84
- public static readonly action_object: 24;
85
- public static readonly actor_sleep: 25;
86
- public static readonly helicopter_on_point: 26;
87
- public static readonly helicopter_on_hit: 27;
88
- public static readonly on_item_take: 28;
89
- public static readonly on_item_drop: 29;
90
- public static readonly script_animation: 30;
91
- public static readonly trader_global_anim_request: 31;
92
- public static readonly trader_head_anim_request: 32;
93
- public static readonly trader_sound_end: 33;
94
- public static readonly take_item_from_box: 34;
95
- public static readonly weapon_no_ammo: 35;
96
- public static readonly hud_animation_end: 36;
97
-
98
- public static readonly key_press: 37;
99
- public static readonly key_release: 38;
100
- public static readonly key_hold: 39;
101
- public static readonly mouse_move: 40;
102
- public static readonly mouse_wheel: 41;
103
- public static readonly controller_press: 42;
104
- public static readonly controller_release: 43;
105
- public static readonly controller_hold: 44;
106
- // public static readonly controller_attitude_change: 45;
107
-
108
- public static readonly item_to_belt: 46;
109
- public static readonly item_to_slot: 47;
110
- public static readonly item_to_ruck: 48;
111
-
112
- public static readonly weapon_zoom_in: 49;
113
- public static readonly weapon_zoom_out: 50;
114
- public static readonly weapon_jammed: 51;
115
- public static readonly weapon_magazine_empty: 52;
116
-
117
- public static readonly actor_before_death: 53;
118
- public static readonly on_attach_vehicle: 54;
119
- public static readonly on_detach_vehicle: 55;
120
- public static readonly on_use_vehicle: 56;
121
- }
122
-
123
- /**
124
- * @group xr_script_interface
125
- */
126
- export type TXR_callbacks = typeof callback;
127
-
128
- /**
129
- * @group xr_script_interface
130
- */
131
- export type TXR_callback = EnumeratedStaticsValues<TXR_callbacks>;
132
-
133
- /**
134
- * Custom extension.
135
- * For reference: src/xrGame/script_game_object_script.cpp
136
- *
137
- * @group xr_script_interface
138
- */
139
- class game_object_callbacks_implementation_base {
140
- /**
141
- * Remove callback.
142
- *
143
- * @param type - type of callback
144
- * @param cb - null to reset
145
- */
146
- public set_callback(type: TXR_callback, cb: null): void;
147
-
148
- /**
149
- * 0 todo;
150
- */
151
- public set_callback<T extends AnyObject>(
152
- type: TXR_callbacks["trade_start"],
153
- cb?: ((this: void) => void) | null,
154
- object?: Maybe<T>
155
- ): void;
156
-
157
- /**
158
- * 1 todo;
159
- */
160
- public set_callback<T extends AnyObject>(
161
- type: TXR_callbacks["trade_stop"],
162
- cb?: ((this: void) => void) | null,
163
- object?: Maybe<T>
164
- ): void;
165
-
166
- /**
167
- * 2 todo;
168
- */
169
- public set_callback<T extends AnyObject>(
170
- type: TXR_callbacks["trade_sell_buy_item"],
171
- cb?: ((this: void, item: game_object, money_direction: boolean, money: number) => void) | null,
172
- object?: Maybe<T>
173
- ): void;
174
-
175
- /**
176
- * 3 todo;
177
- */
178
- public set_callback<T extends AnyObject>(
179
- type: TXR_callbacks["trade_perform_operation"],
180
- cb?: ((this: void, money_get: u32, money_put: u32) => void) | null,
181
- object?: Maybe<T>
182
- ): void;
183
-
184
- /**
185
- * 4 todo;
186
- *
187
- * Works with script_zone objects.
188
- */
189
- public set_callback<T extends AnyObject>(
190
- type: TXR_callbacks["zone_enter"],
191
- cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
192
- object?: Maybe<T>
193
- ): void;
194
-
195
- /**
196
- * 5 todo;
197
- *
198
- * Works with script_zone objects.
199
- */
200
- public set_callback<T extends AnyObject>(
201
- type: TXR_callbacks["zone_exit"],
202
- cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
203
- object?: Maybe<T>
204
- ): void;
205
-
206
- /**
207
- * 6 todo;
208
- */
209
- public set_callback<T extends AnyObject>(
210
- type: TXR_callbacks["level_border_exit"],
211
- cb?: ((this: void, xobject: game_object) => void) | null,
212
- object?: Maybe<T>
213
- ): void;
214
-
215
- /**
216
- * 7 todo;
217
- */
218
- public set_callback<T extends AnyObject>(
219
- type: TXR_callbacks["level_border_enter"],
220
- cb?: ((this: void, xobject: game_object) => void) | null,
221
- object?: Maybe<T>
222
- ): void;
223
-
224
- /**
225
- * 8 todo;
226
- */
227
- public set_callback<T extends AnyObject>(
228
- type: TXR_callbacks["death"],
229
- cb?: (this: void, target: game_object, killer: game_object) => void,
230
- object?: Maybe<T>
231
- ): void;
232
-
233
- /**
234
- * 9 todo;
235
- */
236
- public set_callback<T extends AnyObject>(
237
- type: TXR_callbacks["patrol_path_in_point"],
238
- cb?: ((this: void, object: game_object, action_type: number, point_index: number) => void) | null,
239
- object?: Maybe<T>
240
- ): void;
241
-
242
- // 10 todo: inventory_pda -> implement in game engine
243
-
244
- /**
245
- * 11 todo:
246
- */
247
- public set_callback<T extends AnyObject>(
248
- type: TXR_callbacks["inventory_info"],
249
- cb?: ((this: void, npc: game_object, info_id: string) => void) | null,
250
- object?: Maybe<T>
251
- ): void;
252
-
253
- // 12 todo: article_info -> implement in game engine
254
-
255
- /**
256
- * 13 todo;
257
- */
258
- public set_callback<T extends AnyObject>(
259
- type: TXR_callbacks["task_state"],
260
- cb?: ((this: void, task: CGameTask, state: TXR_TaskState) => void) | null,
261
- object?: Maybe<T>
262
- ): void;
263
-
264
- /**
265
- * 14 todo;
266
- */
267
- public set_callback<T extends AnyObject>(
268
- type: TXR_callbacks["map_location_added"],
269
- cb?: ((this: void, spot_type: string, id: u16) => void) | null,
270
- object?: Maybe<T>
271
- ): void;
272
-
273
- /**
274
- * 15 Use some object.
275
- */
276
- public set_callback<T extends AnyObject>(
277
- type: TXR_callbacks["use_object"],
278
- cb?: ((this: void, object: game_object) => void) | null,
279
- object?: Maybe<T>
280
- ): void;
281
- public set_callback<T extends AnyObject>(
282
- type: TXR_callbacks["use_object"],
283
- cb?: ((this: void, object: game_object, who: game_object) => void) | null,
284
- object?: Maybe<T>
285
- ): void;
286
-
287
- /**
288
- * 16 Entity got hit.
289
- */
290
- public set_callback<T extends AnyObject>(
291
- type: TXR_callbacks["hit"],
292
- cb?:
293
- | ((
294
- this: void,
295
- object: game_object,
296
- damage: number,
297
- direction: vector,
298
- who: game_object,
299
- bone_id: number
300
- ) => void)
301
- | null,
302
- object?: Maybe<T>
303
- ): void;
304
-
305
- /**
306
- * 17 todo;
307
- */
308
- public set_callback<T extends AnyObject>(
309
- type: TXR_callbacks["sound"],
310
- cb?:
311
- | ((
312
- this: void,
313
- object: game_object,
314
- source_id: number,
315
- sound_type: TXR_snd_type,
316
- position: vector,
317
- sound_power: number
318
- ) => void)
319
- | null,
320
- object?: Maybe<T>
321
- ): void;
322
-
323
- /**
324
- * 18 todo;
325
- */
326
- public set_callback<T extends AnyObject>(
327
- type: TXR_callbacks["action_movement"],
328
- cb?: ((this: void, object: game_object, movement_type: u32 /* EMovementType */, unknown: -1) => void) | null,
329
- object?: Maybe<T>
330
- ): void;
331
-
332
- // 19 todo: action_watch
333
-
334
- // 20 todo: action_removed
335
-
336
- // 21 todo: action_animation
337
-
338
- // 22 todo: action_sound
339
-
340
- // 23 todo: action_particle
341
-
342
- // 24 todo: action_object
343
-
344
- // 25 todo: actor_sleep -> implement in game engine
345
-
346
- /**
347
- * 26 todo;
348
- */
349
- public set_callback<T extends AnyObject>(
350
- type: TXR_callbacks["helicopter_on_point"],
351
- cb?: ((this: void, distance: number, current_position: vector, vertex_id: number) => void) | null,
352
- object?: Maybe<T>
353
- ): void;
354
-
355
- /**
356
- * 27 todo;
357
- */
358
- public set_callback<T extends AnyObject>(
359
- type: TXR_callbacks["helicopter_on_hit"],
360
- cb?: ((this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void) | null,
361
- object?: Maybe<T>
362
- ): void;
363
-
364
- /**
365
- * 28 todo;
366
- */
367
- public set_callback<T extends AnyObject>(
368
- type: TXR_callbacks["on_item_take"],
369
- cb?: ((this: void, object: game_object, item: game_object) => void) | null,
370
- object?: Maybe<T>
371
- ): void;
372
-
373
- /**
374
- * 29 todo;
375
- */
376
- public set_callback<T extends AnyObject>(
377
- type: TXR_callbacks["on_item_drop"],
378
- cb?: ((this: void, object: game_object, item: game_object) => void) | null,
379
- object?: Maybe<T>
380
- ): void;
381
-
382
- /**
383
- * 30 todo;
384
- */
385
- public set_callback<T extends AnyObject>(
386
- type: TXR_callbacks["script_animation"],
387
- cb?: ((this: void, skip_multi_anim_check?: boolean) => void) | null,
388
- object?: object | null
389
- ): void;
390
-
391
- /**
392
- * 31 todo;
393
- */
394
- public set_callback<T extends AnyObject>(
395
- type: TXR_callbacks["trader_global_anim_request"],
396
- cb?: ((this: void) => void) | null,
397
- object?: Maybe<T>
398
- ): void;
399
-
400
- /**
401
- * 32 todo;
402
- */
403
- public set_callback<T extends AnyObject>(
404
- type: TXR_callbacks["trader_head_anim_request"],
405
- cb?: ((this: void) => void) | null,
406
- object?: Maybe<T>
407
- ): void;
408
-
409
- /**
410
- * 33 todo;
411
- */
412
- public set_callback<T extends AnyObject>(
413
- type: TXR_callbacks["trader_sound_end"],
414
- cb?: ((this: void) => void) | null,
415
- object?: Maybe<T>
416
- ): void;
417
-
418
- /**
419
- * 34 todo;
420
- */
421
- public set_callback<T extends AnyObject>(
422
- type: TXR_callbacks["take_item_from_box"],
423
- cb?: ((this: void, object: game_object, box: game_object, item: game_object) => void) | null,
424
- object?: Maybe<T>
425
- ): void;
426
-
427
- /**
428
- * 35 Callback executed when weapon has no ammo to fire.
429
- */
430
- public set_callback<T extends AnyObject>(
431
- type: TXR_callbacks["weapon_no_ammo"],
432
- cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
433
- object?: Maybe<T>
434
- ): void;
435
-
436
- /**
437
- * 36 Callback executed on hud animation stop.
438
- * Called from CHudItem class internals.
439
- */
440
- public set_callback<T extends AnyObject>(
441
- type: TXR_callbacks["hud_animation_end"],
442
- cb?:
443
- | ((
444
- this: void,
445
- object: game_object,
446
- hud_section: string,
447
- current_motion: string,
448
- state: u32,
449
- animation_slot: u32
450
- ) => void)
451
- | null,
452
- object?: Maybe<T>
453
- ): void;
454
-
455
- /**
456
- * 37 todo;
457
- */
458
- public set_callback<T extends AnyObject>(
459
- type: TXR_callbacks["key_press"],
460
- cb?: ((this: void, key: i32) => void) | null,
461
- object?: Maybe<T>
462
- ): void;
463
-
464
- /**
465
- * 38 todo;
466
- */
467
- public set_callback<T extends AnyObject>(
468
- type: TXR_callbacks["key_release"],
469
- cb?: ((this: void, key: i32) => void) | null,
470
- object?: Maybe<T>
471
- ): void;
472
-
473
- /**
474
- * 39 todo;
475
- */
476
- public set_callback<T extends AnyObject>(
477
- type: TXR_callbacks["key_hold"],
478
- cb?: ((this: void, key: i32) => void) | null,
479
- object?: Maybe<T>
480
- ): void;
481
-
482
- // 40 todo: mouse_move
483
-
484
- // 41 todo: mouse_wheel
485
-
486
- // 42 todo: controller_press
487
-
488
- // 43 todo: controller_release
489
-
490
- // 44 todo: controller_hold
491
-
492
- // 45 todo: controller_attitude_change
493
-
494
- /**
495
- * 46 todo: item_to_belt
496
- */
497
- public set_callback<T extends AnyObject>(
498
- type: TXR_callbacks["item_to_belt"],
499
- cb?: ((this: void, object: game_object) => void) | null,
500
- object?: Maybe<T>
501
- ): void;
502
-
503
- /**
504
- * 47 todo: item_to_slot
505
- */
506
- public set_callback<T extends AnyObject>(
507
- type: TXR_callbacks["item_to_slot"],
508
- cb?: ((this: void, object: game_object) => void) | null,
509
- object?: Maybe<T>
510
- ): void;
511
-
512
- /**
513
- * 48 todo: item_to_ruck
514
- */
515
- public set_callback<T extends AnyObject>(
516
- type: TXR_callbacks["item_to_ruck"],
517
- cb?: ((this: void, object: game_object) => void) | null,
518
- object?: Maybe<T>
519
- ): void;
520
-
521
- /**
522
- * 49 Callback executed when weapon is zoomed in.
523
- */
524
- public set_callback<T extends AnyObject>(
525
- type: TXR_callbacks["weapon_zoom_in"],
526
- cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
527
- object?: Maybe<T>
528
- ): void;
529
-
530
- /**
531
- * 50 Callback executed when weapon is zoomed out.
532
- */
533
- public set_callback<T extends AnyObject>(
534
- type: TXR_callbacks["weapon_zoom_out"],
535
- cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
536
- object?: Maybe<T>
537
- ): void;
538
-
539
- /**
540
- * 51 Callback executed when magazine ammo is elapsed and empty.
541
- */
542
- public set_callback<T extends AnyObject>(
543
- type: TXR_callbacks["weapon_jammed"],
544
- cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
545
- object?: Maybe<T>
546
- ): void;
547
-
548
- /**
549
- * 52 Callback executed when magazine ammo is elapsed and empty.
550
- */
551
- public set_callback<T extends AnyObject>(
552
- type: TXR_callbacks["weapon_magazine_empty"],
553
- cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
554
- object?: Maybe<T>
555
- ): void;
556
-
557
- /**
558
- * 53 todo: actor_before_death
559
- */
560
- public set_callback<T extends AnyObject>(
561
- type: TXR_callbacks["actor_before_death"],
562
- cb?: ((this: void, killer_id: u16) => void) | null,
563
- object?: Maybe<T>
564
- ): void;
565
-
566
- // 54 todo: on_attach_vehicle
567
-
568
- // 55 todo: on_detach_vehicle
569
-
570
- // 56 todo: on_use_vehicle
571
-
572
- public clear_callbacks(): void;
573
-
574
- public set_enemy_callback(cb: null): void;
575
-
576
- public set_enemy_callback<T>(cb: (this: T, object: game_object, enemy: game_object) => boolean, object: T): void;
577
-
578
- public set_fastcall<T>(cb: (this: T) => boolean, context: T): void;
579
-
580
- public set_patrol_extrapolate_callback(cb?: ((cur_pt: number) => boolean) | null, object?: object): void;
581
-
582
- public set_smart_cover_target_selector(cb?: ((object: game_object) => void) | null, object?: object | null): void;
583
- }
584
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Cover point returned by cover search helpers.
4
+ *
5
+ * @source C++ class cover_point
6
+ * @customConstructor cover_point
7
+ * @group xr_script_interface
8
+ */
9
+ export class cover_point {
10
+ /**
11
+ * Engine-created cover point descriptor.
12
+ */
13
+ private constructor();
14
+
15
+ /**
16
+ * Get the level vertex occupied by this cover.
17
+ *
18
+ * @returns Level vertex id.
19
+ */
20
+ public level_vertex_id(): u32;
21
+
22
+ /**
23
+ * Check whether this cover point comes from a smart cover.
24
+ *
25
+ * @returns Whether it is a smart cover.
26
+ */
27
+ public is_smart_cover(): boolean;
28
+
29
+ /**
30
+ * Get cover position.
31
+ *
32
+ * @returns Cover position.
33
+ */
34
+ public position(): vector;
35
+ }
36
+
37
+ /**
38
+ * Hit context passed to monster combat callbacks.
39
+ *
40
+ * @source C++ class MonsterHitInfo
41
+ * @customConstructor MonsterHitInfo
42
+ * @group xr_script_interface
43
+ */
44
+ export class MonsterHitInfo extends EngineBinding {
45
+ /**
46
+ * Engine-created monster hit descriptor.
47
+ */
48
+ private constructor();
49
+
50
+ /**
51
+ * Hit direction.
52
+ */
53
+ public direction: vector;
54
+
55
+ /**
56
+ * Hit time.
57
+ */
58
+ public time: i32;
59
+
60
+ /**
61
+ * Object that caused the hit.
62
+ */
63
+ public who: game_object;
64
+ }
65
+
66
+ /**
67
+ * Visibility state of bloodsucker.
68
+ * Possible values are:
69
+ * - unset = -1,
70
+ * - no_visibility = 0,
71
+ * - partial_visibility = 1,
72
+ * - full_visibility = 2.
73
+ *
74
+ * @source C++ enum visibility_t
75
+ * @group xr_script_interface
76
+ */
77
+ export type TXR_bloodsucker_visibility_state = -1 | 0 | 1 | 2;
78
+
79
+ /**
80
+ * @source C++ enum visibility_t
81
+ * @group xr_script_interface
82
+ */
83
+ export type TXR_game_object_path = 0 | 1 | 2 | 3 | number;
84
+
85
+ /**
86
+ * Engine callback id registry.
87
+ *
88
+ * @source C++ class callback
89
+ * @customConstructor callback
90
+ * @group xr_script_interface
91
+ */
92
+ export class callback {
93
+ /**
94
+ * Default x-ray 16 callbacks.
95
+ */
96
+ public static readonly trade_start: 0;
97
+ /**
98
+ * Engine enum value for `callback.trade_stop`.
99
+ */
100
+ public static readonly trade_stop: 1;
101
+ /**
102
+ * Engine enum value for `callback.trade_sell_buy_item`.
103
+ */
104
+ public static readonly trade_sell_buy_item: 2;
105
+ /**
106
+ * Engine enum value for `callback.trade_perform_operation`.
107
+ */
108
+ public static readonly trade_perform_operation: 3;
109
+ /**
110
+ * Engine enum value for `callback.zone_enter`.
111
+ */
112
+ public static readonly zone_enter: 4;
113
+ /**
114
+ * Engine enum value for `callback.zone_exit`.
115
+ */
116
+ public static readonly zone_exit: 5;
117
+ /**
118
+ * Engine enum value for `callback.level_border_exit`.
119
+ */
120
+ public static readonly level_border_exit: 6;
121
+ /**
122
+ * Engine enum value for `callback.level_border_enter`.
123
+ */
124
+ public static readonly level_border_enter: 7;
125
+ /**
126
+ * Engine enum value for `callback.death`.
127
+ */
128
+ public static readonly death: 8;
129
+ /**
130
+ * Engine enum value for `callback.patrol_path_in_point`.
131
+ */
132
+ public static readonly patrol_path_in_point: 9;
133
+ /**
134
+ * Engine enum value for `callback.inventory_pda`.
135
+ */
136
+ public static readonly inventory_pda: 10;
137
+ /**
138
+ * Engine enum value for `callback.inventory_info`.
139
+ */
140
+ public static readonly inventory_info: 11;
141
+ /**
142
+ * Engine enum value for `callback.article_info`.
143
+ */
144
+ public static readonly article_info: 12;
145
+ /**
146
+ * Engine enum value for `callback.task_state`.
147
+ */
148
+ public static readonly task_state: 13;
149
+ /**
150
+ * Engine enum value for `callback.map_location_added`.
151
+ */
152
+ public static readonly map_location_added: 14;
153
+ /**
154
+ * Engine enum value for `callback.use_object`.
155
+ */
156
+ public static readonly use_object: 15;
157
+ /**
158
+ * Engine enum value for `callback.hit`.
159
+ */
160
+ public static readonly hit: 16;
161
+ /**
162
+ * Engine enum value for `callback.sound`.
163
+ */
164
+ public static readonly sound: 17;
165
+ /**
166
+ * Engine enum value for `callback.action_movement`.
167
+ */
168
+ public static readonly action_movement: 18;
169
+ /**
170
+ * Engine enum value for `callback.action_watch`.
171
+ */
172
+ public static readonly action_watch: 19;
173
+ /**
174
+ * Engine enum value for `callback.action_removed`.
175
+ */
176
+ public static readonly action_removed: 20;
177
+ /**
178
+ * Engine enum value for `callback.action_animation`.
179
+ */
180
+ public static readonly action_animation: 21;
181
+ /**
182
+ * Engine enum value for `callback.action_sound`.
183
+ */
184
+ public static readonly action_sound: 22;
185
+ /**
186
+ * Engine enum value for `callback.action_particle`.
187
+ */
188
+ public static readonly action_particle: 23;
189
+ /**
190
+ * Engine enum value for `callback.action_object`.
191
+ */
192
+ public static readonly action_object: 24;
193
+ /**
194
+ * Engine enum value for `callback.actor_sleep`.
195
+ */
196
+ public static readonly actor_sleep: 25;
197
+ /**
198
+ * Engine enum value for `callback.helicopter_on_point`.
199
+ */
200
+ public static readonly helicopter_on_point: 26;
201
+ /**
202
+ * Engine enum value for `callback.helicopter_on_hit`.
203
+ */
204
+ public static readonly helicopter_on_hit: 27;
205
+ /**
206
+ * Engine enum value for `callback.on_item_take`.
207
+ */
208
+ public static readonly on_item_take: 28;
209
+ /**
210
+ * Engine enum value for `callback.on_item_drop`.
211
+ */
212
+ public static readonly on_item_drop: 29;
213
+ /**
214
+ * Engine enum value for `callback.script_animation`.
215
+ */
216
+ public static readonly script_animation: 30;
217
+ /**
218
+ * Engine enum value for `callback.trader_global_anim_request`.
219
+ */
220
+ public static readonly trader_global_anim_request: 31;
221
+ /**
222
+ * Engine enum value for `callback.trader_head_anim_request`.
223
+ */
224
+ public static readonly trader_head_anim_request: 32;
225
+ /**
226
+ * Engine enum value for `callback.trader_sound_end`.
227
+ */
228
+ public static readonly trader_sound_end: 33;
229
+ /**
230
+ * Engine enum value for `callback.take_item_from_box`.
231
+ */
232
+ public static readonly take_item_from_box: 34;
233
+ /**
234
+ * Engine enum value for `callback.weapon_no_ammo`.
235
+ */
236
+ public static readonly weapon_no_ammo: 35;
237
+ /**
238
+ * Engine enum value for `callback.hud_animation_end`.
239
+ */
240
+ public static readonly hud_animation_end: 36;
241
+
242
+ /**
243
+ * Engine enum value for `callback.key_press`.
244
+ */
245
+ public static readonly key_press: 37;
246
+ /**
247
+ * Engine enum value for `callback.key_release`.
248
+ */
249
+ public static readonly key_release: 38;
250
+ /**
251
+ * Engine enum value for `callback.key_hold`.
252
+ */
253
+ public static readonly key_hold: 39;
254
+ /**
255
+ * Engine enum value for `callback.mouse_move`.
256
+ */
257
+ public static readonly mouse_move: 40;
258
+ /**
259
+ * Engine enum value for `callback.mouse_wheel`.
260
+ */
261
+ public static readonly mouse_wheel: 41;
262
+ /**
263
+ * Engine enum value for `callback.controller_press`.
264
+ */
265
+ public static readonly controller_press: 42;
266
+ /**
267
+ * Engine enum value for `callback.controller_release`.
268
+ */
269
+ public static readonly controller_release: 43;
270
+ /**
271
+ * Engine enum value for `callback.controller_hold`.
272
+ */
273
+ public static readonly controller_hold: 44;
274
+ // Public static readonly controller_attitude_change: 45;
275
+
276
+ /**
277
+ * Engine enum value for `callback.item_to_belt`.
278
+ */
279
+ public static readonly item_to_belt: 46;
280
+ /**
281
+ * Engine enum value for `callback.item_to_slot`.
282
+ */
283
+ public static readonly item_to_slot: 47;
284
+ /**
285
+ * Engine enum value for `callback.item_to_ruck`.
286
+ */
287
+ public static readonly item_to_ruck: 48;
288
+
289
+ /**
290
+ * Engine enum value for `callback.weapon_zoom_in`.
291
+ */
292
+ public static readonly weapon_zoom_in: 49;
293
+ /**
294
+ * Engine enum value for `callback.weapon_zoom_out`.
295
+ */
296
+ public static readonly weapon_zoom_out: 50;
297
+ /**
298
+ * Engine enum value for `callback.weapon_jammed`.
299
+ */
300
+ public static readonly weapon_jammed: 51;
301
+ /**
302
+ * Engine enum value for `callback.weapon_magazine_empty`.
303
+ */
304
+ public static readonly weapon_magazine_empty: 52;
305
+
306
+ /**
307
+ * Engine enum value for `callback.actor_before_death`.
308
+ */
309
+ public static readonly actor_before_death: 53;
310
+ /**
311
+ * Engine enum value for `callback.on_attach_vehicle`.
312
+ */
313
+ public static readonly on_attach_vehicle: 54;
314
+ /**
315
+ * Engine enum value for `callback.on_detach_vehicle`.
316
+ */
317
+ public static readonly on_detach_vehicle: 55;
318
+ /**
319
+ * Engine enum value for `callback.on_use_vehicle`.
320
+ */
321
+ public static readonly on_use_vehicle: 56;
322
+ }
323
+
324
+ /**
325
+ * @group xr_script_interface
326
+ */
327
+ export type TXR_callbacks = typeof callback;
328
+
329
+ /**
330
+ * @group xr_script_interface
331
+ */
332
+ export type TXR_callback = EnumeratedStaticsValues<TXR_callbacks>;
333
+
334
+ /**
335
+ * Custom extension.
336
+ * For reference: src/xrGame/script_game_object_script.cpp.
337
+ *
338
+ * @group xr_script_interface
339
+ */
340
+ class game_object_callbacks_implementation_base {
341
+ /**
342
+ * Remove callback.
343
+ *
344
+ * @param type - Type of callback.
345
+ * @param cb - Null to reset.
346
+ */
347
+ public set_callback(type: TXR_callback, cb: null): void;
348
+
349
+ /**
350
+ * 0 todo;.
351
+ */
352
+ public set_callback<T extends AnyObject>(
353
+ type: TXR_callbacks["trade_start"],
354
+ cb?: ((this: void) => void) | null,
355
+ object?: Maybe<T>
356
+ ): void;
357
+
358
+ /**
359
+ * 1 todo;.
360
+ */
361
+ public set_callback<T extends AnyObject>(
362
+ type: TXR_callbacks["trade_stop"],
363
+ cb?: ((this: void) => void) | null,
364
+ object?: Maybe<T>
365
+ ): void;
366
+
367
+ /**
368
+ * 2 todo;.
369
+ */
370
+ public set_callback<T extends AnyObject>(
371
+ type: TXR_callbacks["trade_sell_buy_item"],
372
+ cb?: ((this: void, item: game_object, money_direction: boolean, money: number) => void) | null,
373
+ object?: Maybe<T>
374
+ ): void;
375
+
376
+ /**
377
+ * 3 todo;.
378
+ */
379
+ public set_callback<T extends AnyObject>(
380
+ type: TXR_callbacks["trade_perform_operation"],
381
+ cb?: ((this: void, money_get: u32, money_put: u32) => void) | null,
382
+ object?: Maybe<T>
383
+ ): void;
384
+
385
+ /**
386
+ * 4 todo;
387
+ *
388
+ * Works with script_zone objects.
389
+ */
390
+ public set_callback<T extends AnyObject>(
391
+ type: TXR_callbacks["zone_enter"],
392
+ cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
393
+ object?: Maybe<T>
394
+ ): void;
395
+
396
+ /**
397
+ * 5 todo;
398
+ *
399
+ * Works with script_zone objects.
400
+ */
401
+ public set_callback<T extends AnyObject>(
402
+ type: TXR_callbacks["zone_exit"],
403
+ cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
404
+ object?: Maybe<T>
405
+ ): void;
406
+
407
+ /**
408
+ * 6 todo;.
409
+ */
410
+ public set_callback<T extends AnyObject>(
411
+ type: TXR_callbacks["level_border_exit"],
412
+ cb?: ((this: void, xobject: game_object) => void) | null,
413
+ object?: Maybe<T>
414
+ ): void;
415
+
416
+ /**
417
+ * 7 todo;.
418
+ */
419
+ public set_callback<T extends AnyObject>(
420
+ type: TXR_callbacks["level_border_enter"],
421
+ cb?: ((this: void, xobject: game_object) => void) | null,
422
+ object?: Maybe<T>
423
+ ): void;
424
+
425
+ /**
426
+ * 8 todo;.
427
+ */
428
+ public set_callback<T extends AnyObject>(
429
+ type: TXR_callbacks["death"],
430
+ cb?: (this: void, target: game_object, killer: game_object) => void,
431
+ object?: Maybe<T>
432
+ ): void;
433
+
434
+ /**
435
+ * 9 todo;.
436
+ */
437
+ public set_callback<T extends AnyObject>(
438
+ type: TXR_callbacks["patrol_path_in_point"],
439
+ cb?: ((this: void, object: game_object, action_type: number, point_index: number) => void) | null,
440
+ object?: Maybe<T>
441
+ ): void;
442
+
443
+ // 10 todo: inventory_pda -> implement in game engine
444
+
445
+ /**
446
+ * Callback executed when an NPC receives an info portion.
447
+ */
448
+ public set_callback<T extends AnyObject>(
449
+ type: TXR_callbacks["inventory_info"],
450
+ cb?: ((this: void, npc: game_object, info_id: string) => void) | null,
451
+ object?: Maybe<T>
452
+ ): void;
453
+
454
+ // 12 todo: article_info -> implement in game engine
455
+
456
+ /**
457
+ * 13 todo;.
458
+ */
459
+ public set_callback<T extends AnyObject>(
460
+ type: TXR_callbacks["task_state"],
461
+ cb?: ((this: void, task: CGameTask, state: TXR_TaskState) => void) | null,
462
+ object?: Maybe<T>
463
+ ): void;
464
+
465
+ /**
466
+ * 14 todo;.
467
+ */
468
+ public set_callback<T extends AnyObject>(
469
+ type: TXR_callbacks["map_location_added"],
470
+ cb?: ((this: void, spot_type: string, id: u16) => void) | null,
471
+ object?: Maybe<T>
472
+ ): void;
473
+
474
+ /**
475
+ * 15 Use some object.
476
+ */
477
+ public set_callback<T extends AnyObject>(
478
+ type: TXR_callbacks["use_object"],
479
+ cb?: ((this: void, object: game_object) => void) | null,
480
+ object?: Maybe<T>
481
+ ): void;
482
+
483
+ /**
484
+ * 15 Use some object with explicit user object.
485
+ */
486
+ public set_callback<T extends AnyObject>(
487
+ type: TXR_callbacks["use_object"],
488
+ cb?: ((this: void, object: game_object, who: game_object) => void) | null,
489
+ object?: Maybe<T>
490
+ ): void;
491
+
492
+ /**
493
+ * 16 Entity got hit.
494
+ */
495
+ public set_callback<T extends AnyObject>(
496
+ type: TXR_callbacks["hit"],
497
+ cb?:
498
+ | ((
499
+ this: void,
500
+ object: game_object,
501
+ damage: number,
502
+ direction: vector,
503
+ who: game_object,
504
+ bone_id: number
505
+ ) => void)
506
+ | null,
507
+ object?: Maybe<T>
508
+ ): void;
509
+
510
+ /**
511
+ * 17 todo;.
512
+ */
513
+ public set_callback<T extends AnyObject>(
514
+ type: TXR_callbacks["sound"],
515
+ cb?:
516
+ | ((
517
+ this: void,
518
+ object: game_object,
519
+ source_id: number,
520
+ sound_type: TXR_snd_type,
521
+ position: vector,
522
+ sound_power: number
523
+ ) => void)
524
+ | null,
525
+ object?: Maybe<T>
526
+ ): void;
527
+
528
+ /**
529
+ * 18 todo;.
530
+ */
531
+ public set_callback<T extends AnyObject>(
532
+ type: TXR_callbacks["action_movement"],
533
+ cb?: ((this: void, object: game_object, movement_type: u32 /* EMovementType */, unknown: -1) => void) | null,
534
+ object?: Maybe<T>
535
+ ): void;
536
+
537
+ // 19 todo: action_watch
538
+
539
+ // 20 todo: action_removed
540
+
541
+ // 21 todo: action_animation
542
+
543
+ // 22 todo: action_sound
544
+
545
+ // 23 todo: action_particle
546
+
547
+ // 24 todo: action_object
548
+
549
+ // 25 todo: actor_sleep -> implement in game engine
550
+
551
+ /**
552
+ * 26 todo;.
553
+ */
554
+ public set_callback<T extends AnyObject>(
555
+ type: TXR_callbacks["helicopter_on_point"],
556
+ cb?: ((this: void, distance: number, current_position: vector, vertex_id: number) => void) | null,
557
+ object?: Maybe<T>
558
+ ): void;
559
+
560
+ /**
561
+ * 27 todo;.
562
+ */
563
+ public set_callback<T extends AnyObject>(
564
+ type: TXR_callbacks["helicopter_on_hit"],
565
+ cb?: ((this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void) | null,
566
+ object?: Maybe<T>
567
+ ): void;
568
+
569
+ /**
570
+ * 28 todo;.
571
+ */
572
+ public set_callback<T extends AnyObject>(
573
+ type: TXR_callbacks["on_item_take"],
574
+ cb?: ((this: void, object: game_object, item: game_object) => void) | null,
575
+ object?: Maybe<T>
576
+ ): void;
577
+
578
+ /**
579
+ * 29 todo;.
580
+ */
581
+ public set_callback<T extends AnyObject>(
582
+ type: TXR_callbacks["on_item_drop"],
583
+ cb?: ((this: void, object: game_object, item: game_object) => void) | null,
584
+ object?: Maybe<T>
585
+ ): void;
586
+
587
+ /**
588
+ * 30 todo;.
589
+ */
590
+ public set_callback<T extends AnyObject>(
591
+ type: TXR_callbacks["script_animation"],
592
+ cb?: ((this: void, skip_multi_anim_check?: boolean) => void) | null,
593
+ object?: object | null
594
+ ): void;
595
+
596
+ /**
597
+ * 31 todo;.
598
+ */
599
+ public set_callback<T extends AnyObject>(
600
+ type: TXR_callbacks["trader_global_anim_request"],
601
+ cb?: ((this: void) => void) | null,
602
+ object?: Maybe<T>
603
+ ): void;
604
+
605
+ /**
606
+ * 32 todo;.
607
+ */
608
+ public set_callback<T extends AnyObject>(
609
+ type: TXR_callbacks["trader_head_anim_request"],
610
+ cb?: ((this: void) => void) | null,
611
+ object?: Maybe<T>
612
+ ): void;
613
+
614
+ /**
615
+ * 33 todo;.
616
+ */
617
+ public set_callback<T extends AnyObject>(
618
+ type: TXR_callbacks["trader_sound_end"],
619
+ cb?: ((this: void) => void) | null,
620
+ object?: Maybe<T>
621
+ ): void;
622
+
623
+ /**
624
+ * 34 todo;.
625
+ */
626
+ public set_callback<T extends AnyObject>(
627
+ type: TXR_callbacks["take_item_from_box"],
628
+ cb?: ((this: void, object: game_object, box: game_object, item: game_object) => void) | null,
629
+ object?: Maybe<T>
630
+ ): void;
631
+
632
+ /**
633
+ * 35 Callback executed when weapon has no ammo to fire.
634
+ */
635
+ public set_callback<T extends AnyObject>(
636
+ type: TXR_callbacks["weapon_no_ammo"],
637
+ cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
638
+ object?: Maybe<T>
639
+ ): void;
640
+
641
+ /**
642
+ * 36 Callback executed on hud animation stop.
643
+ * Called from CHudItem class internals.
644
+ */
645
+ public set_callback<T extends AnyObject>(
646
+ type: TXR_callbacks["hud_animation_end"],
647
+ cb?:
648
+ | ((
649
+ this: void,
650
+ object: game_object,
651
+ hud_section: string,
652
+ current_motion: string,
653
+ state: u32,
654
+ animation_slot: u32
655
+ ) => void)
656
+ | null,
657
+ object?: Maybe<T>
658
+ ): void;
659
+
660
+ /**
661
+ * 37 todo;.
662
+ */
663
+ public set_callback<T extends AnyObject>(
664
+ type: TXR_callbacks["key_press"],
665
+ cb?: ((this: void, key: i32) => void) | null,
666
+ object?: Maybe<T>
667
+ ): void;
668
+
669
+ /**
670
+ * 38 todo;.
671
+ */
672
+ public set_callback<T extends AnyObject>(
673
+ type: TXR_callbacks["key_release"],
674
+ cb?: ((this: void, key: i32) => void) | null,
675
+ object?: Maybe<T>
676
+ ): void;
677
+
678
+ /**
679
+ * 39 todo;.
680
+ */
681
+ public set_callback<T extends AnyObject>(
682
+ type: TXR_callbacks["key_hold"],
683
+ cb?: ((this: void, key: i32) => void) | null,
684
+ object?: Maybe<T>
685
+ ): void;
686
+
687
+ // 40 todo: mouse_move
688
+
689
+ // 41 todo: mouse_wheel
690
+
691
+ // 42 todo: controller_press
692
+
693
+ // 43 todo: controller_release
694
+
695
+ // 44 todo: controller_hold
696
+
697
+ // 45 todo: controller_attitude_change
698
+
699
+ /**
700
+ * 46 todo: item_to_belt.
701
+ */
702
+ public set_callback<T extends AnyObject>(
703
+ type: TXR_callbacks["item_to_belt"],
704
+ cb?: ((this: void, object: game_object) => void) | null,
705
+ object?: Maybe<T>
706
+ ): void;
707
+
708
+ /**
709
+ * 47 todo: item_to_slot.
710
+ */
711
+ public set_callback<T extends AnyObject>(
712
+ type: TXR_callbacks["item_to_slot"],
713
+ cb?: ((this: void, object: game_object) => void) | null,
714
+ object?: Maybe<T>
715
+ ): void;
716
+
717
+ /**
718
+ * 48 todo: item_to_ruck.
719
+ */
720
+ public set_callback<T extends AnyObject>(
721
+ type: TXR_callbacks["item_to_ruck"],
722
+ cb?: ((this: void, object: game_object) => void) | null,
723
+ object?: Maybe<T>
724
+ ): void;
725
+
726
+ /**
727
+ * 49 Callback executed when weapon is zoomed in.
728
+ */
729
+ public set_callback<T extends AnyObject>(
730
+ type: TXR_callbacks["weapon_zoom_in"],
731
+ cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
732
+ object?: Maybe<T>
733
+ ): void;
734
+
735
+ /**
736
+ * 50 Callback executed when weapon is zoomed out.
737
+ */
738
+ public set_callback<T extends AnyObject>(
739
+ type: TXR_callbacks["weapon_zoom_out"],
740
+ cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
741
+ object?: Maybe<T>
742
+ ): void;
743
+
744
+ /**
745
+ * 51 Callback executed when magazine ammo is elapsed and empty.
746
+ */
747
+ public set_callback<T extends AnyObject>(
748
+ type: TXR_callbacks["weapon_jammed"],
749
+ cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
750
+ object?: Maybe<T>
751
+ ): void;
752
+
753
+ /**
754
+ * 52 Callback executed when magazine ammo is elapsed and empty.
755
+ */
756
+ public set_callback<T extends AnyObject>(
757
+ type: TXR_callbacks["weapon_magazine_empty"],
758
+ cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
759
+ object?: Maybe<T>
760
+ ): void;
761
+
762
+ /**
763
+ * 53 todo: actor_before_death.
764
+ */
765
+ public set_callback<T extends AnyObject>(
766
+ type: TXR_callbacks["actor_before_death"],
767
+ cb?: ((this: void, killer_id: u16) => void) | null,
768
+ object?: Maybe<T>
769
+ ): void;
770
+
771
+ // 54 todo: on_attach_vehicle
772
+
773
+ // 55 todo: on_detach_vehicle
774
+
775
+ // 56 todo: on_use_vehicle
776
+
777
+ /**
778
+ * Clear all callbacks registered on this object.
779
+ */
780
+ public clear_callbacks(): void;
781
+
782
+ /**
783
+ * Clear the custom enemy selector callback.
784
+ */
785
+ public set_enemy_callback(cb: null): void;
786
+
787
+ /**
788
+ * Set a custom enemy selector callback.
789
+ *
790
+ * @param cb - Callback that receives this object and a candidate enemy.
791
+ * @param object - Lua context used as callback `this`.
792
+ */
793
+ public set_enemy_callback<T>(cb: (this: T, object: game_object, enemy: game_object) => boolean, object: T): void;
794
+
795
+ /**
796
+ * Set a fast update callback for this object.
797
+ *
798
+ * @param cb - Callback called from the object's fast update path.
799
+ * @param context - Lua context used as callback `this`.
800
+ */
801
+ public set_fastcall<T>(cb: (this: T) => boolean, context: T): void;
802
+
803
+ /**
804
+ * Set or clear the patrol extrapolation callback.
805
+ *
806
+ * @param cb - Callback called with current patrol point index.
807
+ * @param object - Optional Lua context.
808
+ */
809
+ public set_patrol_extrapolate_callback(cb?: ((cur_pt: number) => boolean) | null, object?: object): void;
810
+
811
+ /**
812
+ * Set or clear smart-cover target selection callback.
813
+ *
814
+ * @param cb - Callback that receives this object when a smart-cover target is selected.
815
+ * @param object - Optional Lua context.
816
+ */
817
+ public set_smart_cover_target_selector(cb?: ((object: game_object) => void) | null, object?: object | null): void;
818
+ }
819
+ }