xray16 1.0.7 → 1.0.8

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 (65) hide show
  1. package/README.md +4 -1
  2. package/package.json +4 -3
  3. package/types/index.d.ts +46 -22
  4. package/types/{xr_object → xr_ai}/xr_action.d.ts +163 -135
  5. package/types/xr_ai/xr_alife.d.ts +552 -0
  6. package/types/xr_ai/xr_enemy_evaluation.d.ts +41 -0
  7. package/types/xr_ai/xr_goap.d.ts +668 -0
  8. package/types/xr_ai/xr_graph.d.ts +47 -0
  9. package/types/xr_ai/xr_memory.d.ts +148 -0
  10. package/types/xr_lib/xr_animation.d.ts +81 -0
  11. package/types/xr_lib/xr_bitwise.d.ts +21 -0
  12. package/types/xr_lib/xr_color.d.ts +40 -0
  13. package/types/xr_lib/xr_debug.d.ts +100 -0
  14. package/types/{xr_object → xr_lib}/xr_dialog.d.ts +7 -1
  15. package/types/xr_lib/xr_flags.d.ts +148 -0
  16. package/types/xr_lib/xr_fs.d.ts +37 -233
  17. package/types/xr_lib/xr_game.d.ts +159 -0
  18. package/types/xr_lib/xr_hit.d.ts +41 -0
  19. package/types/xr_lib/xr_ini.d.ts +176 -0
  20. package/types/xr_lib/xr_level.d.ts +225 -0
  21. package/types/xr_lib/xr_luabind.d.ts +59 -0
  22. package/types/{xr_map → xr_lib}/xr_map.d.ts +19 -0
  23. package/types/xr_lib/xr_math.d.ts +65 -0
  24. package/types/{xr_online → xr_lib}/xr_multiplayer.d.ts +52 -0
  25. package/types/xr_lib/xr_properties.d.ts +166 -0
  26. package/types/xr_lib/xr_relation.d.ts +84 -0
  27. package/types/xr_lib/xr_render.d.ts +70 -0
  28. package/types/xr_lib/xr_save.d.ts +223 -0
  29. package/types/{xr_sound → xr_lib}/xr_sound.d.ts +10 -12
  30. package/types/xr_lib/xr_stats.ts +20 -0
  31. package/types/{xr_object/xr_quest.d.ts → xr_lib/xr_task.d.ts} +54 -2
  32. package/types/xr_lib/xr_time.d.ts +61 -0
  33. package/types/{xr_type → xr_lib}/xr_type.d.ts +13 -13
  34. package/types/xr_object/client/xr_client_object.d.ts +76 -0
  35. package/types/xr_object/{xr_level.d.ts → client/xr_level.d.ts} +69 -0
  36. package/types/xr_object/{xr_physic.d.ts → client/xr_physic.d.ts} +58 -0
  37. package/types/xr_object/client/xr_zone.d.ts +40 -0
  38. package/types/xr_object/script/xr_script_interface.d.ts +429 -0
  39. package/types/xr_object/{xr_client_object.d.ts → script/xr_script_object.d.ts} +425 -518
  40. package/types/xr_object/script/xr_script_trade.d.ts +26 -0
  41. package/types/xr_object/{xr_server_object.d.ts → server/xr_server_object.d.ts} +151 -72
  42. package/types/xr_ui/xr_ui_asset.d.ts +123 -0
  43. package/types/xr_ui/xr_ui_core.d.ts +33 -123
  44. package/types/xr_ui/xr_ui_event.d.ts +382 -0
  45. package/types/xr_ui/xr_ui_interface.d.ts +213 -0
  46. package/types/xr_ui/xr_ui_menu.d.ts +142 -0
  47. package/types/xr_constant.d.ts +0 -996
  48. package/types/xr_core.d.ts +0 -347
  49. package/types/xr_global.d.ts +0 -663
  50. package/types/xr_lib/xr_utils.d.ts +0 -412
  51. package/types/xr_luabind.d.ts +0 -34
  52. package/types/xr_object/xr_alife.d.ts +0 -213
  53. package/types/xr_type/xr_enums.d.ts +0 -17
  54. package/types/xr_ui/README.md +0 -277
  55. package/types/xr_ui/demo/CServerList.png +0 -0
  56. package/types/xr_ui/demo/CUI3tButton.png +0 -0
  57. package/types/xr_ui/demo/CUICheckButton.png +0 -0
  58. package/types/xr_ui/demo/CUIComboBox.png +0 -0
  59. package/types/xr_ui/demo/CUICustomEdit.png +0 -0
  60. package/types/xr_ui/demo/CUIStatic.png +0 -0
  61. package/types/xr_ui/demo/CUITrackBar.png +0 -0
  62. /package/types/xr_object/{xr_anomaly.d.ts → client/xr_anomaly.d.ts} +0 -0
  63. /package/types/xr_object/{xr_artefact.d.ts → client/xr_artefact.d.ts} +0 -0
  64. /package/types/xr_object/{xr_creature.d.ts → client/xr_creature.d.ts} +0 -0
  65. /package/types/xr_object/{xr_item.d.ts → client/xr_item.d.ts} +0 -0
