fleethub-core 1.8.11 → 1.9.0

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,69 +1,213 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- */
5
- export function set_panic_hook(): void;
6
3
  /**
7
4
  * @param {ShipConditions} value
8
5
  * @returns {ShipConditions}
9
6
  */
10
7
  export function parse_ship_conditions(value: ShipConditions): ShipConditions;
11
- export interface ShipPosition {
12
- org_type?: OrgType;
13
- fleet_type?: FleetType;
14
- fleet_len?: number;
15
- index?: number;
16
- }
8
+ /**
9
+ */
10
+ export function set_panic_hook(): void;
11
+ export type GearCategory =
12
+ | "Fighter"
13
+ | "Bomber"
14
+ | "Recon"
15
+ | "MainGun"
16
+ | "Secondary"
17
+ | "Torpedo"
18
+ | "AntiSub"
19
+ | "Radar"
20
+ | "Landing"
21
+ | "Ration"
22
+ | "LandBased"
23
+ | "Misc";
17
24
 
18
- export interface CompMeta {
19
- fleets: Record<FleetType, FleetMeta>;
20
- }
25
+ export type GearType =
26
+ | "Unknown"
27
+ | "SmallMainGun"
28
+ | "MediumMainGun"
29
+ | "LargeMainGun"
30
+ | "SecondaryGun"
31
+ | "Torpedo"
32
+ | "CbFighter"
33
+ | "CbDiveBomber"
34
+ | "CbTorpedoBomber"
35
+ | "CbRecon"
36
+ | "ReconSeaplane"
37
+ | "SeaplaneBomber"
38
+ | "SmallRadar"
39
+ | "LargeRadar"
40
+ | "Sonar"
41
+ | "DepthCharge"
42
+ | "ExtraArmor"
43
+ | "Engine"
44
+ | "AntiAirShell"
45
+ | "ApShell"
46
+ | "VtFuze"
47
+ | "AntiAirGun"
48
+ | "MidgetSubmarine"
49
+ | "EmergencyRepair"
50
+ | "LandingCraft"
51
+ | "Rotorcraft"
52
+ | "AntiSubPatrolAircraft"
53
+ | "MediumArmor"
54
+ | "LargeArmor"
55
+ | "Searchlight"
56
+ | "SupplyContainer"
57
+ | "ShipRepairFacility"
58
+ | "SubmarineTorpedo"
59
+ | "Starshell"
60
+ | "CommandFacility"
61
+ | "AviationPersonnel"
62
+ | "AntiAirFireDirector"
63
+ | "AntiGroundEquipment"
64
+ | "LargeMainGun2"
65
+ | "ShipPersonnel"
66
+ | "LargeSonar"
67
+ | "LargeFlyingBoat"
68
+ | "LargeSearchlight"
69
+ | "CombatRation"
70
+ | "Supplies"
71
+ | "SeaplaneFighter"
72
+ | "AmphibiousTank"
73
+ | "LbAttacker"
74
+ | "LbFighter"
75
+ | "LbRecon"
76
+ | "TransportationMaterial"
77
+ | "SubmarineEquipment"
78
+ | "LargeLbAircraft"
79
+ | "JetFighter"
80
+ | "JetFighterBomber"
81
+ | "JetTorpedoBomber"
82
+ | "JetRecon"
83
+ | "LargeRadar2"
84
+ | "CbRecon2"
85
+ | "SecondaryGun2";
21
86
 
22
- export interface FleetMeta {
23
- id: string;
24
- len: number;
25
- ships: [string, ShipMeta | null][];
26
- }
87
+ export type GearAttr =
88
+ | "Unknown"
89
+ | "Abyssal"
90
+ | "HighAngleMount"
91
+ | "NightFighter"
92
+ | "NightAttacker"
93
+ | "HeavyBomber"
94
+ | "NightRecon"
95
+ | "MainGun"
96
+ | "Radar"
97
+ | "SurfaceRadar"
98
+ | "AirRadar"
99
+ | "DepthChargeProjector"
100
+ | "SynergisticDepthCharge"
101
+ | "AntiSubMortar"
102
+ | "AntiSubWeapon"
103
+ | "ApDepthCharge"
104
+ | "AntiSubAircraft"
105
+ | "LateModelBowTorpedo"
106
+ | "Seaplane"
107
+ | "CbAircraft"
108
+ | "LbAircraft"
109
+ | "JetAircraft"
110
+ | "Fighter"
111
+ | "Recon"
112
+ | "ObservationSeaplane"
113
+ | "CbFighterBomber"
114
+ | "AntiInstDiveBomber"
115
+ | "CbSwordfish"
116
+ | "SemiNightPlane"
117
+ | "HighAltitudeInterceptor"
118
+ | "HistoricalAircraftA1"
119
+ | "HistoricalAircraftA2"
120
+ | "HistoricalAircraftA3"
121
+ | "HistoricalAircraftB1"
122
+ | "HistoricalAircraftB2"
123
+ | "HistoricalAircraftB3"
124
+ | "HistoricalAircraftC1"
125
+ | "HistoricalAircraftC2"
126
+ | "HistoricalAircraftC3";
27
127
 
