xray16 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/types/xr_ai/xr_action.d.ts +1321 -29
  3. package/types/xr_ai/xr_alife.d.ts +1336 -32
  4. package/types/xr_ai/xr_enemy_evaluation.d.ts +112 -19
  5. package/types/xr_ai/xr_goap.d.ts +450 -3
  6. package/types/xr_ai/xr_graph.d.ts +94 -6
  7. package/types/xr_ai/xr_memory.d.ts +240 -6
  8. package/types/xr_lib/xr_animation.d.ts +185 -14
  9. package/types/xr_lib/xr_bitwise.d.ts +20 -8
  10. package/types/xr_lib/xr_color.d.ts +103 -6
  11. package/types/xr_lib/xr_debug.d.ts +110 -12
  12. package/types/xr_lib/xr_dialog.d.ts +99 -7
  13. package/types/xr_lib/xr_flags.d.ts +78 -15
  14. package/types/xr_lib/xr_fs.d.ts +395 -5
  15. package/types/xr_lib/xr_game.d.ts +101 -0
  16. package/types/xr_lib/xr_hit.d.ts +84 -0
  17. package/types/xr_lib/xr_ini.d.ts +60 -2
  18. package/types/xr_lib/xr_level.d.ts +182 -39
  19. package/types/xr_lib/xr_luabind.d.ts +37 -11
  20. package/types/xr_lib/xr_map.d.ts +137 -6
  21. package/types/xr_lib/xr_math.d.ts +56 -0
  22. package/types/xr_lib/xr_multiplayer.d.ts +729 -1
  23. package/types/xr_lib/xr_profile.d.ts +80 -0
  24. package/types/xr_lib/xr_properties.d.ts +159 -4
  25. package/types/xr_lib/xr_relation.d.ts +147 -0
  26. package/types/xr_lib/xr_render.d.ts +99 -3
  27. package/types/xr_lib/xr_save.d.ts +110 -4
  28. package/types/xr_lib/xr_sound.d.ts +373 -9
  29. package/types/xr_lib/xr_stats.ts +33 -4
  30. package/types/xr_lib/xr_task.d.ts +277 -0
  31. package/types/xr_lib/xr_time.d.ts +11 -0
  32. package/types/xr_object/client/xr_anomaly.d.ts +20 -0
  33. package/types/xr_object/client/xr_artefact.d.ts +57 -2
  34. package/types/xr_object/client/xr_client_object.d.ts +131 -0
  35. package/types/xr_object/client/xr_creature.d.ts +79 -0
  36. package/types/xr_object/client/xr_item.d.ts +108 -2
  37. package/types/xr_object/client/xr_level.d.ts +482 -14
  38. package/types/xr_object/client/xr_physic.d.ts +459 -29
  39. package/types/xr_object/client/xr_zone.d.ts +38 -0
  40. package/types/xr_object/script/xr_script_interface.d.ts +236 -1
  41. package/types/xr_object/script/xr_script_object.d.ts +3402 -82
  42. package/types/xr_object/script/xr_script_trade.d.ts +25 -15
  43. package/types/xr_object/server/xr_server_object.d.ts +707 -15
  44. package/types/xr_ui/xr_ui_asset.d.ts +241 -6
  45. package/types/xr_ui/xr_ui_core.d.ts +327 -9
  46. package/types/xr_ui/xr_ui_event.d.ts +1067 -1
  47. package/types/xr_ui/xr_ui_interface.d.ts +1563 -17
  48. package/types/xr_ui/xr_ui_menu.d.ts +259 -16
  49. package/types/xrf_plugin.d.ts +44 -14
@@ -1,81 +1,252 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Post-process double-vision offsets.
4
+ *
3
5
  * @source C++ class duality
4
6
  * @customConstructor duality
5
7
  * @group xr_animation
8
+ *
9
+ * @remarks
10
+ * These values are accumulated when several post-process effectors are active.
6
11
  */
