xray16 1.3.4 → 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 (84) 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 +2 -2
  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 +1 -1
  35. package/types/index.d.ts +55 -55
  36. package/types/xr_ai/xr_action.d.ts +1802 -510
  37. package/types/xr_ai/xr_alife.d.ts +1870 -566
  38. package/types/xr_ai/xr_enemy_evaluation.d.ts +134 -41
  39. package/types/xr_ai/xr_goap.d.ts +1116 -668
  40. package/types/xr_ai/xr_graph.d.ts +135 -47
  41. package/types/xr_ai/xr_memory.d.ts +382 -148
  42. package/types/xr_lib/xr_animation.d.ts +252 -81
  43. package/types/xr_lib/xr_bitwise.d.ts +44 -21
  44. package/types/xr_lib/xr_color.d.ts +142 -40
  45. package/types/xr_lib/xr_debug.d.ts +181 -77
  46. package/types/xr_lib/xr_dialog.d.ts +132 -40
  47. package/types/xr_lib/xr_flags.d.ts +592 -148
  48. package/types/xr_lib/xr_fs.d.ts +539 -148
  49. package/types/xr_lib/xr_game.d.ts +362 -158
  50. package/types/xr_lib/xr_hit.d.ts +125 -41
  51. package/types/xr_lib/xr_ini.d.ts +473 -188
  52. package/types/xr_lib/xr_level.d.ts +795 -225
  53. package/types/xr_lib/xr_luabind.d.ts +90 -59
  54. package/types/xr_lib/xr_map.d.ts +192 -61
  55. package/types/xr_lib/xr_math.d.ts +871 -233
  56. package/types/xr_lib/xr_multiplayer.d.ts +1079 -351
  57. package/types/xr_lib/xr_profile.d.ts +272 -160
  58. package/types/xr_lib/xr_properties.d.ts +610 -166
  59. package/types/xr_lib/xr_relation.d.ts +231 -84
  60. package/types/xr_lib/xr_render.d.ts +167 -69
  61. package/types/xr_lib/xr_save.d.ts +833 -223
  62. package/types/xr_lib/xr_sound.d.ts +515 -151
  63. package/types/xr_lib/xr_stats.ts +49 -20
  64. package/types/xr_lib/xr_task.d.ts +388 -111
  65. package/types/xr_lib/xr_time.d.ts +177 -61
  66. package/types/xr_lib/xr_type.d.ts +75 -75
  67. package/types/xr_object/client/xr_anomaly.d.ts +70 -50
  68. package/types/xr_object/client/xr_artefact.d.ts +153 -98
  69. package/types/xr_object/client/xr_client_object.d.ts +207 -76
  70. package/types/xr_object/client/xr_creature.d.ts +243 -164
  71. package/types/xr_object/client/xr_item.d.ts +370 -264
  72. package/types/xr_object/client/xr_level.d.ts +753 -285
  73. package/types/xr_object/client/xr_physic.d.ts +644 -214
  74. package/types/xr_object/client/xr_zone.d.ts +85 -47
  75. package/types/xr_object/script/xr_script_interface.d.ts +819 -584
  76. package/types/xr_object/script/xr_script_object.d.ts +5728 -1390
  77. package/types/xr_object/script/xr_script_trade.d.ts +51 -26
  78. package/types/xr_object/server/xr_server_object.d.ts +1486 -792
  79. package/types/xr_ui/xr_ui_asset.d.ts +364 -123
  80. package/types/xr_ui/xr_ui_core.d.ts +424 -97
  81. package/types/xr_ui/xr_ui_event.d.ts +1449 -381
  82. package/types/xr_ui/xr_ui_interface.d.ts +2447 -903
  83. package/types/xr_ui/xr_ui_menu.d.ts +385 -142
  84. package/types/xrf_plugin.d.ts +89 -51