28
- export interface ShipMeta {
29
- id: string;
30
- ship_id: number;
31
- }
128
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
32
129
 
33
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
130
+ export interface BattleDefinitions {
131
+ formation: Record<Formation, NestedFormationDef>;
132
+ anti_air_cutin: Record<number, AntiAirCutinDef>;
133
+ day_cutin: Record<DayCutin, DayCutinDef>;
134
+ night_cutin: Record<NightCutin, NightCutinDef>;
135
+ }
34
136
 
35
- export type TorpedoAttackType = null;
137
+ export interface NightCutinDef {
138
+ tag: NightCutin;
139
+ hits: number;
140
+ type_factor: number | null;
141
+ power_mod: number | null;
142
+ accuracy_mod: number | null;
143
+ }
36
144
 
37
- export type NightPhaseAttackType =
38
- | { t: "Night"; c: NightAttackType }
39
- | { t: "Asw"; c: AswAttackType };
145
+ export interface DayCutinDef {
146
+ tag: DayCutin;
147
+ hits: number;
148
+ type_factor: number | null;
149
+ power_mod: number | null;
150
+ accuracy_mod: number | null;
151
+ }
40
152
 
41
- export type DayPhaseAttackType =
42
- | { t: "Shelling"; c: ShellingType }
43
- | { t: "Asw"; c: AswAttackType };
153
+ export interface AntiAirCutinDef {
154
+ id: number;
155
+ type_factor: number | null;
156
+ multiplier: number | null;
157
+ guaranteed: number | null;
158
+ sequential: boolean | null;
159
+ }
44
160
 
45
- export type AttackType =
46
- | { t: "Asw"; c: AswAttackType }
47
- | { t: "Shelling"; c: ShellingType }
48
- | { t: "Night"; c: NightAttackType }
49
- | { t: "Torpedo" }
50
- | { t: "SupportShelling"; c: SupportShellingType };
161
+ export type NestedFormationDef =
162
+ | FormationDef
163
+ | { top_half: FormationDef; bottom_half: FormationDef };
51
164
 
52
- export type SupportShellingType = ShellingType;
165
+ export interface FormationDef {
166
+ tag: Formation;
167
+ protection_rate: number | null;
168
+ fleet_anti_air_mod: number;
169
+ shelling: FormationCombatModifiersDef;
170
+ torpedo: FormationCombatModifiersDef;
171
+ asw: FormationCombatModifiersDef;
172
+ night: FormationCombatModifiersDef;
173
+ support_shelling: FormationCombatModifiersDef;
174
+ }
53
175
 
54
- export type NightAttackType = "Normal" | "Swordfish" | "Carrier";
176
+ export interface FormationCombatModifiersDef {
177
+ power_mod?: number;
178
+ accuracy_mod?: number;
179
+ evasion_mod?: number;
180
+ }
55
181
 
56
- export type ShellingType = "Normal" | "Carrier";
182
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
57
183
 
58
- export type AswAttackType = "DepthCharge" | "Aircraft";
184
+ export type AirState =
185
+ | "AirSupremacy"
186
+ | "AirSuperiority"
187
+ | "AirParity"
188
+ | "AirDenial"
189
+ | "AirIncapability";
59
190
 
60
- export type FhResult<T> = { Ok: T } | { Err: string };
191
+ export interface MasterData extends MasterBattleDefinitions {
192
+ created_at: number;
193
+ gears: MasterGear[];
194
+ gear_attrs: MasterAttrRule<GearAttr>[];
195
+ ships: MasterShip[];
196
+ ship_attrs: MasterAttrRule<ShipAttr>[];
197
+ ibonuses: MasterIBonuses;
198
+ equippable: MasterEquippability;
199
+ }
61
200
 
