fleethub-core 1.11.5 → 1.11.6

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,13 +1,19 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ */
5
+ export function set_panic_hook(): void;
3
6
  /**
4
7
  * @param {ShipConditions} value
5
8
  * @returns {ShipConditions}
6
9
  */
7
10
  export function parse_ship_conditions(value: ShipConditions): ShipConditions;
8
- /**
9
- */
10
- export function set_panic_hook(): void;
11
+ export interface SupportShellingSimulatorParams {
12
+ attacker_formation?: Formation;
13
+ target_formation?: Formation;
14
+ engagement: Engagement;
15
+ }
16
+
11
17
  export interface AttackPower {
12
18
  precap: number;
13
19
  is_capped: boolean;
@@ -33,66 +39,27 @@ export interface AttackPowerParams {
33
39
  custom_mods: CustomPowerModifiers;
34
40
  }
35
41
 
36
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
37
- formation?: Formation;
38
- }
39
-
40
- export interface NodeAttackAnalyzerConfig {
41
- air_state?: AirState;
42
- engagement?: Engagement;
43
- node_state?: NodeState;
44
- left?: NodeAttackAnalyzerShipConfig;
45
- right?: NodeAttackAnalyzerShipConfig;
46
- }
47
-
48
- export interface NodeAttackAnalysis {
49
- left: AttackAnalysis;
50
- right: AttackAnalysis;
51
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
52
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
53
- }
54
-
55
- export interface AttackAnalyzerShipConfig
56
- extends ShipConditions,
57
- NightFleetConditions {
58
- fleet_los_mod?: number | null;
59
- }
60
-
61
- export interface ShellingStyle {
62
- tag: "ShellingStyle";
63
- attack_type: ShellingType;
64
- cutin: DayCutinLike | null;
65
- power_mod: number;
66
- accuracy_mod: number;
67
- hits: number;
68
- }
69
-
70
- export interface NightAttackStyle {
71
- tag: "NightAttackStyle";
72
- attack_type: NightAttackType;
73
- cutin: NightCutinLike | null;
74
- power_mod: number;
75
- accuracy_mod: number;
76
- hits: number;
42
+ export interface NightContactChance {
43
+ rank1: number;
44
+ rank2: number;
45
+ rank3: number;
77
46
  }
78
47
 
79
- export interface AswAttackStyle {
80
- tag: "AswAttackStyle";
81
- attack_type: AswAttackType;
48
+ export interface CompNightCutinAnalysis {
49
+ night_contact_chance: NightContactChance;
50
+ ships: ShipNightCutinAnalysis[];
82
51
  }
83
52
 
84
- export interface TorpedoAttackStyle {
85
- tag: "TorpedoAttackStyle";
86
- attack_type: TorpedoAttackType;
53
+ export interface ShipNightCutinAnalysis {
54
+ ship_id: number;
55
+ index: number;
56
+ normal: NightCutinActionReport;
57
+ chuuha: NightCutinActionReport;
87
58
  }
88
59
 
89
- export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
90
-
91
- export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
92
-
93
- export interface SupportShellingStyle {
94
- tag: "SupportShellingStyle";
95
- attack_type: SupportShellingType;
60
+ export interface NightCutinActionReport
61
+ extends ActionReport<NightPhaseAttackStyle> {
62
+ cutin_term: number | null;
96
63
  }
97
64
 
98
65
  export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
@@ -222,49 +189,67 @@ export interface OrgState {
222
189
 
223
190
  export type FleetKey = "f1" | "f2" | "f3" | "f4";
224
191
 
225
- export interface CompDayCutinAnalysis {
226
- rank3_air_state: AirState;
227
- rank2_air_state: AirState;
228
- main_fleet_los_mod: number | null;
229
- escort_fleet_los_mod: number | null;
230
- ships: ShipDayCutinAnalysis[];
192
+ export interface EquippabilityRule {
193
+ ship: CompiledEvaler;
194
+ keys?: string[];
195
+ include?: string;
196
+ exclude?: string;
231
197
  }
232
198
 
233
- export interface ShipDayCutinAnalysis {
234
- ship_id: number;
235
- role: Role;
236
- index: number;
237
- rank3: DayCutinReport;
238
- rank2: DayCutinReport;
199
+ export interface MasterEquippability {
200
+ equip_stype: EquipStype[];
201
+ equip_exslot: number[];
202
+ equip_ship: MstEquipShip[];
203
+ equip_exslot_ship: MstEquipExslotShip[];
204
+ rules: EquippabilityRule[];
239
205
  }
240
206
 
241
- export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
242
- observation_term: number | null;
207
+ export interface MstEquipExslotShip {
208
+ api_slotitem_id: number;
209
+ api_ship_ids: number[];
243
210
  }
244
211
 
245
- export interface ShipMeta {
246
- id: string;
247
- ship_id: number;
212
+ export interface MstEquipShip {
213
+ api_ship_id: number;
214
+ api_equip_type: number[];
248
215
  }
249
216
 
250
- export interface FleetMeta {
251
- id: string;
252
- len: number;
253
- ships: [string, ShipMeta | null][];
217
+ export interface EquipStype {
218
+ id: number;
219
+ equip_type: number[];
254
220
  }
255
221
 
256
- export interface CompMeta {
257
- fleets: Record<FleetType, FleetMeta>;
222
+ export interface CompAnalyzerConfig {
223
+ engagement: Engagement;
224
+ formation: Formation;
225
+ anti_air_cutin: number | null;
226
+ ship_anti_air_resist: number;
227
+ fleet_anti_air_resist: number;
228
+ left_night_fleet_conditions: NightFleetConditions;
229
+ right_night_fleet_conditions: NightFleetConditions;
258
230
  }
259
231
 
260
- export type NodeId = string;
232
+ export interface CompNightAnalysis {
233
+ night_cutin: CompNightCutinAnalysis;
234
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
235
+ }
261
236
 
262
- export interface NodeState {
263
- map?: number;
264
- node?: NodeId;
265
- phase?: number;
266
- debuff?: boolean;
267
- disable_historical_mod?: boolean;
237
+ export interface CompDayAnalysis {
238
+ day_cutin: CompDayCutinAnalysis;
239
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
240
+ }
241
+
242
+ export interface CompAnalysis {
243
+ day: CompDayAnalysis;
244
+ night: CompNightAnalysis;
245
+ contact: ContactAnalysis;
246
+ anti_air: CompAntiAirAnalysis;
247
+ }
248
+
249
+ export interface AttackAnalyzerShipConfig
250
+ extends ShipConditions,
251
+ NightFleetConditions {
252
+ fleet_los_mod?: number | null;
268
253
  }
269
254
 
270
255
  export type OrgType =
@@ -275,23 +260,6 @@ export type OrgType =
275
260
  | "EnemySingle"
276
261
  | "EnemyCombined";
277
262
 
278
- export type SlotSizeVec = (number | null)[];
279
-
280
- export type SpecialEnemyType =
281
- | "None"
282
- | "SoftSkinned"
283
- | "Pillbox"
284
- | "IsolatedIsland"
285
- | "SupplyDepot"
286
- | "NewSupplyDepot"
287
- | "HarbourSummerPrincess"
288
- | "PtImp"
289
- | "BattleshipSummerPrincess"
290
- | "HeavyCruiserSummerPrincess"
291
- | "FrenchBattleshipPrincess"
292
- | "AnchorageWaterDemonVacationMode"
293
- | "DockPrincess";
294
-
295
263
  export interface MasterShip {
296
264
  ship_id: number;
297
265
  name: string;
@@ -326,34 +294,42 @@ export interface MasterShip {
326
294
 
327
295
  export type StatInterval = [number | null, number | null];
328
296
 
329
- export interface FleetCutinReport<T> {
330
- cutin: FleetCutin;
331
- rate: number | null;
332
- formation: Formation;
333
- attacks: FleetCutinAttackReport<T>[];
297
+ export interface ShellingStyle {
298
+ tag: "ShellingStyle";
299
+ attack_type: ShellingType;
300
+ cutin: DayCutinLike | null;
301
+ power_mod: number;
302
+ accuracy_mod: number;
303
+ hits: number;
334
304
  }
335
305
 
336
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
337
- index: number;
338
- ship_id: number;
306
+ export interface NightAttackStyle {
307
+ tag: "NightAttackStyle";
308
+ attack_type: NightAttackType;
309
+ cutin: NightCutinLike | null;
339
310
  power_mod: number;
311
+ accuracy_mod: number;
312
+ hits: number;
340
313
  }
341
314
 
342
- export type SingleFormation =
343
- | "LineAhead"
344
- | "DoubleLine"
345
- | "Diamond"
346
- | "Echelon"
347
- | "LineAbreast"
348
- | "Vanguard";
315
+ export interface AswAttackStyle {
316
+ tag: "AswAttackStyle";
317
+ attack_type: AswAttackType;
318
+ }
349
319
 
350
- export type CombinedFormation =
351
- | "Cruising1"
352
- | "Cruising2"
353
- | "Cruising3"
354
- | "Cruising4";
320
+ export interface TorpedoAttackStyle {
321
+ tag: "TorpedoAttackStyle";
322
+ attack_type: TorpedoAttackType;
323
+ }
355
324
 
356
- export type Formation = SingleFormation | CombinedFormation;
325
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
326
+
327
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
328
+
329
+ export interface SupportShellingStyle {
330
+ tag: "SupportShellingStyle";
331
+ attack_type: SupportShellingType;
332
+ }
357
333
 
358
334
  export type GearVecInput = GearInput[];
359
335
 
@@ -395,6 +371,8 @@ export interface EBonuses {
395
371
  range: number;
396
372
  }
397
373
 
374
+ export type FhResult<T> = { Ok: T } | { Err: string };
375
+
398
376
  export interface MasterGear {
399
377
  gear_id: number;
400
378
  name: string;
@@ -421,34 +399,43 @@ export interface MasterGear {
421
399
  historical_aircraft_group?: number;
422
400
  }
423
401
 
424
- export interface EquippabilityRule {
425
- ship: CompiledEvaler;
426
- keys?: string[];
427
- include?: string;
428
- exclude?: string;
402
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
403
+ formation?: Formation;
429
404
  }
430
405
 
431
- export interface MasterEquippability {
432
- equip_stype: EquipStype[];
433
- equip_exslot: number[];
434
- equip_ship: MstEquipShip[];
435
- equip_exslot_ship: MstEquipExslotShip[];
436
- rules: EquippabilityRule[];
406
+ export interface NodeAttackAnalyzerConfig {
407
+ air_state?: AirState;
408
+ engagement?: Engagement;
409
+ node_state?: NodeState;
410
+ left?: NodeAttackAnalyzerShipConfig;
411
+ right?: NodeAttackAnalyzerShipConfig;
437
412
  }
438
413
 
439
- export interface MstEquipExslotShip {
440
- api_slotitem_id: number;
441
- api_ship_ids: number[];
414
+ export interface NodeAttackAnalysis {
415
+ left: AttackAnalysis;
416
+ right: AttackAnalysis;
417
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
418
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
442
419
  }
443
420
 
444
- export interface MstEquipShip {
445
- api_ship_id: number;
446
- api_equip_type: number[];
421
+ export interface CompDayCutinAnalysis {
422
+ rank3_air_state: AirState;
423
+ rank2_air_state: AirState;
424
+ main_fleet_los_mod: number | null;
425
+ escort_fleet_los_mod: number | null;
426
+ ships: ShipDayCutinAnalysis[];
447
427
  }
448
428
 
449
- export interface EquipStype {
450
- id: number;
451
- equip_type: number[];
429
+ export interface ShipDayCutinAnalysis {
430
+ ship_id: number;
431
+ role: Role;
432
+ index: number;
433
+ rank3: DayCutinReport;
434
+ rank2: DayCutinReport;
435
+ }
436
+
437
+ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
438
+ observation_term: number | null;
452
439
  }
453
440
 
454
441
  export interface BattleConditions {
@@ -518,23 +505,55 @@ export type DayCutinLike = DayCutin | FleetCutin;
518
505
 
519
506
  export type NightCutinLike = NightCutin | FleetCutin;
520
507
 
508
+ export type SingleFormation =
509
+ | "LineAhead"
510
+ | "DoubleLine"
511
+ | "Diamond"
512
+ | "Echelon"
513
+ | "LineAbreast"
514
+ | "Vanguard";
515
+
516
+ export type CombinedFormation =
517
+ | "Cruising1"
518
+ | "Cruising2"
519
+ | "Cruising3"
520
+ | "Cruising4";
521
+
522
+ export type Formation = SingleFormation | CombinedFormation;
523
+
524
+ export type SpecialEnemyType =
525
+ | "None"
526
+ | "SoftSkinned"
527
+ | "Pillbox"
528
+ | "IsolatedIsland"
529
+ | "SupplyDepot"
530
+ | "NewSupplyDepot"
531
+ | "HarbourSummerPrincess"
532
+ | "PtImp"
533
+ | "BattleshipSummerPrincess"
534
+ | "HeavyCruiserSummerPrincess"
535
+ | "FrenchBattleshipPrincess"
536
+ | "AnchorageWaterDemonVacationMode"
537
+ | "DockPrincess";
538
+
539
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
540
+
521
541
  export interface MoveShipPayload {
522
542
  current: [string, string, ShipKey];
523
543
  target: [string | null, string, ShipKey];
524
544
  }
525
545
 
526
- export interface ContactAnalysis {
527
- single: DayContactChance[] | null;
528
- combined: DayContactChance[] | null;
546
+ export interface FleetCutinReport<T> {
547
+ cutin: FleetCutin;
548
+ rate: number | null;
549
+ formation: Formation;
550
+ attacks: FleetCutinAttackReport<T>[];
529
551
  }
530
552
 
531
- export interface DayContactChance {
532
- air_state: AirState;
533
- trigger_rate: number;
534
- rank3: number;
535
- rank2: number;
536
- rank1: number;
537
- total: number;
553
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
554
+ index: number;
555
+ ship_id: number;
556
+ power_mod: number;
538
557
  }
539
558
 
540
559
  export interface FormationCombatModifiersDef {
@@ -610,16 +629,29 @@ export interface BattleDefinitions {
610
629
  historical_bonuses: HistoricalBonusDef[];
611
630
  }
612
631
 
613
- export interface FleetState {
614
- id?: string;
615
- len?: number;
616
- s1?: ShipState;
617
- s2?: ShipState;
618
- s3?: ShipState;
619
- s4?: ShipState;
620
- s5?: ShipState;
621
- s6?: ShipState;
622
- s7?: ShipState;
632
+ export interface ShipMeta {
633
+ id: string;
634
+ ship_id: number;
635
+ }
636
+
637
+ export interface FleetMeta {
638
+ id: string;
639
+ len: number;
640
+ ships: [string, ShipMeta | null][];
641
+ }
642
+
643
+ export interface CompMeta {
644
+ fleets: Record<FleetType, FleetMeta>;
645
+ }
646
+
647
+ export type NodeId = string;
648
+
649
+ export interface NodeState {
650
+ map?: number;
651
+ node?: NodeId;
652
+ phase?: number;
653
+ debuff?: boolean;
654
+ disable_historical_mod?: boolean;
623
655
  }
624
656
 
625
657
  export interface SlotSizeVecState {
@@ -654,9 +686,13 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
654
686
 
655
687
  export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
656
688
 
657
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
658
-
659
- export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
689
+ export interface MasterBattleDefinitions {
690
+ formation: NestedFormationDef[];
691
+ anti_air_cutin: AntiAirCutinDef[];
692
+ day_cutin: DayCutinDef[];
693
+ night_cutin: NightCutinDef[];
694
+ historical_bonuses?: HistoricalBonusDef[];
695
+ }
660
696
 
661
697
  export interface HitRate {
662
698
  normal: number;
@@ -686,15 +722,18 @@ export interface DamageReport {
686
722
  damage_state_density: Histogram<DamageState, number>;
687
723
  }
688
724
 
689
- export interface AttackReport<T> {
690
- style: T;
691
- proc_rate: number | null;
692
- attack_power: AttackPower | null;
693
- attack_power_params: AttackPowerParams | null;
694
- hits: number;
695
- hit_rate: HitRate | null;
696
- hit_rate_params: HitRateParams | null;
697
- damage: DamageReport | null;
725
+ export interface ContactAnalysis {
726
+ single: DayContactChance[] | null;
727
+ combined: DayContactChance[] | null;
728
+ }
729
+
730
+ export interface DayContactChance {
731
+ air_state: AirState;
732
+ trigger_rate: number;
733
+ rank3: number;
734
+ rank2: number;
735
+ rank1: number;
736
+ total: number;
698
737
  }
699
738
 
700
739
  export interface AttackAnalysis {
@@ -727,6 +766,18 @@ export interface AntiAirReport {
727
766
  anti_air_propellant_barrage_chance: number | null;
728
767
  }
729
768
 
769
+ export interface FleetState {
770
+ id?: string;
771
+ len?: number;
772
+ s1?: ShipState;
773
+ s2?: ShipState;
774
+ s3?: ShipState;
775
+ s4?: ShipState;
776
+ s5?: ShipState;
777
+ s6?: ShipState;
778
+ s7?: ShipState;
779
+ }
780
+
730
781
  export interface GearState {
731
782
  id?: string;
732
783
  gear_id: number;
@@ -780,19 +831,21 @@ export type ShipType =
780
831
  | "CT"
781
832
  | "AO";
782
833
 
783
- export type GearTypeIdArray = [number, number, number, number, number];
834
+ export type SlotSizeVec = (number | null)[];
784
835
 
785
- export interface SupportShellingSimulatorParams {
786
- attacker_formation?: Formation;
787
- target_formation?: Formation;
788
- engagement: Engagement;
789
- }
836
+ export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
790
837
 
791
- export interface ShipAnalyzerConfig {
792
- air_state?: AirState;
793
- engagement?: Engagement;
794
- left?: AttackAnalyzerShipConfig;
795
- right?: AttackAnalyzerShipConfig;
838
+ export type CompiledEvaler = string;
839
+
840
+ export interface AttackReport<T> {
841
+ style: T;
842
+ proc_rate: number | null;
843
+ attack_power: AttackPower | null;
844
+ attack_power_params: AttackPowerParams | null;
845
+ hits: number;
846
+ hit_rate: HitRate | null;
847
+ hit_rate_params: HitRateParams | null;
848
+ damage: DamageReport | null;
796
849
  }
797
850
 
798
851
  export interface ActionReport<T> {
@@ -803,58 +856,10 @@ export interface ActionReport<T> {
803
856
 
804
857
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
805
858
 
806
- export type AirSquadronMode = "Sortie" | "AirDefense";
807
-
808
- export interface AirSquadronState extends GearVecState, SlotSizeVecState {
809
- id?: string;
810
- mode?: AirSquadronMode;
811
- }
812
-
813
- export type AswAttackType = "DepthCharge" | "Aerial";
814
-
815
- export type ShellingType = "Normal" | "Aerial";
816
-
817
- export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
818
-
819
- export type SupportShellingType = ShellingType;
820
-
821
- export type AttackType =
822
- | { t: "Asw"; c: AswAttackType }
823
- | { t: "Shelling"; c: ShellingType }
824
- | { t: "Night"; c: NightAttackType }
825
- | { t: "Torpedo" }
826
- | { t: "SupportShelling"; c: SupportShellingType };
827
-
828
- export type DayPhaseAttackType =
829
- | { t: "Shelling"; c: ShellingType }
830
- | { t: "Asw"; c: AswAttackType };
831
-
832
- export type NightPhaseAttackType =
833
- | { t: "Night"; c: NightAttackType }
834
- | { t: "Asw"; c: AswAttackType };
835
-
836
- export type TorpedoAttackType = null;
837
-
838
- export type Role = "Main" | "Escort";
839
-
840
859
  export type Side = "Player" | "Enemy";
841
860
 
842
861
  export type Align = "Left" | "Right";
843
862
 
844
- export type CompiledEvaler = string;
845
-
846
- export interface SimulatorResult {
847
- items: SimulatorResultItem[];
848
- sunk_vec: [number, number, number][];
849
- }
850
-
851
- export interface SimulatorResultItem {
852
- id: string;
853
- fleet_type: FleetType;
854
- index: number;
855
- damage_state_map: Record<DamageState, number>;
856
- }
857
-
858
863
  export interface MasterData extends MasterBattleDefinitions {
859
864
  created_at: number;
860
865
  gears: MasterGear[];
@@ -876,48 +881,38 @@ export interface MasterAttrRule<T> {
876
881
  expr: CompiledEvaler;
877
882
  }
878
883
 
879
- export interface MasterBattleDefinitions {
880
- formation: NestedFormationDef[];
881
- anti_air_cutin: AntiAirCutinDef[];
882
- day_cutin: DayCutinDef[];
883
- night_cutin: NightCutinDef[];
884
- historical_bonuses?: HistoricalBonusDef[];
885
- }
886
-
887
- export interface NightContactChance {
888
- rank1: number;
889
- rank2: number;
890
- rank3: number;
891
- }
892
-
893
- export interface CompNightCutinAnalysis {
894
- night_contact_chance: NightContactChance;
895
- ships: ShipNightCutinAnalysis[];
884
+ export interface MasterIBonuses {
885
+ shelling_power: MasterIBonusRule[];
886
+ shelling_accuracy: MasterIBonusRule[];
887
+ shelling_aerial_power: MasterIBonusRule[];
888
+ torpedo_power: MasterIBonusRule[];
889
+ torpedo_accuracy: MasterIBonusRule[];
890
+ torpedo_evasion: MasterIBonusRule[];
891
+ asw_power: MasterIBonusRule[];
892
+ asw_accuracy: MasterIBonusRule[];
893
+ night_power: MasterIBonusRule[];
894
+ night_aerial_power: MasterIBonusRule[];
895
+ night_accuracy: MasterIBonusRule[];
896
+ defense_power: MasterIBonusRule[];
897
+ contact_selection: MasterIBonusRule[];
898
+ fighter_power: MasterIBonusRule[];
899
+ ship_anti_air: MasterIBonusRule[];
900
+ fleet_anti_air: MasterIBonusRule[];
901
+ elos: MasterIBonusRule[];
896
902
  }
897
903
 
898
- export interface ShipNightCutinAnalysis {
899
- ship_id: number;
900
- index: number;
901
- normal: NightCutinActionReport;
902
- chuuha: NightCutinActionReport;
904
+ export interface MasterIBonusRule {
905
+ expr: CompiledEvaler;
906
+ formula: CompiledEvaler;
903
907
  }
904
908
 
905
- export interface NightCutinActionReport
906
- extends ActionReport<NightPhaseAttackStyle> {
907
- cutin_term: number | null;
909
+ export interface ShipPosition {
910
+ org_type?: OrgType;
911
+ fleet_type?: FleetType;
912
+ fleet_len?: number;
913
+ index?: number;
908
914
  }
909
915
 
910
- export type AirState =
911
- | "AirSupremacy"
912
- | "AirSuperiority"
913
- | "AirParity"
914
- | "AirDenial"
915
- | "AirIncapability";
916
-
917
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
918
-
919
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
920
-
921
916
  export type ShipAttr =
922
917
  | "Unknown"
923
918
  | "NightCarrier"
@@ -943,59 +938,42 @@ export interface ShipConditions extends ShipPosition {
943
938
  amagiri_index?: number | null;
944
939
  }
945
940
 
946
- export type FhResult<T> = { Ok: T } | { Err: string };
941
+ export type GearTypeIdArray = [number, number, number, number, number];
947
942
 
948
- export interface MasterIBonuses {
949
- shelling_power: MasterIBonusRule[];
950
- shelling_accuracy: MasterIBonusRule[];
951
- shelling_aerial_power: MasterIBonusRule[];
952
- torpedo_power: MasterIBonusRule[];
953
- torpedo_accuracy: MasterIBonusRule[];
954
- torpedo_evasion: MasterIBonusRule[];
955
- asw_power: MasterIBonusRule[];
956
- asw_accuracy: MasterIBonusRule[];
957
- night_power: MasterIBonusRule[];
958
- night_aerial_power: MasterIBonusRule[];
959
- night_accuracy: MasterIBonusRule[];
960
- defense_power: MasterIBonusRule[];
961
- contact_selection: MasterIBonusRule[];
962
- fighter_power: MasterIBonusRule[];
963
- ship_anti_air: MasterIBonusRule[];
964
- fleet_anti_air: MasterIBonusRule[];
965
- elos: MasterIBonusRule[];
943
+ export interface SimulatorResult {
944
+ items: SimulatorResultItem[];
945
+ sunk_vec: [number, number, number][];
966
946
  }
967
947
 
968
- export interface MasterIBonusRule {
969
- expr: CompiledEvaler;
970
- formula: CompiledEvaler;
948
+ export interface SimulatorResultItem {
949
+ id: string;
950
+ fleet_type: FleetType;
951
+ index: number;
952
+ damage_state_map: Record<DamageState, number>;
971
953
  }
972
954
 
973
- export interface CompAnalyzerConfig {
974
- engagement: Engagement;
975
- formation: Formation;
976
- anti_air_cutin: number | null;
977
- ship_anti_air_resist: number;
978
- fleet_anti_air_resist: number;
979
- left_night_fleet_conditions: NightFleetConditions;
980
- right_night_fleet_conditions: NightFleetConditions;
955
+ export interface ShipAnalyzerConfig {
956
+ air_state?: AirState;
957
+ engagement?: Engagement;
958
+ left?: AttackAnalyzerShipConfig;
959
+ right?: AttackAnalyzerShipConfig;
981
960
  }
982
961
 
983
- export interface CompNightAnalysis {
984
- night_cutin: CompNightCutinAnalysis;
985
- fleet_cutin: FleetCutinReport<NightAttackStyle>[];
986
- }
962
+ export type AirSquadronMode = "Sortie" | "AirDefense";
987
963
 
988
- export interface CompDayAnalysis {
989
- day_cutin: CompDayCutinAnalysis;
990
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
964
+ export interface AirSquadronState extends GearVecState, SlotSizeVecState {
965
+ id?: string;
966
+ mode?: AirSquadronMode;
991
967
  }
992
968
 
993
- export interface CompAnalysis {
994
- day: CompDayAnalysis;
995
- night: CompNightAnalysis;
996
- contact: ContactAnalysis;
997
- anti_air: CompAntiAirAnalysis;
998
- }
969
+ export type AirState =
970
+ | "AirSupremacy"
971
+ | "AirSuperiority"
972
+ | "AirParity"
973
+ | "AirDenial"
974
+ | "AirIncapability";
975
+
976
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
999
977
 
1000
978
  export interface AttackPowerModifier {
1001
979
  a?: number;
@@ -1020,16 +998,38 @@ export interface CustomPowerModifiers {
1020
998
  historical_mod?: AttackPowerModifier;
1021
999
  }
1022
1000
 
1001
+ export type AswAttackType = "DepthCharge" | "Aerial";
1002
+
1003
+ export type ShellingType = "Normal" | "Aerial";
1004
+
1005
+ export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
1006
+
1007
+ export type SupportShellingType = ShellingType;
1008
+
1009
+ export type AttackType =
1010
+ | { t: "Asw"; c: AswAttackType }
1011
+ | { t: "Shelling"; c: ShellingType }
1012
+ | { t: "Night"; c: NightAttackType }
1013
+ | { t: "Torpedo" }
1014
+ | { t: "SupportShelling"; c: SupportShellingType };
1015
+
1016
+ export type DayPhaseAttackType =
1017
+ | { t: "Shelling"; c: ShellingType }
1018
+ | { t: "Asw"; c: AswAttackType };
1019
+
1020
+ export type NightPhaseAttackType =
1021
+ | { t: "Night"; c: NightAttackType }
1022
+ | { t: "Asw"; c: AswAttackType };
1023
+
1024
+ export type TorpedoAttackType = null;
1025
+
1023
1026
  export type ContactRank = "Rank1" | "Rank2" | "Rank3";
1024
1027
 
1028
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
1029
+
1025
1030
  export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
1026
1031
 
1027
- export interface ShipPosition {
1028
- org_type?: OrgType;
1029
- fleet_type?: FleetType;
1030
- fleet_len?: number;
1031
- index?: number;
1032
- }
1032
+ export type Role = "Main" | "Escort";
1033
1033
 
1034
1034
  /**
1035
1035
  */
@@ -1088,7 +1088,7 @@ export class Analyzer {
1088
1088
  config: ShipAnalyzerConfig,
1089
1089
  left: Ship,
1090
1090
  right: Ship,
1091
- attacker_is_left: boolean
1091
+ attacker_is_left: boolean,
1092
1092
  ): AttackAnalysis;
1093
1093
  /**
1094
1094
  * @param {NodeAttackAnalyzerConfig} config
@@ -1103,7 +1103,7 @@ export class Analyzer {
1103
1103
  left_comp: Comp,
1104
1104
  left_ship: Ship,
1105
1105
  right_comp: Comp,
1106
- right_ship: Ship
1106
+ right_ship: Ship,
1107
1107
  ): NodeAttackAnalysis;
1108
1108
  /**
1109
1109
  * @param {Comp} comp
@@ -1122,7 +1122,7 @@ export class Analyzer {
1122
1122
  player_comp: Comp,
1123
1123
  enemy_comp: Comp,
1124
1124
  config: NodeAttackAnalyzerConfig,
1125
- times: number
1125
+ times: number,
1126
1126
  ): SimulatorResult;
1127
1127
  }
1128
1128
  /**
@@ -1202,7 +1202,7 @@ export class Comp {
1202
1202
  */
1203
1203
  fighter_power(
1204
1204
  escort_participates: boolean,
1205
- air_type: AirWaveType
1205
+ air_type: AirWaveType,
1206
1206
  ): number | undefined;
1207
1207
  /**
1208
1208
  * マップ索敵
@@ -1341,7 +1341,7 @@ export class Fleet {
1341
1341
  get_remaining_fuel(
1342
1342
  id: string,
1343
1343
  rate: number,
1344
- ceil: boolean
1344
+ ceil: boolean,
1345
1345
  ): number | undefined;
1346
1346
  /**
1347
1347
  * @param {string} id
@@ -1352,7 +1352,7 @@ export class Fleet {
1352
1352
  get_remaining_ammo(
1353
1353
  id: string,
1354
1354
  rate: number,
1355
- ceil: boolean
1355
+ ceil: boolean,
1356
1356
  ): number | undefined;
1357
1357
  /**
1358
1358
  * @returns {number}
@@ -1733,7 +1733,7 @@ export class Org {
1733
1733
  create_move_ship_payload(
1734
1734
  id: string,
1735
1735
  x: number,
1736
- y: number
1736
+ y: number,
1737
1737
  ): MoveShipPayload | undefined;
1738
1738
  /**
1739
1739
  * @param {FleetKey} key
@@ -1962,7 +1962,7 @@ export class Ship {
1962
1962
  evasion_term(
1963
1963
  formation_mod: number,
1964
1964
  postcap_additive: number,
1965
- postcap_multiplicative: number
1965
+ postcap_multiplicative: number,
1966
1966
  ): number | undefined;
1967
1967
  /**
1968
1968
  * @param {number} armor_penetration