xray16 1.0.4 → 1.0.7
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.
- package/package.json +1 -1
- package/types/xr_constant.d.ts +20 -0
- package/types/xr_global.d.ts +17 -2
- package/types/xr_lib/xr_fs.d.ts +5 -1
- package/types/xr_lib/xr_utils.d.ts +5 -0
- package/types/xr_object/xr_alife.d.ts +8 -1
- package/types/xr_object/xr_client_object.d.ts +24 -4
- package/types/xr_object/xr_server_object.d.ts +5 -6
package/package.json
CHANGED
package/types/xr_constant.d.ts
CHANGED
|
@@ -64,6 +64,9 @@ declare module "xray16" {
|
|
|
64
64
|
public static readonly detect_anomaly: 11;
|
|
65
65
|
public static readonly get_out_of_anomaly: 10;
|
|
66
66
|
public static readonly property_alife: 3;
|
|
67
|
+
/**
|
|
68
|
+
* Whether object is alive.
|
|
69
|
+
*/
|
|
67
70
|
public static readonly property_alive: 0;
|
|
68
71
|
public static readonly property_already_dead: 2;
|
|
69
72
|
public static readonly property_anomaly: 46;
|
|
@@ -76,6 +79,9 @@ declare module "xray16" {
|
|
|
76
79
|
public static readonly property_danger_in_direction: 39;
|
|
77
80
|
public static readonly property_danger_unknown: 38;
|
|
78
81
|
public static readonly property_dead: 1;
|
|
82
|
+
/**
|
|
83
|
+
* Whether object has any enemy.
|
|
84
|
+
*/
|
|
79
85
|
public static readonly property_enemy: 7;
|
|
80
86
|
public static readonly property_enemy_critically_wounded: 30;
|
|
81
87
|
public static readonly property_enemy_detoured: 21;
|
|
@@ -86,16 +92,30 @@ declare module "xray16" {
|
|
|
86
92
|
public static readonly property_inside_anomaly: 47;
|
|
87
93
|
public static readonly property_item_can_kill: 11;
|
|
88
94
|
public static readonly property_item_to_kill: 9;
|
|
95
|
+
/**
|
|
96
|
+
* Whether object has valuable items to be looted after death.
|
|
97
|
+
*/
|
|
89
98
|
public static readonly property_items: 6;
|
|
90
99
|
public static readonly property_looked_around: 44;
|
|
91
100
|
public static readonly property_looked_out: 19;
|
|
101
|
+
/**
|
|
102
|
+
* Whether object should panic.
|
|
103
|
+
*/
|
|
92
104
|
public static readonly property_panic: 17;
|
|
93
105
|
public static readonly property_position_holded: 20;
|
|
94
106
|
public static readonly property_pure_enemy: 23;
|
|
107
|
+
/**
|
|
108
|
+
* Whether object has solved zone puzzle.
|
|
109
|
+
* Originally alife was different and it was end goal of each stalker.
|
|
110
|
+
* To solve zone puzzle stalkers collected artefacts, did quests etc.
|
|
111
|
+
*/
|
|
95
112
|
public static readonly property_puzzle_solved: 4;
|
|
96
113
|
public static readonly property_ready_to_detour: 14;
|
|
97
114
|
public static readonly property_ready_to_kill: 13;
|
|
98
115
|
public static readonly property_script: 74;
|
|
116
|
+
/**
|
|
117
|
+
* Whether object see enemy.
|
|
118
|
+
*/
|
|
99
119
|
public static readonly property_see_enemy: 15;
|
|
100
120
|
public static readonly property_smart_terrain_task: 5;
|
|
101
121
|
public static readonly property_use_crouch_to_look_out: 24;
|
package/types/xr_global.d.ts
CHANGED
|
@@ -457,8 +457,23 @@ declare module "xray16" {
|
|
|
457
457
|
map_add_object_spot(this: void, id: u16, selector: string, hint: string): void;
|
|
458
458
|
map_add_object_spot_ser(this: void, id: u16, str1: string, str2: string): void;
|
|
459
459
|
map_change_spot_hint(this: void, num: u16, selector: string, hint: string): void;
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
/**
|
|
461
|
+
* Checks if object has map spot registered with provided selector.
|
|
462
|
+
*
|
|
463
|
+
* @param object_id - game object id to check map spot
|
|
464
|
+
* @param spot_type - map spot type (icon type to display for the object)
|
|
465
|
+
* @returns whether object map spot with provided selector is registered
|
|
466
|
+
*/
|
|
467
|
+
map_has_object_spot(this: void, object_id: u16, spot_type: string): u16;
|
|
468
|
+
/**
|
|
469
|
+
* Remove object map spot if it exists.
|
|
470
|
+
* Checks if map spot is registered and then removes it in such case.
|
|
471
|
+
* There is no sense in checking object spot before calling removal since action will be duplicated.
|
|
472
|
+
*
|
|
473
|
+
* @param object_id - game object id to check map spot
|
|
474
|
+
* @param spot_type - map spot type (icon type to display for the object)
|
|
475
|
+
*/
|
|
476
|
+
map_remove_object_spot(this: void, object_id: u16, spot_type: string): void;
|
|
462
477
|
name<T extends string = string>(this: void): T;
|
|
463
478
|
object_by_id(this: void, object_id: u16): game_object | null;
|
|
464
479
|
patrol_path_exists(this: void, path_name: string): boolean;
|
package/types/xr_lib/xr_fs.d.ts
CHANGED
|
@@ -206,7 +206,11 @@ declare module "xray16" {
|
|
|
206
206
|
public w_string(section: string, field: string, string: string, comment?: string): void;
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
|
-
* Get file name of ini file.
|
|
209
|
+
* Get file name and path of ini file.
|
|
210
|
+
*
|
|
211
|
+
* @example `f:\applications\steam\steamapps\common\stalker call of pripyat\gamedata\configs\misc\task_manager.ltx`
|
|
212
|
+
*
|
|
213
|
+
* @returns full path to ini file
|
|
210
214
|
*/
|
|
211
215
|
public fname(): string;
|
|
212
216
|
public set_readonly(is_readonly: boolean): void;
|
|
@@ -219,6 +219,11 @@ declare module "xray16" {
|
|
|
219
219
|
public accessible(value: u32): boolean;
|
|
220
220
|
public accessible(value1: u32, value2: boolean): void;
|
|
221
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Method to iterate over game levels registered in `all.spawn`.
|
|
224
|
+
*
|
|
225
|
+
* @returns level abstract object with every iteration
|
|
226
|
+
*/
|
|
222
227
|
public levels(): LuaIterable<cse_abstract>;
|
|
223
228
|
}
|
|
224
229
|
|
|
@@ -20,7 +20,14 @@ declare module "xray16" {
|
|
|
20
20
|
public has_info(object_id: u16, info_id: string): boolean;
|
|
21
21
|
public iterate_objects(cb: (this: void, object: cse_alife_object) => boolean | void): void;
|
|
22
22
|
public level_id(): u32;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Method to get level name based on level ID.
|
|
25
|
+
* Easy way to get level is to get it by game vertex ID graph or iterate over all levels in graphs.
|
|
26
|
+
*
|
|
27
|
+
* @param level_id - ID of the level
|
|
28
|
+
* @returns level name based on level ID provided
|
|
29
|
+
*/
|
|
30
|
+
public level_name<T extends string = string>(level_id: i32): T;
|
|
24
31
|
public release(cse_abstract: cse_alife_object | null, flag: boolean): void;
|
|
25
32
|
public remove_all_restrictions(value: u16, type: i32 /* enum RestrictionSpace::ERestrictorTypes */): void;
|
|
26
33
|
public remove_in_restriction(monster: cse_alife_monster_abstract, value: u16): void;
|
|
@@ -923,7 +923,7 @@ declare module "xray16" {
|
|
|
923
923
|
public section<T extends string = string>(): T;
|
|
924
924
|
public see(game_object: game_object): boolean;
|
|
925
925
|
public see(value: string): boolean;
|
|
926
|
-
public sell_condition(ini_file: ini_file,
|
|
926
|
+
public sell_condition(ini_file: ini_file, section: string): void;
|
|
927
927
|
public sell_condition(value1: f32, value2: f32): void;
|
|
928
928
|
public set__force(vector: vector, value1: number, value2: number): void;
|
|
929
929
|
public set_actor_relation_flags(value: flags32): void;
|
|
@@ -991,7 +991,7 @@ declare module "xray16" {
|
|
|
991
991
|
public attachable_item_enabled(): boolean;
|
|
992
992
|
public burer_get_force_gravi_attack(): boolean;
|
|
993
993
|
public burer_get_force_anti_aim(): boolean;
|
|
994
|
-
public buy_condition(ini_file: ini_file,
|
|
994
|
+
public buy_condition(ini_file: ini_file, section: string): void;
|
|
995
995
|
public buy_condition(value1: f32, value2: f32): void;
|
|
996
996
|
public change_character_reputation(value: i32): void;
|
|
997
997
|
public change_goodwill(delta_goodwill: i32, to_object: game_object): void;
|
|
@@ -1002,7 +1002,13 @@ declare module "xray16" {
|
|
|
1002
1002
|
public detail_path_type(): unknown;
|
|
1003
1003
|
public disable_show_hide_sounds(value: boolean): void;
|
|
1004
1004
|
public enable_anomaly(): void;
|
|
1005
|
-
|
|
1005
|
+
/**
|
|
1006
|
+
* Method for inventory items to set them enabled / disabled for stalkers.
|
|
1007
|
+
* As result, medkit or detector can be activated by stalker.
|
|
1008
|
+
*
|
|
1009
|
+
* @param is_enabled - whether item should be enabled for usage by owning object
|
|
1010
|
+
*/
|
|
1011
|
+
public enable_attachable_item(is_enabled: boolean): void;
|
|
1006
1012
|
public enable_talk(): void;
|
|
1007
1013
|
public enable_trade(): void;
|
|
1008
1014
|
public enable_vision(value: boolean): void;
|
|
@@ -1137,6 +1143,12 @@ declare module "xray16" {
|
|
|
1137
1143
|
public set_smart_cover_target_fire_no_lookout(): unknown;
|
|
1138
1144
|
public set_sound_mask(value: u32): void;
|
|
1139
1145
|
public set_start_dialog(value: string): void;
|
|
1146
|
+
/**
|
|
1147
|
+
* Set tip text when actor is near and hovering aim over target.
|
|
1148
|
+
* As example, `talk`, `loot` and other kind of labels is possible when using this method.
|
|
1149
|
+
*
|
|
1150
|
+
* @param text - text to set as tip
|
|
1151
|
+
*/
|
|
1140
1152
|
public set_tip_text(text: string): void;
|
|
1141
1153
|
public set_tip_text_default(): void;
|
|
1142
1154
|
public set_trader_global_anim(value: string): void;
|
|
@@ -1217,8 +1229,16 @@ declare module "xray16" {
|
|
|
1217
1229
|
public command(entity_action: entity_action, is_high_priority: boolean): void;
|
|
1218
1230
|
public hit(hit: hit): void;
|
|
1219
1231
|
public inactualize_patrol_path(): void;
|
|
1232
|
+
/**
|
|
1233
|
+
* Iterate over game object inventory.
|
|
1234
|
+
* Runs supplied callback for each item in inventory of the object.
|
|
1235
|
+
* If callback returns `true`, the cycle breaks.
|
|
1236
|
+
*
|
|
1237
|
+
* @param cb - callback to run for each item
|
|
1238
|
+
* @param object - target object to run callback for (actually unused by the engine)
|
|
1239
|
+
*/
|
|
1220
1240
|
public iterate_inventory(
|
|
1221
|
-
cb: (this: void, owner: game_object, item: game_object) => void,
|
|
1241
|
+
cb: (this: void, owner: game_object, item: game_object) => void | boolean,
|
|
1222
1242
|
object: game_object
|
|
1223
1243
|
): void;
|
|
1224
1244
|
public movement_enabled(): boolean;
|
|
@@ -238,7 +238,7 @@ declare module "xray16" {
|
|
|
238
238
|
public g_group(): u8;
|
|
239
239
|
public g_squad(): u8;
|
|
240
240
|
public o_torso(): rotation;
|
|
241
|
-
public on_death(killer:
|
|
241
|
+
public on_death(killer: cse_alife_object): void;
|
|
242
242
|
public smart_terrain_id(): u16;
|
|
243
243
|
public kill(): void;
|
|
244
244
|
public force_set_goodwill(goodwill: number, npc_id: number): void;
|
|
@@ -255,6 +255,10 @@ declare module "xray16" {
|
|
|
255
255
|
public brain(): CAILifeMonsterBrain;
|
|
256
256
|
public has_detector(): boolean;
|
|
257
257
|
public rank(): i32;
|
|
258
|
+
/**
|
|
259
|
+
* @returns object community like `monolith`, `stalker` or `zombied`
|
|
260
|
+
*/
|
|
261
|
+
public community<T extends string>(): T;
|
|
258
262
|
}
|
|
259
263
|
|
|
260
264
|
/**
|
|
@@ -268,10 +272,6 @@ declare module "xray16" {
|
|
|
268
272
|
public profile_name(): string;
|
|
269
273
|
public set_rank(rank: i32): void;
|
|
270
274
|
public reputation(): i32;
|
|
271
|
-
/**
|
|
272
|
-
* @returns object community like `monolith`, `stalker` or `zombied`
|
|
273
|
-
*/
|
|
274
|
-
public community<T extends string>(): T;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
/**
|
|
@@ -639,7 +639,6 @@ declare module "xray16" {
|
|
|
639
639
|
public reputation(): i32;
|
|
640
640
|
public rank(): i32;
|
|
641
641
|
public set_rank(rank: i32): void;
|
|
642
|
-
public community(): string;
|
|
643
642
|
public profile_name(): string;
|
|
644
643
|
public character_name(): string;
|
|
645
644
|
public character_icon(): string;
|