fleethub-core 1.11.4 → 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";
@@ -128,44 +95,6 @@ export type GearAttr =
128
95
  | "SemiNightPlane"
129
96
  | "HighAltitudeInterceptor";
130
97
 
131
- export interface OrgState {
132
- id?: string;
133
- f1?: FleetState;
134
- f2?: FleetState;
135
- f3?: FleetState;
136
- f4?: FleetState;
137
- a1?: AirSquadronState;
138
- a2?: AirSquadronState;
139
- a3?: AirSquadronState;
140
- hq_level?: number;
141
- org_type?: OrgType;
142
- sortie?: FleetKey;
143
- route_sup?: FleetKey;
144
- boss_sup?: FleetKey;
145
- }
146
-
147
- export type FleetKey = "f1" | "f2" | "f3" | "f4";
148
-
149
- export interface CompDayCutinAnalysis {
150
- rank3_air_state: AirState;
151
- rank2_air_state: AirState;
152
- main_fleet_los_mod: number | null;
153
- escort_fleet_los_mod: number | null;
154
- ships: ShipDayCutinAnalysis[];
155
- }
156
-
157
- export interface ShipDayCutinAnalysis {
158
- ship_id: number;
159
- role: Role;
160
- index: number;
161
- rank3: DayCutinReport;
162
- rank2: DayCutinReport;
163
- }
164
-
165
- export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
166
- observation_term: number | null;
167
- }
168
-
169
98
  export type GearType =
170
99
  | "Unknown"
171
100
  | "SmallMainGun"
@@ -242,29 +171,85 @@ export type GearCategory =
242
171
  | "LandBased"
243
172
  | "Misc";
244
173
 
