xray16 1.5.4 → 1.6.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.
@@ -1,3 +1,5 @@
1
+ import type { Nillable } from "../../internal";
2
+
1
3
  declare module "xray16" {
2
4
  /**
3
5
  * Cover point returned by cover search helpers.
@@ -94,146 +96,182 @@ declare module "xray16" {
94
96
  * Default x-ray 16 callbacks.
95
97
  */
96
98
  public static readonly trade_start: 0;
99
+
97
100
  /**
98
101
  * Engine enum value for `callback.trade_stop`.
99
102
  */
100
103
  public static readonly trade_stop: 1;
104
+
101
105
  /**
102
106
  * Engine enum value for `callback.trade_sell_buy_item`.
103
107
  */
104
108
  public static readonly trade_sell_buy_item: 2;
109
+
105
110
  /**
106
111
  * Engine enum value for `callback.trade_perform_operation`.
107
112
  */
108
113
  public static readonly trade_perform_operation: 3;
114
+
109
115
  /**
110
116
  * Engine enum value for `callback.zone_enter`.
111
117
  */
112
118
  public static readonly zone_enter: 4;
119
+
113
120
  /**
114
121
  * Engine enum value for `callback.zone_exit`.
115
122
  */
116
123
  public static readonly zone_exit: 5;
124
+
117
125
  /**
118
126
  * Engine enum value for `callback.level_border_exit`.
119
127
  */
120
128
  public static readonly level_border_exit: 6;
129
+
121
130
  /**
122
131
  * Engine enum value for `callback.level_border_enter`.
123
132
  */
124
133
  public static readonly level_border_enter: 7;
134
+
125
135
  /**
126
136
  * Engine enum value for `callback.death`.
127
137
  */
128
138
  public static readonly death: 8;
139
+
129
140
  /**
130
141
  * Engine enum value for `callback.patrol_path_in_point`.
131
142
  */
132
143
  public static readonly patrol_path_in_point: 9;
144
+
133
145
  /**
134
146
  * Engine enum value for `callback.inventory_pda`.
135
147
  */
136
148
  public static readonly inventory_pda: 10;
149
+
137
150
  /**
138
151
  * Engine enum value for `callback.inventory_info`.
139
152
  */
140
153
  public static readonly inventory_info: 11;
154
+
141
155
  /**
142
156
  * Engine enum value for `callback.article_info`.
143
157
  */
144
158
  public static readonly article_info: 12;
159
+
145
160
  /**
146
161
  * Engine enum value for `callback.task_state`.
147
162
  */
148
163
  public static readonly task_state: 13;
164
+
149
165
  /**
150
166
  * Engine enum value for `callback.map_location_added`.
151
167
  */
152
168
  public static readonly map_location_added: 14;
169
+
153
170
  /**
154
171
  * Engine enum value for `callback.use_object`.
155
172
  */
156
173
  public static readonly use_object: 15;
174
+
157
175
  /**
158
176
  * Engine enum value for `callback.hit`.
159
177
  */
160
178
  public static readonly hit: 16;
179
+
161
180
  /**
162
181
  * Engine enum value for `callback.sound`.
163
182
  */
164
183
  public static readonly sound: 17;
184
+
165
185
  /**
166
186
  * Engine enum value for `callback.action_movement`.
167
187
  */
168
188
  public static readonly action_movement: 18;
189
+
169
190
  /**
170
191
  * Engine enum value for `callback.action_watch`.
171
192
  */
172
193
  public static readonly action_watch: 19;
194
+
173
195
  /**
174
196
  * Engine enum value for `callback.action_removed`.
175
197
  */
176
198
  public static readonly action_removed: 20;
199
+
177
200
  /**
178
201
  * Engine enum value for `callback.action_animation`.
179
202
  */
180
203
  public static readonly action_animation: 21;
204
+
181
205
  /**
182
206
  * Engine enum value for `callback.action_sound`.
183
207
  */
184
208
  public static readonly action_sound: 22;
209
+
185
210
  /**
186
211
  * Engine enum value for `callback.action_particle`.
187
212
  */
188
213
  public static readonly action_particle: 23;
214
+
189
215
  /**
190
216
  * Engine enum value for `callback.action_object`.
191
217
  */
192
218
  public static readonly action_object: 24;
219
+
193
220
  /**
194
221
  * Engine enum value for `callback.actor_sleep`.
195
222
  */
196
223
  public static readonly actor_sleep: 25;
224
+
197
225
  /**
198
226
  * Engine enum value for `callback.helicopter_on_point`.
199
227
  */
200
228
  public static readonly helicopter_on_point: 26;
229
+
201
230
  /**
202
231
  * Engine enum value for `callback.helicopter_on_hit`.
203
232
  */
204
233
  public static readonly helicopter_on_hit: 27;
234
+
205
235
  /**
206
236
  * Engine enum value for `callback.on_item_take`.
207
237
  */
208
238
  public static readonly on_item_take: 28;
239
+
209
240
  /**
210
241
  * Engine enum value for `callback.on_item_drop`.
211
242
  */
212
243
  public static readonly on_item_drop: 29;
244
+
213
245
  /**
214
246
  * Engine enum value for `callback.script_animation`.
215
247
  */
216
248
  public static readonly script_animation: 30;
249
+
217
250
  /**
218
251
  * Engine enum value for `callback.trader_global_anim_request`.
219
252
  */
220
253
  public static readonly trader_global_anim_request: 31;
254
+
221
255
  /**
222
256
  * Engine enum value for `callback.trader_head_anim_request`.
223
257
  */
224
258
  public static readonly trader_head_anim_request: 32;
259
+
225
260
  /**
226
261
  * Engine enum value for `callback.trader_sound_end`.
227
262
  */
228
263
  public static readonly trader_sound_end: 33;
264
+
229
265
  /**
230
266
  * Engine enum value for `callback.take_item_from_box`.
231
267
  */
232
268
  public static readonly take_item_from_box: 34;
269
+
233
270
  /**
234
271
  * Engine enum value for `callback.weapon_no_ammo`.
235
272
  */
236
273
  public static readonly weapon_no_ammo: 35;
274
+
237
275
  /**
238
276
  * Engine enum value for `callback.hud_animation_end`.
239
277
  */
@@ -242,83 +280,102 @@ declare module "xray16" {
242
280
  /**
243
281
  * Engine enum value for `callback.key_press`.
244
282
  */
245
- public static readonly key_press: 37;
283
+ public static readonly key_press: 123;
284
+
246
285
  /**
247
286
  * Engine enum value for `callback.key_release`.
248
287
  */
249
- public static readonly key_release: 38;
288
+ public static readonly key_release: 124;
289
+
250
290
  /**
251
291
  * Engine enum value for `callback.key_hold`.
252
292
  */
253
- public static readonly key_hold: 39;
293
+ public static readonly key_hold: 125;
294
+
254
295
  /**
255
296
  * Engine enum value for `callback.mouse_move`.
256
297
  */
257
- public static readonly mouse_move: 40;
298
+ public static readonly mouse_move: 127;
299
+
258
300
  /**
259
301
  * Engine enum value for `callback.mouse_wheel`.
260
302
  */
261
- public static readonly mouse_wheel: 41;
303
+ public static readonly mouse_wheel: 126;
304
+
262
305
  /**
263
306
  * Engine enum value for `callback.controller_press`.
264
307
  */
265
- public static readonly controller_press: 42;
308
+ public static readonly controller_press: 48;
309
+
266
310
  /**
267
311
  * Engine enum value for `callback.controller_release`.
268
312
  */
269
- public static readonly controller_release: 43;
313
+ public static readonly controller_release: 49;
314
+
270
315
  /**
271
316
  * Engine enum value for `callback.controller_hold`.
272
317
  */
273
- public static readonly controller_hold: 44;
274
- // Public static readonly controller_attitude_change: 45;
318
+ public static readonly controller_hold: 50;
319
+
320
+ /**
321
+ * Engine enum value for `callback.controller_attitude_change`.
322
+ */
323
+ public static readonly controller_attitude_change: 51;
275
324
 
276
325
  /**
277
326
  * Engine enum value for `callback.item_to_belt`.
278
327
  */
279
- public static readonly item_to_belt: 46;
328
+ public static readonly item_to_belt: 37;
329
+
280
330
  /**
281
331
  * Engine enum value for `callback.item_to_slot`.
282
332
  */
283
- public static readonly item_to_slot: 47;
333
+ public static readonly item_to_slot: 38;
334
+
284
335
  /**
285
336
  * Engine enum value for `callback.item_to_ruck`.
286
337
  */
287
- public static readonly item_to_ruck: 48;
338
+ public static readonly item_to_ruck: 39;
288
339
 
289
340
  /**
290
341
  * Engine enum value for `callback.weapon_zoom_in`.
291
342
  */
292
- public static readonly weapon_zoom_in: 49;
343
+ public static readonly weapon_zoom_in: 40;
344
+
293
345
  /**
294
346
  * Engine enum value for `callback.weapon_zoom_out`.
295
347
  */
296
- public static readonly weapon_zoom_out: 50;
348
+ public static readonly weapon_zoom_out: 41;
349
+
297
350
  /**
298
351
  * Engine enum value for `callback.weapon_jammed`.
299
352
  */
300
- public static readonly weapon_jammed: 51;
353
+ public static readonly weapon_jammed: 42;
354
+
301
355
  /**
302
356
  * Engine enum value for `callback.weapon_magazine_empty`.
303
357
  */
304
- public static readonly weapon_magazine_empty: 52;
358
+ public static readonly weapon_magazine_empty: 43;
305
359
 
306
360
  /**
307
361
  * Engine enum value for `callback.actor_before_death`.
308
362
  */
309
- public static readonly actor_before_death: 53;
363
+ public static readonly actor_before_death: 44;
364
+
310
365
  /**
311
366
  * Engine enum value for `callback.on_attach_vehicle`.
312
367
  */
313
- public static readonly on_attach_vehicle: 54;
368
+ public static readonly on_attach_vehicle: 45;
369
+
314
370
  /**
315
371
  * Engine enum value for `callback.on_detach_vehicle`.
316
372
  */
317
- public static readonly on_detach_vehicle: 55;
373
+ public static readonly on_detach_vehicle: 46;
374
+
318
375
  /**
319
376
  * Engine enum value for `callback.on_use_vehicle`.
320
377
  */
321
- public static readonly on_use_vehicle: 56;
378
+ public static readonly on_use_vehicle: 47;
322
379
  }
323
380
 
324
381
  /**
@@ -332,447 +389,710 @@ declare module "xray16" {
332
389
  export type TXR_callback = EnumeratedStaticsValues<TXR_callbacks>;
333
390
 
334
391
  /**
335
- * Custom extension.
336
- * For reference: src/xrGame/script_game_object_script.cpp.
392
+ * `game_object.set_callback` overloads for Lua-visible game object callbacks.
337
393
  *
338
394
  * @group xr_script_interface
395
+ *
396
+ * @remarks
397
+ * When `object` is supplied, `CScriptCallbackEx` passes it as the first Lua callback argument.
339
398
  */
340
399
  class game_object_callbacks_implementation_base {
341
400
  /**
342
- * Remove callback.
401
+ * Clear one callback registration.
402
+ *
403
+ * @remarks
404
+ * Uses the no-functor `CScriptGameObject::SetCallback(type)` overload, which clears the callback slot.
343
405
  *
344
- * @param type - Type of callback.
345
- * @param cb - Null to reset.
406
+ * @param type - Callback type to clear.
407
+ * @param cb - Nullish value used to select the clear overload.
346
408
  */
347
- public set_callback(type: TXR_callback, cb: null): void;
409
+ public set_callback(type: TXR_callback, cb: Nillable<never>): void;
348
410
 
349
411
  /**
350
- * 0 todo;.
412
+ * Fired when a trader starts a trade session.
413
+ *
414
+ * @source `src/xrGame/ai/trader/ai_trader.cpp`, `CAI_Trader::OnStartTrade`.
351
415
  */
352
416
  public set_callback<T extends AnyObject>(
353
417
  type: TXR_callbacks["trade_start"],
354
- cb?: ((this: void) => void) | null,
355
- object?: Maybe<T>
418
+ cb?: Nillable<(this: void) => void>,
419
+ object?: Nillable<T>
356
420
  ): void;
357
421
 
358
422
  /**
359
- * 1 todo;.
423
+ * Fired when a trader stops a trade session.
424
+ *
425
+ * @source `src/xrGame/ai/trader/ai_trader.cpp`, `CAI_Trader::OnStopTrade`.
360
426
  */
361
427
  public set_callback<T extends AnyObject>(
362
428
  type: TXR_callbacks["trade_stop"],
363
- cb?: ((this: void) => void) | null,
364
- object?: Maybe<T>
429
+ cb?: Nillable<(this: void) => void>,
430
+ object?: Nillable<T>
365
431
  ): void;
366
432
 
367
433
  /**
368
- * 2 todo;.
434
+ * Fired when an actor-involved trade transfers an item and money.
435
+ *
436
+ * @source `src/xrGame/trade2.cpp`, `CTrade::TransferItem`.
369
437
  */
370
438
  public set_callback<T extends AnyObject>(
371
439
  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>
440
+ cb?: Nillable<
441
+ (this: void, item: game_object, money_direction: boolean, money: number, partner: game_object) => void
442
+ >,
443
+ object?: Nillable<T>
374
444
  ): void;
375
445
 
376
446
  /**
377
- * 3 todo;.
447
+ * Fired when a trader performs the money part of a trade operation.
448
+ *
449
+ * @source `src/xrGame/trade.cpp`, `CTrade::OnPerformTrade`.
378
450
  */
379
451
  public set_callback<T extends AnyObject>(
380
452
  type: TXR_callbacks["trade_perform_operation"],
381
- cb?: ((this: void, money_get: u32, money_put: u32) => void) | null,
382
- object?: Maybe<T>
453
+ cb?: Nillable<(this: void, money_get: u32, money_put: u32) => void>,
454
+ object?: Nillable<T>
383
455
  ): void;
384
456
 
385
457
  /**
386
- * 4 todo;
458
+ * Fired by a script zone when a game object enters it.
387
459
  *
388
- * Works with script_zone objects.
460
+ * @source `src/xrGame/script_zone.cpp`, `CScriptZone::feel_touch_new`.
461
+ *
462
+ * @remarks
463
+ * The first callback argument is the zone object; the second is the entering object.
389
464
  */
390
465
  public set_callback<T extends AnyObject>(
391
466
  type: TXR_callbacks["zone_enter"],
392
- cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
393
- object?: Maybe<T>
467
+ cb?: Nillable<(this: void, zone: game_object, object: game_object) => void>,
468
+ object?: Nillable<T>
394
469
  ): void;
395
470
 
396
471
  /**
397
- * 5 todo;
472
+ * Fired by a script zone when a game object leaves it or is released while touching it.
473
+ *
474
+ * @source `src/xrGame/script_zone.cpp`, `CScriptZone::feel_touch_delete` and `CScriptZone::net_Relcase`.
398
475
  *
399
- * Works with script_zone objects.
476
+ * @remarks
477
+ * The first callback argument is the zone object; the second is the leaving object.
400
478
  */
401
479
  public set_callback<T extends AnyObject>(
402
480
  type: TXR_callbacks["zone_exit"],
403
- cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
404
- object?: Maybe<T>
481
+ cb?: Nillable<(this: void, zone: game_object, object: game_object) => void>,
482
+ object?: Nillable<T>
405
483
  ): void;
406
484
 
407
485
  /**
408
- * 6 todo;.
486
+ * Fired when the actor leaves the playable level border.
487
+ *
488
+ * @source `src/xrGame/Actor.cpp`, `CActor::SwitchOutBorder`.
409
489
  */
410
490
  public set_callback<T extends AnyObject>(
411
491
  type: TXR_callbacks["level_border_exit"],
412
- cb?: ((this: void, xobject: game_object) => void) | null,
413
- object?: Maybe<T>
492
+ cb?: Nillable<(this: void, object: game_object) => void>,
493
+ object?: Nillable<T>
414
494
  ): void;
415
495
 
416
496
  /**
417
- * 7 todo;.
497
+ * Fired when the actor re-enters the playable level border.
498
+ *
499
+ * @source `src/xrGame/Actor.cpp`, `CActor::SwitchOutBorder`.
418
500
  */
419
501
  public set_callback<T extends AnyObject>(
420
502
  type: TXR_callbacks["level_border_enter"],
421
- cb?: ((this: void, xobject: game_object) => void) | null,
422
- object?: Maybe<T>
503
+ cb?: Nillable<(this: void, object: game_object) => void>,
504
+ object?: Nillable<T>
423
505
  ): void;
424
506
 
425
507
  /**
426
- * 8 todo;.
508
+ * Fired when the object dies or a destroyable physics object is destroyed.
509
+ *
510
+ * @source `src/xrGame/entity_alive.cpp`, `src/xrGame/DestroyablePhysicsObject.cpp`, and `src/xrGame/ai/crow/ai_crow.cpp`.
511
+ *
512
+ * @remarks
513
+ * The engine passes the victim and, when available, the killer object.
427
514
  */
428
515
  public set_callback<T extends AnyObject>(
429
516
  type: TXR_callbacks["death"],
430
517
  cb?: (this: void, target: game_object, killer: game_object) => void,
431
- object?: Maybe<T>
518
+ object?: Nillable<T>
432
519
  ): void;
433
520
 
434
521
  /**
435
- * 9 todo;.
522
+ * Fired when an object reaches a patrol path point.
523
+ *
524
+ * @source `src/xrGame/patrol_path_manager.cpp`, `CPatrolPathManager::select_point`.
525
+ *
526
+ * @remarks
527
+ * The action type is `ScriptEntity::eActionTypeMovement`; `point_index` is the reached patrol vertex index.
436
528
  */
437
529
  public set_callback<T extends AnyObject>(
438
530
  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>
531
+ cb?: Nillable<(this: void, object: game_object, action_type: number, point_index: number) => void>,
532
+ object?: Nillable<T>
441
533
  ): void;
442
534
 
443
- // 10 todo: inventory_pda -> implement in game engine
535
+ // The `inventory_pda` callback is registered in the enum, but no xray-16 call site was found.
444
536
 
445
537
  /**
446
- * Callback executed when an NPC receives an info portion.
538
+ * Fired when the actor receives an info portion.
539
+ *
540
+ * @source `src/xrGame/actor_communication.cpp`, `CActor::OnReceiveInfo`.
447
541
  */
448
542
  public set_callback<T extends AnyObject>(
449
543
  type: TXR_callbacks["inventory_info"],
450
- cb?: ((this: void, npc: game_object, info_id: string) => void) | null,
451
- object?: Maybe<T>
544
+ cb?: Nillable<(this: void, npc: game_object, info_id: string) => void>,
545
+ object?: Nillable<T>
546
+ ): void;
547
+
548
+ /**
549
+ * Fired when the actor receives an encyclopedia article from an info portion.
550
+ *
551
+ * @source `src/xrGame/actor_communication.cpp`, `CActor::AddEncyclopediaArticle`.
552
+ */
553
+ public set_callback<T extends AnyObject>(
554
+ type: TXR_callbacks["article_info"],
555
+ cb?: Nillable<(this: void, actor: game_object, group: string, name: string, article_type: i32) => void>,
556
+ object?: Nillable<T>
452
557
  ): void;
453
558
 
454
- // 12 todo: article_info -> implement in game engine
559
+ /**
560
+ * Fired when an actor task state changes.
561
+ *
562
+ * @source `src/xrGame/GameTask.cpp`, `CGameTask::ChangeStateCallback` and `SGameTaskObjective::ChangeStateCallback`.
563
+ *
564
+ * @remarks
565
+ * Root task callbacks pass task and state. Objective callbacks are fired from the engine with parent task, objective, and state.
566
+ */
567
+ public set_callback<T extends AnyObject>(
568
+ type: TXR_callbacks["task_state"],
569
+ cb?: Nillable<(this: void, task: CGameTask, state: TXR_TaskState) => void>,
570
+ object?: Nillable<T>
571
+ ): void;
455
572
 
456
573
  /**
457
- * 13 todo;.
574
+ * Fired when a task objective state changes.
575
+ *
576
+ * @source `src/xrGame/GameTask.cpp`, `SGameTaskObjective::ChangeStateCallback`.
458
577
  */
459
578
  public set_callback<T extends AnyObject>(
460
579
  type: TXR_callbacks["task_state"],
461
- cb?: ((this: void, task: CGameTask, state: TXR_TaskState) => void) | null,
462
- object?: Maybe<T>
580
+ cb?: Nillable<(this: void, task: CGameTask, objective: SGameTaskObjective, state: TXR_TaskState) => void>,
581
+ object?: Nillable<T>
463
582
  ): void;
464
583
 
465
584
  /**
466
- * 14 todo;.
585
+ * Fired when the single-player map manager adds an actor map location.
586
+ *
587
+ * @source `src/xrGame/map_manager.cpp`, `CMapManager::AddMapLocation`.
467
588
  */
468
589
  public set_callback<T extends AnyObject>(
469
590
  type: TXR_callbacks["map_location_added"],
470
- cb?: ((this: void, spot_type: string, id: u16) => void) | null,
471
- object?: Maybe<T>
591
+ cb?: Nillable<(this: void, spot_type: string, id: u16) => void>,
592
+ object?: Nillable<T>
472
593
  ): void;
473
594
 
474
595
  /**
475
- * 15 Use some object.
596
+ * Fired when the actor uses an inventory item.
597
+ *
598
+ * @source `src/xrGame/Inventory.cpp`, inventory item use path.
476
599
  */
477
600
  public set_callback<T extends AnyObject>(
478
601
  type: TXR_callbacks["use_object"],
479
- cb?: ((this: void, object: game_object) => void) | null,
480
- object?: Maybe<T>
602
+ cb?: Nillable<(this: void, object: game_object) => void>,
603
+ object?: Nillable<T>
481
604
  ): void;
482
605
 
483
606
  /**
484
- * 15 Use some object with explicit user object.
607
+ * Fired when an object is used by another object.
608
+ *
609
+ * @source `src/xrGame/GameObject.cpp` and `src/xrGame/doors_door.cpp`.
610
+ *
611
+ * @remarks
612
+ * Door use callbacks pass the used object and the initiator when the initiator is available.
485
613
  */
486
614
  public set_callback<T extends AnyObject>(
487
615
  type: TXR_callbacks["use_object"],
488
- cb?: ((this: void, object: game_object, who: game_object) => void) | null,
489
- object?: Maybe<T>
616
+ cb?: Nillable<(this: void, object: game_object, who: game_object) => void>,
617
+ object?: Nillable<T>
490
618
  ): void;
491
619
 
492
620
  /**
493
- * 16 Entity got hit.
621
+ * Fired when the actor receives a hit processed by the script hit path.
622
+ *
623
+ * @source `src/xrGame/Actor.cpp`, `CActor::Hit`.
494
624
  */
495
625
  public set_callback<T extends AnyObject>(
496
626
  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>
627
+ cb?: Nillable<
628
+ (this: void, object: game_object, damage: number, direction: vector, who: game_object, bone_id: number) => void
629
+ >,
630
+ object?: Nillable<T>
508
631
  ): void;
509
632
 
510
633
  /**
511
- * 17 todo;.
634
+ * Fired when a script entity processes a saved sound notification.
635
+ *
636
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::process_sound_callbacks`.
512
637
  */
513
638
  public set_callback<T extends AnyObject>(
514
639
  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>
640
+ cb?: Nillable<
641
+ (
642
+ this: void,
643
+ object: game_object,
644
+ source_id: number,
645
+ sound_type: TXR_snd_type,
646
+ position: vector,
647
+ sound_power: number
648
+ ) => void
649
+ >,
650
+ object?: Nillable<T>
526
651
  ): void;
527
652
 
528
653
  /**
529
- * 18 todo;.
654
+ * Fired when a script entity movement action completes.
655
+ *
656
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
657
+ *
658
+ * @remarks
659
+ * The engine passes `-1` as the third argument for this callback path.
530
660
  */
531
661
  public set_callback<T extends AnyObject>(
532
662
  type: TXR_callbacks["action_movement"],
533
- cb?: ((this: void, object: game_object, movement_type: u32 /* EMovementType */, unknown: -1) => void) | null,
534
- object?: Maybe<T>
663
+ cb?: Nillable<(this: void, object: game_object, movement_type: u32 /* EMovementType */, unknown: -1) => void>,
664
+ object?: Nillable<T>
535
665
  ): void;
536
666
 
537
- // 19 todo: action_watch
667
+ /**
668
+ * Fired when a script entity watch action completes.
669
+ *
670
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
671
+ */
672
+ public set_callback<T extends AnyObject>(
673
+ type: TXR_callbacks["action_watch"],
674
+ cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
675
+ object?: Nillable<T>
676
+ ): void;
538
677
 
539
- // 20 todo: action_removed
678
+ /**
679
+ * Fired when a script entity action is removed from its queue.
680
+ *
681
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
682
+ */
683
+ public set_callback<T extends AnyObject>(
684
+ type: TXR_callbacks["action_removed"],
685
+ cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
686
+ object?: Nillable<T>
687
+ ): void;
540
688
 
541
- // 21 todo: action_animation
689
+ /**
690
+ * Fired when a script entity animation action completes.
691
+ *
692
+ * @source `src/xrGame/script_entity.cpp`, `ScriptCallBack`.
693
+ */
694
+ public set_callback<T extends AnyObject>(
695
+ type: TXR_callbacks["action_animation"],
696
+ cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
697
+ object?: Nillable<T>
698
+ ): void;
542
699
 
543
- // 22 todo: action_sound
700
+ /**
701
+ * Fired when a script entity sound action completes.
702
+ *
703
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
704
+ */
705
+ public set_callback<T extends AnyObject>(
706
+ type: TXR_callbacks["action_sound"],
707
+ cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
708
+ object?: Nillable<T>
709
+ ): void;
544
710
 
545
- // 23 todo: action_particle
711
+ /**
712
+ * Fired when a script entity particle action completes.
713
+ *
714
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
715
+ */
716
+ public set_callback<T extends AnyObject>(
717
+ type: TXR_callbacks["action_particle"],
718
+ cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
719
+ object?: Nillable<T>
720
+ ): void;
546
721
 
547
- // 24 todo: action_object
722
+ /**
723
+ * Fired when a script entity object action completes.
724
+ *
725
+ * @source `src/xrGame/script_entity.cpp`, `CScriptEntity::ProcessScripts`.
726
+ */
727
+ public set_callback<T extends AnyObject>(
728
+ type: TXR_callbacks["action_object"],
729
+ cb?: Nillable<(this: void, object: game_object, action_type: u32) => void>,
730
+ object?: Nillable<T>
731
+ ): void;
548
732
 
549
- // 25 todo: actor_sleep -> implement in game engine
733
+ // The `actor_sleep` callback is registered in the enum, but no xray-16 call site was found.
550
734
 
551
735
  /**
552
- * 26 todo;.
736
+ * Fired when a helicopter reaches its current patrol path point or move target.
737
+ *
738
+ * @source `src/xrGame/HelicopterMovementManager.cpp`.
739
+ *
740
+ * @remarks
741
+ * Patrol-path movement passes the patrol vertex id. Direct movement passes `-1`.
553
742
  */
554
743
  public set_callback<T extends AnyObject>(
555
744
  type: TXR_callbacks["helicopter_on_point"],
556
- cb?: ((this: void, distance: number, current_position: vector, vertex_id: number) => void) | null,
557
- object?: Maybe<T>
745
+ cb?: Nillable<(this: void, distance: number, current_position: vector, vertex_id: number) => void>,
746
+ object?: Nillable<T>
558
747
  ): void;
559
748
 
560
749
  /**
561
- * 27 todo;.
750
+ * Fired when a helicopter is hit by the actor, stalker, or custom zone.
751
+ *
752
+ * @source `src/xrGame/Helicopter2.cpp`, `CHelicopter::Hit`.
562
753
  */
563
754
  public set_callback<T extends AnyObject>(
564
755
  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>
756
+ cb?: Nillable<(this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void>,
757
+ object?: Nillable<T>
567
758
  ): void;
568
759
 
569
760
  /**
570
- * 28 todo;.
761
+ * Fired when an inventory owner takes an item.
762
+ *
763
+ * @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemTake`.
571
764
  */
572
765
  public set_callback<T extends AnyObject>(
573
766
  type: TXR_callbacks["on_item_take"],
574
- cb?: ((this: void, object: game_object, item: game_object) => void) | null,
575
- object?: Maybe<T>
767
+ cb?: Nillable<(this: void, object: game_object, item: game_object) => void>,
768
+ object?: Nillable<T>
576
769
  ): void;
577
770
 
578
771
  /**
579
- * 29 todo;.
772
+ * Fired when an inventory owner drops an item.
773
+ *
774
+ * @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemDrop`.
580
775
  */
581
776
  public set_callback<T extends AnyObject>(
582
777
  type: TXR_callbacks["on_item_drop"],
583
- cb?: ((this: void, object: game_object, item: game_object) => void) | null,
584
- object?: Maybe<T>
778
+ cb?: Nillable<(this: void, object: game_object, item: game_object) => void>,
779
+ object?: Nillable<T>
585
780
  ): void;
586
781
 
587
782
  /**
588
- * 30 todo;.
783
+ * Fired by script animation callback processing.
784
+ *
785
+ * @source `src/xrGame/stalker_animation_manager_update.cpp` and `src/xrGame/animation_script_callback.cpp`.
786
+ *
787
+ * @remarks
788
+ * Stalker animation manager callbacks can call this with no arguments; animation script callbacks pass whether the ended phase is being reported.
589
789
  */
590
790
  public set_callback<T extends AnyObject>(
591
791
  type: TXR_callbacks["script_animation"],
592
- cb?: ((this: void, skip_multi_anim_check?: boolean) => void) | null,
593
- object?: object | null
792
+ cb?: Nillable<(this: void, skip_multi_anim_check?: boolean) => void>,
793
+ object?: Nillable<object>
594
794
  ): void;
595
795
 
596
796
  /**
597
- * 31 todo;.
797
+ * Fired when a trader needs a new global animation motion.
798
+ *
799
+ * @source `src/xrGame/ai/trader/trader_animation.cpp`, `CTraderAnimation::update_frame`.
598
800
  */
599
801
  public set_callback<T extends AnyObject>(
600
802
  type: TXR_callbacks["trader_global_anim_request"],
601
- cb?: ((this: void) => void) | null,
602
- object?: Maybe<T>
803
+ cb?: Nillable<(this: void) => void>,
804
+ object?: Nillable<T>
603
805
  ): void;
604
806
 
605
807
  /**
606
- * 32 todo;.
808
+ * Fired when a trader needs a new head animation motion while sound is playing.
809
+ *
810
+ * @source `src/xrGame/ai/trader/trader_animation.cpp`, `CTraderAnimation::update_frame`.
607
811
  */
608
812
  public set_callback<T extends AnyObject>(
609
813
  type: TXR_callbacks["trader_head_anim_request"],
610
- cb?: ((this: void) => void) | null,
611
- object?: Maybe<T>
814
+ cb?: Nillable<(this: void) => void>,
815
+ object?: Nillable<T>
612
816
  ): void;
613
817
 
614
818
  /**
615
- * 33 todo;.
819
+ * Fired when a trader sound finishes playing.
820
+ *
821
+ * @source `src/xrGame/ai/trader/trader_animation.cpp`, `CTraderAnimation::update_frame`.
616
822
  */
617
823
  public set_callback<T extends AnyObject>(
618
824
  type: TXR_callbacks["trader_sound_end"],
619
- cb?: ((this: void) => void) | null,
620
- object?: Maybe<T>
825
+ cb?: Nillable<(this: void) => void>,
826
+ object?: Nillable<T>
621
827
  ): void;
622
828
 
623
829
  /**
624
- * 34 todo;.
830
+ * Fired when the actor takes an item from an inventory box while the box is open.
831
+ *
832
+ * @source `src/xrGame/InventoryBox.cpp`, `CInventoryBox::TakeItem`.
625
833
  */
626
834
  public set_callback<T extends AnyObject>(
627
835
  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>
836
+ cb?: Nillable<(this: void, object: game_object, box: game_object, item: game_object) => void>,
837
+ object?: Nillable<T>
630
838
  ): void;
631
839
 
632
840
  /**
633
- * 35 Callback executed when weapon has no ammo to fire.
841
+ * Fired when an actor-owned weapon tries to reload and no suitable ammo is available.
842
+ *
843
+ * @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::TryReload`.
634
844
  */
635
845
  public set_callback<T extends AnyObject>(
636
846
  type: TXR_callbacks["weapon_no_ammo"],
637
- cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
638
- object?: Maybe<T>
847
+ cb?: Nillable<(this: void, object: game_object, suitable_ammo_total: i32) => void>,
848
+ object?: Nillable<T>
639
849
  ): void;
640
850
 
641
851
  /**
642
- * 36 Callback executed on hud animation stop.
643
- * Called from CHudItem class internals.
852
+ * Fired when a HUD item animation ends.
853
+ *
854
+ * @source `src/xrGame/HudItem.cpp`, `CHudItem::OnAnimationEnd`.
644
855
  */
645
856
  public set_callback<T extends AnyObject>(
646
857
  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>
858
+ cb?: Nillable<
859
+ (
860
+ this: void,
861
+ object: game_object,
862
+ hud_section: string,
863
+ current_motion: string,
864
+ state: u32,
865
+ animation_slot: u32
866
+ ) => void
867
+ >,
868
+ object?: Nillable<T>
658
869
  ): void;
659
870
 
660
871
  /**
661
- * 37 todo;.
872
+ * Fired when the actor receives a keyboard press before UI and game input handling.
873
+ *
874
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnKeyboardPress`.
662
875
  */
663
876
  public set_callback<T extends AnyObject>(
664
877
  type: TXR_callbacks["key_press"],
665
- cb?: ((this: void, key: i32) => void) | null,
666
- object?: Maybe<T>
878
+ cb?: Nillable<(this: void, key: i32) => void>,
879
+ object?: Nillable<T>
667
880
  ): void;
668
881
 
669
882
  /**
670
- * 38 todo;.
883
+ * Fired when the actor receives a keyboard release before UI and game input handling.
884
+ *
885
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnKeyboardRelease`.
671
886
  */
672
887
  public set_callback<T extends AnyObject>(
673
888
  type: TXR_callbacks["key_release"],
674
- cb?: ((this: void, key: i32) => void) | null,
675
- object?: Maybe<T>
889
+ cb?: Nillable<(this: void, key: i32) => void>,
890
+ object?: Nillable<T>
676
891
  ): void;
677
892
 
678
893
  /**
679
- * 39 todo;.
894
+ * Fired when the actor receives a keyboard hold before normal input handling.
895
+ *
896
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnKeyboardHold`.
680
897
  */
681
898
  public set_callback<T extends AnyObject>(
682
899
  type: TXR_callbacks["key_hold"],
683
- cb?: ((this: void, key: i32) => void) | null,
684
- object?: Maybe<T>
900
+ cb?: Nillable<(this: void, key: i32) => void>,
901
+ object?: Nillable<T>
685
902
  ): void;
686
903
 
687
- // 40 todo: mouse_move
904
+ /**
905
+ * Fired when the actor receives a mouse movement event before normal input handling.
906
+ *
907
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnMouseMove`.
908
+ */
909
+ public set_callback<T extends AnyObject>(
910
+ type: TXR_callbacks["mouse_move"],
911
+ cb?: Nillable<(this: void, dx: i32, dy: i32) => void>,
912
+ object?: Nillable<T>
913
+ ): void;
688
914
 
689
- // 41 todo: mouse_wheel
915
+ /**
916
+ * Fired when the actor receives a mouse wheel event before normal input handling.
917
+ *
918
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnMouseWheel`.
919
+ *
920
+ * @remarks
921
+ * The engine passes wheel deltas as `(y, x)`.
922
+ */
923
+ public set_callback<T extends AnyObject>(
924
+ type: TXR_callbacks["mouse_wheel"],
925
+ cb?: Nillable<(this: void, y: number, x: number) => void>,
926
+ object?: Nillable<T>
927
+ ): void;
690
928
 
691
- // 42 todo: controller_press
929
+ /**
930
+ * Fired when the actor receives a controller press event before normal input handling.
931
+ *
932
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerPress`.
933
+ */
934
+ public set_callback<T extends AnyObject>(
935
+ type: TXR_callbacks["controller_press"],
936
+ cb?: Nillable<(this: void, key: i32, state: AnyObject) => void>,
937
+ object?: Nillable<T>
938
+ ): void;
692
939
 
693
- // 43 todo: controller_release
940
+ /**
941
+ * Fired when the actor receives a controller release event before normal input handling.
942
+ *
943
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerRelease`.
944
+ */
945
+ public set_callback<T extends AnyObject>(
946
+ type: TXR_callbacks["controller_release"],
947
+ cb?: Nillable<(this: void, key: i32, state: AnyObject) => void>,
948
+ object?: Nillable<T>
949
+ ): void;
694
950
 
695
- // 44 todo: controller_hold
951
+ /**
952
+ * Fired when the actor receives a controller hold event before normal input handling.
953
+ *
954
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerHold`.
955
+ */
956
+ public set_callback<T extends AnyObject>(
957
+ type: TXR_callbacks["controller_hold"],
958
+ cb?: Nillable<(this: void, key: i32, state: AnyObject) => void>,
959
+ object?: Nillable<T>
960
+ ): void;
696
961
 
697
- // 45 todo: controller_attitude_change
962
+ /**
963
+ * Fired when the actor receives a controller attitude change event before normal input handling.
964
+ *
965
+ * @source `src/xrGame/Level_input.cpp`, `CLevel::IR_OnControllerAttitudeChange`.
966
+ */
967
+ public set_callback<T extends AnyObject>(
968
+ type: TXR_callbacks["controller_attitude_change"],
969
+ cb?: Nillable<(this: void, change: vector) => void>,
970
+ object?: Nillable<T>
971
+ ): void;
698
972
 
699
973
  /**
700
- * 46 todo: item_to_belt.
974
+ * Fired when an inventory owner moves an item to the belt.
975
+ *
976
+ * @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemBelt`.
701
977
  */
702
978
  public set_callback<T extends AnyObject>(
703
979
  type: TXR_callbacks["item_to_belt"],
704
- cb?: ((this: void, object: game_object) => void) | null,
705
- object?: Maybe<T>
980
+ cb?: Nillable<(this: void, object: game_object) => void>,
981
+ object?: Nillable<T>
706
982
  ): void;
707
983
 
708
984
  /**
709
- * 47 todo: item_to_slot.
985
+ * Fired when an inventory owner moves an item to a slot.
986
+ *
987
+ * @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemSlot`.
710
988
  */
711
989
  public set_callback<T extends AnyObject>(
712
990
  type: TXR_callbacks["item_to_slot"],
713
- cb?: ((this: void, object: game_object) => void) | null,
714
- object?: Maybe<T>
991
+ cb?: Nillable<(this: void, object: game_object) => void>,
992
+ object?: Nillable<T>
715
993
  ): void;
716
994
 
717
995
  /**
718
- * 48 todo: item_to_ruck.
996
+ * Fired when an inventory owner moves an item to the rucksack.
997
+ *
998
+ * @source `src/xrGame/InventoryOwner.cpp`, `CInventoryOwner::OnItemRuck`.
719
999
  */
720
1000
  public set_callback<T extends AnyObject>(
721
1001
  type: TXR_callbacks["item_to_ruck"],
722
- cb?: ((this: void, object: game_object) => void) | null,
723
- object?: Maybe<T>
1002
+ cb?: Nillable<(this: void, object: game_object) => void>,
1003
+ object?: Nillable<T>
724
1004
  ): void;
725
1005
 
726
1006
  /**
727
- * 49 Callback executed when weapon is zoomed in.
1007
+ * Fired when a weapon owner zooms in with a magazined weapon.
1008
+ *
1009
+ * @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnZoomIn`.
728
1010
  */
729
1011
  public set_callback<T extends AnyObject>(
730
1012
  type: TXR_callbacks["weapon_zoom_in"],
731
- cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
732
- object?: Maybe<T>
1013
+ cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
1014
+ object?: Nillable<T>
733
1015
  ): void;
734
1016
 
735
1017
  /**
736
- * 50 Callback executed when weapon is zoomed out.
1018
+ * Fired when a weapon owner zooms out with a magazined weapon.
1019
+ *
1020
+ * @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnZoomOut`.
737
1021
  */
738
1022
  public set_callback<T extends AnyObject>(
739
1023
  type: TXR_callbacks["weapon_zoom_out"],
740
- cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
741
- object?: Maybe<T>
1024
+ cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
1025
+ object?: Nillable<T>
742
1026
  ): void;
743
1027
 
744
1028
  /**
745
- * 51 Callback executed when magazine ammo is elapsed and empty.
1029
+ * Fired when a magazined weapon misfires.
1030
+ *
1031
+ * @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnShot` misfire path.
746
1032
  */
747
1033
  public set_callback<T extends AnyObject>(
748
1034
  type: TXR_callbacks["weapon_jammed"],
749
- cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
750
- object?: Maybe<T>
1035
+ cb?: Nillable<(this: void, owner: game_object, weapon: game_object) => void>,
1036
+ object?: Nillable<T>
751
1037
  ): void;
752
1038
 
753
1039
  /**
754
- * 52 Callback executed when magazine ammo is elapsed and empty.
1040
+ * Fired when an actor-owned magazined weapon becomes empty or unloads its magazine.
1041
+ *
1042
+ * @source `src/xrGame/WeaponMagazined.cpp`, `CWeaponMagazined::OnMagazineEmpty` and `CWeaponMagazined::UnloadMagazine`.
755
1043
  */
756
1044
  public set_callback<T extends AnyObject>(
757
1045
  type: TXR_callbacks["weapon_magazine_empty"],
758
- cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
759
- object?: Maybe<T>
1046
+ cb?: Nillable<(this: void, object: game_object, suitable_ammo_total: i32) => void>,
1047
+ object?: Nillable<T>
760
1048
  ): void;
761
1049
 
762
1050
  /**
763
- * 53 todo: actor_before_death.
1051
+ * Fired before actor death handling when the engine callback gate is enabled.
1052
+ *
1053
+ * @source `src/xrGame/Entity.cpp`, `CEntity::KillEntity` under `ACTOR_BEFORE_DEATH_CALLBACK`.
1054
+ *
1055
+ * @remarks
1056
+ * The callback receives the id of the object that caused the actor death path.
764
1057
  */
765
1058
  public set_callback<T extends AnyObject>(
766
1059
  type: TXR_callbacks["actor_before_death"],
767
- cb?: ((this: void, killer_id: u16) => void) | null,
768
- object?: Maybe<T>
1060
+ cb?: Nillable<(this: void, killer_id: u16) => void>,
1061
+ object?: Nillable<T>
769
1062
  ): void;
770
1063
 
771
- // 54 todo: on_attach_vehicle
1064
+ /**
1065
+ * Fired when the actor attaches to a vehicle or mounted weapon.
1066
+ *
1067
+ * @source `src/xrGame/ActorVehicle.cpp` and `src/xrGame/ActorMountedWeapon.cpp`.
1068
+ */
1069
+ public set_callback<T extends AnyObject>(
1070
+ type: TXR_callbacks["on_attach_vehicle"],
1071
+ cb?: Nillable<(this: void, vehicle: game_object) => void>,
1072
+ object?: Nillable<T>
1073
+ ): void;
772
1074
 
773
- // 55 todo: on_detach_vehicle
1075
+ /**
1076
+ * Fired when the actor detaches from a vehicle or mounted weapon.
1077
+ *
1078
+ * @source `src/xrGame/ActorVehicle.cpp` and `src/xrGame/ActorMountedWeapon.cpp`.
1079
+ */
1080
+ public set_callback<T extends AnyObject>(
1081
+ type: TXR_callbacks["on_detach_vehicle"],
1082
+ cb?: Nillable<(this: void, vehicle: game_object) => void>,
1083
+ object?: Nillable<T>
1084
+ ): void;
774
1085
 
775
- // 56 todo: on_use_vehicle
1086
+ /**
1087
+ * Fired when the actor uses a vehicle without attaching to it.
1088
+ *
1089
+ * @source `src/xrGame/ActorVehicle.cpp`, `CActor::use_Vehicle`.
1090
+ */
1091
+ public set_callback<T extends AnyObject>(
1092
+ type: TXR_callbacks["on_use_vehicle"],
1093
+ cb?: Nillable<(this: void, vehicle: game_object) => void>,
1094
+ object?: Nillable<T>
1095
+ ): void;
776
1096
 
777
1097
  /**
778
1098
  * Clear all callbacks registered on this object.
@@ -806,7 +1126,7 @@ declare module "xray16" {
806
1126
  * @param cb - Callback called with current patrol point index.
807
1127
  * @param object - Optional Lua context.
808
1128
  */
809
- public set_patrol_extrapolate_callback(cb?: ((cur_pt: number) => boolean) | null, object?: object): void;
1129
+ public set_patrol_extrapolate_callback(cb?: Nillable<(cur_pt: number) => boolean>, object?: object): void;
810
1130
 
811
1131
  /**
812
1132
  * Set or clear smart-cover target selection callback.
@@ -814,6 +1134,9 @@ declare module "xray16" {
814
1134
  * @param cb - Callback that receives this object when a smart-cover target is selected.
815
1135
  * @param object - Optional Lua context.
816
1136
  */
817
- public set_smart_cover_target_selector(cb?: ((object: game_object) => void) | null, object?: object | null): void;
1137
+ public set_smart_cover_target_selector(
1138
+ cb?: Nillable<(object: game_object) => void>,
1139
+ object?: Nillable<object>
1140
+ ): void;
818
1141
  }
819
1142
  }