7
12
  export class duality {
13
+ /**
14
+ * Vertical duality amount.
15
+ */
8
16
  public v: f32;
17
+
18
+ /**
19
+ * Horizontal duality amount.
20
+ */
9
21
  public h: f32;
10
22
 
23
+ /**
24
+ * Create zeroed duality settings.
25
+ */
11
26
  public constructor();
12
- public constructor(v: f32, h: f32);
13
27
 
14
- public set(v: f32, h: f32): duality;
28
+ /**
29
+ * Create duality settings with both offsets.
30
+ *
31
+ * @param h - Horizontal duality amount.
32
+ * @param v - Vertical duality amount.
33
+ */
34
+ public constructor(h: f32, v: f32);
35
+
36
+ /**
37
+ * Set both duality values.
38
+ *
39
+ * @param h - Horizontal duality amount.
40
+ * @param v - Vertical duality amount.
41
+ * @returns This object for chained setup.
42
+ */
43
+ public set(h: f32, v: f32): duality;
15
44
  }
16
45
 
17
46
  /**
47
+ * Post-process noise settings.
48
+ *
18
49
  * @source C++ class noise
19
50
  * @customConstructor noise
20
51
  * @group xr_animation
52
+ *
53
+ * @remarks
54
+ * Combined effectors keep the maximum intensity, grain, and FPS values.
21
55
  */
22
56
  export class noise {
57
+ /**
58
+ * Noise frame rate.
59
+ */
23
60
  public fps: f32;
61
+
62
+ /**
63
+ * Noise grain size.
64
+ */
24
65
  public grain: f32;
66
+
67
+ /**
68
+ * Noise intensity.
69
+ */
25
70
  public intensity: f32;
26
71
 
72
+ /**
73
+ * Create default noise settings.
74
+ *
75
+ * @remarks
76
+ * Defaults are intensity 0, grain 1, and 10 FPS.
77
+ */
27
78
  public constructor();
28
- public constructor(fps: f32, grain: f32, intensity: f32);
29
79
 
30
- public set(fps: f32, grain: f32, intensity: f32): noise;
80
+ /**
81
+ * Create noise settings with all values.
82
+ *
83
+ * @param intensity - Noise intensity.
84
+ * @param grain - Noise grain size.
85
+ * @param fps - Noise frame rate.
86
+ */
87
+ public constructor(intensity: f32, grain: f32, fps: f32);
88
+
89
+ /**
90
+ * Set all noise values.
91
+ *
92
+ * @param intensity - Noise intensity.
93
+ * @param grain - Noise grain size.
94
+ * @param fps - Noise frame rate.
95
+ * @returns This object for chained setup.
96
+ */
97
+ public set(intensity: f32, grain: f32, fps: f32): noise;
31
98
  }
32
99
 
33
100
  /**
101
+ * Script-controlled post-process effector.
102
+ *
34
103
  * @source C++ class effector
35
104
  * @customConstructor effector
36
105
  * @group xr_animation
106
+ *
107
+ * @remarks
108
+ * Subclass it from script and override {@link process}. The effector is tied to the actor camera stack.
37
109
  */
38
110
  export class effector extends EngineBinding {
39
- public constructor(int: i32, float: f32);
40
-
111
+ /**
112
+ * @remarks
113
+ * Use a stable custom type id. {@link finish} removes the active effector by this type.
114
+ *
115
+ * @param type - Unique post-process effector type id.
116
+ * @param time - Effector lifetime in seconds.
117
+ */
118
+ public constructor(type: i32, time: f32);
119
+
120
+ /**
121
+ * Add the effector to the actor camera stack.
122
+ *
123
+ * @remarks
124
+ * Requires an active actor. This is intended for in-game actor post-processing, not menu/editor code.
125
+ */
41
126
  public start(): void;
42
127
 
43
- public process(effector_params: effector_params): boolean;
44
-
128
+ /**
129
+ * Update post-process parameters for the current frame.
130
+ *
131
+ * @remarks
132
+ * Override this in script. Mutate `params` for the current frame and return `false` to stop the effector.
133
+ *
134
+ * @param params - Mutable post-process parameters.
135
+ * @returns Whether the effector should continue running.
136
+ */
137
+ public process(params: effector_params): boolean;
138
+
139
+ /**
140
+ * Remove the effector from the actor camera stack.
141
+ *
142
+ * @remarks
143
+ * Removes by effector type, so sharing a type id with another active effector can remove the wrong effect.
144
+ */
45
145
  public finish(): void;
46
146
  }
