fleethub-core 1.8.12 → 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.
@@ -8,62 +8,206 @@ export function parse_ship_conditions(value: ShipConditions): ShipConditions;
8
8
  /**
9
9
  */
10
10
  export function set_panic_hook(): void;
11
- export interface ShipPosition {
12
- org_type?: OrgType;
13
- fleet_type?: FleetType;
14
- fleet_len?: number;
15
- index?: number;
16
- }
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,55 +290,59 @@ 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 interface NightFleetConditions {
154
- night_contact_rank?: ContactRank | null;
155
- starshell_index?: number | null;
156
- searchlight_index?: number | null;
157
- activates_large_searchlight?: boolean;
295
+ export type ShipType =
296
+ | "Unknown"
297
+ | "DE"
298
+ | "DD"
299
+ | "CL"
300
+ | "CLT"
301
+ | "CA"
302
+ | "CAV"
303
+ | "CVL"
304
+ | "FBB"
305
+ | "BB"
306
+ | "BBV"
307
+ | "CV"
308
+ | "XBB"
309
+ | "SS"
310
+ | "SSV"
311
+ | "AP"
312
+ | "AV"
313
+ | "LHA"
314
+ | "CVB"
315
+ | "AR"
316
+ | "AS"
317
+ | "CT"
318
+ | "AO";
319
+
320
+ export type ShipCategory =
321
+ | "Battleship"
322
+ | "AircraftCarrier"
323
+ | "HeavyCruiser"
324
+ | "LightCruiser"
325
+ | "Destroyer"
326
+ | "CoastalDefenseShip"
327
+ | "Submarine"
328
+ | "AuxiliaryShip";
329
+
330
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
331
+ formation?: Formation;
158
332
  }
159
333
 
