xray16 1.3.2 → 1.4.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 (85) 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 +4 -4
  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 +2 -2
  35. package/plugins/utils/tracy.js +2 -5
  36. package/types/index.d.ts +55 -55
  37. package/types/xr_ai/xr_action.d.ts +510 -510
  38. package/types/xr_ai/xr_alife.d.ts +566 -566
  39. package/types/xr_ai/xr_enemy_evaluation.d.ts +41 -41
  40. package/types/xr_ai/xr_goap.d.ts +669 -668
  41. package/types/xr_ai/xr_graph.d.ts +47 -47
  42. package/types/xr_ai/xr_memory.d.ts +148 -148
  43. package/types/xr_lib/xr_animation.d.ts +81 -81
  44. package/types/xr_lib/xr_bitwise.d.ts +32 -21
  45. package/types/xr_lib/xr_color.d.ts +45 -40
  46. package/types/xr_lib/xr_debug.d.ts +83 -77
  47. package/types/xr_lib/xr_dialog.d.ts +40 -40
  48. package/types/xr_lib/xr_flags.d.ts +529 -148
  49. package/types/xr_lib/xr_fs.d.ts +149 -148
  50. package/types/xr_lib/xr_game.d.ts +261 -158
  51. package/types/xr_lib/xr_hit.d.ts +41 -41
  52. package/types/xr_lib/xr_ini.d.ts +415 -188
  53. package/types/xr_lib/xr_level.d.ts +652 -225
  54. package/types/xr_lib/xr_luabind.d.ts +64 -59
  55. package/types/xr_lib/xr_map.d.ts +61 -61
  56. package/types/xr_lib/xr_math.d.ts +815 -233
  57. package/types/xr_lib/xr_multiplayer.d.ts +351 -351
  58. package/types/xr_lib/xr_profile.d.ts +192 -160
  59. package/types/xr_lib/xr_properties.d.ts +455 -166
  60. package/types/xr_lib/xr_relation.d.ts +84 -84
  61. package/types/xr_lib/xr_render.d.ts +71 -69
  62. package/types/xr_lib/xr_save.d.ts +727 -223
  63. package/types/xr_lib/xr_sound.d.ts +151 -151
  64. package/types/xr_lib/xr_stats.ts +20 -20
  65. package/types/xr_lib/xr_task.d.ts +111 -111
  66. package/types/xr_lib/xr_time.d.ts +166 -61
  67. package/types/xr_lib/xr_type.d.ts +75 -75
  68. package/types/xr_object/client/xr_anomaly.d.ts +50 -50
  69. package/types/xr_object/client/xr_artefact.d.ts +98 -98
  70. package/types/xr_object/client/xr_client_object.d.ts +76 -76
  71. package/types/xr_object/client/xr_creature.d.ts +164 -164
  72. package/types/xr_object/client/xr_item.d.ts +264 -264
  73. package/types/xr_object/client/xr_level.d.ts +285 -285
  74. package/types/xr_object/client/xr_physic.d.ts +214 -214
  75. package/types/xr_object/client/xr_zone.d.ts +47 -47
  76. package/types/xr_object/script/xr_script_interface.d.ts +584 -584
  77. package/types/xr_object/script/xr_script_object.d.ts +2408 -1390
  78. package/types/xr_object/script/xr_script_trade.d.ts +41 -26
  79. package/types/xr_object/server/xr_server_object.d.ts +794 -792
  80. package/types/xr_ui/xr_ui_asset.d.ts +129 -123
  81. package/types/xr_ui/xr_ui_core.d.ts +106 -97
  82. package/types/xr_ui/xr_ui_event.d.ts +383 -381
  83. package/types/xr_ui/xr_ui_interface.d.ts +901 -903
  84. package/types/xr_ui/xr_ui_menu.d.ts +142 -142
  85. package/types/xrf_plugin.d.ts +59 -51
