xray16 1.0.7 → 1.0.9

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 +18 -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,429 @@
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
+ * @source C++ class explosive
34
+ * @customConstructor explosive
35
+ * @group xr_script_interface
36
+ */
37
+ export class explosive extends EngineBinding {
38
+ protected constructor();
39
+
40
+ public explode(): void;
41
+ }
42
+
43
+ /**
44
+ * @source C++ class holder
45
+ * @customConstructor holder
46
+ * @group xr_script_interface
47
+ */
48
+ export class holder {
49
+ public engaged(): boolean;
50
+
51
+ public Action(value1: u16, value2: u32): void;
52
+
53
+ public SetParam(value: i32, vector: vector): void;
54
+ }
55
+
56
+ /**
57
+ * Visibility state of bloodsucker.
58
+ * Possible values are:
59
+ * - unset = -1,
60
+ * - no_visibility = 0,
61
+ * - partial_visibility = 1,
62
+ * - full_visibility = 2
63
+ *
64
+ * @source C++ enum visibility_t
65
+ * @group xr_script_interface
66
+ */
67
+ export type TXR_bloodsucker_visibility_state = -1 | 0 | 1 | 2;
68
+
69
+ /**
70
+ * @source C++ enum visibility_t
71
+ * @group xr_script_interface
72
+ */
73
+ export type TXR_game_object_path = 0 | 1 | 2 | 3 | number;
74
+
75
+ /**
76
+ * @source C++ class callback
77
+ * @customConstructor callback
78
+ * @group xr_script_interface
79
+ */
80
+ export class callback {
81
+ /**
82
+ * Placeholder.
83
+ */
84
+ public static readonly dummy: -1;
85
+
86
+ /**
87
+ * Default x-ray 16 callbacks.
88
+ */
89
+ public static readonly trade_start: 0;
90
+ public static readonly trade_stop: 1;
91
+ public static readonly trade_sell_buy_item: 2;
92
+ public static readonly trade_perform_operation: 3;
93
+ public static readonly zone_enter: 4;
94
+ public static readonly zone_exit: 5;
95
+ public static readonly level_border_exit: 6;
96
+ public static readonly level_border_enter: 7;
97
+ public static readonly death: 8;
98
+ public static readonly patrol_path_in_point: 9;
99
+ public static readonly inventory_pda: 10;
100
+ public static readonly inventory_info: 11;
101
+ public static readonly article_info: 12;
102
+ public static readonly task_state: 13;
103
+ public static readonly map_location_added: 14;
104
+ public static readonly use_object: 15;
105
+ public static readonly hit: 16;
106
+ public static readonly sound: 17;
107
+ public static readonly action_movement: 18;
108
+ public static readonly action_watch: 19;
109
+ public static readonly action_removed: 20;
110
+ public static readonly action_animation: 21;
111
+ public static readonly action_sound: 22;
112
+ public static readonly action_particle: 23;
113
+ public static readonly action_object: 24;
114
+ public static readonly actor_sleep: 25;
115
+ public static readonly helicopter_on_point: 26;
116
+ public static readonly helicopter_on_hit: 27;
117
+ public static readonly on_item_take: 28;
118
+ public static readonly on_item_drop: 29;
119
+ public static readonly script_animation: 30;
120
+ public static readonly trader_global_anim_request: 31;
121
+ public static readonly trader_head_anim_request: 32;
122
+ public static readonly trader_sound_end: 33;
123
+ public static readonly take_item_from_box: 34;
124
+ public static readonly weapon_no_ammo: 35;
125
+
126
+ /**
127
+ * Custom callbacks from open x-ray:
128
+ */
129
+ public static readonly key_press: 36;
130
+ public static readonly key_release: 37;
131
+ public static readonly key_hold: 38;
132
+ public static readonly mouse_move: 39;
133
+ public static readonly mouse_wheel: 40;
134
+ public static readonly controller_press: 41;
135
+ public static readonly controller_release: 42;
136
+ public static readonly controller_hold: 43;
137
+ public static readonly item_to_belt: 44;
138
+ public static readonly item_to_slot: 45;
139
+ public static readonly item_to_ruck: 46;
140
+ public static readonly actor_before_death: 47;
141
+ public static readonly on_attach_vehicle: 48;
142
+ public static readonly on_detach_vehicle: 49;
143
+ public static readonly on_use_vehicle: 50;
144
+ public static readonly weapon_zoom_in: 51;
145
+ public static readonly weapon_zoom_out: 52;
146
+ public static readonly weapon_jammed: 53;
147
+ }
148
+
149
+ /**
150
+ * @group xr_script_interface
151
+ */
152
+ export type TXR_callbacks = typeof callback;
153
+
154
+ /**
155
+ * @group xr_script_interface
156
+ */
157
+ export type TXR_callback = EnumeratedStaticsValues<TXR_callbacks>;
158
+
159
+ /**
160
+ * Custom extension.
161
+ * For reference: src/xrGame/script_game_object_script.cpp
162
+ *
163
+ * @group xr_script_interface
164
+ */
165
+ class game_object_callbacks_implementation_base {
166
+ /**
167
+ * Remove callback.
168
+ *
169
+ * @param type - type of callback
170
+ * @param cb - null to reset
171
+ */
172
+ public set_callback(type: TXR_callback, cb: null): void;
173
+
174
+ // 0 todo: trade start
175
+
176
+ // 1 todo: trade stop
177
+
178
+ /**
179
+ * 2 todo;
180
+ */
181
+ public set_callback<T extends AnyObject>(
182
+ type: TXR_callbacks["trade_sell_buy_item"],
183
+ cb?: ((this: void, item: game_object, money_direction: boolean, money: number) => void) | null,
184
+ object?: Maybe<T>
185
+ ): void;
186
+
187
+ // 3 todo: trade_perform_operation
188
+
189
+ /**
190
+ * 4 todo;
191
+ */
192
+ public set_callback<T extends AnyObject>(
193
+ type: TXR_callbacks["zone_enter"],
194
+ cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
195
+ object?: Maybe<T>
196
+ ): void;
197
+
198
+ /**
199
+ * 4 todo;
200
+ */
201
+ public set_callback<T extends AnyObject>(
202
+ type: TXR_callbacks["zone_exit"],
203
+ cb?: ((this: void, zone: game_object, object: game_object) => void) | null,
204
+ object?: Maybe<T>
205
+ ): void;
206
+
207
+ // 6 todo: level_border_exit
208
+
209
+ // 7 todo: level_border_enter
210
+
211
+ /**
212
+ * 8 todo;
213
+ */
214
+ public set_callback<T extends AnyObject>(
215
+ type: TXR_callbacks["death"],
216
+ cb?: (this: void, target: game_object, killer: game_object) => void,
217
+ object?: Maybe<T>
218
+ ): void;
219
+
220
+ /**
221
+ * 9 todo;
222
+ */
223
+ public set_callback<T extends AnyObject>(
224
+ type: TXR_callbacks["patrol_path_in_point"],
225
+ cb?: ((this: void, object: game_object, action_type: number, point_index: number) => void) | null,
226
+ object?: Maybe<T>
227
+ ): void;
228
+
229
+ // 10 todo: inventory_pda
230
+
231
+ /**
232
+ * 11 todo:
233
+ */
234
+ public set_callback<T extends AnyObject>(
235
+ type: TXR_callbacks["inventory_info"],
236
+ cb?: ((this: void, npc: game_object, info_id: string) => void) | null,
237
+ object?: Maybe<T>
238
+ ): void;
239
+
240
+ // 12 todo: article_info
241
+
242
+ /**
243
+ * 13 todo;
244
+ */
245
+ public set_callback<T extends AnyObject>(
246
+ type: TXR_callbacks["task_state"],
247
+ cb?: ((this: void, task: CGameTask, state: TXR_TaskState) => void) | null,
248
+ object?: Maybe<T>
249
+ ): void;
250
+
251
+ // 14 todo: map_location_added
252
+
253
+ /**
254
+ * 15 Use some object.
255
+ */
256
+ public set_callback<T extends AnyObject>(
257
+ type: TXR_callbacks["use_object"],
258
+ cb?: ((this: void, object: game_object) => void) | null,
259
+ object?: Maybe<T>
260
+ ): void;
261
+ public set_callback<T extends AnyObject>(
262
+ type: TXR_callbacks["use_object"],
263
+ cb?: ((this: void, object: game_object, who: game_object) => void) | null,
264
+ object?: Maybe<T>
265
+ ): void;
266
+
267
+ /**
268
+ * 16 Entity got hit.
269
+ */
270
+ public set_callback<T extends AnyObject>(
271
+ type: TXR_callbacks["hit"],
272
+ cb?:
273
+ | ((
274
+ this: void,
275
+ object: game_object,
276
+ damage: number,
277
+ direction: vector,
278
+ who: game_object,
279
+ bone_id: number
280
+ ) => void)
281
+ | null,
282
+ object?: Maybe<T>
283
+ ): void;
284
+
285
+ /**
286
+ * 17 todo;
287
+ */
288
+ public set_callback<T extends AnyObject>(
289
+ type: TXR_callbacks["sound"],
290
+ cb?:
291
+ | ((
292
+ this: void,
293
+ object: game_object,
294
+ source_id: number,
295
+ sound_type: TXR_snd_type,
296
+ position: vector,
297
+ sound_power: number
298
+ ) => void)
299
+ | null,
300
+ object?: Maybe<T>
301
+ ): void;
302
+
303
+ // 18 todo: action_movement
304
+
305
+ // 19 todo: action_watch
306
+
307
+ // 20 todo: action_removed
308
+
309
+ // 21 todo: action_animation
310
+
311
+ // 22 todo: action_sound
312
+
313
+ // 23 todo: action_particle
314
+
315
+ // 24 todo: action_object
316
+
317
+ // 25 todo: actor_sleep
318
+
319
+ /**
320
+ * 26 todo;
321
+ */
322
+ public set_callback<T extends AnyObject>(
323
+ type: TXR_callbacks["helicopter_on_point"],
324
+ cb?: ((this: void, distance: number, current_position: vector, vertex_id: number) => void) | null,
325
+ object?: Maybe<T>
326
+ ): void;
327
+
328
+ /**
329
+ * 27 todo;
330
+ */
331
+ public set_callback<T extends AnyObject>(
332
+ type: TXR_callbacks["helicopter_on_hit"],
333
+ cb?: ((this: void, damage: number, impulse: number, hit_type: number, who_id: number) => void) | null,
334
+ object?: Maybe<T>
335
+ ): void;
336
+
337
+ /**
338
+ * 28 todo;
339
+ */
340
+ public set_callback<T extends AnyObject>(
341
+ type: TXR_callbacks["on_item_take"],
342
+ cb?: ((this: void, object: game_object, item: game_object) => void) | null,
343
+ object?: Maybe<T>
344
+ ): void;
345
+
346
+ /**
347
+ * 29 todo;
348
+ */
349
+ public set_callback<T extends AnyObject>(
350
+ type: TXR_callbacks["on_item_drop"],
351
+ cb?: ((this: void, object: game_object, item: game_object) => void) | null,
352
+ object?: Maybe<T>
353
+ ): void;
354
+
355
+ /**
356
+ * 30 todo;
357
+ */
358
+ public set_callback<T extends AnyObject>(
359
+ type: TXR_callbacks["script_animation"],
360
+ cb?: ((this: void, skip_multi_anim_check?: boolean) => void) | null,
361
+ object?: object | null
362
+ ): void;
363
+
364
+ // 31 todo: trader_global_anim_request
365
+
366
+ // 32 todo: trader_head_anim_request
367
+
368
+ // 33 todo: trader_sound_end
369
+
370
+ /**
371
+ * 34 todo;
372
+ */
373
+ public set_callback<T extends AnyObject>(
374
+ type: TXR_callbacks["take_item_from_box"],
375
+ cb?: ((this: void, object: game_object, box: game_object, item: game_object) => void) | null,
376
+ object?: Maybe<T>
377
+ ): void;
378
+
379
+ // 35 todo: weapon_no_ammo
380
+
381
+ // 36 todo: key_press
382
+
383
+ // 37 todo: key_release
384
+
385
+ // 38 todo: key_hold
386
+
387
+ // 39 todo: mouse_move
388
+
389
+ // 40 todo: mouse_wheel
390
+
391
+ // 41 todo: controller_press
392
+
393
+ // 42 todo: controller_release
394
+
395
+ // 43 todo: controller_hold
396
+
397
+ // 44 todo: item_to_belt
398
+
399
+ // 45 todo: item_to_slot
400
+
401
+ // 46 todo: item_to_ruck
402
+
403
+ // 47 todo: actor_before_death
404
+
405
+ // 48 todo: on_attach_vehicle
406
+
407
+ // 49 todo: on_detach_vehicle
408
+
409
+ // 50 todo: on_use_vehicle
410
+
411
+ // 51 todo: weapon_zoom_in
412
+
413
+ // 52 todo: weapon_zoom_out
414
+
415
+ // 53 todo: weapon_jammed
416
+
417
+ public clear_callbacks(): void;
418
+
419
+ public set_enemy_callback(cb: null): void;
420
+
421
+ public set_enemy_callback<T>(cb: (this: T, object: game_object, enemy: game_object) => boolean, object: T): void;
422
+
423
+ public set_fastcall<T>(cb: (this: T) => boolean, context: T): void;
424
+
425
+ public set_patrol_extrapolate_callback(cb?: ((cur_pt: number) => boolean) | null, object?: object): void;
426
+
427
+ public set_smart_cover_target_selector(cb?: (object: game_object) => void, object?: object): void;
428
+ }
429
+ }