fleethub-core 1.3.1 → 1.3.2

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.
@@ -1,30 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * @param {Gear} gear
5
- * @returns {boolean}
6
- */
7
- export function air_squadron_can_equip(gear: Gear): boolean;
8
- /**
9
- * @param {OrgType} org_type
10
- * @returns {boolean}
11
- */
12
- export function org_type_is_single(org_type: OrgType): boolean;
13
- /**
14
- * @param {OrgType} org_type
15
- * @returns {Formation}
16
- */
17
- export function org_type_default_formation(org_type: OrgType): Formation;
18
- /**
19
- * @param {OrgType} org_type
20
- * @returns {boolean}
21
- */
22
- export function org_type_is_player(org_type: OrgType): boolean;
23
- /**
24
- * @param {OrgType} org_type
25
- * @returns {Side}
26
- */
27
- export function org_type_side(org_type: OrgType): Side;
28
3
  /**
29
4
  */
30
5
  export function set_panic_hook(): void;
@@ -63,6 +38,18 @@ export type DamageInfo = {
63
38
  damage_state_map: NumMap<DamageState, number>;
64
39
  };
65
40
 
41
+ export type NumMap<K, V> = Partial<Record<K, V>>;
42
+
43
+ export type OrgType =
44
+ | "Single"
45
+ | "CarrierTaskForce"
46
+ | "SurfaceTaskForce"
47
+ | "TransportEscort"
48
+ | "EnemySingle"
49
+ | "EnemyCombined";
50
+
51
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
52
+
66
53
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
67
54
 