@@ -0,0 +1,668 @@
1
+ declare module "xray16" {
2
+ /**
3
+ * @source C++ class stalker_ids
4
+ * @customConstructor stalker_ids
5
+ * @group xr_goap
6
+ */
7
+ export class stalker_ids {
8
+ public static readonly action_accomplish_task: 7;
9
+ public static readonly action_aim_enemy: 16;
10
+ public static readonly action_alife_planner: 88;
11
+ public static readonly action_anomaly_planner: 90;
12
+ public static readonly action_combat_planner: 89;
13
+ public static readonly action_communicate_with_customer: 9;
14
+ public static readonly action_critically_wounded: 36;
15
+ public static readonly action_danger_by_sound_planner: 73;
16
+ public static readonly action_danger_grenade_look_around: 85;
17
+ public static readonly action_danger_grenade_planner: 72;
18
+ public static readonly action_danger_grenade_search: 86;
19
+ public static readonly action_danger_grenade_take_cover: 82;
20
+ public static readonly action_danger_grenade_take_cover_after_explosion: 84;
21
+ public static readonly action_danger_grenade_wait_for_explosion: 83;
22
+ public static readonly action_danger_in_direction_detour: 80;
23
+ public static readonly action_danger_in_direction_hold_position: 79;
24
+ public static readonly action_danger_in_direction_look_out: 78;
25
+ public static readonly action_danger_in_direction_planner: 71;
26
+ public static readonly action_danger_in_direction_search: 81;
27
+ public static readonly action_danger_in_direction_take_cover: 77;
28
+ public static readonly action_danger_planner: 91;
29
+ public static readonly action_danger_unknown_look_around: 75;
30
+ public static readonly action_danger_unknown_planner: 70;
31
+ public static readonly action_danger_unknown_search: 76;
32
+ public static readonly action_danger_unknown_take_cover: 74;
33
+ public static readonly action_dead: 0;
34
+ public static readonly action_death_planner: 87;
35
+ public static readonly action_detour_enemy: 25;
36
+ public static readonly action_dying: 1;
37
+ public static readonly action_find_ammo: 15;
38
+ public static readonly action_find_item_to_kill: 13;
39
+ public static readonly action_gather_items: 2;
40
+ public static readonly action_get_distance: 24;
41
+ public static readonly action_get_item_to_kill: 12;
42
+ public static readonly action_get_ready_to_kill: 17;
43
+ public static readonly action_hold_position: 23;
44
+ public static readonly action_kill_enemy: 19;
45
+ public static readonly action_kill_enemy_if_not_visible: 29;
46
+ public static readonly action_kill_if_enemy_critically_wounded: 37;
47
+ public static readonly action_kill_if_player_on_the_path: 35;
48
+ public static readonly action_kill_wounded_enemy: 33;
49
+ public static readonly action_look_out: 22;
50
+ public static readonly action_make_item_killing: 14;
51
+ public static readonly action_no_alife: 3;
52
+ public static readonly action_post_combat_wait: 34;
53
+ public static readonly action_prepare_wounded_enemy: 32;
54
+ public static readonly action_reach_customer_location: 8;
55
+ public static readonly action_reach_task_location: 6;
56
+ public static readonly action_reach_wounded_enemy: 30;
57
+ public static readonly action_retreat_from_enemy: 20;
58
+ public static readonly action_script: 92;
59
+ public static readonly action_search_enemy: 26;
60
+ public static readonly action_smart_terrain_task: 4;
61
+ public static readonly action_solve_zone_puzzle: 5;
62
+ public static readonly action_sudden_attack: 28;
63
+ public static readonly action_take_cover: 21;
64
+ public static readonly detect_anomaly: 11;
65
+ public static readonly get_out_of_anomaly: 10;
66
+
67
+ public static readonly property_alife: 3;
68
+ /**
69
+ * Whether object is alive.
70
+ */
71
+ public static readonly property_alive: 0;
72
+ public static readonly property_already_dead: 2;
73
+ public static readonly property_anomaly: 46;
74
+ public static readonly property_cover_actual: 42;
75
+ public static readonly property_cover_reached: 43;
76
+ public static readonly property_critically_wounded: 29;
77
+ public static readonly property_danger: 8;
78
+ public static readonly property_danger_by_sound: 41;
79
+ public static readonly property_danger_grenade: 40;
80
+ public static readonly property_danger_in_direction: 39;
81
+ public static readonly property_danger_unknown: 38;
82
+ public static readonly property_dead: 1;
83
+ /**
84
+ * Whether object has any enemy.
85
+ */
86
+ public static readonly property_enemy: 7;
87
+ public static readonly property_enemy_critically_wounded: 30;
88
+ public static readonly property_enemy_detoured: 21;
89
+ public static readonly property_found_ammo: 12;
90
+ public static readonly property_found_item_to_kill: 10;
91
+ public static readonly property_grenade_exploded: 45;
92
+ public static readonly property_in_cover: 18;
93
+ public static readonly property_inside_anomaly: 47;
94
+ public static readonly property_item_can_kill: 11;
95
+ public static readonly property_item_to_kill: 9;
96
+ /**
97
+ * Whether object has valuable items to be looted after death.
98
+ */
99
+ public static readonly property_items: 6;
100
+ public static readonly property_looked_around: 44;
101
+ public static readonly property_looked_out: 19;
102
+ /**
103
+ * Whether object should panic.
104
+ */
105
+ public static readonly property_panic: 17;
106
+ public static readonly property_position_holded: 20;
107
+ public static readonly property_pure_enemy: 23;
108
+ /**
109
+ * Whether object has solved zone puzzle.
110
+ * Originally alife was different and it was end goal of each stalker.
111
+ * To solve zone puzzle stalkers collected artefacts, did quests etc.
112
+ */
113
+ public static readonly property_puzzle_solved: 4;
114
+ public static readonly property_ready_to_detour: 14;
115
+ public static readonly property_ready_to_kill: 13;
116
+ public static readonly property_script: 74;
117
+ /**
118
+ * Whether object see enemy.
119
+ */
120
+ public static readonly property_see_enemy: 15;
121
+ public static readonly property_smart_terrain_task: 5;
122
+ public static readonly property_use_crouch_to_look_out: 24;
123
+ public static readonly property_use_suddenness: 22;
124
+
125
+ public static readonly sound_alarm: 4;
126
+ public static readonly sound_attack_allies_several_enemies: 7;
127
+ public static readonly sound_attack_allies_single_enemy: 6;
128
+ public static readonly sound_attack_no_allies: 5;
129
+ public static readonly sound_backup: 8;
130
+ public static readonly sound_detour: 9;
131
+ public static readonly sound_die: 0;
132
+ public static readonly sound_die_in_anomaly: 1;
133
+ public static readonly sound_enemy_critically_wounded: 24;
134
+ public static readonly sound_enemy_killed_or_wounded = -805289984;
135
+ public static readonly sound_enemy_lost_no_allies: 12;
136
+ public static readonly sound_enemy_lost_with_allies: 13;
137
+ public static readonly sound_friendly_grenade_alarm: 20;
138
+ public static readonly sound_grenade_alarm: 19;
139
+ public static readonly sound_humming: 3;
140
+ public static readonly sound_injuring: 2;
141
+ public static readonly sound_injuring_by_friend: 14;
142
+ public static readonly sound_kill_wounded: 23;
143
+ public static readonly sound_need_backup: 21;
144
+ public static readonly sound_panic_human: 15;
145
+ public static readonly sound_panic_monster: 16;
146
+ public static readonly sound_running_in_danger: 22;
147
+ public static readonly sound_script: 27;
148
+ public static readonly sound_search1_no_allies: 11;
149
+ public static readonly sound_search1_with_allies: 10;
150
+ public static readonly sound_tolls: 17;
151
+ public static readonly sound_wounded: 18;
152
+
153
+ public constructor();
154
+ }
155
+
156
+ /**
157
+ * Generic container object for GOAP world properties.
158
+ *
159
+ * @source C++ class world_property
160
+ * @customConstructor world_property
161
+ * @group xr_goap
162
+ */
163
+ export class world_property extends EngineBinding {
164
+ /**
165
+ * Default constructor to describe a pair of identifier and value.
166
+ *
167
+ * @param id - identifier of unique world property
168
+ * @param enabled - value of property state
169
+ */
170
+ public constructor(id: u32, enabled: boolean);
171
+
172
+ /**
173
+ * @returns value of current world property
174
+ */
175
+ public value(): boolean;
176
+
177
+ /**
178
+ * @returns condition identifier of current world property
179
+ */
180
+ public condition(): u32;
181
+ }
182
+
183
+ /**
184
+ * World state describing whole world state in action planning.
185
+ *
186
+ * Overrides operators: `<`, `==`
187
+ *
188
+ * @source C++ class world_state
189
+ * @customConstructor world_state
190
+ * @group xr_goap
191
+ */
192
+ export class world_state extends EngineBinding {
193
+ /**
194
+ * Default constructor.
195
+ */
196
+ public constructor();
197
+
198
+ /**
199
+ * Copy constructor.
200
+ *
201
+ * @param another_state - target world state to copy
202
+ */
203
+ public constructor(another_state: world_state);
204
+
205
+ /**
206
+ * Set property for world state.
207
+ *
208
+ * @param property - target property to add in world state
209
+ */
210
+ public add_property(property: world_property): void;
211
+
212
+ /**
213
+ * Clear all properties in the state.
214
+ */
215
+ public clear(): void;
216
+
217
+ /**
218
+ * Check if provided state is subset of current one.
219
+ *
220
+ * @param state - target state to check
221
+ * @returns whether current world state includes provided state
222
+ */
223
+ public includes(state: world_state): boolean;
224
+
225
+ /**
226
+ * Get world property by id.
227
+ *
228
+ * @param id - numeric if of the required property
229
+ * @returns property id/state based on provided id
230
+ */
231
+ public property(id: u32): world_property;
232
+
233
+ /**
234
+ * Remove world property from current world state.
235
+ *
236
+ * @param id - identifier of the property to remove
237
+ */
238
+ public remove_property(id: u32): void;
239
+ }
240
+
241
+ /**
242
+ * Storage of object evaluators cached state for handling of in-game logic.
243
+ * Container for actions.
244
+ *
245
+ * @source C++ class property_storage
246
+ * @customConstructor property_storage
247
+ * @group xr_goap
248
+ */
249
+ export class property_storage extends EngineBinding {
250
+ /**
251
+ * Get property evaluator value by `id`.
252
+ *
253
+ * @throws if property is not declared in storage
254
+ *
255
+ * @param id - unique identifier of the world property
256
+ * @returns current value for provided `id`
257
+ */
258
+ public property(id: u32): boolean;
259
+
260
+ /**
261
+ * Set property value in the storage.
262
+ *
263
+ * @param id - unique identifier of the world property
264
+ * @param value - value for provided `id`
265
+ */
266
+ public set_property(id: u32, value: boolean): void;
267
+ }
268
+
269
+ /**
270
+ * Class implementation of world properties evaluators.
271
+ * Generic handler to calculate current state of bound world property `id`.
272
+ *
273
+ * @source C++ class property_evaluator
274
+ * @customConstructor property_evaluator
275
+ * @group xr_goap
276
+ */
277
+ export class property_evaluator extends EngineBinding {
278
+ /**
279
+ * Linked game object to work with.
280
+ */
281
+ public readonly object: game_object;
282
+
283
+ /**
284
+ * Container reference with state of action preconditions.
285
+ */
286
+ public readonly storage: property_storage;
287
+
288
+ /**
289
+ * Default constructor.
290
+ */
291
+ public constructor();
292
+
293
+ /**
294
+ * @param object - target game object to work with, `null` is OK since correct object will be injected on setup
295
+ */
296
+ public constructor(object: game_object | null);
297
+
298
+ /**
299
+ * @param object - target game object to work with, `null` is OK since correct object will be injected on setup
300
+ * @param name - name of the evaluator, used for debug purposes mainly
301
+ */
302
+ public constructor(object: game_object | null, name: string);
303
+
304
+ /**
305
+ * Handle setup of the evaluator and binding to a specific object.
306
+ *
307
+ * @param object - target client object to work with
308
+ * @param storage - action instance storage with preconditions and state
309
+ */
310
+ public setup(object: game_object, storage: property_storage): void;
311
+
312
+ /**
313
+ * Main evaluator lifecycle method.
314
+ * Called every time to get world property up-to-date state.
315
+ */
316
+ public evaluate(): boolean;
317
+ }
318
+
319
+ /**
320
+ * Class implementation of world properties evaluators.
321
+ * Static handler to return pre-defined value for specific world property `id`.
322
+ *
323
+ * @source C++ class property_evaluator_const : property_evaluator
324
+ * @customConstructor property_evaluator_const
325
+ * @group xr_goap
326
+ */
327
+ export class property_evaluator_const extends property_evaluator {
328
+ /**
329
+ * @param value - constant value for evaluation
330
+ */
331
+ public constructor(value: boolean);
332
+ }
333
+
334
+ /**
335
+ * Abstract class for implementation of GOAP planner actions.
336
+ *
337
+ * @source C++ class action_base
338
+ * @customConstructor action_base
339
+ * @group xr_goap
340
+ */
341
+ export abstract class action_base extends EngineBinding {
342
+ /**
343
+ * Game object that is handled by current action instance.
344
+ */
345
+ public readonly object: game_object;
346
+
347
+ /**
348
+ * Container reference with state of action preconditions.
349
+ */
350
+ public readonly storage: property_storage;
351
+
352
+ /**
353
+ * Default constructor.
354
+ */
355
+ public constructor();
356
+
357
+ /**
358
+ * @param object - target game object to work with, `null` is OK since correct object will be injected on setup
359
+ */
360
+ public constructor(object?: game_object | null);
361
+
362
+ /**
363
+ * @param object - target game object to work with, `null` is OK since correct object will be injected on setup
364
+ * @param name - name of the action, used for debug purposes mainly
365
+ */
366
+ public constructor(object: game_object | null, name: string);
367
+
368
+ /**
369
+ * Handle setup of the action and binding to a specific object.
370
+ *
371
+ * @param object - target client object to work with
372
+ * @param storage - action instance storage with preconditions and state
373
+ */
374
+ public setup(object: game_object, storage: property_storage): void;
375
+
376
+ /**
377
+ * Lifecycle method called once on action execution start.
378
+ * Means that lifecycle of the action begun.
379
+ */
380
+ public initialize(): void;
381
+
382
+ /**
383
+ * Lifecycle method.
384
+ * Execution tick of the action, called from object logics update cycle when current action is active.
385
+ */
386
+ public execute(): void;
387
+
388
+ /**
389
+ * Lifecycle method called once on action execution stop.
390
+ * Means that action is finished / preconditions are not met anymore.
391
+ */
392
+ public finalize(): void;
393
+
394
+ /**
395
+ * Set weight of current action execution.
396
+ *
397
+ * @param weight - weight value to express how prioritized action is
398
+ */
399
+ public set_weight(weight: u16): void;
400
+
401
+ /**
402
+ * Add action effect.
403
+ * Describes what target world state is expected to be if action is completed.
404
+ *
405
+ * @param property - world state property describing a pair of evaluator ID and value
406
+ */
407
+ public add_effect(property: world_property): void;
408
+
409
+ /**
410
+ * Remove action effect.
411
+ * Action will be not considered as property changing for `id` anymore
412
+ *
413
+ * @param id - world state property id
414
+ */
415
+ public remove_effect(id: u32): void;
416
+
417
+ /**
418
+ * Add action execution precondition.
419
+ * When building logics graph, action will be considered blocked by some preconditions.
420
+ *
421
+ * @param property - world state property describing a pair of evaluator ID and value
422
+ */
423
+ public add_precondition(property: world_property): void;
424
+
425
+ /**
426
+ * Remove precondition for action.
427
+ * When building logics graph, action will not be considered blocked by evaluator `id` states.
428
+ *
429
+ * @param id - world state property id
430
+ */
431
+ public remove_precondition(id: u32): void;
432
+
433
+ /**
434
+ * Debug method.
435
+ * With mixed / debug build allows investigation of evaluators and actions matches.
436
+ * Helps to debug custom actions and actions pre-conditions with state printing in log files.
437
+ *
438
+ * Note: Available only in mixed / debug engine builds, not for direct usage from lua.
439
+ *
440
+ * @param prefix - string prefix to display current action state in logs
441
+ */
442
+ public show(prefix?: string): void;
443
+ }
444
+
445
+ /**
446
+ * @source C++ class action_planner
447
+ * @customConstructor action_planner
448
+ * @group xr_goap
449
+ */
450
+ export class action_planner extends EngineBinding {
451
+ /**
452
+ * Game object that is handled by current planner instance.
453
+ */
454
+ public readonly object: game_object;
455
+
456
+ /**
457
+ * Container reference with state of planner preconditions.
458
+ */
459
+ public readonly storage: property_storage;
460
+
461
+ /**
462
+ * Default constructor.
463
+ */
464
+ public constructor();
465
+
466
+ /**
467
+ * @returns whether object action planner is already initialized
468
+ */
469
+ public initialized(): boolean;
470
+
471
+ /**
472
+ * @returns whether state of current planner is actual
473
+ */
474
+ public actual(): boolean;
475
+
476
+ /**
477
+ * Setup planner for game object.
478
+ *
479
+ * @param object - client game object to setup planner for
480
+ */
481
+ public setup(object: game_object): void;
482
+
483
+ /**
484
+ * Clear state of current action planner.
485
+ */
486
+ public clear(): void;
487
+
488
+ /**
489
+ * Lifecycle method to handle generic game loop updates.
490
+ */
491
+ public update(): void;
492
+
493
+ /**
494
+ * Add generic action by `id` for planner execution.
495
+ *
496
+ * @param id - unique identifier of new action
497
+ * @param action - action implementation containing preconditions, logics, effects and other meta infos
498
+ */
499
+ public add_action(id: u32, action: action_base): void;
500
+
501
+ /**
502
+ * Remove action by unique `id`.
503
+ *
504
+ * @param id - unique identifier of the action to remove
505
+ */
506
+ public remove_action(id: u32): void;
507
+
508
+ /**
509
+ * Get action instance by unique `id`.
510
+ *
511
+ * @param id - unique identifier of the action to get
512
+ */
513
+ public action(id: u32): action_base;
514
+
515
+ /**
516
+ * Get currently active action being executed.
517
+ *
518
+ * @returns current action instance reference
519
+ */
520
+ public current_action(): action_base;
521
+
522
+ /**
523
+ * Get currently active action identifier.
524
+ *
525
+ * @returns unique identifier of current action
526
+ */
527
+ public current_action_id(): u32;
528
+
529
+ /**
530
+ * Set target world state to try to reach with all the graph logics.
531
+ * All graphs will be built from current state to goal world state with the shortest possible path.
532
+ *
533
+ * @param state - target world state to reach with planner
534
+ */
535
+ public set_goal_world_state(state: world_state): void;
536
+
537
+ /**
538
+ * Add evaluator instance for current action planner.
539
+ *
540
+ * @param id - unique identifier of the evaluator
541
+ * @param evaluator - instance of evaluator linked to the `id`
542
+ */
543
+ public add_evaluator(id: u32, evaluator: property_evaluator): void;
544
+
545
+ /**
546
+ * Return evaluator instance for current action planner.
547
+ *
548
+ * @param id - unique identifier of the evaluator for removal
549
+ */
550
+ public remove_evaluator(id: u32): void;
551
+
552
+ /**
553
+ * Get evaluator instance by `id`.
554
+ *
555
+ * @param id - unique identifier of the evaluator to get
556
+ */
557
+ public evaluator(id: u32): property_evaluator;
558
+
559
+ /**
560
+ * Debug method.
561
+ * With mixed / debug build allows investigation of evaluators and actions matches.
562
+ * Helps to debug custom actions and actions pre-conditions with state printing in log files.
563
+ *
564
+ * Note: Available only in mixed / debug engine builds, not for direct usage from lua.
565
+ *
566
+ * @param prefix - string prefix to display current action state in logs
567
+ */
568
+ public show(prefix: string): void;
569
+ }
570
+
571
+ /**
572
+ * GOAP action class implementing both action base and action planner.
573
+ * Captures execution as action and plans its internal logic with separate logics graph.
574
+ *
575
+ * Examples: combat planner, anomaly planner, items looting planner, alife planner, state planner
576
+ *
577
+ * @source C++ class planner_action : action_planner,action_base
578
+ * @customConstructor planner_action
579
+ * @group xr_goap
580
+ */
581
+ export class planner_action extends action_planner {
582
+ /**
583
+ * Default constructor.
584
+ */
585
+ public constructor();
586
+
587
+ /**
588
+ * @param object - target game object to work with, `null` is OK since correct object will be injected on setup
589
+ */
590
+ public constructor(object?: game_object | null);
591
+
592
+ /**
593
+ * @param object - target game object to work with, `null` is OK since correct object will be injected on setup
594
+ * @param name - name of the action, used for debug purposes mainly
595
+ */
596
+ public constructor(object: game_object | null, name: string);
597
+
598
+ /**
599
+ * Lifecycle method called once on action execution start.
600
+ * Means that lifecycle of the action begun.
601
+ */
602
+ public initialize(): void;
603
+
604
+ /**
605
+ * Lifecycle method called once on action execution stop.
606
+ * Means that action is finished / preconditions are not met anymore.
607
+ */
608
+ public finalize(): void;
609
+
610
+ /**
611
+ * Lifecycle method.
612
+ * Execution tick of the action, called from object logics update cycle when current action is active.
613
+ */
614
+ public execute(): void;
615
+
616
+ /**
617
+ * Add action effect.
618
+ * Describes what target world state is expected to be if action is completed.
619
+ *
620
+ * @param property - world state property describing a pair of evaluator ID and value
621
+ */
622
+ public add_effect(property: world_property): unknown;
623
+
624
+ /**
625
+ * Remove action effect.
626
+ * Action will be not considered as property changing for `id` anymore
627
+ *
628
+ * @param id - world state property id
629
+ */
630
+ public remove_effect(id: u32): void;
631
+
632
+ /**
633
+ * Add action execution precondition.
634
+ * When building logics graph, action will be considered blocked by some preconditions.
635
+ *
636
+ * @param property - world state property describing a pair of evaluator ID and value
637
+ */
638
+ public add_precondition(property: world_property): void;
639
+
640
+ /**
641
+ * Remove precondition for action.
642
+ * When building logics graph, action will not be considered blocked by evaluator `id` states.
643
+ *
644
+ * @param id - world state property id
645
+ */
646
+ public remove_precondition(id: u32): void;
647
+
648
+ /**
649
+ * Set weight of planner action switch.
650
+ *
651
+ * @param weight - weight value to express how prioritized action is
652
+ */
653
+ public set_weight(weight: u32): void;
654
+
655
+ /**
656
+ * Comparator to check weight of switching one state to another.
657
+ *
658
+ * @param first - first state
659
+ * @param second - second state
660
+ */
661
+ public weight(first: world_state, second: world_state): u16;
662
+ }
663
+
664
+ /**
665
+ * @group xr_global_declaration
666
+ */
667
+ export function cast_planner(this: void, base_action: action_base): action_planner;
668
+ }
@@ -0,0 +1,47 @@
1
+ declare module "xray16" {
2
+ /**
3
+ * @source C++ class GameGraph__CVertex
4
+ * @customConstructor GameGraph__CVertex
5
+ * @group xr_graph
6
+ */
7
+ export class GameGraph__CVertex extends EngineBinding {
8
+ protected constructor();
9
+
10
+ public level_vertex_id(): u32;
11
+
12
+ public level_id(): u8;
13
+
14
+ public game_point(): vector;
15
+
16
+ public level_point(): vector;
17
+ }
18
+
19
+ /**
20
+ * @source C++ class CGameGraph
21
+ * @customConstructor CGameGraph
22
+ * @group xr_graph
23
+ */
24
+ export class CGameGraph {
25
+ public valid_vertex_id(value: u32): boolean;
26
+
27
+ public vertex(vertexId: u32): GameGraph__CVertex;
28
+
29
+ public vertex_id(graph: CGameGraph): u16;
30
+
31
+ public accessible(value: u32): boolean;
32
+
33
+ public accessible(value1: u32, value2: boolean): void;
34
+
35
+ /**
36
+ * Method to iterate over game levels registered in `all.spawn`.
37
+ *
38
+ * @returns level abstract object with every iteration
39
+ */
40
+ public levels(): LuaIterable<cse_abstract>;
41
+ }
42
+
43
+ /**
44
+ * @group xr_graph
45
+ */
46
+ export function game_graph(this: void): CGameGraph;
47
+ }