xray16 1.0.12 → 1.0.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xray16",
3
- "version": "1.0.12",
3
+ "version": "1.0.15",
4
4
  "author": "Neloreck",
5
5
  "repository": "https://github.com/stalker-xrts/xray-16-types",
6
6
  "private": false,
@@ -55,7 +55,7 @@ declare module "xray16" {
55
55
 
56
56
  public spawn_id(value: u32): u16;
57
57
 
58
- public story_object(value: u32): cse_alife_object;
58
+ public story_object(value: u32): cse_alife_object | null;
59
59
 
60
60
  /**
61
61
  * @returns alife server-client switch distance
@@ -135,12 +135,12 @@ declare module "xray16" {
135
135
  /**
136
136
  * @group xr_game
137
137
  */
138
- export function set_start_position(position: vector): void;
138
+ export function set_start_position(this: void, position: vector): void;
139
139
 
140
140
  /**
141
141
  * @group xr_game
142
142
  */
143
- export function set_start_game_vertex_id(gvid: i32): void;
143
+ export function set_start_game_vertex_id(this: void, gvid: i32): void;
144
144
 
145
145
  /**
146
146
  * @group xr_game
@@ -164,6 +164,8 @@ declare module "xray16" {
164
164
 
165
165
  /**
166
166
  * 4 todo;
167
+ *
168
+ * Works with script_zone objects.
167
169
  */
168
170
  public set_callback<T extends AnyObject>(
169
171
  type: TXR_callbacks["zone_enter"],
@@ -173,6 +175,8 @@ declare module "xray16" {
173
175
 
174
176
  /**
175
177
  * 4 todo;
178
+ *
179
+ * Works with script_zone objects.
176
180
  */
177
181
  public set_callback<T extends AnyObject>(
178
182
  type: TXR_callbacks["zone_exit"],
@@ -78,7 +78,7 @@ declare module "xray16" {
78
78
  local_animation: boolean
79
79
  ): void;
80
80
 
81
- public action(): entity_action;
81
+ public action(): entity_action | null;
82
82
 
83
83
  public action_count(): u32;
84
84
 
@@ -739,9 +739,9 @@ declare module "xray16" {
739
739
  */
740
740
  public info_clear(): void;
741
741
 
742
- public inside(vector: vector): boolean;
742
+ public inside(position: vector): boolean;
743
743
 
744
- public inside(vector: vector, value: number /* ? */): boolean;
744
+ public inside(position: vector, epsilon: f32): boolean;
745
745
 
746
746
  public inv_box_can_take_status(): boolean;
747
747
 
@@ -875,10 +875,55 @@ declare module "xray16" {
875
875
 
876
876
  public switch_to_upgrade(): void;
877
877
 
878
+ // For weapons / outfits:
879
+
880
+ /**
881
+ * @param upgrade_section - section of upgrade to check
882
+ * @returns whether upgrade can be added
883
+ */
884
+ public can_add_upgrade(upgrade_section: string): boolean;
885
+
886
+ /**
887
+ * @param upgrade_section - section of upgrade to check
888
+ * @returns whether upgrade can be installed
889
+ */
890
+ public can_install_upgrade(upgrade_section: string): boolean;
891
+
892
+ /**
893
+ * @param upgrade_section - section of upgrade to check
894
+ * @returns whether upgrade is installed
895
+ */
878
896
  public has_upgrade(upgrade_section: string): boolean;
879
897
 
898
+ /**
899
+ * @param upgrade_group_section - section of upgrade group to check
900
+ * @returns whether upgrade group is installed
901
+ */
902
+ public has_upgrade_group(upgrade_group_section: string): boolean;
903
+
904
+ /**
905
+ * @param upgrade_section - section of upgrade to check parent group
906
+ * @returns whether upgrade parent group is installed
907
+ */
908
+ public has_upgrade_group_by_upgrade_id(upgrade_section: string): boolean;
909
+
910
+ /**
911
+ * @param upgrade_section - section of upgrade to add
912
+ * @returns whether upgrade is installed successfully or not
913
+ */
914
+ public add_upgrade(upgrade_section: string): boolean;
915
+
916
+ /**
917
+ * @param upgrade_section - section of upgrade to install
918
+ * @returns whether upgrade is installed successfully or not
919
+ */
880
920
  public install_upgrade(upgrade_section: string): boolean;
881
921
 
922
+ /**
923
+ * Iterate over all item upgrades.
924
+ *
925
+ * @param callback - callback to call on each iteration to check installed upgrades
926
+ */
882
927
  public iterate_installed_upgrades(callback: (upgrade_section: string, object: game_object) => void): void;
883
928
 
884
929
  public target_body_state(): TXR_move;