68
55
  export type SimulatorResult = {
@@ -77,60 +64,6 @@ export type SimulatorResultItem = {
77
64
  damage_state_map: Record<DamageState, number>;
78
65
  };
79
66
 
80
- export type FleetNightCutinRateInfo = {
81
- night_contact_chance: NightContactChance;
82
- ships: ShipNightCutinRateInfo[];
83
- };
84
-
85
- export type ShipNightCutinRateInfo = {
86
- ship_id: number;
87
- normal: NightCutinRateInfo;
88
- chuuha: NightCutinRateInfo;
89
- };
90
-
91
- export type NightCutinRateInfo = {
92
- cutin_term: number | null;
93
- rates: [NightCutin | null, number | null][];
94
- };
95
-
96
- export type NightContactChance = {
97
- rank1: number;
98
- rank2: number;
99
- rank3: number;
100
- total: number;
101
- };
102
-
103
- export type NumMap<K, V> = Partial<Record<K, V>>;
104
-
105
- export type CompMeta = { fleets: Record<FleetType, FleetMeta> };
106
-
107
- export type FleetMeta = {
108
- id: string;
109
- len: number;
110
- ships: [string, ShipMeta | null][];
111
- };
112
-
113
- export type ShipMeta = { id: string; ship_id: number };
114
-
115
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
116
-
117
- export type WarfareContext = {
118
- attacker_env: WarfareShipEnvironment;
119
- target_env: WarfareShipEnvironment;
120
- engagement: Engagement;
121
- air_state: AirState;
122
- custom_mods: CustomModifiers;
123
- };
124
-
125
- export type WarfareShipEnvironment = {
126
- org_type: OrgType;
127
- role: Role;
128
- ship_index: number;
129
- fleet_len: number;
130
- formation: Formation;
131
- fleet_los_mod: number | null;
132
- };
133
-
134
67
  export type AswAttackType = "DepthCharge" | "Aircraft";
135
68
 
136
69
  export type MasterData = {
@@ -204,7 +137,7 @@ export type MasterIBonuses = {
204
137
  defense_power: MasterIBonusRule[];
205
138
  contact_selection: MasterIBonusRule[];
206
139
  fighter_power: MasterIBonusRule[];
207
- adjusted_anti_air: MasterIBonusRule[];
140
+ ship_anti_air: MasterIBonusRule[];
208
141
  fleet_anti_air: MasterIBonusRule[];
209
142
  elos: MasterIBonusRule[];
210
143
  };
@@ -236,7 +169,7 @@ export type MasterGear = {
236
169
  radius?: number;
237
170
  cost?: number;
238
171
  improvable?: boolean;
239
- adjusted_anti_air_resistance?: number;
172
+ ship_anti_air_resistance?: number;
240
173
  fleet_anti_air_resistance?: number;
241
174
  };
242
175
 
@@ -332,6 +265,18 @@ export type ShipAttr =
332
265
  | "BattleshipSummerPrincess"
333
266
  | "HeavyCruiserSummerPrincess";
334
267
 
268
+ export type Role = "Main" | "Escort";
269
+
270
+ export type CompMeta = { fleets: Record<FleetType, FleetMeta> };
271
+
272
+ export type FleetMeta = {
273
+ id: string;
274
+ len: number;
275
+ ships: [string, ShipMeta | null][];
276
+ };
277
+
278
+ export type ShipMeta = { id: string; ship_id: number };
279
+
335
280
  export type GearAttr =
336
281
  | "Abyssal"
337
282
  | "HighAngleMount"
@@ -362,6 +307,23 @@ export type GearAttr =
362
307
  | "SemiNightPlane"
363
308
  | "HighAltitudeInterceptor";
364
309
 
310
+ export type WarfareContext = {
311
+ attacker_env: WarfareShipEnvironment;
312
+ target_env: WarfareShipEnvironment;
313
+ engagement: Engagement;
314
+ air_state: AirState;
315
+ custom_mods: CustomModifiers;
316
+ };
317
+
318
+ export type WarfareShipEnvironment = {
319
+ org_type: OrgType;
320
+ role: Role;
321
+ ship_index: number;
322
+ fleet_len: number;
323
+ formation: Formation;
324
+ fleet_los_mod: number | null;
325
+ };
326
+
365
327
  export type ShipType =
366
328
  | "Unknown"
367
329
  | "DE"
@@ -517,107 +479,28 @@ export type SpecialEnemyModifiers = {
517
479
 
518
480
  export type AttackPowerModifier = { a: number; b: number };
519
481
 
520
- export type GearState = {
521
- id?: string;
522
- gear_id: number;
523
- exp?: number;
524
- stars?: number;
525
- };
526
-
527
- export type ShipState = {
528
- id?: string;
529
- ship_id: number;
530
- level?: number;
531
- current_hp?: number;
532
- morale?: number;
533
- ammo?: number;
534
- fuel?: number;
535
- max_hp_mod?: number;
536
- firepower_mod?: number;
537
- torpedo_mod?: number;
538
- armor_mod?: number;
539
- anti_air_mod?: number;
540
- evasion_mod?: number;
541
- asw_mod?: number;
542
- los_mod?: number;
543
- luck_mod?: number;
544
- g1?: GearState;
545
- g2?: GearState;
546
- g3?: GearState;
547
- g4?: GearState;
548
- g5?: GearState;
549
- gx?: GearState;
550
- ss1?: number;
551
- ss2?: number;
552
- ss3?: number;
553
- ss4?: number;
554
- ss5?: number;
555
- };
482
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
556
483
 
557
- export type FleetState = {
558
- id?: string;
559
- len?: number;
560
- s1?: ShipState;
561
- s2?: ShipState;
562
- s3?: ShipState;
563
- s4?: ShipState;
564
- s5?: ShipState;
565
- s6?: ShipState;
566
- s7?: ShipState;
484
+ export type FleetCutinAnalysis = {
485
+ shelling: FleetCutinInfo[];
486
+ night: FleetCutinInfo[];
567
487
  };
568
488
 
569
- export type AirSquadronMode = "Sortie" | "AirDefense";
570
-
571
- export type AirSquadronState = {
572
- id?: string;
573
- mode?: AirSquadronMode;
574
- g1?: GearState;
575
- g2?: GearState;
576
- g3?: GearState;
577
- g4?: GearState;
578
- g5?: GearState;
579
- gx?: GearState;
580
- ss1?: number;
581
- ss2?: number;
582
- ss3?: number;
583
- ss4?: number;
584
- ss5?: number;
489
+ export type FleetCutinInfo = {
490
+ cutin: FleetCutin;
491
+ formation: Formation;
492
+ items: FleetCutinInfoItem[];
585
493
  };
586
494
 
587
- export type Side = "Player" | "Enemy";
588
-
589
- export type OrgType =
590
- | "Single"
591
- | "CarrierTaskForce"
592
- | "SurfaceTaskForce"
593
- | "TransportEscort"
594
- | "EnemySingle"
595
- | "EnemyCombined";
596
-
597
- export type Role = "Main" | "Escort";
598
-
599
- export type OrgState = {
600
- id?: string;
601
- f1?: FleetState;
602
- f2?: FleetState;
603
- f3?: FleetState;
604
- f4?: FleetState;
605
- a1?: AirSquadronState;
606
- a2?: AirSquadronState;
607
- a3?: AirSquadronState;
608
- hq_level?: number;
609
- org_type?: OrgType;
610
- sortie?: string;
611
- route_sup?: string;
612
- boss_sup?: string;
495
+ export type FleetCutinInfoItem = {
496
+ ship_id: number;
497
+ cutin: FleetCutin;
498
+ fleet_cutin_mod: number;
499
+ stats: AttackStats;
613
500
  };
614
501
 
615
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
616
-
617
- export type ShipStateMap = Record<ShipKey, ShipState>;
618
-
619
502
  export type CompAntiAirInfo = {
620
- fleet_anti_air: number;
503
+ fleet_adjusted_anti_air: number;
621
504
  ships: ShipAntiAirInfo[];
622
505
  anti_air_cutin_chance: [number, number][];
623
506
  };
@@ -627,11 +510,28 @@ export type ShipAntiAirInfo = {
627
510
  adjusted_anti_air: number | null;
628
511
  proportional_shotdown_rate: number | null;
629
512
  fixed_shotdown_number: number | null;
630
- minimum_bonus: number | null;
513
+ guaranteed: number | null;
631
514
  anti_air_cutin_chance: [number, number][];
632
515
  anti_air_propellant_barrage_chance: number | null;
633
516
  };
634
517
 
518
+ export type CompContactChanceInfo = {
519
+ single: AirstrikeContactChance[] | null;
520
+ combined: AirstrikeContactChance[] | null;
521
+ };
522
+
523
+ export type AirstrikeContactChance = {
524
+ air_state: AirState;
525
+ trigger_rate: number;
526
+ rank3: number;
527
+ rank2: number;
528
+ rank1: number;
529
+ total: number;
530
+ };
531
+
532
+ import * as bindings from "../bindings";
533
+ export * from "../bindings";
534
+
635
535
  export type Formation = SingleFormation | CombinedFormation;
636
536
 
637
537
  export type CombinedFormation =
@@ -648,8 +548,6 @@ export type SingleFormation =
648
548
  | "LineAbreast"
649
549
  | "Vanguard";
650
550
 
651
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
652
-
653
551
  export type ShellingAttackType = "Normal" | "Carrier";
654
552
 
655
553
  export type NightBattleAttackType =
@@ -660,24 +558,6 @@ export type DayBattleAttackType =
660
558
  | { t: "Shelling"; c: ShellingAttackType }
661
559
  | { t: "Asw"; c: AswAttackType };
662
560
 
663
- export type FleetCutinAnalysis = {
664
- shelling: FleetCutinInfo[];
665
- night: FleetCutinInfo[];
666
- };
667
-
668
- export type FleetCutinInfo = {
669
- cutin: FleetCutin;
670
- formation: Formation;
671
- items: FleetCutinInfoItem[];
672
- };
673
-
674
- export type FleetCutinInfoItem = {
675
- ship_id: number;
676
- cutin: FleetCutin;
677
- fleet_cutin_mod: number;
678
- stats: AttackStats;
679
- };
680
-
681
561
  export type AttackInfo<AttackType, Cutin> = {
682
562
  attack_type: AttackType;
683
563
  items: AttackInfoItem<Cutin>[];
@@ -699,47 +579,94 @@ export type AttackStats = {
699
579
  damage: DamageInfo | null;
700
580
  };
701
581
 
702
- export type CompContactChanceInfo = {
703
- single: AirstrikeContactChance[] | null;
704
- combined: AirstrikeContactChance[] | null;
705
- };
582
+ export type SlotSizeVec = (number | null)[];
706
583
 
707
- export type AirstrikeContactChance = {
708
- air_state: AirState;
709
- trigger_rate: number;
710
- rank3: number;
711
- rank2: number;
712
- rank1: number;
713
- total: number;
584
+ export type ShipStateMap = Record<ShipKey, ShipState>;
585
+
586
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
587
+
588
+ export type OrgState = {
589
+ id?: string;
590
+ f1?: FleetState;
591
+ f2?: FleetState;
592
+ f3?: FleetState;
593
+ f4?: FleetState;
594
+ a1?: AirSquadronState;
595
+ a2?: AirSquadronState;
596
+ a3?: AirSquadronState;
597
+ hq_level?: number;
598
+ org_type?: OrgType;
599
+ sortie?: string;
600
+ route_sup?: string;
601
+ boss_sup?: string;
714
602
  };
715
603
 
716
- import * as bindings from "../bindings";
717
- export * from "../bindings";
604
+ export type AirSquadronState = {
605
+ id?: string;
606
+ mode?: AirSquadronMode;
607
+ g1?: GearState;
608
+ g2?: GearState;
609
+ g3?: GearState;
610
+ g4?: GearState;
611
+ g5?: GearState;
612
+ gx?: GearState;
613
+ ss1?: number;
614
+ ss2?: number;
615
+ ss3?: number;
616
+ ss4?: number;
617
+ ss5?: number;
618
+ };
718
619
 
719
- export type SlotSizeVec = (number | null)[];
620
+ export type AirSquadronMode = "Sortie" | "AirDefense";
720
621
 
721
- export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
622
+ export type FleetState = {
623
+ id?: string;
624
+ len?: number;
625
+ s1?: ShipState;
626
+ s2?: ShipState;
627
+ s3?: ShipState;
628
+ s4?: ShipState;
629
+ s5?: ShipState;
630
+ s6?: ShipState;
631
+ s7?: ShipState;
632
+ };
722
633
 
723
- export type NightSpecialAttack =
724
- | { NightCutin: NightCutin }
725
- | { FleetCutin: FleetCutin };
634
+ export type ShipState = {
635
+ id?: string;
636
+ ship_id: number;
637
+ level?: number;
638
+ current_hp?: number;
639
+ morale?: number;
640
+ ammo?: number;
641
+ fuel?: number;
642
+ max_hp_mod?: number;
643
+ firepower_mod?: number;
644
+ torpedo_mod?: number;
645
+ armor_mod?: number;
646
+ anti_air_mod?: number;
647
+ evasion_mod?: number;
648
+ asw_mod?: number;
649
+ los_mod?: number;
650
+ luck_mod?: number;
651
+ g1?: GearState;
652
+ g2?: GearState;
653
+ g3?: GearState;
654
+ g4?: GearState;
655
+ g5?: GearState;
656
+ gx?: GearState;
657
+ ss1?: number;
658
+ ss2?: number;
659
+ ss3?: number;
660
+ ss4?: number;
661
+ ss5?: number;
662
+ };
726
663
 
727
- export type NightCutin =
728
- | "MainTorpRadar"
729
- | "TorpLookoutRadar"
730
- | "TorpTsloTorp"
731
- | "TorpTsloDrum"
732
- | "DoubleAttack"
733
- | "TorpTorpMain"
734
- | "TorpTorpTorp"
735
- | "MainMainSec"
736
- | "MainMainMain"
737
- | "SubTorpTorp"
738
- | "SubRadarTorp"
739
- | "Cvci1_25"
740
- | "Cvci1_20"
741
- | "Cvci1_18"
742
- | "Photobomber";
664
+ export type GearState = {
665
+ id?: string;
666
+ gear_id: number;
667
+ exp?: number;
668
+ stars?: number;
669
+ };
743
670
 
744
671
  export type HitRate = { total: number; normal: number; critical: number };
745
672
 
@@ -778,6 +705,8 @@ export type WarfareAnalyzerShipEnvironment = {
778
705
  custom_mods: CustomModifiers;
779
706
  };
780
707
 
708
+ export type Side = "Player" | "Enemy";
709
+
781
710
  export type SpecialEnemyType =
782
711
  | "None"
783
712
  | "SoftSkinned"
@@ -795,6 +724,29 @@ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
795
724
 
796
725
  export type SpeedGroup = "A" | "B1" | "B2" | "C";
797
726
 
727
+ export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
728
+
729
+ export type NightSpecialAttack =
730
+ | { NightCutin: NightCutin }
731
+ | { FleetCutin: FleetCutin };
732
+
733
+ export type NightCutin =
734
+ | "MainTorpRadar"
735
+ | "TorpLookoutRadar"
736
+ | "TorpTsloTorp"
737
+ | "TorpTsloDrum"
738
+ | "DoubleAttack"
739
+ | "TorpTorpMain"
740
+ | "TorpTorpTorp"
741
+ | "MainMainSec"
742
+ | "MainMainMain"
743
+ | "SubTorpTorp"
744
+ | "SubRadarTorp"
745
+ | "Cvci1_25"
746
+ | "Cvci1_20"
747
+ | "Cvci1_18"
748
+ | "Photobomber";
749
+
798
750
  export type FleetCutin =
799
751
  | "NelsonTouch"
800
752
  | "NagatoCutin"
@@ -828,7 +780,7 @@ export type AntiAirCutinDef = {
828
780
  id: number;
829
781
  chance_numer: number | null;
830
782
  multiplier: number | null;
831
- minimum_bonus: number | null;
783
+ guaranteed: number | null;
832
784
  sequential: boolean | null;
833
785
  };
834
786
 
@@ -853,6 +805,29 @@ export type FormationWarfareDef = {
853
805
  evasion_mod: number | null;
854
806
  };
855
807
 
808
+ export type FleetNightCutinRateInfo = {
809
+ night_contact_chance: NightContactChance;
810
+ ships: ShipNightCutinRateInfo[];
811
+ };
812
+
813
+ export type ShipNightCutinRateInfo = {
814
+ ship_id: number;
815
+ normal: NightCutinRateInfo;
816
+ chuuha: NightCutinRateInfo;
817
+ };
818
+
819
+ export type NightCutinRateInfo = {
820
+ cutin_term: number | null;
821
+ rates: [NightCutin | null, number | null][];
822
+ };
823
+
824
+ export type NightContactChance = {
825
+ rank1: number;
826
+ rank2: number;
827
+ rank3: number;
828
+ total: number;
829
+ };
830
+
856
831
  /**
857
832
  */
858
833
  export class AirSquadron {
@@ -862,11 +837,6 @@ export class AirSquadron {
862
837
  * @returns {Gear | undefined}
863
838
  */
864
839
  get_gear(key: string): Gear | undefined;
865
- /**
866
- * @param {Gear} gear
867
- * @returns {boolean}
868
- */
869
- can_equip(gear: Gear): boolean;
870
840
  /**
871
841
  * @param {number} index
872
842
  * @returns {number}
@@ -907,7 +877,7 @@ export class Analyzer {
907
877
  /**
908
878
  * @param {Comp} comp
909
879
  * @param {Formation} formation
910
- * @param {number} adjusted_anti_air_resist
880
+ * @param {number} ship_anti_air_resist
911
881
  * @param {number} fleet_anti_air_resist
912
882
  * @param {number | undefined} aaci
913
883
  * @returns {CompAntiAirInfo}
@@ -915,7 +885,7 @@ export class Analyzer {
915
885
  analyze_anti_air(
916
886
  comp: Comp,
917
887
  formation: Formation,
918
- adjusted_anti_air_resist: number,
888
+ ship_anti_air_resist: number,
919
889
  fleet_anti_air_resist: number,
920
890
  aaci?: number
921
891
  ): CompAntiAirInfo;
@@ -1009,11 +979,11 @@ export class Comp {
1009
979
  */
1010
980
  default_formation(): Formation;
1011
981
  /**
1012
- * 艦隊対空値
982
+ * 艦隊防空値
1013
983
  * @param {number} formation_mod
1014
984
  * @returns {number}
1015
985
  */
1016
- fleet_anti_air(formation_mod: number): number;
986
+ adjusted_anti_air(formation_mod: number): number;
1017
987
  /**
1018
988
  * 制空値
1019
989
  * @param {boolean} escort_participates
@@ -1281,11 +1251,11 @@ export class Gear {
1281
1251
  /**
1282
1252
  * @returns {number}
1283
1253
  */
1284
- fleet_anti_air(): number;
1254
+ fleet_anti_air_mod(): number;
1285
1255
  /**
1286
1256
  * @returns {number}
1287
1257
  */
1288
- adjusted_anti_air(): number;
1258
+ ship_anti_air_mod(): number;
1289
1259
  /**
1290
1260
  * @param {number} slot_size
1291
1261
  * @returns {number}
@@ -1331,6 +1301,10 @@ export class Gear {
1331
1301
  * @returns {number}
1332
1302
  */
1333
1303
  expedition_bonus(): number;
1304
+ /**
1305
+ * @returns {boolean}
1306
+ */
1307
+ can_be_deployed_to_land_base(): boolean;
1334
1308
  /**
1335
1309
  */
1336
1310
  accuracy: number;
@@ -1338,9 +1312,6 @@ export class Gear {
1338
1312
  * @returns {number}
1339
1313
  */
1340
1314
  readonly ace: number;
1341
- /**
1342
- */
1343
- adjusted_anti_air_resistance: number;
1344
1315
  /**
1345
1316
  */
1346
1317
  anti_air: number;
@@ -1417,6 +1388,9 @@ export class Gear {
1417
1388
  /**
1418
1389
  */
1419
1390
  range: number;
1391
+ /**
1392
+ */
1393
+ ship_anti_air_resistance: number;
1420
1394
  /**
1421
1395
  * @returns {number}
1422
1396
  */
@@ -1441,9 +1415,6 @@ export class Gear {
1441
1415
  */
1442
1416
  export class IBonuses {
1443
1417
  free(): void;
1444
- /**
1445
- */
1446
- adjusted_anti_air: number;
1447
1418
  /**
1448
1419
  */
1449
1420
  asw_accuracy: number;
@@ -1480,6 +1451,9 @@ export class IBonuses {
1480
1451
  /**
1481
1452
  */
1482
1453
  shelling_power: number;
1454
+ /**
1455
+ */
1456
+ ship_anti_air: number;
1483
1457
  /**
1484
1458
  */
1485
1459
  torpedo_accuracy: number;
@@ -1781,7 +1755,7 @@ export class Ship {
1781
1755
  /**
1782
1756
  * @returns {number}
1783
1757
  */
1784
- fleet_anti_air(): number;
1758
+ fleet_anti_air_mod(): number;
1785
1759
  /**
1786
1760
  * @returns {number}
1787
1761
  */