@@ -1,84 +1,231 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class FactionState
4
- * @customConstructor FactionState
5
- * @group xr_relation
6
- */
7
- export class FactionState {
8
- public actor_goodwill: i32;
9
- public bonus: i32;
10
- public faction_id: string;
11
- public icon: string;
12
- public icon_big: string;
13
- public location: string;
14
- public member_count: i32;
15
- public name: string;
16
- public power: f32;
17
- public resource: f32;
18
- public target: string;
19
- public target_desc: string;
20
- public war_state1: string;
21
- public war_state2: string;
22
- public war_state3: string;
23
- public war_state4: string;
24
- public war_state5: string;
25
- public war_state_hint1: string;
26
- public war_state_hint2: string;
27
- public war_state_hint3: string;
28
- public war_state_hint4: string;
29
- public war_state_hint5: string;
30
-
31
- protected constructor();
32
- }
33
-
34
- /**
35
- * @source namespace relation_registry
36
- * @group xr_relation
37
- */
38
- export interface IXR_relation_registry {
39
- /**
40
- * Change relation from community to object by `delta_goodwill`.
41
- */
42
- change_community_goodwill(this: void, from_community: string, to_object_id: i32, delta_goodwill: i32): void;
43
-
44
- community_goodwill(this: void, from_community: string, to_object_id: i32): i32;
45
-
46
- /**
47
- * @returns relation points between communities, usually between `-5000` and `5000`
48
- */
49
- community_relation(this: void, from_community: string, to_community: string): i32;
50
-
51
- /**
52
- * Get relation from object to actor.
53
- * Return formula looks like `personal_goodwill + community_to_obj_goodwill + community_to_community_goodwill`.
54
- *
55
- * @param from_object_id - object from
56
- * @param to_object_id - object to
57
- * @returns general goodwill from object to another object based on personal and community goodwill
58
- */
59
- get_general_goodwill_between(this: void, from_object_id: u16, to_object_id: u16): i32;
60
-
61
- set_community_goodwill(this: void, from_community: string, to_object_id: i32, goodwill: i32): void;
62
-
63
- set_community_relation(this: void, from_community: string, to_community: string, goodwill: i32): void;
64
- }
65
-
66
- /**
67
- * @group xr_relation
68
- */
69
- export const relation_registry: IXR_relation_registry;
70
-
71
- /**
72
- * Enumeration of relations.
73
- *
74
- * eRelationTypeFriend - 0
75
- * eRelationTypeNeutral - 1
76
- * eRelationTypeEnemy - 2
77
- * eRelationTypeWorstEnemy - 3
78
- * eRelationTypeLast - 4
79
- * eRelationTypeDummy - -1
80
- *
81
- * @group xr_relation
82
- */
83
- export type TXR_relation = 0 | 1 | 2 | 3;
84
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Faction state shown by faction-war UI scripts.
4
+ *
5
+ * @source C++ class FactionState
6
+ * @customConstructor FactionState
7
+ * @group xr_relation
8
+ *
9
+ * @remarks
10
+ * This is a mutable data object filled by faction-war UI scripts. War state slots are fixed to five entries.
11
+ */
12
+ export class FactionState {
13
+ /**
14
+ * Current goodwill from this faction to the actor.
15
+ */
16
+ public actor_goodwill: i32;
17
+
18
+ /**
19
+ * Faction bonus level or id.
20
+ */
21
+ public bonus: i32;
22
+
23
+ /**
24
+ * Faction community id.
25
+ */
26
+ public faction_id: string;
27
+
28
+ /**
29
+ * Small faction icon texture.
30
+ */
31
+ public icon: string;
32
+
33
+ /**
34
+ * Large faction icon texture.
35
+ */
36
+ public icon_big: string;
37
+
38
+ /**
39
+ * Current faction map location.
40
+ */
41
+ public location: string;
42
+
43
+ /**
44
+ * Number of faction members.
45
+ */
46
+ public member_count: i32;
47
+
48
+ /**
49
+ * Localized faction name or string table id.
50
+ */
51
+ public name: string;
52
+
53
+ /**
54
+ * Faction combat power.
55
+ */
56
+ public power: f32;
57
+
58
+ /**
59
+ * Faction resource amount.
60
+ */
61
+ public resource: f32;
62
+
63
+ /**
64
+ * Current faction target.
65
+ */
66
+ public target: string;
67
+
68
+ /**
69
+ * Description of the current faction target.
70
+ */
71
+ public target_desc: string;
72
+
73
+ /**
74
+ * First faction war state line.
75
+ */
76
+ public war_state1: string;
77
+
78
+ /**
79
+ * Second faction war state line.
80
+ */
81
+ public war_state2: string;
82
+
83
+ /**
84
+ * Third faction war state line.
85
+ */
86
+ public war_state3: string;
87
+
88
+ /**
89
+ * Fourth faction war state line.
90
+ */
91
+ public war_state4: string;
92
+
93
+ /**
94
+ * Fifth faction war state line.
95
+ */
96
+ public war_state5: string;
97
+
98
+ /**
99
+ * Hint for the first faction war state line.
100
+ */
101
+ public war_state_hint1: string;
102
+
103
+ /**
104
+ * Hint for the second faction war state line.
105
+ */
106
+ public war_state_hint2: string;
107
+
108
+ /**
109
+ * Hint for the third faction war state line.
110
+ */
111
+ public war_state_hint3: string;
112
+
113
+ /**
114
+ * Hint for the fourth faction war state line.
115
+ */
116
+ public war_state_hint4: string;
117
+
118
+ /**
119
+ * Hint for the fifth faction war state line.
120
+ */
121
+ public war_state_hint5: string;
122
+
123
+ /**
124
+ * Engine-created faction state.
125
+ */
126
+ protected constructor();
127
+ }
128
+
129
+ /**
130
+ * @source namespace relation_registry
131
+ * @group xr_relation
132
+ *
133
+ * @remarks
134
+ * Community ids are resolved through the engine community registry. Invalid names follow the native registry rules.
135
+ */
136
+ export interface IXR_relation_registry {
137
+ /**
138
+ * Change relation from community to object by `delta_goodwill`.
139
+ *
140
+ * @remarks
141
+ * Applies the delta to the current goodwill, then clamps the result to `community_goodwill_limits`.
142
+ *
143
+ * @param from_community - Source community id.
144
+ * @param to_object_id - Target object id.
145
+ * @param delta_goodwill - Goodwill delta to apply.
146
+ */
147
+ change_community_goodwill(this: void, from_community: string, to_object_id: i32, delta_goodwill: i32): void;
148
+
149
+ /**
150
+ * Get goodwill from a community to an object.
151
+ *
152
+ * @remarks
153
+ * Returns neutral goodwill when no explicit community-to-object value is stored.
154
+ *
155
+ * @param from_community - Source community id.
156
+ * @param to_object_id - Target object id.
157
+ * @returns Stored community goodwill.
158
+ */
159
+ community_goodwill(this: void, from_community: string, to_object_id: i32): i32;
160
+
161
+ /**
162
+ * Get relation between two communities.
163
+ *
164
+ * @remarks
165
+ * Reads the global community relation matrix, not per-object goodwill.
166
+ *
167
+ * @param from_community - Source community id.
168
+ * @param to_community - Target community id.
169
+ * @returns Relation points between communities, usually between `-5000` and `5000`.
170
+ */
171
+ community_relation(this: void, from_community: string, to_community: string): i32;
172
+
173
+ /**
174
+ * Get relation from object to actor.
175
+ * Return formula looks like `personal_goodwill + community_to_obj_goodwill + community_to_community_goodwill`.
176
+ *
177
+ * @remarks
178
+ * Both object ids must resolve to ALife trader objects. Non-trader objects log a script error and return `0`.
179
+ *
180
+ * @param from_object_id - Object from.
181
+ * @param to_object_id - Object to.
182
+ * @returns General goodwill from object to another object based on personal and community goodwill.
183
+ */
184
+ get_general_goodwill_between(this: void, from_object_id: u16, to_object_id: u16): i32;
185
+
186
+ /**
187
+ * Set goodwill from a community to an object.
188
+ *
189
+ * @remarks
190
+ * The engine clamps the stored value to `community_goodwill_limits`.
191
+ *
192
+ * @param from_community - Source community id.
193
+ * @param to_object_id - Target object id.
194
+ * @param goodwill - New goodwill value.
195
+ */
196
+ set_community_goodwill(this: void, from_community: string, to_object_id: i32, goodwill: i32): void;
197
+
198
+ /**
199
+ * Set relation between two communities.
200
+ *
201
+ * @remarks
202
+ * Updates the global community relation matrix.
203
+ *
204
+ * @param from_community - Source community id.
205
+ * @param to_community - Target community id.
206
+ * @param goodwill - New community relation value.
207
+ */
208
+ set_community_relation(this: void, from_community: string, to_community: string, goodwill: i32): void;
209
+ }
210
+
211
+ /**
212
+ * Global relation registry helpers.
213
+ *
214
+ * @group xr_relation
215
+ */
216
+ export const relation_registry: IXR_relation_registry;
217
+
218
+ /**
219
+ * Enumeration of relations.
220
+ *
221
+ * ERelationTypeFriend - 0
222
+ * eRelationTypeNeutral - 1
223
+ * eRelationTypeEnemy - 2
224
+ * eRelationTypeWorstEnemy - 3
225
+ * eRelationTypeLast - 4
226
+ * eRelationTypeDummy - -1.
227
+ *
228
+ * @group xr_relation
229
+ */
230
+ export type TXR_relation = 0 | 1 | 2 | 3;
231
+ }
@@ -1,69 +1,167 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class render_device
4
- * @customConstructor render_device
5
- * @group xr_render
6
- */
7
- export class render_device {
8
- private constructor();
9
-
10
- public readonly cam_dir: vector;
11
- public readonly cam_pos: vector;
12
- public readonly cam_right: vector;
13
- public readonly cam_top: vector;
14
- public readonly aspect_ratio: f32;
15
- public readonly fov: f32;
16
- public readonly precache_frame: u32;
17
- public readonly frame: u32;
18
- public readonly height: u32;
19
- public readonly time_delta: u32;
20
- public readonly f_time_delta: f32;
21
- public readonly width: u32;
22
-
23
- /**
24
- * Get current game timestamp.
25
- *
26
- * @example `29319`,`46297`
27
- * @returns milliseconds from game start
28
- */
29
- public time_global(): u32;
30
-
31
- /**
32
- * @returns whether game is paused
33
- */
34
- public is_paused(): boolean;
35
-
36
- /**
37
- * Change game pause state.
38
- *
39
- * @param paused - whether game should be paused
40
- */
41
- public pause(paused: boolean): void;
42
- }
43
-
44
- /**
45
- * @group xr_render
46
- */
47
- export function device(this: void): render_device;
48
-
49
- /**
50
- * @group xr_render
51
- */
52
- export function app_ready(this: void): boolean;
53
-
54
- /**
55
- * @group xr_render
56
- */
57
- export function xrRender_test_r2_hw(this: void): boolean;
58
-
59
- /**
60
- * @group xr_render
61
- */
62
- export function render_get_dx_level(this: void): number;
63
-
64
- /**
65
- * @group xr_global_declaration
66
- * @returns whether renderer setting can be changed
67
- */
68
- export function renderer_allow_override(this: void): boolean;
69
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Current render device state.
4
+ *
5
+ * @source C++ class render_device
6
+ * @customConstructor render_device
7
+ * @group xr_render
8
+ *
9
+ * @remarks
10
+ * Values are snapshots of the global engine `Device` for the current frame.
11
+ */
12
+ export class render_device {
13
+ /**
14
+ * Engine-owned render device state.
15
+ */
16
+ private constructor();
17
+
18
+ /**
19
+ * Camera forward direction.
20
+ */
21
+ public readonly cam_dir: vector;
22
+
23
+ /**
24
+ * Camera world position.
25
+ */
26
+ public readonly cam_pos: vector;
27
+
28
+ /**
29
+ * Camera right direction.
30
+ */
31
+ public readonly cam_right: vector;
32
+
33
+ /**
34
+ * Camera up direction.
35
+ */
36
+ public readonly cam_top: vector;
37
+
38
+ /**
39
+ * Current viewport aspect ratio.
40
+ */
41
+ public readonly aspect_ratio: f32;
42
+
43
+ /**
44
+ * Current field of view.
45
+ */
46
+ public readonly fov: f32;
47
+
48
+ /**
49
+ * Remaining precache frame count.
50
+ */
51
+ public readonly precache_frame: u32;
52
+
53
+ /**
54
+ * Current render frame number.
55
+ */
56
+ public readonly frame: u32;
57
+
58
+ /**
59
+ * Backbuffer height in pixels.
60
+ */
61
+ public readonly height: u32;
62
+
63
+ /**
64
+ * Last frame time delta in milliseconds.
65
+ *
66
+ * @remarks
67
+ * This value is `0` while the game timer is paused.
68
+ */
69
+ public readonly time_delta: u32;
70
+
71
+ /**
72
+ * Last frame time delta in seconds.
73
+ *
74
+ * @remarks
75
+ * This value is `0` while the game timer is paused.
76
+ */
77
+ public readonly f_time_delta: f32;
78
+
79
+ /**
80
+ * Backbuffer width in pixels.
81
+ */
82
+ public readonly width: u32;
83
+
84
+ /**
85
+ * Get current game timestamp.
86
+ *
87
+ * @remarks
88
+ * Reads the frame-updated `Device.dwTimeGlobal` value.
89
+ *
90
+ * @example `29319`, `46297`
91
+ *
92
+ * @returns Milliseconds from game start.
93
+ */
94
+ public time_global(): u32;
95
+
96
+ /**
97
+ * Check whether the render device is paused.
98
+ *
99
+ * @returns Whether game rendering is paused.
100
+ */
101
+ public is_paused(): boolean;
102
+
103
+ /**
104
+ * Change game pause state.
105
+ *
106
+ * @remarks
107
+ * Pauses the game timer but not sound emitters. Dedicated servers and benchmark mode ignore pause requests.
108
+ *
109
+ * @param paused - Whether the game should be paused.
110
+ */
111
+ public pause(paused: boolean): void;
112
+ }
113
+
114
+ /**
115
+ * Get the global render device.
116
+ *
117
+ * @group xr_render
118
+ *
119
+ * @remarks
120
+ * Returns the engine-owned `Device` singleton.
121
+ *
122
+ * @returns Render device.
123
+ */
124
+ export function device(this: void): render_device;
125
+
126
+ /**
127
+ * Check whether the game persistent state finished loading.
128
+ *
129
+ * @group xr_render
130
+ *
131
+ * @returns Whether the app is ready for gameplay/render logic.
132
+ */
133
+ export function app_ready(this: void): boolean;
134
+
135
+ /**
136
+ * Check whether R2 renderer hardware support is available.
137
+ *
138
+ * @group xr_render
139
+ *
140
+ * @remarks
141
+ * In this binding the hardware test always returns `true`.
142
+ *
143
+ * @returns Whether R2 hardware test passes.
144
+ */
145
+ export function xrRender_test_r2_hw(this: void): boolean;
146
+
147
+ /**
148
+ * Get active renderer feature level.
149
+ *
150
+ * @group xr_render
151
+ *
152
+ * @returns Renderer DX level.
153
+ */
154
+ export function render_get_dx_level(this: void): number;
155
+
156
+ /**
157
+ * Check whether renderer setting can be changed at runtime.
158
+ *
159
+ * @group xr_global_declaration
160
+ *
161
+ * @remarks
162
+ * Returns `false` after the renderer command is locked by command-line or config processing.
163
+ *
164
+ * @returns Whether renderer setting can be changed.
165
+ */
166
+ export function renderer_allow_override(this: void): boolean;
167
+ }