47
147
 
48
148
  /**
149
+ * Mutable post-process state passed to effectors.
150
+ *
49
151
  * @source C++ class effector_params
50
152
  * @customConstructor effector_params
51
153
  * @group xr_animation
154
+ *
155
+ * @remarks
156
+ * Defaults match the neutral post-process state: no blur, gray, duality, or noise intensity.
52
157
  */
53
158
  export class effector_params extends EngineBinding {
159
+ /**
160
+ * Additive color applied over the frame.
161
+ */
54
162
  public color_add: color;
163
+
164
+ /**
165
+ * Base color tint.
166
+ */
55
167
  public color_base: color;
168
+
169
+ /**
170
+ * Grayscale color tint.
171
+ */
56
172
  public color_gray: color;
173
+
174
+ /**
175
+ * Double-vision settings.
176
+ */
57
177
  public dual: duality;
178
+
179
+ /**
180
+ * Blur amount.
181
+ */
58
182
  public blur: f32;
183
+
184
+ /**
185
+ * Grayscale amount.
186
+ */
59
187
  public gray: f32;
188
+
189
+ /**
190
+ * Noise settings.
191
+ */
60
192
  public noise: noise;
61
193
 
194
+ /**
195
+ * Create default post-process parameters.
196
+ */
62
197
  public constructor();
63
198
 
64
- public assign(effector_params: effector_params): void;
199
+ /**
200
+ * Copy all post-process values from another params object.
201
+ *
202
+ * @remarks
203
+ * Copies the current values. Later changes to `params` are not linked back to this object.
204
+ *
205
+ * @param params - Source values.
206
+ */
207
+ public assign(params: effector_params): void;
65
208
  }
66
209
 
67
210
  /**
211
+ * Evaluate a color animation by time.
212
+ *
68
213
  * @source C++ class color_animator
69
214
  * @customConstructor color_animator
70
215
  * @group xr_animation
216
+ *
217
+ * @remarks
218
+ * Animations are looked up in the loaded light-animation library (`lanims.xr`).
71
219
  */
72
220
  export class color_animator extends EngineBinding {
73
- public constructor(value: string);
74
-
221
+ /**
222
+ * @param name - Color animation name.
223
+ */
224
+ public constructor(name: string);
225
+
226
+ /**
227
+ * @returns Animation length in milliseconds.
228
+ */
75
229
  public length(): u32;
76
230
 
77
- public load(value: string): void;
78
-
79
- public calculate(value: f32): fcolor;
231
+ /**
232
+ * Load another color animation.
233
+ *
234
+ * @remarks
235
+ * The native binding asserts when the animation name is missing or unknown.
236
+ *
237
+ * @param name - Color animation name.
238
+ */
239
+ public load(name: string): void;
240
+
241
+ /**
242
+ * Sample the animation.
243
+ *
244
+ * @remarks
245
+ * Time wraps over the animation length.
246
+ *
247
+ * @param time - Animation time in seconds.
248
+ * @returns Color at the requested time.
249
+ */
250
+ public calculate(time: f32): fcolor;
80
251
  }
81
252
  }
@@ -1,32 +1,44 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Apply bitwise AND to two signed integers.
4
+ *
3
5
  * @group xr_bitwise
4
6
  *