245
- export interface ShipMeta {
246
- id: string;
247
- ship_id: number;
174
+ export interface OrgState {
175
+ id?: string;
176
+ f1?: FleetState;
177
+ f2?: FleetState;
178
+ f3?: FleetState;
179
+ f4?: FleetState;
180
+ a1?: AirSquadronState;
181
+ a2?: AirSquadronState;
182
+ a3?: AirSquadronState;
183
+ hq_level?: number;
184
+ org_type?: OrgType;
185
+ sortie?: FleetKey;
186
+ route_sup?: FleetKey;
187
+ boss_sup?: FleetKey;
248
188
  }
249
189
 
250
- export interface FleetMeta {
251
- id: string;
252
- len: number;
253
- ships: [string, ShipMeta | null][];
190
+ export type FleetKey = "f1" | "f2" | "f3" | "f4";
191
+
192
+ export interface EquippabilityRule {
193
+ ship: CompiledEvaler;
194
+ keys?: string[];
195
+ include?: string;
196
+ exclude?: string;
254
197
  }
255
198
 
256
- export interface CompMeta {
257
- fleets: Record<FleetType, FleetMeta>;
199
+ export interface MasterEquippability {
200
+ equip_stype: EquipStype[];
201
+ equip_exslot: number[];
202
+ equip_ship: MstEquipShip[];
203
+ equip_exslot_ship: MstEquipExslotShip[];
204
+ rules: EquippabilityRule[];
258
205
  }
259
206
 
260
- export type NodeId = string;
207
+ export interface MstEquipExslotShip {
208
+ api_slotitem_id: number;
209
+ api_ship_ids: number[];
210
+ }
261
211
 
262
- export interface NodeState {
263
- map?: number;
264
- node?: NodeId;
265
- phase?: number;
266
- debuff?: boolean;
267
- disable_historical_mod?: boolean;
212
+ export interface MstEquipShip {
213
+ api_ship_id: number;
214
+ api_equip_type: number[];
215
+ }
216
+
217
+ export interface EquipStype {
218
+ id: number;
219
+ equip_type: number[];
220
+ }
221
+
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;
230
+ }
231
+
232
+ export interface CompNightAnalysis {
233
+ night_cutin: CompNightCutinAnalysis;
234
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
235
+ }
236
+
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,21 +260,6 @@ export type OrgType =
275
260
  | "EnemySingle"
276
261
  | "EnemyCombined";
277
262
 
278
- export type SpecialEnemyType =
279
- | "None"
280
- | "SoftSkinned"
281
- | "Pillbox"
282
- | "IsolatedIsland"
283
- | "SupplyDepot"
284
- | "NewSupplyDepot"
285
- | "HarbourSummerPrincess"
286
- | "PtImp"
287
- | "BattleshipSummerPrincess"
288
- | "HeavyCruiserSummerPrincess"
289
- | "FrenchBattleshipPrincess"
290
- | "AnchorageWaterDemonVacationMode"
291
- | "DockPrincess";
292
-
293
263
  export interface MasterShip {
294
264
  ship_id: number;
295
265
  name: string;
@@ -324,56 +294,42 @@ export interface MasterShip {
324
294
 
325
295
  export type StatInterval = [number | null, number | null];
326
296
 
327
- export interface FleetCutinReport<T> {
328
- cutin: FleetCutin;
329
- rate: number | null;
330
- formation: Formation;
331
- 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;
332
304
  }
333
305
 
334
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
335
- index: number;
336
- ship_id: number;
306
+ export interface NightAttackStyle {
307
+ tag: "NightAttackStyle";
308
+ attack_type: NightAttackType;
309
+ cutin: NightCutinLike | null;
337
310
  power_mod: number;
311
+ accuracy_mod: number;
312
+ hits: number;
338
313
  }
339
314
 
340
- export interface BattleConditions {
341
- org_type: OrgType;
342
- role: Role;
343
- ship_index: number;
344
- fleet_len: number;
345
- formation: Formation;
346
- fleet_los_mod: number | null;
347
- night_conditions: NightFleetConditions;
315
+ export interface AswAttackStyle {
316
+ tag: "AswAttackStyle";
317
+ attack_type: AswAttackType;
348
318
  }
349
319
 
350
- export interface NightConditions {
351
- player?: NightFleetConditions;
352
- enemy?: NightFleetConditions;
353
- }
354
-
355
- export interface NightFleetConditions {
356
- night_contact_rank?: ContactRank | null;
357
- starshell_index?: number | null;
358
- searchlight_index?: number | null;
359
- activates_large_searchlight?: boolean;
320
+ export interface TorpedoAttackStyle {
321
+ tag: "TorpedoAttackStyle";
322
+ attack_type: TorpedoAttackType;
360
323
  }
361
324
 
362
- export type SingleFormation =
363
- | "LineAhead"
364
- | "DoubleLine"
365
- | "Diamond"
366
- | "Echelon"
367
- | "LineAbreast"
368
- | "Vanguard";
325
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
369
326
 
370
- export type CombinedFormation =
371
- | "Cruising1"
372
- | "Cruising2"
373
- | "Cruising3"
374
- | "Cruising4";
327
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
375
328
 
376
- export type Formation = SingleFormation | CombinedFormation;
329
+ export interface SupportShellingStyle {
330
+ tag: "SupportShellingStyle";
331
+ attack_type: SupportShellingType;
332
+ }
377
333
 
378
334
  export type GearVecInput = GearInput[];
379
335
 
@@ -415,6 +371,8 @@ export interface EBonuses {
415
371
  range: number;
416
372
  }
417
373
 
374
+ export type FhResult<T> = { Ok: T } | { Err: string };
375
+
418
376
  export interface MasterGear {
419
377
  gear_id: number;
420
378
  name: string;
@@ -441,34 +399,65 @@ export interface MasterGear {
441
399
  historical_aircraft_group?: number;
442
400
  }
443
401
 
444
- export interface EquippabilityRule {
445
- ship: CompiledEvaler;
446
- keys?: string[];
447
- include?: string;
448
- exclude?: string;
402
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
403
+ formation?: Formation;
449
404
  }
450
405
 
451
- export interface MasterEquippability {
452
- equip_stype: EquipStype[];
453
- equip_exslot: number[];
454
- equip_ship: MstEquipShip[];
455
- equip_exslot_ship: MstEquipExslotShip[];
456
- rules: EquippabilityRule[];
406
+ export interface NodeAttackAnalyzerConfig {
407
+ air_state?: AirState;
408
+ engagement?: Engagement;
409
+ node_state?: NodeState;
410
+ left?: NodeAttackAnalyzerShipConfig;
411
+ right?: NodeAttackAnalyzerShipConfig;
457
412
  }
458
413
 
459
- export interface MstEquipExslotShip {
460
- api_slotitem_id: number;
461
- 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>[];
462
419
  }
463
420
 
464
- export interface MstEquipShip {
465
- api_ship_id: number;
466
- 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[];
467
427
  }
468
428
 
469
- export interface EquipStype {
470
- id: number;
471
- 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;
439
+ }
440
+
441
+ export interface BattleConditions {
442
+ org_type: OrgType;
443
+ role: Role;
444
+ ship_index: number;
445
+ fleet_len: number;
446
+ formation: Formation;
447
+ fleet_los_mod: number | null;
448
+ night_conditions: NightFleetConditions;
449
+ }
450
+
451
+ export interface NightConditions {
452
+ player?: NightFleetConditions;
453
+ enemy?: NightFleetConditions;
454
+ }
455
+
456
+ export interface NightFleetConditions {
457
+ night_contact_rank?: ContactRank | null;
458
+ starshell_index?: number | null;
459
+ searchlight_index?: number | null;
460
+ activates_large_searchlight?: boolean;
472
461
  }
473
462
 
474
463
  export type DayCutin =
@@ -516,7 +505,36 @@ export type DayCutinLike = DayCutin | FleetCutin;
516
505
 
517
506
  export type NightCutinLike = NightCutin | FleetCutin;
518
507
 
519
- export type SlotSizeVec = (number | null)[];
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";
520
538
 
521
539
  export type SpeedGroup = "A" | "B1" | "B2" | "C";
522
540
 
@@ -525,18 +543,17 @@ export interface MoveShipPayload {
525
543
  target: [string | null, string, ShipKey];
526
544
  }
527
545
 
528
- export interface ContactAnalysis {
529
- single: DayContactChance[] | null;
530
- combined: DayContactChance[] | null;
546
+ export interface FleetCutinReport<T> {
547
+ cutin: FleetCutin;
548
+ rate: number | null;
549
+ formation: Formation;
550
+ attacks: FleetCutinAttackReport<T>[];
531
551
  }
532
552
 
533
- export interface DayContactChance {
534
- air_state: AirState;
535
- trigger_rate: number;
536
- rank3: number;
537
- rank2: number;
538
- rank1: number;
539
- total: number;
553
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
554
+ index: number;
555
+ ship_id: number;
556
+ power_mod: number;
540
557
  }
541
558
 
542
559
  export interface FormationCombatModifiersDef {
@@ -612,16 +629,29 @@ export interface BattleDefinitions {
612
629
  historical_bonuses: HistoricalBonusDef[];
613
630
  }
614
631
 
615
- export interface FleetState {
616
- id?: string;
617
- len?: number;
618
- s1?: ShipState;
619
- s2?: ShipState;
620
- s3?: ShipState;
621
- s4?: ShipState;
622
- s5?: ShipState;
623
- s6?: ShipState;
624
- 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;
625
655
  }
626
656
 
627
657
  export interface SlotSizeVecState {
@@ -656,7 +686,13 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
656
686
 
657
687
  export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
658
688
 
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,7 +831,22 @@ 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)[];
835
+
836
+ export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
837
+
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;
849
+ }
784
850
 
785
851
  export interface ActionReport<T> {
786
852
  data: Record<string, AttackReport<T>>;
@@ -790,60 +856,10 @@ export interface ActionReport<T> {
790
856
 
791
857
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
792
858
 
793
- export type AirSquadronMode = "Sortie" | "AirDefense";
794
-
795
- export interface AirSquadronState extends GearVecState, SlotSizeVecState {
796
- id?: string;
797
- mode?: AirSquadronMode;
798
- }
799
-
800
- export type AswAttackType = "DepthCharge" | "Aerial";
801
-
802
- export type ShellingType = "Normal" | "Aerial";
803
-
804
- export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
805
-
806
- export type SupportShellingType = ShellingType;
807
-
808
- export type AttackType =
809
- | { t: "Asw"; c: AswAttackType }
810
- | { t: "Shelling"; c: ShellingType }
811
- | { t: "Night"; c: NightAttackType }
812
- | { t: "Torpedo" }
813
- | { t: "SupportShelling"; c: SupportShellingType };
814
-
815
- export type DayPhaseAttackType =
816
- | { t: "Shelling"; c: ShellingType }
817
- | { t: "Asw"; c: AswAttackType };
818
-
819
- export type NightPhaseAttackType =
820
- | { t: "Night"; c: NightAttackType }
821
- | { t: "Asw"; c: AswAttackType };
822
-
823
- export type TorpedoAttackType = null;
824
-
825
859
  export type Side = "Player" | "Enemy";
826
860
 
827
861
  export type Align = "Left" | "Right";
828
862
 
829
- export interface SupportShellingSimulatorParams {
830
- attacker_formation?: Formation;
831
- target_formation?: Formation;
832
- engagement: Engagement;
833
- }
834
-
835
- export interface SimulatorResult {
836
- items: SimulatorResultItem[];
837
- sunk_vec: [number, number, number][];
838
- }
839
-
840
- export interface SimulatorResultItem {
841
- id: string;
842
- fleet_type: FleetType;
843
- index: number;
844
- damage_state_map: Record<DamageState, number>;
845
- }
846
-
847
863
  export interface MasterData extends MasterBattleDefinitions {
848
864
  created_at: number;
849
865
  gears: MasterGear[];
@@ -865,40 +881,38 @@ export interface MasterAttrRule<T> {
865
881
  expr: CompiledEvaler;
866
882
  }
867
883
 
868
- export interface ShipAnalyzerConfig {
869
- air_state?: AirState;
870
- engagement?: Engagement;
871
- left?: AttackAnalyzerShipConfig;
872
- right?: AttackAnalyzerShipConfig;
873
- }
874
-
875
- export interface NightContactChance {
876
- rank1: number;
877
- rank2: number;
878
- rank3: number;
879
- }
880
-
881
- export interface CompNightCutinAnalysis {
882
- night_contact_chance: NightContactChance;
883
- 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[];
884
902
  }
885
903
 
886
- export interface ShipNightCutinAnalysis {
887
- ship_id: number;
888
- index: number;
889
- normal: NightCutinActionReport;
890
- chuuha: NightCutinActionReport;
904
+ export interface MasterIBonusRule {
905
+ expr: CompiledEvaler;
906
+ formula: CompiledEvaler;
891
907
  }
892
908
 
893
- export interface NightCutinActionReport
894
- extends ActionReport<NightPhaseAttackStyle> {
895
- cutin_term: number | null;
909
+ export interface ShipPosition {
910
+ org_type?: OrgType;
911
+ fleet_type?: FleetType;
912
+ fleet_len?: number;
913
+ index?: number;
896
914
  }
897
915
 
898
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
899
-
900
- export type Role = "Main" | "Escort";
901
-
902
916
  export type ShipAttr =
903
917
  | "Unknown"
904
918
  | "NightCarrier"
@@ -924,68 +938,32 @@ export interface ShipConditions extends ShipPosition {
924
938
  amagiri_index?: number | null;
925
939
  }
926
940
 
927
- export type CompiledEvaler = string;
928
-
929
- export type FhResult<T> = { Ok: T } | { Err: string };
930
-
931
- export interface MasterIBonuses {
932
- shelling_power: MasterIBonusRule[];
933
- shelling_accuracy: MasterIBonusRule[];
934
- shelling_aerial_power: MasterIBonusRule[];
935
- torpedo_power: MasterIBonusRule[];
936
- torpedo_accuracy: MasterIBonusRule[];
937
- torpedo_evasion: MasterIBonusRule[];
938
- asw_power: MasterIBonusRule[];
939
- asw_accuracy: MasterIBonusRule[];
940
- night_power: MasterIBonusRule[];
941
- night_aerial_power: MasterIBonusRule[];
942
- night_accuracy: MasterIBonusRule[];
943
- defense_power: MasterIBonusRule[];
944
- contact_selection: MasterIBonusRule[];
945
- fighter_power: MasterIBonusRule[];
946
- ship_anti_air: MasterIBonusRule[];
947
- fleet_anti_air: MasterIBonusRule[];
948
- elos: MasterIBonusRule[];
949
- }
950
-
951
- export interface MasterIBonusRule {
952
- expr: CompiledEvaler;
953
- formula: CompiledEvaler;
954
- }
941
+ export type GearTypeIdArray = [number, number, number, number, number];
955
942
 
956
- export interface MasterBattleDefinitions {
957
- formation: NestedFormationDef[];
958
- anti_air_cutin: AntiAirCutinDef[];
959
- day_cutin: DayCutinDef[];
960
- night_cutin: NightCutinDef[];
961
- historical_bonuses?: HistoricalBonusDef[];
943
+ export interface SimulatorResult {
944
+ items: SimulatorResultItem[];
945
+ sunk_vec: [number, number, number][];
962
946
  }
963
947
 
964
- export interface CompAnalyzerConfig {
965
- engagement: Engagement;
966
- formation: Formation;
967
- anti_air_cutin: number | null;
968
- ship_anti_air_resist: number;
969
- fleet_anti_air_resist: number;
970
- left_night_fleet_conditions: NightFleetConditions;
971
- right_night_fleet_conditions: NightFleetConditions;
948
+ export interface SimulatorResultItem {
949
+ id: string;
950
+ fleet_type: FleetType;
951
+ index: number;
952
+ damage_state_map: Record<DamageState, number>;
972
953
  }
973
954
 
974
- export interface CompNightAnalysis {
975
- night_cutin: CompNightCutinAnalysis;
976
- fleet_cutin: FleetCutinReport<NightAttackStyle>[];
955
+ export interface ShipAnalyzerConfig {
956
+ air_state?: AirState;
957
+ engagement?: Engagement;
958
+ left?: AttackAnalyzerShipConfig;
959
+ right?: AttackAnalyzerShipConfig;
977
960
  }
978
961
 
979
- export interface CompDayAnalysis {
980
- day_cutin: CompDayCutinAnalysis;
981
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
982
- }
962
+ export type AirSquadronMode = "Sortie" | "AirDefense";
983
963
 
984
- export interface CompAnalysis {
985
- day: CompDayAnalysis;
986
- night: CompNightAnalysis;
987
- contact: ContactAnalysis;
988
- anti_air: CompAntiAirAnalysis;
964
+ export interface AirSquadronState extends GearVecState, SlotSizeVecState {
965
+ id?: string;
966
+ mode?: AirSquadronMode;
989
967
  }
990
968
 
991
969
  export type AirState =
@@ -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