fleethub-core 1.11.17 → 1.11.18

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.
@@ -23,6 +23,33 @@ export interface DamageReport {
23
23
  damage_state_density: Histogram<DamageState, number>;
24
24
  }
25
25
 
26
+ export interface CompAnalyzerConfig {
27
+ engagement: Engagement;
28
+ formation: Formation;
29
+ anti_air_cutin: number | null;
30
+ ship_anti_air_resist: number;
31
+ fleet_anti_air_resist: number;
32
+ left_night_fleet_conditions: NightFleetConditions;
33
+ right_night_fleet_conditions: NightFleetConditions;
34
+ }
35
+
36
+ export interface CompNightAnalysis {
37
+ night_cutin: CompNightCutinAnalysis;
38
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
39
+ }
40
+
41
+ export interface CompDayAnalysis {
42
+ day_cutin: CompDayCutinAnalysis;
43
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
44
+ }
45
+
46
+ export interface CompAnalysis {
47
+ day: CompDayAnalysis;
48
+ night: CompNightAnalysis;
49
+ contact: ContactAnalysis;
50
+ anti_air: CompAntiAirAnalysis;
51
+ }
52
+
26
53
  export type AirSquadronMode = "Sortie" | "AirDefense";
27
54
 
28
55
  export interface AirSquadronState extends GearVecState, SlotSizeVecState {
@@ -39,10 +66,9 @@ export type AirState =
39
66
 
40
67
  export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
41
68
 
42
- export interface ShipConditions extends ShipPosition {
43
- formation?: Formation;
44
- amagiri_index?: number | null;
45
- }
69
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
70
+
71
+ export type Role = "Main" | "Escort";
46
72
 
47
73
  export interface SupportShellingSimulatorParams {
48
74
  attacker_formation?: Formation;
@@ -51,8 +77,6 @@ export interface SupportShellingSimulatorParams {
51
77
  node_state: NodeState;
52
78
  }
53
79
 
54
- export type FhResult<T> = { Ok: T } | { Err: string };
55
-
56
80
  export interface MasterIBonuses {
57
81
  shelling_power: MasterIBonusRule[];
58
82
  shelling_accuracy: MasterIBonusRule[];
@@ -89,6 +113,7 @@ export interface AttackPower {
89
113
  }
90
114
 
91
115
  export interface AttackPowerParams {
116
+ is_cutin: boolean;
92
117
  basic: number;
93
118
  cap: number;
94
119
  precap_mod: AttackPowerModifier;
@@ -98,38 +123,12 @@ export interface AttackPowerParams {
98
123
  proficiency_critical_mod: number;
99
124
  armor_penetration: number;
100
125
  remaining_ammo_mod: number;
126
+ balloon_mod: number;
101
127
  special_enemy_mods: SpecialEnemyModifiers;
102
128
  historical_mod: AttackPowerModifier;
103
129
  custom_mods: CustomPowerModifiers;
104
130
  }
105
131
 
106
- export interface CompAnalyzerConfig {
107
- engagement: Engagement;
108
- formation: Formation;
109
- anti_air_cutin: number | null;
110
- ship_anti_air_resist: number;
111
- fleet_anti_air_resist: number;
112
- left_night_fleet_conditions: NightFleetConditions;
113
- right_night_fleet_conditions: NightFleetConditions;
114
- }
115
-
116
- export interface CompNightAnalysis {
117
- night_cutin: CompNightCutinAnalysis;
118
- fleet_cutin: FleetCutinReport<NightAttackStyle>[];
119
- }
120
-
121
- export interface CompDayAnalysis {
122
- day_cutin: CompDayCutinAnalysis;
123
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
124
- }
125
-
126
- export interface CompAnalysis {
127
- day: CompDayAnalysis;
128
- night: CompNightAnalysis;
129
- contact: ContactAnalysis;
130
- anti_air: CompAntiAirAnalysis;
131
- }
132
-
133
132
  export interface ActionReport<T> {
134
133
  data: Record<string, AttackReport<T>>;
135
134
  damage_state_density: Histogram<DamageState, number> | null;
@@ -185,10 +184,6 @@ export interface NightFleetConditions {
185
184
 
186
185
  export type ContactRank = "Rank1" | "Rank2" | "Rank3";
187
186
 
188
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
189
-
190
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
191
-
192
187
  export interface FleetState {
193
188
  id?: string;
194
189
  len?: number;
@@ -216,21 +211,14 @@ export interface CompMeta {
216
211
  fleets: Record<FleetType, FleetMeta>;
217
212
  }
218
213
 
219
- export type SpecialEnemyType =
220
- | "None"
221
- | "SoftSkinned"
222
- | "Pillbox"
223
- | "IsolatedIsland"
224
- | "SupplyDepot"
225
- | "NewSupplyDepot"
226
- | "HarbourSummerPrincess"
227
- | "PtImp"
228
- | "BattleshipSummerPrincess"
229
- | "HeavyCruiserSummerPrincess"
230
- | "FrenchBattleshipPrincess"
231
- | "AnchorageWaterDemonVacationMode"
232
- | "DockPrincess"
233
- | "SummerAircraftCarrierDemon";
214
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
215
+
216
+ export interface ShipConditions extends ShipPosition {
217
+ formation?: Formation;
218
+ amagiri_index?: number | null;
219
+ }
220
+
221
+ export type FhResult<T> = { Ok: T } | { Err: string };
234
222
 
235
223
  export interface MasterData extends MasterBattleDefinitions {
236
224
  created_at: number;
@@ -253,37 +241,6 @@ export interface MasterAttrRule<T> {
253
241
  expr: CompiledEvaler;
254
242
  }
255
243
 
256
- export interface EquippabilityRule {
257
- ship: CompiledEvaler;
258
- keys?: string[];
259
- include?: string;
260
- exclude?: string;
261
- }
262
-
263
- export interface MasterEquippability {
264
- equip_stype: EquipStype[];
265
- equip_exslot: number[];
266
- equip_ship: MstEquipShip[];
267
- equip_exslot_ship: Record<number, MstEquipExslotShip>;
268
- rules: EquippabilityRule[];
269
- }
270
-
271
- export interface MstEquipExslotShip {
272
- api_ctypes: Record<number, number> | null;
273
- api_ship_ids: Record<number, number> | null;
274
- api_stypes: Record<number, number> | null;
275
- }
276
-
277
- export interface MstEquipShip {
278
- api_ship_id: number;
279
- api_equip_type: number[];
280
- }
281
-
282
- export interface EquipStype {
283
- id: number;
284
- equip_type: number[];
285
- }
286
-
287
244
  export interface MasterBattleDefinitions {
288
245
  formation: NestedFormationDef[];
289
246
  anti_air_cutin: AntiAirCutinDef[];
@@ -335,7 +292,12 @@ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
335
292
  observation_term: number | null;
336
293
  }
337
294
 
338
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
295
+ export interface AttackAnalyzerShipConfig
296
+ extends ShipConditions,
297
+ NightFleetConditions {
298
+ balloons?: number;
299
+ fleet_los_mod?: number | null;
300
+ }
339
301
 
340
302
  export type SingleFormation =
341
303
  | "LineAhead"
@@ -384,8 +346,6 @@ export type GearAttr =
384
346
  | "SemiNightPlane"
385
347
  | "HighAltitudeInterceptor";
386
348
 
387
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
388
-
389
349
  export interface OrgState {
390
350
  id?: string;
391
351
  f1?: FleetState;
@@ -412,55 +372,55 @@ export type OrgType =
412
372
  | "EnemySingle"
413
373
  | "EnemyCombined";
414
374
 
415
- export type Role = "Main" | "Escort";
375
+ export interface EquippabilityRule {
376
+ ship: CompiledEvaler;
377
+ keys?: string[];
378
+ include?: string;
379
+ exclude?: string;
380
+ }
416
381
 
417
- export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
382
+ export interface MasterEquippability {
383
+ equip_stype: EquipStype[];
384
+ equip_exslot: number[];
385
+ equip_ship: MstEquipShip[];
386
+ equip_exslot_ship: Record<number, MstEquipExslotShip>;
387
+ rules: EquippabilityRule[];
388
+ }
418
389
 
419
- export interface SimulatorResult {
420
- items: SimulatorResultItem[];
421
- sunk_vec: [number, number, number][];
390
+ export interface MstEquipExslotShip {
391
+ api_ctypes: Record<number, number> | null;
392
+ api_ship_ids: Record<number, number> | null;
393
+ api_stypes: Record<number, number> | null;
422
394
  }
423
395
 
424
- export interface SimulatorResultItem {
425
- id: string;
426
- fleet_type: FleetType;
427
- index: number;
428
- damage_state_map: Record<DamageState, number>;
396
+ export interface MstEquipShip {
397
+ api_ship_id: number;
398
+ api_equip_type: number[];
429
399
  }
430
400
 
431
- export interface AttackReport<T> {
432
- style: T;
433
- proc_rate: number | null;
434
- attack_power: AttackPower | null;
435
- attack_power_params: AttackPowerParams | null;
436
- hits: number;
437
- hit_rate: HitRate | null;
438
- hit_rate_params: HitRateParams | null;
439
- damage: DamageReport | null;
401
+ export interface EquipStype {
402
+ id: number;
403
+ equip_type: number[];
440
404
  }
441
405
 
442
- export interface AttackAnalyzerShipConfig
443
- extends ShipConditions,
444
- NightFleetConditions {
445
- fleet_los_mod?: number | null;
406
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
407
+ formation?: Formation;
408
+ balloons?: number;
446
409
  }
447
410
 
448
- export interface CompAntiAirAnalysis {
449
- fleet_adjusted_anti_air: number;
450
- ships: AntiAirReport[];
451
- anti_air_cutin_chance: [number, number][];
411
+ export interface NodeAttackAnalyzerConfig {
412
+ air_state?: AirState;
413
+ engagement?: Engagement;
414
+ node_state?: NodeState;
415
+ left?: NodeAttackAnalyzerShipConfig;
416
+ right?: NodeAttackAnalyzerShipConfig;
452
417
  }
453
418
 
454
- export interface AntiAirReport {
455
- ship_id: number;
456
- role: Role;
457
- index: number;
458
- adjusted_anti_air: number | null;
459
- proportional_shotdown_rate: number | null;
460
- fixed_shotdown_number: number | null;
461
- guaranteed: number | null;
462
- anti_air_cutin_chance: [number, number][];
463
- anti_air_propellant_barrage_chance: number | null;
419
+ export interface NodeAttackAnalysis {
420
+ left: AttackAnalysis;
421
+ right: AttackAnalysis;
422
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
423
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
464
424
  }
465
425
 
466
426
  export interface FormationCombatModifiersDef {
@@ -536,6 +496,8 @@ export interface BattleDefinitions {
536
496
  historical_bonuses: HistoricalBonusDef[];
537
497
  }
538
498
 
499
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
500
+
539
501
  export interface ShipPosition {
540
502
  org_type?: OrgType;
541
503
  fleet_type?: FleetType;
@@ -543,6 +505,49 @@ export interface ShipPosition {
543
505
  index?: number;
544
506
  }
545
507
 
508
+ export interface SimulatorResult {
509
+ items: SimulatorResultItem[];
510
+ sunk_vec: [number, number, number][];
511
+ }
512
+
513
+ export interface SimulatorResultItem {
514
+ id: string;
515
+ fleet_type: FleetType;
516
+ index: number;
517
+ damage_state_map: Record<DamageState, number>;
518
+ }
519
+
520
+ export interface ContactAnalysis {
521
+ single: DayContactChance[] | null;
522
+ combined: DayContactChance[] | null;
523
+ }
524
+
525
+ export interface DayContactChance {
526
+ air_state: AirState;
527
+ trigger_rate: number;
528
+ rank3: number;
529
+ rank2: number;
530
+ rank1: number;
531
+ total: number;
532
+ }
533
+
534
+ export type NodeId = string;
535
+
536
+ export interface NodeState {
537
+ map?: number;
538
+ node?: NodeId;
539
+ phase?: number;
540
+ debuff?: boolean;
541
+ disable_historical_mod?: boolean;
542
+ landing_battle?: boolean;
543
+ }
544
+
545
+ export type Side = "Player" | "Enemy";
546
+
547
+ export type Align = "Left" | "Right";
548
+
549
+ export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
550
+
546
551
  export type CompiledEvaler = string;
547
552
 
548
553
  export interface HitRate {
@@ -567,37 +572,33 @@ export interface ShipAnalyzerConfig {
567
572
  right?: AttackAnalyzerShipConfig;
568
573
  }
569
574
 
570
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
571
- formation?: Formation;
572
- }
573
-
574
- export interface NodeAttackAnalyzerConfig {
575
- air_state?: AirState;
576
- engagement?: Engagement;
577
- node_state?: NodeState;
578
- left?: NodeAttackAnalyzerShipConfig;
579
- right?: NodeAttackAnalyzerShipConfig;
580
- }
581
-
582
- export interface NodeAttackAnalysis {
583
- left: AttackAnalysis;
584
- right: AttackAnalysis;
585
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
586
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
575
+ export interface AttackReport<T> {
576
+ style: T;
577
+ proc_rate: number | null;
578
+ attack_power: AttackPower | null;
579
+ attack_power_params: AttackPowerParams | null;
580
+ hits: number;
581
+ hit_rate: HitRate | null;
582
+ hit_rate_params: HitRateParams | null;
583
+ damage: DamageReport | null;
587
584
  }
588
585
 
589
- export interface ContactAnalysis {
590
- single: DayContactChance[] | null;
591
- combined: DayContactChance[] | null;
586
+ export interface CompAntiAirAnalysis {
587
+ fleet_adjusted_anti_air: number;
588
+ ships: AntiAirReport[];
589
+ anti_air_cutin_chance: [number, number][];
592
590
  }
593
591
 
594
- export interface DayContactChance {
595
- air_state: AirState;
596
- trigger_rate: number;
597
- rank3: number;
598
- rank2: number;
599
- rank1: number;
600
- total: number;
592
+ export interface AntiAirReport {
593
+ ship_id: number;
594
+ role: Role;
595
+ index: number;
596
+ adjusted_anti_air: number | null;
597
+ proportional_shotdown_rate: number | null;
598
+ fixed_shotdown_number: number | null;
599
+ guaranteed: number | null;
600
+ anti_air_cutin_chance: [number, number][];
601
+ anti_air_propellant_barrage_chance: number | null;
601
602
  }
602
603
 
603
604
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
@@ -627,20 +628,6 @@ export type NightPhaseAttackType =
627
628
 
628
629
  export type TorpedoAttackType = null;
629
630
 
630
- export type NodeId = string;
631
-
632
- export interface NodeState {
633
- map?: number;
634
- node?: NodeId;
635
- phase?: number;
636
- debuff?: boolean;
637
- disable_historical_mod?: boolean;
638
- }
639
-
640
- export type Side = "Player" | "Enemy";
641
-
642
- export type Align = "Left" | "Right";
643
-
644
631
  export interface MoveShipPayload {
645
632
  current: [string, string, ShipKey];
646
633
  target: [string | null, string, ShipKey];
@@ -745,6 +732,46 @@ export type SlotSizeVec = (number | null)[];
745
732
 
746
733
  export type SpeedGroup = "A" | "B1" | "B2" | "C";
747
734
 
735
+ export type GearVecInput = GearInput[];
736
+
737
+ export interface GearInput {
738
+ gear_id: number;
739
+ types: GearTypeIdArray;
740
+ firepower: number;
741
+ torpedo: number;
742
+ anti_air: number;
743
+ armor: number;
744
+ evasion: number;
745
+ asw: number;
746
+ los: number;
747
+ bombing: number;
748
+ accuracy: number;
749
+ range: number;
750
+ radius: number;
751
+ stars: number;
752
+ ace: number;
753
+ }
754
+
755
+ export interface ShipInput {
756
+ ship_id: number;
757
+ ctype: number;
758
+ stype: number;
759
+ yomi: string;
760
+ }
761
+
762
+ export interface EBonuses {
763
+ firepower: number;
764
+ torpedo: number;
765
+ anti_air: number;
766
+ armor: number;
767
+ evasion: number;
768
+ asw: number;
769
+ los: number;
770
+ bombing: number;
771
+ accuracy: number;
772
+ range: number;
773
+ }
774
+
748
775
  export interface MasterShip {
749
776
  ship_id: number;
750
777
  name: string;
@@ -779,16 +806,17 @@ export interface MasterShip {
779
806
 
780
807
  export type StatInterval = [number | null, number | null];
781
808
 
782
- export interface AttackAnalysis {
783
- attacker_is_player: boolean;
784
- attacker_ship_id: number;
785
- target_ship_id: number;
786
- historical_params: HistoricalParams;
787
- day: ActionReport<DayPhaseAttackStyle>;
788
- night: ActionReport<NightPhaseAttackStyle>;
789
- closing_torpedo: ActionReport<TorpedoAttackStyle>;
790
- opening_asw: ActionReport<AswAttackStyle>;
791
- support_shelling: ActionReport<SupportShellingStyle>;
809
+ export interface FleetCutinReport<T> {
810
+ cutin: FleetCutin;
811
+ rate: number | null;
812
+ formation: Formation;
813
+ attacks: FleetCutinAttackReport<T>[];
814
+ }
815
+
816
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
817
+ index: number;
818
+ ship_id: number;
819
+ power_mod: number;
792
820
  }
793
821
 
794
822
  export type DayCutin =
@@ -930,27 +958,6 @@ export type GearCategory =
930
958
  | "LandBased"
931
959
  | "Misc";
932
960
 
933
- export type ShipAttr =
934
- | "Unknown"
935
- | "NightCarrier"
936
- | "Installation"
937
- | "RoyalNavy"
938
- | "Kai2"
939
- | "TurbineSpeedBonus"
940
- | "NewModelBoilerSpeedBonus"
941
- | "Pillbox"
942
- | "IsolatedIsland"
943
- | "HarbourSummerPrincess"
944
- | "SupplyDepot"
945
- | "NewSupplyDepot"
946
- | "PtImp"
947
- | "BattleshipSummerPrincess"
948
- | "HeavyCruiserSummerPrincess"
949
- | "AnchorageWaterDemonVacationMode"
950
- | "FrenchBattleshipPrincess"
951
- | "DockPrincess"
952
- | "SummerAircraftCarrierDemon";
953
-
954
961
  export type ShipCategory =
955
962
  | "Battleship"
956
963
  | "AircraftCarrier"
@@ -986,58 +993,56 @@ export type ShipType =
986
993
  | "CT"
987
994
  | "AO";
988
995
 
989
- export type GearVecInput = GearInput[];
990
-
991
- export interface GearInput {
992
- gear_id: number;
993
- types: GearTypeIdArray;
994
- firepower: number;
995
- torpedo: number;
996
- anti_air: number;
997
- armor: number;
998
- evasion: number;
999
- asw: number;
1000
- los: number;
1001
- bombing: number;
1002
- accuracy: number;
1003
- range: number;
1004
- radius: number;
1005
- stars: number;
1006
- ace: number;
1007
- }
1008
-
1009
- export interface ShipInput {
1010
- ship_id: number;
1011
- ctype: number;
1012
- stype: number;
1013
- yomi: string;
996
+ export interface AttackAnalysis {
997
+ attacker_is_player: boolean;
998
+ attacker_ship_id: number;
999
+ target_ship_id: number;
1000
+ historical_params: HistoricalParams;
1001
+ day: ActionReport<DayPhaseAttackStyle>;
1002
+ night: ActionReport<NightPhaseAttackStyle>;
1003
+ closing_torpedo: ActionReport<TorpedoAttackStyle>;
1004
+ opening_asw: ActionReport<AswAttackStyle>;
1005
+ support_shelling: ActionReport<SupportShellingStyle>;
1014
1006
  }
1015
1007
 
1016
- export interface EBonuses {
1017
- firepower: number;
1018
- torpedo: number;
1019
- anti_air: number;
1020
- armor: number;
1021
- evasion: number;
1022
- asw: number;
1023
- los: number;
1024
- bombing: number;
1025
- accuracy: number;
1026
- range: number;
1027
- }
1008
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
1028
1009
 
1029
- export interface FleetCutinReport<T> {
1030
- cutin: FleetCutin;
1031
- rate: number | null;
1032
- formation: Formation;
1033
- attacks: FleetCutinAttackReport<T>[];
1034
- }
1010
+ export type ShipAttr =
1011
+ | "Unknown"
1012
+ | "NightCarrier"
1013
+ | "Installation"
1014
+ | "RoyalNavy"
1015
+ | "Kai2"
1016
+ | "TurbineSpeedBonus"
1017
+ | "NewModelBoilerSpeedBonus"
1018
+ | "Pillbox"
1019
+ | "IsolatedIsland"
1020
+ | "HarbourSummerPrincess"
1021
+ | "SupplyDepot"
1022
+ | "NewSupplyDepot"
1023
+ | "PtImp"
1024
+ | "BattleshipSummerPrincess"
1025
+ | "HeavyCruiserSummerPrincess"
1026
+ | "AnchorageWaterDemonVacationMode"
1027
+ | "FrenchBattleshipPrincess"
1028
+ | "DockPrincess"
1029
+ | "SummerAircraftCarrierDemon";
1035
1030
 
1036
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
1037
- index: number;
1038
- ship_id: number;
1039
- power_mod: number;
1040
- }
1031
+ export type SpecialEnemyType =
1032
+ | "None"
1033
+ | "SoftSkinned"
1034
+ | "Pillbox"
1035
+ | "IsolatedIsland"
1036
+ | "SupplyDepot"
1037
+ | "NewSupplyDepot"
1038
+ | "HarbourSummerPrincess"
1039
+ | "PtImp"
1040
+ | "BattleshipSummerPrincess"
1041
+ | "HeavyCruiserSummerPrincess"
1042
+ | "FrenchBattleshipPrincess"
1043
+ | "AnchorageWaterDemonVacationMode"
1044
+ | "DockPrincess"
1045
+ | "SummerAircraftCarrierDemon";
1041
1046
 
1042
1047
  /**
1043
1048
  */
@@ -1234,6 +1239,10 @@ export class Comp {
1234
1239
  * @returns {number | undefined}
1235
1240
  */
1236
1241
  fleet_los_mod(fleet_type: FleetType): number | undefined;
1242
+ /**
1243
+ * @returns {number}
1244
+ */
1245
+ balloons(): number;
1237
1246
  /**
1238
1247
  */
1239
1248
  boss_sup?: Fleet;
@@ -1526,6 +1535,10 @@ export class Gear {
1526
1535
  * @returns {boolean}
1527
1536
  */
1528
1537
  can_be_deployed_to_land_base(): boolean;
1538
+ /**
1539
+ * @returns {boolean}
1540
+ */
1541
+ is_balloon(): boolean;
1529
1542
  /**
1530
1543
  */
1531
1544
  readonly accuracy: number;