62
- export interface NodeAttackAnalysis2 {
63
- data: AttackAnalysis[];
201
+ export interface NationalityDef {
202
+ id: number;
203
+ ctypes: number[];
64
204
  }
65
205
 
66
- export type CompiledEvaler = string;
206
+ export interface MasterAttrRule<T> {
207
+ tag: T;
208
+ name: string;
209
+ expr: CompiledEvaler;
210
+ }
67
211
 
68
212
  export interface OrgState {
69
213
  id?: string;
@@ -146,36 +290,8 @@ export interface GearState {
146
290
  stars?: number;
147
291
  }
148
292
 
149
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
150
-
151
293
  export type SlotSizeVec = (number | null)[];
152
294
 
153
- export type Role = "Main" | "Escort";
154
-
155
- export interface ActionReport<T> {
156
- data: Record<string, AttackReport<T>>;
157
- damage_state_density: Histogram<DamageState, number> | null;
158
- is_active: boolean;
159
- }
160
-
161
- export type GearTypeIdArray = [number, number, number, number, number];
162
-
163
- export type SpecialEnemyType =
164
- | "None"
165
- | "SoftSkinned"
166
- | "Pillbox"
167
- | "IsolatedIsland"
168
- | "SupplyDepot"
169
- | "NewSupplyDepot"
170
- | "HarbourSummerPrincess"
171
- | "PtImp"
172
- | "BattleshipSummerPrincess"
173
- | "HeavyCruiserSummerPrincess";
174
-
175
- export type Align = "Left" | "Right";
176
-
177
- export type Side = "Player" | "Enemy";
178
-
179
295
  export type ShipType =
180
296
  | "Unknown"
181
297
  | "DE"
@@ -211,53 +327,37 @@ export type ShipCategory =
211
327
  | "Submarine"
212
328
  | "AuxiliaryShip";
213
329
 
214
- export interface MasterIBonuses {
215
- shelling_power: MasterIBonusRule[];
216
- shelling_accuracy: MasterIBonusRule[];
217
- shelling_aerial_power: MasterIBonusRule[];
218
- torpedo_power: MasterIBonusRule[];
219
- torpedo_accuracy: MasterIBonusRule[];
220
- torpedo_evasion: MasterIBonusRule[];
221
- asw_power: MasterIBonusRule[];
222
- asw_accuracy: MasterIBonusRule[];
223
- night_power: MasterIBonusRule[];
224
- night_aerial_power: MasterIBonusRule[];
225
- night_accuracy: MasterIBonusRule[];
226
- defense_power: MasterIBonusRule[];
227
- contact_selection: MasterIBonusRule[];
228
- fighter_power: MasterIBonusRule[];
229
- ship_anti_air: MasterIBonusRule[];
230
- fleet_anti_air: MasterIBonusRule[];
231
- elos: MasterIBonusRule[];
330
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
331
+ formation?: Formation;
232
332
  }
233
333
 
234
- export interface MasterIBonusRule {
235
- expr: CompiledEvaler;
236
- formula: CompiledEvaler;
334
+ export interface NodeAttackAnalyzerConfig {
335
+ air_state?: AirState;
336
+ engagement?: Engagement;
337
+ left?: NodeAttackAnalyzerShipConfig;
338
+ right?: NodeAttackAnalyzerShipConfig;
237
339
  }
238
340
 
239
- export interface FleetCutinAnalysis {
240
- shelling: FleetCutinReport<ShellingStyle>[];
241
- night: FleetCutinReport<NightAttackStyle>[];
341
+ export interface NodeAttackAnalysis {
342
+ left: AttackAnalysis;
343
+ right: AttackAnalysis;
344
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
345
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
242
346
  }
243
347
 
244
- export interface FleetCutinReport<T> {
245
- cutin: FleetCutin;
246
- rate: number | null;
247
- formation: Formation;
248
- attacks: FleetCutinAttackReport<T>[];
348
+ export interface ActionReport<T> {
349
+ data: Record<string, AttackReport<T>>;
350
+ damage_state_density: Histogram<DamageState, number> | null;
351
+ is_active: boolean;
249
352
  }
250
353
 
251
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
252
- index: number;
253
- ship_id: number;
254
- power_mod: number;
255
- }
354
+ export type GearTypeIdArray = [number, number, number, number, number];
256
355
 
257
- export interface MoveShipPayload {
258
- current: [string, string, ShipKey];
259
- target: [string | null, string, ShipKey];
260
- }
356
+ export type Align = "Left" | "Right";
357
+
358
+ export type Side = "Player" | "Enemy";
359
+
360
+ export type Role = "Main" | "Escort";
261
361
 
262
362
  export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
263
363
 
@@ -302,7 +402,21 @@ export type DayCutin =
302
402
  | "BBA"
303
403
  | "BA";
304
404
 
305
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
405
+ export interface AttackReport<T> {
406
+ style: T;
407
+ proc_rate: number | null;
408
+ attack_power: AttackPower | null;
409
+ attack_power_params: AttackPowerParams | null;
410
+ hits: number;
411
+ hit_rate: HitRate | null;
412
+ hit_rate_params: HitRateParams | null;
413
+ damage: DamageReport | null;
414
+ }
415
+
416
+ export interface MoveShipPayload {
417
+ current: [string, string, ShipKey];
418
+ target: [string | null, string, ShipKey];
419
+ }
306
420
 
307
421
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
308
422
 
@@ -318,131 +432,39 @@ export interface SimulatorResultItem {
318
432
  damage_state_map: Record<DamageState, number>;
319
433
  }
320
434
 
321
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
322
-
323
- export type GearCategory =
324
- | "Fighter"
325
- | "Bomber"
326
- | "Recon"
327
- | "MainGun"
328
- | "Secondary"
329
- | "Torpedo"
330
- | "AntiSub"
331
- | "Radar"
332
- | "Landing"
333
- | "Ration"
334
- | "LandBased"
335
- | "Misc";
336
-
337
- export type GearType =
338
- | "Unknown"
339
- | "SmallMainGun"
340
- | "MediumMainGun"
341
- | "LargeMainGun"
342
- | "SecondaryGun"
343
- | "Torpedo"
344
- | "CbFighter"
345
- | "CbDiveBomber"
346
- | "CbTorpedoBomber"
347
- | "CbRecon"
348
- | "ReconSeaplane"
349
- | "SeaplaneBomber"
350
- | "SmallRadar"
351
- | "LargeRadar"
352
- | "Sonar"
353
- | "DepthCharge"
354
- | "ExtraArmor"
355
- | "Engine"
356
- | "AntiAirShell"
357
- | "ApShell"
358
- | "VtFuze"
359
- | "AntiAirGun"
360
- | "MidgetSubmarine"
361
- | "EmergencyRepair"
362
- | "LandingCraft"
363
- | "Rotorcraft"
364
- | "AntiSubPatrolAircraft"
365
- | "MediumArmor"
366
- | "LargeArmor"
367
- | "Searchlight"
368
- | "SupplyContainer"
369
- | "ShipRepairFacility"
370
- | "SubmarineTorpedo"
371
- | "Starshell"
372
- | "CommandFacility"
373
- | "AviationPersonnel"
374
- | "AntiAirFireDirector"
375
- | "AntiGroundEquipment"
376
- | "LargeMainGun2"
377
- | "ShipPersonnel"
378
- | "LargeSonar"
379
- | "LargeFlyingBoat"
380
- | "LargeSearchlight"
381
- | "CombatRation"
382
- | "Supplies"
383
- | "SeaplaneFighter"
384
- | "AmphibiousTank"
385
- | "LbAttacker"
386
- | "LbFighter"
387
- | "LbRecon"
388
- | "TransportationMaterial"
389
- | "SubmarineEquipment"
390
- | "LargeLbAircraft"
391
- | "JetFighter"
392
- | "JetFighterBomber"
393
- | "JetTorpedoBomber"
394
- | "JetRecon"
395
- | "LargeRadar2"
396
- | "CbRecon2"
397
- | "SecondaryGun2";
398
-
399
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
400
-
401
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
402
-
403
- export type AirState =
404
- | "AirSupremacy"
405
- | "AirSuperiority"
406
- | "AirParity"
407
- | "AirDenial"
408
- | "AirIncapability";
409
-
410
- export interface MasterData extends MasterBattleDefinitions {
411
- created_at: number;
412
- gears: MasterGear[];
413
- gear_attrs: MasterAttrRule<GearAttr>[];
414
- ships: MasterShip[];
415
- ship_attrs: MasterAttrRule<ShipAttr>[];
416
- ibonuses: MasterIBonuses;
417
- equippable: MasterEquippability;
418
- }
419
-
420
- export interface NationalityDef {
421
- id: number;
422
- ctypes: number[];
435
+ export interface MasterIBonuses {
436
+ shelling_power: MasterIBonusRule[];
437
+ shelling_accuracy: MasterIBonusRule[];
438
+ shelling_aerial_power: MasterIBonusRule[];
439
+ torpedo_power: MasterIBonusRule[];
440
+ torpedo_accuracy: MasterIBonusRule[];
441
+ torpedo_evasion: MasterIBonusRule[];
442
+ asw_power: MasterIBonusRule[];
443
+ asw_accuracy: MasterIBonusRule[];
444
+ night_power: MasterIBonusRule[];
445
+ night_aerial_power: MasterIBonusRule[];
446
+ night_accuracy: MasterIBonusRule[];
447
+ defense_power: MasterIBonusRule[];
448
+ contact_selection: MasterIBonusRule[];
449
+ fighter_power: MasterIBonusRule[];
450
+ ship_anti_air: MasterIBonusRule[];
451
+ fleet_anti_air: MasterIBonusRule[];
452
+ elos: MasterIBonusRule[];
423
453
  }
424
454
 
425
- export interface MasterAttrRule<T> {
426
- tag: T;
427
- name: string;
455
+ export interface MasterIBonusRule {
428
456
  expr: CompiledEvaler;
457
+ formula: CompiledEvaler;
429
458
  }
430
459
 
431
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
432
- formation?: Formation;
433
- }
460
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
434
461
 
435
- export interface NodeAttackAnalyzerConfig {
436
- air_state?: AirState;
437
- engagement?: Engagement;
438
- left?: NodeAttackAnalyzerShipConfig;
439
- right?: NodeAttackAnalyzerShipConfig;
462
+ export interface ShipConditions extends ShipPosition {
463
+ formation?: Formation;
464
+ amagiri_index?: number | null;
440
465
  }
441
466
 
442
- export interface NodeAttackAnalysis {
443
- left: AttackAnalysis;
444
- right: AttackAnalysis;
445
- }
467
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
446
468
 
447
469
  export interface EBonuses {
448
470
  firepower: number;
@@ -484,10 +506,6 @@ export interface GearInput {
484
506
 
485
507
  export type GearVecInput = GearInput[];
486
508
 
487
- export interface ShipConditions extends ShipPosition {
488
- formation?: Formation;
489
- }
490
-
491
509
  export type ShipAttr =
492
510
  | "Unknown"
493
511
  | "Abyssal"
@@ -505,66 +523,63 @@ export type ShipAttr =
505
523
  | "BattleshipSummerPrincess"
506
524
  | "HeavyCruiserSummerPrincess";
507
525
 
508
- export type OrgType =
509
- | "Single"
510
- | "CarrierTaskForce"
511
- | "SurfaceTaskForce"
512
- | "TransportEscort"
513
- | "EnemySingle"
514
- | "EnemyCombined";
515
-
516
- export interface BattleDefinitions {
517
- formation: Record<Formation, NestedFormationDef>;
518
- anti_air_cutin: Record<number, AntiAirCutinDef>;
519
- day_cutin: Record<DayCutin, DayCutinDef>;
520
- night_cutin: Record<NightCutin, NightCutinDef>;
526
+ export interface ShipPosition {
527
+ org_type?: OrgType;
528
+ fleet_type?: FleetType;
529
+ fleet_len?: number;
530
+ index?: number;
521
531
  }
522
532
 
523
- export interface NightCutinDef {
524
- tag: NightCutin;
525
- hits: number;
526
- type_factor: number | null;
527
- power_mod: number | null;
528
- accuracy_mod: number | null;
533
+ export interface CompMeta {
534
+ fleets: Record<FleetType, FleetMeta>;
529
535
  }
530
536
 
531
- export interface DayCutinDef {
532
- tag: DayCutin;
533
- hits: number;
534
- type_factor: number | null;
535
- power_mod: number | null;
536
- accuracy_mod: number | null;
537
+ export interface FleetMeta {
538
+ id: string;
539
+ len: number;
540
+ ships: [string, ShipMeta | null][];
537
541
  }
538
542
 
539
- export interface AntiAirCutinDef {
540
- id: number;
541
- type_factor: number | null;
542
- multiplier: number | null;
543
- guaranteed: number | null;
544
- sequential: boolean | null;
543
+ export interface ShipMeta {
544
+ id: string;
545
+ ship_id: number;
545
546
  }
546
547
 
547
- export type NestedFormationDef =
548
- | FormationDef
549
- | { top_half: FormationDef; bottom_half: FormationDef };
548
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
550
549
 
551
- export interface FormationDef {
552
- tag: Formation;
553
- protection_rate: number | null;
554
- fleet_anti_air_mod: number;
555
- shelling: FormationCombatModifiersDef;
556
- torpedo: FormationCombatModifiersDef;
557
- asw: FormationCombatModifiersDef;
558
- night: FormationCombatModifiersDef;
559
- support_shelling: FormationCombatModifiersDef;
560
- }
550
+ export type TorpedoAttackType = null;
551
+
552
+ export type NightPhaseAttackType =
553
+ | { t: "Night"; c: NightAttackType }
554
+ | { t: "Asw"; c: AswAttackType };
555
+
556
+ export type DayPhaseAttackType =
557
+ | { t: "Shelling"; c: ShellingType }
558
+ | { t: "Asw"; c: AswAttackType };
559
+
560
+ export type AttackType =
561
+ | { t: "Asw"; c: AswAttackType }
562
+ | { t: "Shelling"; c: ShellingType }
563
+ | { t: "Night"; c: NightAttackType }
564
+ | { t: "Torpedo" }
565
+ | { t: "SupportShelling"; c: SupportShellingType };
566
+
567
+ export type SupportShellingType = ShellingType;
568
+
569
+ export type NightAttackType = "Normal" | "Swordfish" | "Carrier";
570
+
571
+ export type ShellingType = "Normal" | "Carrier";
561
572
 
562
- export interface FormationCombatModifiersDef {
563
- power_mod?: number;
564
- accuracy_mod?: number;
565
- evasion_mod?: number;
573
+ export type AswAttackType = "DepthCharge" | "Aircraft";
574
+
575
+ export interface SupportShellingSimulatorParams {
576
+ attacker_formation?: Formation;
577
+ target_formation?: Formation;
578
+ engagement: Engagement;
566
579
  }
567
580
 
581
+ export type FhResult<T> = { Ok: T } | { Err: string };
582
+
568
583
  export interface ShipAnalyzerConfig {
569
584
  air_state?: AirState;
570
585
  engagement?: Engagement;
@@ -572,44 +587,37 @@ export interface ShipAnalyzerConfig {
572
587
  right?: AttackAnalyzerShipConfig;
573
588
  }
574
589
 
575
- export type GearAttr =
576
- | "Unknown"
577
- | "Abyssal"
578
- | "HighAngleMount"
579
- | "NightFighter"
580
- | "NightAttacker"
581
- | "HeavyBomber"
582
- | "NightRecon"
583
- | "MainGun"
584
- | "Radar"
585
- | "SurfaceRadar"
586
- | "AirRadar"
587
- | "DepthChargeProjector"
588
- | "SynergisticDepthCharge"
589
- | "AntiSubMortar"
590
- | "AntiSubWeapon"
591
- | "ApDepthCharge"
592
- | "AntiSubAircraft"
593
- | "LateModelBowTorpedo"
594
- | "Seaplane"
595
- | "CbAircraft"
596
- | "LbAircraft"
597
- | "JetAircraft"
598
- | "Fighter"
599
- | "Recon"
600
- | "ObservationSeaplane"
601
- | "CbFighterBomber"
602
- | "AntiInstDiveBomber"
603
- | "CbSwordfish"
604
- | "SemiNightPlane"
605
- | "HighAltitudeInterceptor";
590
+ export type OrgType =
591
+ | "Single"
592
+ | "CarrierTaskForce"
593
+ | "SurfaceTaskForce"
594
+ | "TransportEscort"
595
+ | "EnemySingle"
596
+ | "EnemyCombined";
606
597
 
607
598
  export type FleetKey = "f1" | "f2" | "f3" | "f4";
608
599
 
609
- export interface SupportShellingSimulatorParams {
610
- attacker_formation?: Formation;
611
- target_formation?: Formation;
612
- engagement: Engagement;
600
+ export interface NightContactChance {
601
+ rank1: number;
602
+ rank2: number;
603
+ rank3: number;
604
+ }
605
+
606
+ export interface CompNightCutinAnalysis {
607
+ night_contact_chance: NightContactChance;
608
+ ships: ShipNightCutinAnalysis[];
609
+ }
610
+
611
+ export interface ShipNightCutinAnalysis {
612
+ ship_id: number;
613
+ index: number;
614
+ normal: NightCutinActionReport;
615
+ chuuha: NightCutinActionReport;
616
+ }
617
+
618
+ export interface NightCutinActionReport
619
+ extends ActionReport<NightPhaseAttackStyle> {
620
+ cutin_term: number | null;
613
621
  }
614
622
 
615
623
  export interface CompAntiAirAnalysis {
@@ -669,6 +677,28 @@ export interface ShellingStyle {
669
677
  hits: number;
670
678
  }
671
679
 
680
+ export interface CustomPowerModifiers {
681
+ precap_mod?: AttackPowerModifier;
682
+ postcap_mod?: AttackPowerModifier;
683
+ basic_power_mod?: AttackPowerModifier;
684
+ }
685
+
686
+ export interface SpecialEnemyModifiers {
687
+ precap_general_mod: AttackPowerModifier;
688
+ stype_mod: AttackPowerModifier;
689
+ landing_craft_synergy_mod: AttackPowerModifier;
690
+ toku_daihatsu_tank_mod: AttackPowerModifier;
691
+ m4a1dd_mod: AttackPowerModifier;
692
+ honi_mod: AttackPowerModifier;
693
+ postcap_general_mod: AttackPowerModifier;
694
+ pt_mod: AttackPowerModifier;
695
+ }
696
+
697
+ export interface AttackPowerModifier {
698
+ a?: number;
699
+ b?: number;
700
+ }
701
+
672
702
  export interface AttackPower {
673
703
  precap: number;
674
704
  is_capped: boolean;
@@ -704,27 +734,17 @@ export interface SpecialEnemyModifiers {
704
734
  pt_mod: AttackPowerModifier;
705
735
  }
706
736
 
707
- export interface NightContactChance {
708
- rank1: number;
709
- rank2: number;
710
- rank3: number;
711
- }
712
-
713
- export interface CompNightCutinAnalysis {
714
- night_contact_chance: NightContactChance;
715
- ships: ShipNightCutinAnalysis[];
737
+ export interface FleetCutinReport<T> {
738
+ cutin: FleetCutin;
739
+ rate: number | null;
740
+ formation: Formation;
741
+ attacks: FleetCutinAttackReport<T>[];
716
742
  }
717
743
 
718
- export interface ShipNightCutinAnalysis {
719
- ship_id: number;
744
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
720
745
  index: number;
721
- normal: NightCutinActionReport;
722
- chuuha: NightCutinActionReport;
723
- }
724
-
725
- export interface NightCutinActionReport
726
- extends ActionReport<NightPhaseAttackStyle> {
727
- cutin_term: number | null;
746
+ ship_id: number;
747
+ power_mod: number;
728
748
  }
729
749
 
730
750
  export interface DamageReport {
@@ -764,50 +784,6 @@ export type SingleFormation =
764
784
  | "LineAbreast"
765
785
  | "Vanguard";
766
786
 
767
- export interface CustomPowerModifiers {
768
- precap_mod?: AttackPowerModifier;
769
- postcap_mod?: AttackPowerModifier;
770
- basic_power_mod?: AttackPowerModifier;
771
- }
772
-
773
- export interface SpecialEnemyModifiers {
774
- precap_general_mod: AttackPowerModifier;
775
- stype_mod: AttackPowerModifier;
776
- landing_craft_synergy_mod: AttackPowerModifier;
777
- toku_daihatsu_tank_mod: AttackPowerModifier;
778
- m4a1dd_mod: AttackPowerModifier;
779
- honi_mod: AttackPowerModifier;
780
- postcap_general_mod: AttackPowerModifier;
781
- pt_mod: AttackPowerModifier;
782
- }
783
-
784
- export interface AttackPowerModifier {
785
- a?: number;
786
- b?: number;
787
- }
788
-
789
- export interface MasterBattleDefinitions {
790
- formation: NestedFormationDef[];
791
- anti_air_cutin: AntiAirCutinDef[];
792
- day_cutin: DayCutinDef[];
793
- night_cutin: NightCutinDef[];
794
- }
795
-
796
- export interface HitRate {
797
- normal: number;
798
- critical: number;
799
- total: number;
800
- }
801
-
802
- export interface HitRateParams {
803
- accuracy_term: number;
804
- evasion_term: number;
805
- target_morale_mod: number;
806
- critical_rate_constant: number;
807
- critical_percentage_bonus: number;
808
- hit_percentage_bonus: number;
809
- }
810
-
811
787
  export interface CompDayCutinAnalysis {
812
788
  rank3_air_state: AirState;
813
789
  rank2_air_state: AirState;
@@ -828,20 +804,6 @@ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
828
804
  observation_term: number | null;
829
805
  }
830
806
 
831
- export interface ContactAnalysis {
832
- single: DayContactChance[] | null;
833
- combined: DayContactChance[] | null;
834
- }
835
-
836
- export interface DayContactChance {
837
- air_state: AirState;
838
- trigger_rate: number;
839
- rank3: number;
840
- rank2: number;
841
- rank1: number;
842
- total: number;
843
- }
844
-
845
807
  export interface AttackAnalysis {
846
808
  attacker_is_player: boolean;
847
809
  attacker_ship_id: number;
@@ -853,6 +815,18 @@ export interface AttackAnalysis {
853
815
  support_shelling: ActionReport<SupportShellingStyle>;
854
816
  }
855
817
 
818
+ export type SpecialEnemyType =
819
+ | "None"
820
+ | "SoftSkinned"
821
+ | "Pillbox"
822
+ | "IsolatedIsland"
823
+ | "SupplyDepot"
824
+ | "NewSupplyDepot"
825
+ | "HarbourSummerPrincess"
826
+ | "PtImp"
827
+ | "BattleshipSummerPrincess"
828
+ | "HeavyCruiserSummerPrincess";
829
+
856
830
  export interface MasterShip {
857
831
  ship_id: number;
858
832
  name: string;
@@ -917,6 +891,42 @@ export interface EquipStype {
917
891
  equip_type: number[];
918
892
  }
919
893
 
894
+ export interface MasterBattleDefinitions {
895
+ formation: NestedFormationDef[];
896
+ anti_air_cutin: AntiAirCutinDef[];
897
+ day_cutin: DayCutinDef[];
898
+ night_cutin: NightCutinDef[];
899
+ }
900
+
901
+ export interface HitRate {
902
+ normal: number;
903
+ critical: number;
904
+ total: number;
905
+ }
906
+
907
+ export interface HitRateParams {
908
+ accuracy_term: number;
909
+ evasion_term: number;
910
+ target_morale_mod: number;
911
+ critical_rate_constant: number;
912
+ critical_percentage_bonus: number;
913
+ hit_percentage_bonus: number;
914
+ }
915
+
916
+ export interface ContactAnalysis {
917
+ single: DayContactChance[] | null;
918
+ combined: DayContactChance[] | null;
919
+ }
920
+
921
+ export interface DayContactChance {
922
+ air_state: AirState;
923
+ trigger_rate: number;
924
+ rank3: number;
925
+ rank2: number;
926
+ rank1: number;
927
+ total: number;
928
+ }
929
+
920
930
  export interface CompAnalyzerConfig {
921
931
  engagement: Engagement;
922
932
  formation: Formation;
@@ -944,6 +954,10 @@ export interface CompAnalysis {
944
954
  anti_air: CompAntiAirAnalysis;
945
955
  }
946
956
 
957
+ export type CompiledEvaler = string;
958
+
959
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
960
+
947
961
  export interface NightFleetConditions {
948
962
  night_contact_rank?: ContactRank | null;
949
963
  starshell_index?: number | null;
@@ -991,17 +1005,6 @@ export interface MasterGear {
991
1005
  fleet_anti_air_resist?: number;
992
1006
  }
993
1007
 
994
- export interface AttackReport<T> {
995
- style: T;
996
- proc_rate: number | null;
997
- attack_power: AttackPower | null;
998
- attack_power_params: AttackPowerParams | null;
999
- hits: number;
1000
- hit_rate: HitRate | null;
1001
- hit_rate_params: HitRateParams | null;
1002
- damage: DamageReport | null;
1003
- }
1004
-
1005
1008
  /**
1006
1009
  */
1007
1010
  export class AirSquadron {
@@ -1076,19 +1079,6 @@ export class Analyzer {
1076
1079
  right_comp: Comp,
1077
1080
  right_ship: Ship
1078
1081
  ): NodeAttackAnalysis;
1079
- /**
1080
- * @param {NodeAttackAnalyzerConfig} config
1081
- * @param {Comp} left_comp
1082
- * @param {Comp} right_comp
1083
- * @param {string} attacker_id
1084
- * @returns {NodeAttackAnalysis2 | undefined}
1085
- */
1086
- analyze_node_attack2(
1087
- config: NodeAttackAnalyzerConfig,
1088
- left_comp: Comp,
1089
- right_comp: Comp,
1090
- attacker_id: string
1091
- ): NodeAttackAnalysis2 | undefined;
1092
1082
  /**
1093
1083
  * @param {Comp} comp
1094
1084
  * @param {CompAnalyzerConfig} config
@@ -1866,6 +1856,10 @@ export class Ship {
1866
1856
  * @returns {boolean}
1867
1857
  */
1868
1858
  is_submarine(): boolean;
1859
+ /**
1860
+ * @returns {boolean}
1861
+ */
1862
+ is_amagiri(): boolean;
1869
1863
  /**
1870
1864
  * @param {Gear} gear
1871
1865
  * @param {string} key
@@ -1880,6 +1874,10 @@ export class Ship {
1880
1874
  * @returns {boolean}
1881
1875
  */
1882
1876
  is_pt_imp(): boolean;
1877
+ /**
1878
+ * @returns {SpecialEnemyType}
1879
+ */
1880
+ special_enemy_type(): SpecialEnemyType;
1883
1881
  /**
1884
1882
  * @returns {boolean}
1885
1883
  */