5
- * @param left
6
- * @param right
7
+ * @param left - Left operand.
8
+ * @param right - Right operand.
9
+ * @returns Result of `left & right`.
7
10
  */
8
11
  export function bit_and(this: void, left: i32, right: i32): i32;
9
12
 
10
13
  /**
14
+ * Apply bitwise OR to two signed integers.
15
+ *
11
16
  * @group xr_bitwise
12
17
  *
13
- * @param first
14
- * @param second
18
+ * @param left - Left operand.
19
+ * @param right - Right operand.
20
+ * @returns Result of `left | right`.
15
21
  */
16
- export function bit_or(this: void, first: i32, second: i32): i32;
22
+ export function bit_or(this: void, left: i32, right: i32): i32;
17
23
 
18
24
  /**
25
+ * Invert all bits in a signed integer.
26
+ *
19
27
  * @group xr_bitwise
20
28
  *
21
- * @param value
29
+ * @param value - Value to invert.
30
+ * @returns Result of `~value`.
22
31
  */
23
32
  export function bit_not(this: void, value: i32): i32;
24
33
 
25
34
  /**
35
+ * Apply bitwise XOR to two signed integers.
36
+ *
26
37
  * @group xr_bitwise
27
38
  *
28
- * @param left
29
- * @param right
39
+ * @param left - Left operand.
40
+ * @param right - Right operand.
41
+ * @returns Result of `left ^ right`.
30
42
  */
31
43
  export function bit_xor(this: void, left: i32, right: i32): i32;
32
44
  }
@@ -1,45 +1,142 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Mutable RGBA color with float components.
4
+ *
5
+ * Components are exposed as `r`, `g`, `b`, and `a`.
6
+ *
3
7
  * @source C++ class fcolor
4
8
  * @customConstructor fcolor
5
9
  * @group xr_color
10
+ *
11
+ * @remarks
12
+ * Float components are normally used in the `0..1` range. `set()` mutates this color and returns it.
6
13
  */
7
14
  export class fcolor extends EngineBinding {
15
+ /**
16
+ * Alpha component.
17
+ */
8
18
  public a: f32;
19
+
20
+ /**
21
+ * Blue component.
22
+ */
9
23
  public b: f32;
24
+
25
+ /**
26
+ * Green component.
27
+ */
10
28
  public g: f32;
29
+
30
+ /**
31
+ * Red component.
32
+ */
11
33
  public r: f32;
12
34
 
13
- public set(a: f32, b: f32, c: f32, d: f32): fcolor;
35
+ /**
36
+ * Create an empty color.
37
+ *
38
+ * @remarks
39
+ * Call `set()` before reading components when you need a known value.
40
+ */
41
+ public constructor();
42
+
43
+ /**
44
+ * Set RGBA components.
45
+ *
46
+ * @param r - Red component.
47
+ * @param g - Green component.
48
+ * @param b - Blue component.
49
+ * @param a - Alpha component.
50
+ * @returns This color.
51
+ */
52
+ public set(r: f32, g: f32, b: f32, a: f32): fcolor;
14
53
 
15
- public set(it: fcolor): fcolor;
54
+ /**
55
+ * Copy another float color.
56
+ *
57
+ * @param color - Source color.
58
+ * @returns This color.
59
+ */
60
+ public set(color: fcolor): fcolor;
16
61
 
62
+ /**
63
+ * Decode packed ARGB color into float components.
64
+ *
65
+ * @remarks
66
+ * Channels are decoded from 8-bit ARGB into normalized float components.
67
+ *
68
+ * @param value - Packed ARGB value.
69
+ * @returns This color.
70
+ */
17
71
  public set(value: u32): fcolor;
18
72
  }
19
73
 
20
74
  /**
75
+ * Mutable RGB color with float components.
76
+ *
21
77
  * @source C++ class color
22
78
  * @customConstructor color
23
79
  * @group xr_color
80
+ *
81
+ * @remarks
82
+ * This is the postprocess RGB color helper used by effector parameters. It has no alpha channel.
24
83
  */