@@ -1,158 +1,261 @@
1
- declare module "xray16" {
2
- /**
3
- * Enumeration with possible game types:
4
- * - eGameIDNoGame = u32(0),
5
- * - eGameIDSingle = u32(1) << 0,
6
- * - eGameIDDeathmatch = u32(1) << 1,
7
- * - eGameIDTeamDeathmatch = u32(1) << 2,
8
- * - eGameIDArtefactHunt = u32(1) << 3,
9
- * - eGameIDCaptureTheArtefact = u32(1) << 4,
10
- * - eGameIDDominationZone = u32(1) << 5,
11
- * - eGameIDTeamDominationZone = u32(1) << 6,
12
- *
13
- * @source C++ enum EGameIDs
14
- * @group xr_game
15
- */
16
- export type TXR_EGameID = 0 | 1 | 2 | 8 | 16 | 32 | 64;
17
-
18
- /**
19
- * @source C++ class GAME_TYPE
20
- * @customConstructor GAME_TYPE
21
- * @group xr_game
22
- */
23
- export class GAME_TYPE {
24
- public static readonly eGameIDArtefactHunt: 8;
25
- public static readonly eGameIDCaptureTheArtefact: 16;
26
- public static readonly eGameIDDeathmatch: 2;
27
- public static readonly eGameIDTeamDeathmatch: 4;
28
-
29
- public static readonly GAME_UNKNOWN: -1;
30
- public static readonly GAME_ANY: 0;
31
- public static readonly GAME_SINGLE: 1;
32
- public static readonly GAME_DEATHMATCH: 2;
33
- // GAME_CTF = 3,
34
- // GAME_ASSAULT = 4, // Team1 - assaulting, Team0 - Defending
35
- public static readonly GAME_CS: 5;
36
- public static readonly GAME_TEAMDEATHMATCH: 6;
37
- public static readonly GAME_ARTEFACTHUNT: 7;
38
- public static readonly GAME_CAPTURETHEARTEFACT: 8;
39
- // identifiers in range [100...254] are registered for script game type
40
- public static readonly GAME_DUMMY: 255; // temporary g
41
- }
42
-
43
- /**
44
- * @group xr_game
45
- */
46
- type TXR_GAME_TYPE = EnumeratedStaticsValues<typeof GAME_TYPE>;
47
-
48
- /**
49
- * @source C++ class game_difficulty
50
- * @customConstructor game_difficulty
51
- * @group xr_game
52
- */
53
- export class game_difficulty {
54
- public static readonly novice: 0;
55
- public static readonly stalker: 1;
56
- public static readonly veteran: 2;
57
- public static readonly master: 3;
58
- }
59
-
60
- /**
61
- * @group xr_game
62
- */
63
- export type TXR_game_difficulty_name = EnumeratedStaticsKeys<typeof game_difficulty>;
64
-
65
- /**
66
- * @group xr_game
67
- */
68
- export type TXR_game_difficulty = EnumeratedStaticsValues<typeof game_difficulty>;
69
-
70
- /**
71
- * @source namespace game
72
- * @group xr_game
73
- */
74
- export interface IXR_game {
75
- CTime: (this: void) => CTime;
76
-
77
- translate_string(this: void, translation_key: string): string;
78
-
79
- time(this: void): u32;
80
-
81
- reload_language(this: void): void;
82
-
83
- get_game_time(this: void): CTime;
84
-
85
- log_stack_trace(this: void): void;
86
-
87
- jump_to_level(this: void, level_name: string): void;
88
-
89
- jump_to_level(this: void, position: vector, lvi: u32, gvi: u16): void;
90
-
91
- jump_to_level(this: void, position: vector, lvi: u32, gvi: u16, direction: vector): void;
92
-
93
- start_tutorial(this: void, tutorial_id: string): void;
94
-
95
- has_active_tutorial(this: void): boolean;
96
-
97
- active_tutorial_name(this: void): string;
98
-
99
- stop_tutorial(this: void): void;
100
- }
101
-
102
- /**
103
- * @group xr_game
104
- */
105
- export const game: IXR_game;
106
-
107
- /**
108
- * Check whether dynamic music setting is enabled.
109
- * Dynamic music starts playing different kind of ambient sounds in actor combat.
110
- *
111
- * @group xr_game
112
- * @returns is dynamic music allowed in game settings.
113
- */
114
- export function IsDynamicMusic(this: void): boolean;
115
-
116
- /**
117
- * Whether auto-save on important checkpoints option is turned on.
118
- *
119
- * @group xr_game
120
- */
121
- export function IsImportantSave(this: void): boolean;
122
-
123
- /**
124
- * @group xr_game
125
- */
126
- export function IsGameTypeSingle(this: void): boolean;
127
-
128
- /**
129
- * @group xr_game
130
- * @returns is dev editor tool enabled currently used.
131
- */
132
- export function editor(this: void): boolean;
133
-
134
- /**
135
- * @group xr_game
136
- */
137
- export function set_start_position(this: void, position: vector): void;
138
-
139
- /**
140
- * @group xr_game
141
- */
142
- export function set_start_game_vertex_id(this: void, gvid: i32): void;
143
-
144
- /**
145
- * @group xr_game
146
- */
147
- export function is_enough_address_space_available(this: void): boolean;
148
-
149
- /**
150
- * @group xr_game
151
- */
152
- export function verify_if_thread_is_running(this: void): void;
153
-
154
- /**
155
- * @group xr_game
156
- */
157
- export function script_server_object_version(this: void): u16;
158
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Bitmask values returned by `level.game_id()`.
4
+ *
5
+ * Enumeration with possible game types:
6
+ * - eGameIDNoGame = u32(0),
7
+ * - eGameIDSingle = u32(1) << 0,
8
+ * - eGameIDDeathmatch = u32(1) << 1,
9
+ * - eGameIDTeamDeathmatch = u32(1) << 2,
10
+ * - eGameIDArtefactHunt = u32(1) << 3,
11
+ * - eGameIDCaptureTheArtefact = u32(1) << 4,
12
+ * - eGameIDDominationZone = u32(1) << 5,
13
+ * - eGameIDTeamDominationZone = u32(1) << 6,.
14
+ *
15
+ * @source C++ enum EGameIDs
16
+ * @group xr_game
17
+ */
18
+ export type TXR_EGameID = 0 | 1 | 2 | 8 | 16 | 32 | 64;
19
+
20
+ /**
21
+ * Game type constants used by menu and multiplayer scripts.
22
+ *
23
+ * @source C++ class GAME_TYPE
24
+ * @customConstructor GAME_TYPE
25
+ * @group xr_game
26
+ */
27
+ export class GAME_TYPE {
28
+ public static readonly eGameIDArtefactHunt: 8;
29
+ public static readonly eGameIDCaptureTheArtefact: 16;
30
+ public static readonly eGameIDDeathmatch: 2;
31
+ public static readonly eGameIDTeamDeathmatch: 4;
32
+
33
+ public static readonly GAME_UNKNOWN: -1;
34
+ public static readonly GAME_ANY: 0;
35
+ public static readonly GAME_SINGLE: 1;
36
+ public static readonly GAME_DEATHMATCH: 2;
37
+ // GAME_CTF = 3,
38
+ // GAME_ASSAULT = 4, // Team1 - assaulting, Team0 - Defending
39
+ public static readonly GAME_CS: 5;
40
+ public static readonly GAME_TEAMDEATHMATCH: 6;
41
+ public static readonly GAME_ARTEFACTHUNT: 7;
42
+ public static readonly GAME_CAPTURETHEARTEFACT: 8;
43
+ // Identifiers in range [100...254] are registered for script game type
44
+ public static readonly GAME_DUMMY: 255; // Temporary g
45
+ }
46
+
47
+ /**
48
+ * @group xr_game
49
+ */
50
+ type TXR_GAME_TYPE = EnumeratedStaticsValues<typeof GAME_TYPE>;
51
+
52
+ /**
53
+ * Single-player difficulty constants.
54
+ *
55
+ * @source C++ class game_difficulty
56
+ * @customConstructor game_difficulty
57
+ * @group xr_game
58
+ */
59
+ export class game_difficulty {
60
+ public static readonly novice: 0;
61
+ public static readonly stalker: 1;
62
+ public static readonly veteran: 2;
63
+ public static readonly master: 3;
64
+ }
65
+
66
+ /**
67
+ * @group xr_game
68
+ */
69
+ export type TXR_game_difficulty_name = EnumeratedStaticsKeys<typeof game_difficulty>;
70
+
71
+ /**
72
+ * @group xr_game
73
+ */
74
+ export type TXR_game_difficulty = EnumeratedStaticsValues<typeof game_difficulty>;
75
+
76
+ /**
77
+ * Global helpers exposed by the engine `game` namespace.
78
+ *
79
+ * @source namespace game
80
+ * @group xr_game
81
+ */
82
+ export interface IXR_game {
83
+ /**
84
+ * Create a new game time value.
85
+ *
86
+ * @returns Empty `CTime` instance.
87
+ */
88
+ CTime: (this: void) => CTime;
89
+
90
+ /**
91
+ * Resolve a string table key for the current language.
92
+ *
93
+ * @param translation_key - String table key to translate.
94
+ * @returns Localized text or the fallback string from the string table.
95
+ */
96
+ translate_string(this: void, translation_key: string): string;
97
+
98
+ /**
99
+ * Get current in-game time as seconds.
100
+ *
101
+ * @returns Game time counter.
102
+ */
103
+ time(this: void): u32;
104
+
105
+ /**
106
+ * Reload string table data for the active language.
107
+ */
108
+ reload_language(this: void): void;
109
+
110
+ /**
111
+ * Get current in-game calendar time.
112
+ *
113
+ * @returns Current game time value.
114
+ */
115
+ get_game_time(this: void): CTime;
116
+
117
+ /**
118
+ * Write the current native stack trace to the engine log.
119
+ */
120
+ log_stack_trace(this: void): void;
121
+
122
+ /**
123
+ * Move the actor to another level by level name.
124
+ *
125
+ * @param level_name - Target level name from the game graph.
126
+ */
127
+ jump_to_level(this: void, level_name: string): void;
128
+
129
+ /**
130
+ * Move the actor to another level graph point.
131
+ *
132
+ * @param position - Target position.
133
+ * @param level_vertex_id - Target level vertex.
134
+ * @param game_vertex_id - Target game graph vertex.
135
+ */
136
+ jump_to_level(this: void, position: vector, level_vertex_id: u32, game_vertex_id: u16): void;
137
+
138
+ /**
139
+ * Move the actor to another level graph point and face a direction.
140
+ *
141
+ * @param position - Target position.
142
+ * @param level_vertex_id - Target level vertex.
143
+ * @param game_vertex_id - Target game graph vertex.
144
+ * @param direction - Actor direction after the jump.
145
+ */
146
+ jump_to_level(this: void, position: vector, level_vertex_id: u32, game_vertex_id: u16, direction: vector): void;
147
+
148
+ /**
149
+ * Start an in-game tutorial sequence.
150
+ *
151
+ * @param tutorial_id - Tutorial identifier.
152
+ */
153
+ start_tutorial(this: void, tutorial_id: string): void;
154
+
155
+ /**
156
+ * Check whether a tutorial is currently active.
157
+ *
158
+ * @returns Whether any tutorial is active.
159
+ */
160
+ has_active_tutorial(this: void): boolean;
161
+
162
+ /**
163
+ * Get the active tutorial identifier.
164
+ *
165
+ * @returns Active tutorial name.
166
+ */
167
+ active_tutorial_name(this: void): string;
168
+
169
+ /**
170
+ * Stop the active tutorial sequence.
171
+ */
172
+ stop_tutorial(this: void): void;
173
+ }
174
+
175
+ /**
176
+ * Global engine `game` namespace.
177
+ *
178
+ * @group xr_game
179
+ */
180
+ export const game: IXR_game;
181
+
182
+ /**
183
+ * Check whether dynamic music setting is enabled.
184
+ * Dynamic music starts playing different kind of ambient sounds in actor combat.
185
+ *
186
+ * @group xr_game
187
+ *
188
+ * @returns Is dynamic music allowed in game settings.
189
+ */
190
+ export function IsDynamicMusic(this: void): boolean;
191
+
192
+ /**
193
+ * Whether auto-save on important checkpoints option is turned on.
194
+ *
195
+ * @group xr_game
196
+ *
197
+ * @returns Whether important saves are enabled.
198
+ */
199
+ export function IsImportantSave(this: void): boolean;
200
+
201
+ /**
202
+ * Check whether the active game mode is single-player.
203
+ *
204
+ * @group xr_game
205
+ *
206
+ * @returns Whether the current game type is single-player.
207
+ */
208
+ export function IsGameTypeSingle(this: void): boolean;
209
+
210
+ /**
211
+ * Check whether the in-game editor is active.
212
+ *
213
+ * @group xr_game
214
+ *
215
+ * @returns Whether the editor is currently enabled.
216
+ */
217
+ export function editor(this: void): boolean;
218
+
219
+ /**
220
+ * Set the actor start position used by level transition logic.
221
+ *
222
+ * @group xr_game
223
+ *
224
+ * @param position - Target start position.
225
+ */
226
+ export function set_start_position(this: void, position: vector): void;
227
+
228
+ /**
229
+ * Set the actor start game graph vertex.
230
+ *
231
+ * @group xr_game
232
+ *
233
+ * @param game_vertex_id - Target game graph vertex.
234
+ */
235
+ export function set_start_game_vertex_id(this: void, game_vertex_id: i32): void;
236
+
237
+ /**
238
+ * Check whether the process has enough address space for the current game.
239
+ *
240
+ * @group xr_game
241
+ *
242
+ * @returns Whether available address space is sufficient.
243
+ */
244
+ export function is_enough_address_space_available(this: void): boolean;
245
+
246
+ /**
247
+ * Ask the engine to verify that its watched thread is still running.
248
+ *
249
+ * @group xr_game
250
+ */
251
+ export function verify_if_thread_is_running(this: void): void;
252
+
253
+ /**
254
+ * Get server object serialization version used by scripts.
255
+ *
256
+ * @group xr_game
257
+ *
258
+ * @returns Script server object version.
259
+ */
260
+ export function script_server_object_version(this: void): u16;
261
+ }
@@ -1,41 +1,41 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class hit
4
- * @customConstructor hit
5
- * @group xr_hit
6
- */
7
- export class hit {
8
- public static readonly burn = 0;
9
- public static readonly chemical_burn = 2;
10
- public static readonly dummy = 12;
11
- public static readonly explosion = 7;
12
- public static readonly fire_wound = 8;
13
- public static readonly light_burn = 11;
14
- public static readonly radiation = 3;
15
- public static readonly shock = 1;
16
- public static readonly strike = 5;
17
- public static readonly telepatic = 4;
18
- public static readonly wound = 6;
19
-
20
- public direction: vector;
21
- public draftsman: game_object | null;
22
- public impulse: f32;
23
- public power: f32;
24
- public type: TXR_hit_type;
25
-
26
- public constructor();
27
- public constructor(hit: hit);
28
-
29
- public bone(bone: string): void;
30
- }
31
-
32
- /**
33
- * @group xr_hit
34
- */
35
- export type TXR_hit_types = typeof hit;
36
-
37
- /**
38
- * @group xr_hit
39
- */
40
- export type TXR_hit_type = EnumeratedStaticsValues<TXR_hit_types>;
41
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * @source C++ class hit
4
+ * @customConstructor hit
5
+ * @group xr_hit
6
+ */
7
+ export class hit {
8
+ public static readonly burn = 0;
9
+ public static readonly chemical_burn = 2;
10
+ public static readonly dummy = 12;
11
+ public static readonly explosion = 7;
12
+ public static readonly fire_wound = 8;
13
+ public static readonly light_burn = 11;
14
+ public static readonly radiation = 3;
15
+ public static readonly shock = 1;
16
+ public static readonly strike = 5;
17
+ public static readonly telepatic = 4;
18
+ public static readonly wound = 6;
19
+
20
+ public direction: vector;
21
+ public draftsman: game_object | null;
22
+ public impulse: f32;
23
+ public power: f32;
24
+ public type: TXR_hit_type;
25
+
26
+ public constructor();
27
+ public constructor(hit: hit);
28
+
29
+ public bone(bone: string): void;
30
+ }
31
+
32
+ /**
33
+ * @group xr_hit
34
+ */
35
+ export type TXR_hit_types = typeof hit;
36
+
37
+ /**
38
+ * @group xr_hit
39
+ */
40
+ export type TXR_hit_type = EnumeratedStaticsValues<TXR_hit_types>;
41
+ }