160
- export interface NightConditions {
161
- player?: NightFleetConditions;
162
- enemy?: NightFleetConditions;
163
- }
164
-
165
- export interface BattleConditions {
166
- org_type: OrgType;
167
- role: Role;
168
- ship_index: number;
169
- fleet_len: number;
170
- formation: Formation;
171
- fleet_los_mod: number | null;
172
- night_conditions: NightFleetConditions;
334
+ export interface NodeAttackAnalyzerConfig {
335
+ air_state?: AirState;
336
+ engagement?: Engagement;
337
+ left?: NodeAttackAnalyzerShipConfig;
338
+ right?: NodeAttackAnalyzerShipConfig;
173
339
  }
174
340
 
175
- export interface MasterGear {
176
- gear_id: number;
177
- name: string;
178
- types: GearTypeIdArray;
179
- special_type?: number;
180
- max_hp?: number;
181
- firepower?: number;
182
- armor?: number;
183
- torpedo?: number;
184
- anti_air?: number;
185
- speed?: number;
186
- bombing?: number;
187
- asw?: number;
188
- los?: number;
189
- luck?: number;
190
- accuracy?: number;
191
- evasion?: number;
192
- range?: number;
193
- radius?: number;
194
- cost?: number;
195
- improvable?: boolean;
196
- ship_anti_air_resist?: number;
197
- fleet_anti_air_resist?: number;
341
+ export interface NodeAttackAnalysis {
342
+ left: AttackAnalysis;
343
+ right: AttackAnalysis;
344
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
345
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
198
346
  }
199
347
 
200
348
  export interface ActionReport<T> {
@@ -209,91 +357,8 @@ export type Align = "Left" | "Right";
209
357
 
210
358
  export type Side = "Player" | "Enemy";
211
359
 
212
- export type ShipType =
213
- | "Unknown"
214
- | "DE"
215
- | "DD"
216
- | "CL"
217
- | "CLT"
218
- | "CA"
219
- | "CAV"
220
- | "CVL"
221
- | "FBB"
222
- | "BB"
223
- | "BBV"
224
- | "CV"
225
- | "XBB"
226
- | "SS"
227
- | "SSV"
228
- | "AP"
229
- | "AV"
230
- | "LHA"
231
- | "CVB"
232
- | "AR"
233
- | "AS"
234
- | "CT"
235
- | "AO";
236
-
237
- export type ShipCategory =
238
- | "Battleship"
239
- | "AircraftCarrier"
240
- | "HeavyCruiser"
241
- | "LightCruiser"
242
- | "Destroyer"
243
- | "CoastalDefenseShip"
244
- | "Submarine"
245
- | "AuxiliaryShip";
246
-
247
360
  export type Role = "Main" | "Escort";
248
361
 
249
- export interface MasterIBonuses {
250
- shelling_power: MasterIBonusRule[];
251
- shelling_accuracy: MasterIBonusRule[];
252
- shelling_aerial_power: MasterIBonusRule[];
253
- torpedo_power: MasterIBonusRule[];
254
- torpedo_accuracy: MasterIBonusRule[];
255
- torpedo_evasion: MasterIBonusRule[];
256
- asw_power: MasterIBonusRule[];
257
- asw_accuracy: MasterIBonusRule[];
258
- night_power: MasterIBonusRule[];
259
- night_aerial_power: MasterIBonusRule[];
260
- night_accuracy: MasterIBonusRule[];
261
- defense_power: MasterIBonusRule[];
262
- contact_selection: MasterIBonusRule[];
263
- fighter_power: MasterIBonusRule[];
264
- ship_anti_air: MasterIBonusRule[];
265
- fleet_anti_air: MasterIBonusRule[];
266
- elos: MasterIBonusRule[];
267
- }
268
-
269
- export interface MasterIBonusRule {
270
- expr: CompiledEvaler;
271
- formula: CompiledEvaler;
272
- }
273
-
274
- export interface FleetCutinAnalysis {
275
- shelling: FleetCutinReport<ShellingStyle>[];
276
- night: FleetCutinReport<NightAttackStyle>[];
277
- }
278
-
279
- export interface FleetCutinReport<T> {
280
- cutin: FleetCutin;
281
- rate: number | null;
282
- formation: Formation;
283
- attacks: FleetCutinAttackReport<T>[];
284
- }
285
-
286
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
287
- index: number;
288
- ship_id: number;
289
- power_mod: number;
290
- }
291
-
292
- export interface MoveShipPayload {
293
- current: [string, string, ShipKey];
294
- target: [string | null, string, ShipKey];
295
- }
296
-
297
362
  export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
298
363
 
299
364
  export type NightCutinLike = NightCutin | FleetCutin;
@@ -337,7 +402,21 @@ export type DayCutin =
337
402
  | "BBA"
338
403
  | "BA";
339
404
 
340
- 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
+ }
341
420
 
342
421
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
343
422
 
@@ -353,131 +432,39 @@ export interface SimulatorResultItem {
353
432
  damage_state_map: Record<DamageState, number>;
354
433
  }
355
434
 
356
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
357
-
358
- export type GearCategory =
359
- | "Fighter"
360
- | "Bomber"
361
- | "Recon"
362
- | "MainGun"
363
- | "Secondary"
364
- | "Torpedo"
365
- | "AntiSub"
366
- | "Radar"
367
- | "Landing"
368
- | "Ration"
369
- | "LandBased"
370
- | "Misc";
371
-
372
- export type GearType =
373
- | "Unknown"
374
- | "SmallMainGun"
375
- | "MediumMainGun"
376
- | "LargeMainGun"
377
- | "SecondaryGun"
378
- | "Torpedo"
379
- | "CbFighter"
380
- | "CbDiveBomber"
381
- | "CbTorpedoBomber"
382
- | "CbRecon"
383
- | "ReconSeaplane"
384
- | "SeaplaneBomber"
385
- | "SmallRadar"
386
- | "LargeRadar"
387
- | "Sonar"
388
- | "DepthCharge"
389
- | "ExtraArmor"
390
- | "Engine"
391
- | "AntiAirShell"
392
- | "ApShell"
393
- | "VtFuze"
394
- | "AntiAirGun"
395
- | "MidgetSubmarine"
396
- | "EmergencyRepair"
397
- | "LandingCraft"
398
- | "Rotorcraft"
399
- | "AntiSubPatrolAircraft"
400
- | "MediumArmor"
401
- | "LargeArmor"
402
- | "Searchlight"
403
- | "SupplyContainer"
404
- | "ShipRepairFacility"
405
- | "SubmarineTorpedo"
406
- | "Starshell"
407
- | "CommandFacility"
408
- | "AviationPersonnel"
409
- | "AntiAirFireDirector"
410
- | "AntiGroundEquipment"
411
- | "LargeMainGun2"
412
- | "ShipPersonnel"
413
- | "LargeSonar"
414
- | "LargeFlyingBoat"
415
- | "LargeSearchlight"
416
- | "CombatRation"
417
- | "Supplies"
418
- | "SeaplaneFighter"
419
- | "AmphibiousTank"
420
- | "LbAttacker"
421
- | "LbFighter"
422
- | "LbRecon"
423
- | "TransportationMaterial"
424
- | "SubmarineEquipment"
425
- | "LargeLbAircraft"
426
- | "JetFighter"
427
- | "JetFighterBomber"
428
- | "JetTorpedoBomber"
429
- | "JetRecon"
430
- | "LargeRadar2"
431
- | "CbRecon2"
432
- | "SecondaryGun2";
433
-
434
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
435
-
436
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
437
-
438
- export type AirState =
439
- | "AirSupremacy"
440
- | "AirSuperiority"
441
- | "AirParity"
442
- | "AirDenial"
443
- | "AirIncapability";
444
-
445
- export interface MasterData extends MasterBattleDefinitions {
446
- created_at: number;
447
- gears: MasterGear[];
448
- gear_attrs: MasterAttrRule<GearAttr>[];
449
- ships: MasterShip[];
450
- ship_attrs: MasterAttrRule<ShipAttr>[];
451
- ibonuses: MasterIBonuses;
452
- equippable: MasterEquippability;
453
- }
454
-
455
- export interface NationalityDef {
456
- id: number;
457
- 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[];
458
453
  }
459
454
 
460
- export interface MasterAttrRule<T> {
461
- tag: T;
462
- name: string;
455
+ export interface MasterIBonusRule {
463
456
  expr: CompiledEvaler;
457
+ formula: CompiledEvaler;
464
458
  }
465
459
 
466
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
467
- formation?: Formation;
468
- }
460
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
469
461
 
470
- export interface NodeAttackAnalyzerConfig {
471
- air_state?: AirState;
472
- engagement?: Engagement;
473
- left?: NodeAttackAnalyzerShipConfig;
474
- right?: NodeAttackAnalyzerShipConfig;
462
+ export interface ShipConditions extends ShipPosition {
463
+ formation?: Formation;
464
+ amagiri_index?: number | null;
475
465
  }
476
466
 
477
- export interface NodeAttackAnalysis {
478
- left: AttackAnalysis;
479
- right: AttackAnalysis;
480
- }
467
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
481
468
 
482
469
  export interface EBonuses {
483
470
  firepower: number;
@@ -519,10 +506,6 @@ export interface GearInput {
519
506
 
520
507
  export type GearVecInput = GearInput[];
521
508
 
522
- export interface ShipConditions extends ShipPosition {
523
- formation?: Formation;
524
- }
525
-
526
509
  export type ShipAttr =
527
510
  | "Unknown"
528
511
  | "Abyssal"
@@ -540,111 +523,101 @@ export type ShipAttr =
540
523
  | "BattleshipSummerPrincess"
541
524
  | "HeavyCruiserSummerPrincess";
542
525
 
543
- export type OrgType =
544
- | "Single"
545
- | "CarrierTaskForce"
546
- | "SurfaceTaskForce"
547
- | "TransportEscort"
548
- | "EnemySingle"
549
- | "EnemyCombined";
550
-
551
- export interface BattleDefinitions {
552
- formation: Record<Formation, NestedFormationDef>;
553
- anti_air_cutin: Record<number, AntiAirCutinDef>;
554
- day_cutin: Record<DayCutin, DayCutinDef>;
555
- night_cutin: Record<NightCutin, NightCutinDef>;
526
+ export interface ShipPosition {
527
+ org_type?: OrgType;
528
+ fleet_type?: FleetType;
529
+ fleet_len?: number;
530
+ index?: number;
556
531
  }
557
532
 
558
- export interface NightCutinDef {
559
- tag: NightCutin;
560
- hits: number;
561
- type_factor: number | null;
562
- power_mod: number | null;
563
- accuracy_mod: number | null;
533
+ export interface CompMeta {
534
+ fleets: Record<FleetType, FleetMeta>;
564
535
  }
565
536
 
566
- export interface DayCutinDef {
567
- tag: DayCutin;
568
- hits: number;
569
- type_factor: number | null;
570
- power_mod: number | null;
571
- accuracy_mod: number | null;
537
+ export interface FleetMeta {
538
+ id: string;
539
+ len: number;
540
+ ships: [string, ShipMeta | null][];
572
541
  }
573
542
 
574
- export interface AntiAirCutinDef {
575
- id: number;
576
- type_factor: number | null;
577
- multiplier: number | null;
578
- guaranteed: number | null;
579
- sequential: boolean | null;
543
+ export interface ShipMeta {
544
+ id: string;
545
+ ship_id: number;
580
546
  }
581
547
 
582
- export type NestedFormationDef =
583
- | FormationDef
584
- | { top_half: FormationDef; bottom_half: FormationDef };
548
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
585
549
 
586
- export interface FormationDef {
587
- tag: Formation;
588
- protection_rate: number | null;
589
- fleet_anti_air_mod: number;
590
- shelling: FormationCombatModifiersDef;
591
- torpedo: FormationCombatModifiersDef;
592
- asw: FormationCombatModifiersDef;
593
- night: FormationCombatModifiersDef;
594
- support_shelling: FormationCombatModifiersDef;
595
- }
550
+ export type TorpedoAttackType = null;
596
551
 
597
- export interface FormationCombatModifiersDef {
598
- power_mod?: number;
599
- accuracy_mod?: number;
600
- evasion_mod?: number;
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";
572
+
573
+ export type AswAttackType = "DepthCharge" | "Aircraft";
574
+
575
+ export interface SupportShellingSimulatorParams {
576
+ attacker_formation?: Formation;
577
+ target_formation?: Formation;
578
+ engagement: Engagement;
601
579
  }
602
580
 
581
+ export type FhResult<T> = { Ok: T } | { Err: string };
582
+
603
583
  export interface ShipAnalyzerConfig {
604
584
  air_state?: AirState;
605
585
  engagement?: Engagement;
606
586
  left?: AttackAnalyzerShipConfig;
607
- right?: AttackAnalyzerShipConfig;
608
- }
609
-
610
- export type GearAttr =
611
- | "Unknown"
612
- | "Abyssal"
613
- | "HighAngleMount"
614
- | "NightFighter"
615
- | "NightAttacker"
616
- | "HeavyBomber"
617
- | "NightRecon"
618
- | "MainGun"
619
- | "Radar"
620
- | "SurfaceRadar"
621
- | "AirRadar"
622
- | "DepthChargeProjector"
623
- | "SynergisticDepthCharge"
624
- | "AntiSubMortar"
625
- | "AntiSubWeapon"
626
- | "ApDepthCharge"
627
- | "AntiSubAircraft"
628
- | "LateModelBowTorpedo"
629
- | "Seaplane"
630
- | "CbAircraft"
631
- | "LbAircraft"
632
- | "JetAircraft"
633
- | "Fighter"
634
- | "Recon"
635
- | "ObservationSeaplane"
636
- | "CbFighterBomber"
637
- | "AntiInstDiveBomber"
638
- | "CbSwordfish"
639
- | "SemiNightPlane"
640
- | "HighAltitudeInterceptor";
587
+ right?: AttackAnalyzerShipConfig;
588
+ }
589
+
590
+ export type OrgType =
591
+ | "Single"
592
+ | "CarrierTaskForce"
593
+ | "SurfaceTaskForce"
594
+ | "TransportEscort"
595
+ | "EnemySingle"
596
+ | "EnemyCombined";
641
597
 
642
598
  export type FleetKey = "f1" | "f2" | "f3" | "f4";
643
599
 
644
- export interface SupportShellingSimulatorParams {
645
- attacker_formation?: Formation;
646
- target_formation?: Formation;
647
- 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;
648
621
  }
649
622
 
650
623
  export interface CompAntiAirAnalysis {
@@ -704,6 +677,28 @@ export interface ShellingStyle {
704
677
  hits: number;
705
678
  }
706
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
+
707
702
  export interface AttackPower {
708
703
  precap: number;
709
704
  is_capped: boolean;
@@ -739,27 +734,17 @@ export interface SpecialEnemyModifiers {
739
734
  pt_mod: AttackPowerModifier;
740
735
  }
741
736
 
742
- export interface NightContactChance {
743
- rank1: number;
744
- rank2: number;
745
- rank3: number;
746
- }
747
-
748
- export interface CompNightCutinAnalysis {
749
- night_contact_chance: NightContactChance;
750
- ships: ShipNightCutinAnalysis[];
737
+ export interface FleetCutinReport<T> {
738
+ cutin: FleetCutin;
739
+ rate: number | null;
740
+ formation: Formation;
741
+ attacks: FleetCutinAttackReport<T>[];
751
742
  }
752
743
 
753
- export interface ShipNightCutinAnalysis {
754
- ship_id: number;
744
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
755
745
  index: number;
756
- normal: NightCutinActionReport;
757
- chuuha: NightCutinActionReport;
758
- }
759
-
760
- export interface NightCutinActionReport
761
- extends ActionReport<NightPhaseAttackStyle> {
762
- cutin_term: number | null;
746
+ ship_id: number;
747
+ power_mod: number;
763
748
  }
764
749
 
765
750
  export interface DamageReport {
@@ -783,18 +768,6 @@ export interface AttackAnalyzerShipConfig
783
768
 
784
769
  export type Histogram<K, V> = Partial<Record<K, V>>;
785
770
 
786
- export type SpecialEnemyType =
787
- | "None"
788
- | "SoftSkinned"
789
- | "Pillbox"
790
- | "IsolatedIsland"
791
- | "SupplyDepot"
792
- | "NewSupplyDepot"
793
- | "HarbourSummerPrincess"
794
- | "PtImp"
795
- | "BattleshipSummerPrincess"
796
- | "HeavyCruiserSummerPrincess";
797
-
798
771
  export type Formation = SingleFormation | CombinedFormation;
799
772
 
800
773
  export type CombinedFormation =
@@ -811,43 +784,6 @@ export type SingleFormation =
811
784
  | "LineAbreast"
812
785
  | "Vanguard";
813
786
 
814
- export interface CustomPowerModifiers {
815
- precap_mod?: AttackPowerModifier;
816
- postcap_mod?: AttackPowerModifier;
817
- basic_power_mod?: AttackPowerModifier;
818
- }
819
-
820
- export interface SpecialEnemyModifiers {
821
- precap_general_mod: AttackPowerModifier;
822
- stype_mod: AttackPowerModifier;
823
- landing_craft_synergy_mod: AttackPowerModifier;
824
- toku_daihatsu_tank_mod: AttackPowerModifier;
825
- m4a1dd_mod: AttackPowerModifier;
826
- honi_mod: AttackPowerModifier;
827
- postcap_general_mod: AttackPowerModifier;
828
- pt_mod: AttackPowerModifier;
829
- }
830
-
831
- export interface AttackPowerModifier {
832
- a?: number;
833
- b?: number;
834
- }
835
-
836
- export interface HitRate {
837
- normal: number;
838
- critical: number;
839
- total: number;
840
- }
841
-
842
- export interface HitRateParams {
843
- accuracy_term: number;
844
- evasion_term: number;
845
- target_morale_mod: number;
846
- critical_rate_constant: number;
847
- critical_percentage_bonus: number;
848
- hit_percentage_bonus: number;
849
- }
850
-
851
787
  export interface CompDayCutinAnalysis {
852
788
  rank3_air_state: AirState;
853
789
  rank2_air_state: AirState;
@@ -868,20 +804,6 @@ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
868
804
  observation_term: number | null;
869
805
  }
870
806
 
871
- export interface ContactAnalysis {
872
- single: DayContactChance[] | null;
873
- combined: DayContactChance[] | null;
874
- }
875
-
876
- export interface DayContactChance {
877
- air_state: AirState;
878
- trigger_rate: number;
879
- rank3: number;
880
- rank2: number;
881
- rank1: number;
882
- total: number;
883
- }
884
-
885
807
  export interface AttackAnalysis {
886
808
  attacker_is_player: boolean;
887
809
  attacker_ship_id: number;
@@ -893,6 +815,18 @@ export interface AttackAnalysis {
893
815
  support_shelling: ActionReport<SupportShellingStyle>;
894
816
  }
895
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
+
896
830
  export interface MasterShip {
897
831
  ship_id: number;
898
832
  name: string;
@@ -964,6 +898,35 @@ export interface MasterBattleDefinitions {
964
898
  night_cutin: NightCutinDef[];
965
899
  }
966
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
+
967
930
  export interface CompAnalyzerConfig {
968
931
  engagement: Engagement;
969
932
  formation: Formation;
@@ -991,15 +954,55 @@ export interface CompAnalysis {
991
954
  anti_air: CompAntiAirAnalysis;
992
955
  }
993
956
 
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;
957
+ export type CompiledEvaler = string;
958
+
959
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
960
+
961
+ export interface NightFleetConditions {
962
+ night_contact_rank?: ContactRank | null;
963
+ starshell_index?: number | null;
964
+ searchlight_index?: number | null;
965
+ activates_large_searchlight?: boolean;
966
+ }
967
+
968
+ export interface NightConditions {
969
+ player?: NightFleetConditions;
970
+ enemy?: NightFleetConditions;
971
+ }
972
+
973
+ export interface BattleConditions {
974
+ org_type: OrgType;
975
+ role: Role;
976
+ ship_index: number;
977
+ fleet_len: number;
978
+ formation: Formation;
979
+ fleet_los_mod: number | null;
980
+ night_conditions: NightFleetConditions;
981
+ }
982
+
983
+ export interface MasterGear {
984
+ gear_id: number;
985
+ name: string;
986
+ types: GearTypeIdArray;
987
+ special_type?: number;
988
+ max_hp?: number;
989
+ firepower?: number;
990
+ armor?: number;
991
+ torpedo?: number;
992
+ anti_air?: number;
993
+ speed?: number;
994
+ bombing?: number;
995
+ asw?: number;
996
+ los?: number;
997
+ luck?: number;
998
+ accuracy?: number;
999
+ evasion?: number;
1000
+ range?: number;
1001
+ radius?: number;
1002
+ cost?: number;
1003
+ improvable?: boolean;
1004
+ ship_anti_air_resist?: number;
1005
+ fleet_anti_air_resist?: number;
1003
1006
  }
1004
1007
 
1005
1008
  /**
@@ -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