25
84
  export class color {
85
+ /**
86
+ * Blue component.
87
+ */
26
88
  public b: f32;
89
+
90
+ /**
91
+ * Green component.
92
+ */
27
93
  public g: f32;
94
+
95
+ /**
96
+ * Red component.
97
+ */
28
98
  public r: f32;
29
99
 
100
+ /**
101
+ * Create a black color.
102
+ *
103
+ * @remarks
104
+ * Use the RGB constructor or `set()` when you need explicit component values.
105
+ */
30
106
  public constructor();
107
+
108
+ /**
109
+ * Create color from RGB components.
110
+ *
111
+ * @param r - Red component.
112
+ * @param g - Green component.
113
+ * @param b - Blue component.
114
+ */
31
115
  public constructor(r: f32, g: f32, b: f32);
32
116
 
117
+ /**
118
+ * Set RGB components.
119
+ *
120
+ * @param r - Red component.
121
+ * @param g - Green component.
122
+ * @param b - Blue component.
123
+ */
33
124
  public set(r: f32, g: f32, b: f32): void;
34
125
  }
35
126
 
36
127
  /**
128
+ * Pack alpha, red, green, and blue channels into an engine color value.
129
+ *
37
130
  * @group xr_color
38
131
  *
39
- * @param a
40
- * @param r
41
- * @param g
42
- * @param b
132
+ * @remarks
133
+ * Channels are packed as 8-bit ARGB. Values outside `0..255` keep only their low 8 bits.
134
+ *
135
+ * @param a - Alpha channel.
136
+ * @param r - Red channel.
137
+ * @param g - Green channel.
138
+ * @param b - Blue channel.
139
+ * @returns Packed ARGB color.
43
140
  */
44
141
  export function GetARGB(this: void, a: u16, r: u16, g: u16, b: u16): i32;
45
142
  }
@@ -1,83 +1,181 @@
1
1
  declare module "xray16" {
2
2
  /**
3
+ * Engine console interface.
4
+ *
3
5
  * @source C++ class CConsole
4
6
  * @customConstructor CConsole
5
7
  * @group xr_debug
8
+ *
9
+ * @remarks
10
+ * Use `get_console()` to access the engine-owned console. Scripts do not create console instances.
6
11
  */
7
12
  export class CConsole extends EngineBinding {
13
+ /**
14
+ * Engine-owned console singleton.
15
+ */
8
16
  private constructor();
9
17
 
18
+ /**
19
+ * Execute console command immediately.
20
+ *
21
+ * @remarks
22
+ * Executes without adding the command to console history.
23
+ *
24
+ * @param command - Console command.
25
+ */
10
26
  public execute(command: string): void;
11
27
 
28
+ /**
29
+ * Queue console command for deferred execution.
30
+ *
31
+ * @remarks
32
+ * Schedules a `KERNEL:console` event, so the command runs later on the engine event queue.
33
+ *
34
+ * @param command - Console command.
35
+ */
12
36
  public execute_deferred(command: string): void;
13
37
 
38
+ /**
39
+ * Execute a config file through the console.
40
+ *
41
+ * @remarks
42
+ * The binding prepends `cfg_load` to the provided path.
43
+ *
44
+ * @param script - Config file path.
45
+ */
14
46
  public execute_script(script: string): void;
15
47
 
48
+ /**
49
+ * Show the console window.
50
+ */
16
51
  public show(): void;
17
52
 
53
+ /**
54
+ * Hide the console window.
55
+ */
18
56
  public hide(): void;
19
57
 
58
+ /**
59
+ * Read console variable as boolean.
60
+ *
61
+ * @remarks
62
+ * Returns `false` when the command is missing or is not a boolean-compatible mask/integer command.
63
+ *
64
+ * @param key - Console variable name.
65
+ * @returns Boolean value.
66
+ */
20
67
  public get_bool(key: string): boolean;
21
68
 
69
+ /**
70
+ * Read console variable as float.
71
+ *
72
+ * @remarks
73
+ * Returns `0` when the command is missing or is not a float command.
74
+ *
75
+ * @param key - Console variable name.
76
+ * @returns Float value.
77
+ */
22
78
  public get_float(key: string): f32;
23
79
 
80
+ /**
81
+ * Read console variable as integer.
82
+ *
83
+ * @remarks
84
+ * Mask commands are returned as `0` or `1`. Missing or incompatible commands return `0`.
85
+ *
86
+ * @param key - Console variable name.
87
+ * @returns Integer value.
88
+ */
24
89
  public get_integer(key: string): i32;
25
90
 
26
- public get_string(key: string): string;
27
-
28
- public get_token(key: string): string;
91
+ /**
92
+ * Read console variable as string.
93
+ *
94
+ * @remarks
95
+ * Returns `null` when the command does not exist.
96
+ *
97
+ * @param key - Console variable name.
98
+ * @returns String value.
99
+ */
100
+ public get_string(key: string): string | null;
101
+
102
+ /**
103
+ * Read console variable token text.
104
+ *
105
+ * @remarks
106
+ * Uses the same engine path as `get_string`, so missing commands return `null`.
107
+ *
108
+ * @param key - Console variable name.
109
+ * @returns Token text.
110
+ */
111
+ public get_token(key: string): string | null;
29
112
  }
30
113
 
31
114
  /**
32
- * Log formatted message in game console and log file.
33
- * Resulting message looks like "[LUA] %s", where message is provided text parameter.
34
- *
35
- * Note: text length is limited and supplying too long value will crash the game. Todo: check exact limit..
115
+ * Log a message through the script log channel.
36
116
  *
37
117
  * @group xr_debug
38
118
  *
39
- * @param text - String to print.
119
+ * @remarks
120
+ * In non-master builds the message is sent to `CScriptEngine::script_log`.
121
+ *
122
+ * @param text - Message to print.
40
123
  */
41
124
  export function log(this: void, text: string): void;
42
125
 
43
126
  /**
127
+ * Log an error message and print the current script stack.
128
+ *
44
129
  * @group xr_debug
45
130
  *
46
- * @param text
131
+ * @remarks
132
+ * The C++ binding asserts after logging the message.
133
+ *
134
+ * @param text - Error message.
47
135
  */
48
136
  export function error_log(this: void, text: string): void;
49
137
 
50
138
  /**
139
+ * Print the current script stack to the log.
140
+ *
51
141
  * @group xr_debug
52
142
  */
53
143
  export function print_stack(this: void): void;
54
144
 
55
145
  /**
146
+ * Flush pending script log output in debug builds.
147
+ *
56
148
  * @group xr_debug
57
149
  */
58
150
  export function flush(this: void): void;
59
151
 
60
152
  /**
61
153
  * Get console object reference.
62
- * Allows flushing logs / executing commands / getting global engine variables.
63
154
  *
64
155
  * @group xr_debug
65
156
  *
157
+ * @remarks
158
+ * Returns the global engine console pointer.
159
+ *
66
160
  * @returns Console object reference.
67
161
  */
68
162
  export function get_console(this: void): CConsole;
69
163
 
70
164
  /**
165
+ * Get process command-line parameters.
166
+ *
71
167
  * @group xr_debug
168
+ *
169
+ * @returns Engine command-line string.
72
170
  */
73
171
  export function command_line(this: void): string;
74
172
 
75
173
  /**
76
- * Prefetch provided script before executing next lines.
174
+ * Load and compile a script before continuing execution.
77
175
  *
78
176
  * @group xr_global_declaration
79
177
  *
80
- * @param path
178
+ * @param path - Script file path.
81
179
  */
82
180
  export function prefetch(this: void, path: string): void;
83
181
  }