fleethub-core 1.12.16 → 1.12.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,83 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function set_panic_hook(): void;
4
3
  export function parse_ship_conditions(value: ShipConditions): ShipConditions;
5
- export type ShipAttr =
6
- | "Unknown"
7
- | "NightCarrier"
8
- | "Installation"
9
- | "RoyalNavy"
10
- | "Kai2"
11
- | "TurbineSpeedBonus"
12
- | "NewModelBoilerSpeedBonus"
13
- | "Pillbox"
14
- | "IsolatedIsland"
15
- | "HarbourSummerPrincess"
16
- | "SupplyDepot"
17
- | "NewSupplyDepot"
18
- | "PtImp"
19
- | "BattleshipSummerPrincess"
20
- | "HeavyCruiserSummerPrincess"
21
- | "AnchorageWaterDemonVacationMode"
22
- | "FrenchBattleshipPrincess"
23
- | "DockPrincess"
24
- | "SummerAircraftCarrierDemon"
25
- | "EuropeanWaterPrincess";
26
-
27
- export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
28
-
29
- export interface NationalityDef {
30
- id: number;
31
- ctypes: number[];
32
- }
33
-
34
- export interface MasterData extends MasterBattleDefinitions {
35
- created_at: number;
36
- gears: MasterGear[];
37
- gear_attrs: MasterAttrRule<GearAttr>[];
38
- ships: MasterShip[];
39
- ship_attrs: MasterAttrRule<ShipAttr>[];
40
- ibonuses: MasterIBonuses;
41
- equippability: MasterEquippability;
42
- }
43
-
44
- export interface MasterAttrRule<T> {
45
- tag: T;
46
- name: string;
47
- expr: CompiledEvaler;
48
- }
49
-
50
- export type CompiledEvaler = string;
51
-
52
- export interface NightFleetConditions {
53
- night_contact_rank?: ContactRank | null;
54
- starshell_index?: number | null;
55
- searchlight_index?: number | null;
56
- activates_large_searchlight?: boolean;
57
- }
58
-
59
- export interface NightConditions {
60
- player?: NightFleetConditions;
61
- enemy?: NightFleetConditions;
62
- }
63
-
64
- export interface BattleConditions {
65
- org_type: OrgType;
66
- role: Role;
67
- ship_index: number;
68
- fleet_len: number;
69
- formation: Formation;
70
- fleet_los_mod: number | null;
71
- night_conditions: NightFleetConditions;
72
- }
73
-
74
- export interface ShipPosition {
75
- org_type?: OrgType;
76
- fleet_type?: FleetType;
77
- fleet_len?: number;
78
- index?: number;
79
- }
80
-
4
+ export function set_panic_hook(): void;
81
5
  export type GearAttr =
82
6
  | "Unknown"
83
7
  | "HighAngleMount"
@@ -110,34 +34,73 @@ export type GearAttr =
110
34
  | "SemiNightPlane"
111
35
  | "HighAltitudeInterceptor";
112
36
 
113
- export interface MasterBattleDefinitions {
114
- formation: NestedFormationDef[];
115
- anti_air_cutin: AntiAirCutinDef[];
116
- day_cutin: DayCutinDef[];
117
- night_cutin: NightCutinDef[];
118
- historical_bonuses?: HistoricalBonusDef[];
119
- }
37
+ export type ShipAttr =
38
+ | "Unknown"
39
+ | "NightCarrier"
40
+ | "Installation"
41
+ | "RoyalNavy"
42
+ | "Kai2"
43
+ | "TurbineSpeedBonus"
44
+ | "NewModelBoilerSpeedBonus"
45
+ | "Pillbox"
46
+ | "IsolatedIsland"
47
+ | "HarbourSummerPrincess"
48
+ | "SupplyDepot"
49
+ | "NewSupplyDepot"
50
+ | "PtImp"
51
+ | "BattleshipSummerPrincess"
52
+ | "HeavyCruiserSummerPrincess"
53
+ | "AnchorageWaterDemonVacationMode"
54
+ | "FrenchBattleshipPrincess"
55
+ | "DockPrincess"
56
+ | "SummerAircraftCarrierDemon"
57
+ | "EuropeanWaterPrincess";
120
58
 
121
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
59
+ export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
122
60
 
123
- export interface ActionReport<T> {
124
- data: Record<string, AttackReport<T>>;
125
- damage_state_density: Histogram<DamageState, number> | null;
126
- is_active: boolean;
127
- }
61
+ export type AswAttackType = "DepthCharge" | "Aerial";
128
62
 
129
- export interface AttackReport<T> {
130
- style: T;
131
- proc_rate: number | null;
132
- attack_power: AttackPower | null;
133
- attack_power_params: AttackPowerParams | null;
134
- hits: number;
135
- hit_rate: HitRate | null;
136
- hit_rate_params: HitRateParams | null;
137
- damage: DamageReport | null;
138
- }
63
+ export type AttackType =
64
+ | { t: "Asw"; c: AswAttackType }
65
+ | { t: "Shelling"; c: ShellingType }
66
+ | { t: "Night"; c: NightAttackType }
67
+ | { t: "Torpedo" }
68
+ | { t: "SupportShelling"; c: SupportShellingType };
139
69
 
140
- export type DayCutinLike = DayCutin | FleetCutin;
70
+ export type DayPhaseAttackType =
71
+ | { t: "Shelling"; c: ShellingType }
72
+ | { t: "Asw"; c: AswAttackType };
73
+
74
+ export type TorpedoAttackType = null;
75
+
76
+ export type SupportShellingType = ShellingType;
77
+
78
+ export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
79
+
80
+ export type NightPhaseAttackType =
81
+ | { t: "Night"; c: NightAttackType }
82
+ | { t: "Asw"; c: AswAttackType };
83
+
84
+ export type ShellingType = "Normal" | "Aerial";
85
+
86
+ export type GearTypeIdArray = [number, number, number, number, number];
87
+
88
+ export type NightCutinLike = NightCutin | FleetCutin;
89
+
90
+ export type DayCutin =
91
+ | "Zuiun"
92
+ | "AirSea"
93
+ | "MainMain"
94
+ | "MainAp"
95
+ | "MainRadar"
96
+ | "MainSec"
97
+ | "DoubleAttack"
98
+ | "JFJBJB"
99
+ | "JFJB"
100
+ | "JFBA"
101
+ | "FBA"
102
+ | "BBA"
103
+ | "BA";
141
104
 
142
105
  export type NightCutin =
143
106
  | "MainTorpRadar"
@@ -160,18 +123,6 @@ export type NightCutin =
160
123
  | "Photobomber"
161
124
  | "Cvci1_18";
162
125
 
163
- export type DayCutin =
164
- | "Zuiun"
165
- | "AirSea"
166
- | "MainMain"
167
- | "MainAp"
168
- | "MainRadar"
169
- | "MainSec"
170
- | "DoubleAttack"
171
- | "FBA"
172
- | "BBA"
173
- | "BA";
174
-
175
126
  export type FleetCutin =
176
127
  | "NelsonTouch"
177
128
  | "NagatoClassCutin"
@@ -182,206 +133,139 @@ export type FleetCutin =
182
133
  | "QueenElizabethClassCutin"
183
134
  | "RichelieuClassCutin";
184
135
 
185
- export type NightCutinLike = NightCutin | FleetCutin;
136
+ export type DayCutinLike = DayCutin | FleetCutin;
186
137
 
187
- export type GearType =
188
- | "Unknown"
189
- | "SmallMainGun"
190
- | "MediumMainGun"
191
- | "LargeMainGun"
192
- | "SecondaryGun"
193
- | "Torpedo"
194
- | "CbFighter"
195
- | "CbDiveBomber"
196
- | "CbTorpedoBomber"
197
- | "CbRecon"
198
- | "ReconSeaplane"
199
- | "SeaplaneBomber"
200
- | "SmallRadar"
201
- | "LargeRadar"
202
- | "Sonar"
203
- | "DepthCharge"
204
- | "ExtraArmor"
205
- | "Engine"
206
- | "AntiAirShell"
207
- | "ApShell"
208
- | "VtFuze"
209
- | "AntiAirGun"
210
- | "MidgetSubmarine"
211
- | "EmergencyRepair"
212
- | "LandingCraft"
213
- | "Rotorcraft"
214
- | "AntiSubPatrolAircraft"
215
- | "MediumArmor"
216
- | "LargeArmor"
217
- | "Searchlight"
218
- | "SupplyContainer"
219
- | "ShipRepairFacility"
220
- | "SubmarineTorpedo"
221
- | "Starshell"
222
- | "CommandFacility"
223
- | "AviationPersonnel"
224
- | "AntiAirFireDirector"
225
- | "AntiGroundEquipment"
226
- | "LargeMainGun2"
227
- | "ShipPersonnel"
228
- | "LargeSonar"
229
- | "LargeFlyingBoat"
230
- | "LargeSearchlight"
231
- | "CombatRation"
232
- | "Supplies"
233
- | "SeaplaneFighter"
234
- | "AmphibiousTank"
235
- | "LbAttacker"
236
- | "LbFighter"
237
- | "LbRecon"
238
- | "TransportationMaterial"
239
- | "SubmarineEquipment"
240
- | "LandingForce"
241
- | "LargeLbAircraft"
242
- | "SurfaceEquipment"
243
- | "JetFighter"
244
- | "JetFighterBomber"
245
- | "JetTorpedoBomber"
246
- | "JetRecon"
247
- | "LargeRadar2"
248
- | "CbRecon2"
249
- | "SecondaryGun2";
138
+ export interface AttackReport<T> {
139
+ style: T;
140
+ proc_rate: number | null;
141
+ attack_power: AttackPower | null;
142
+ attack_power_params: AttackPowerParams | null;
143
+ hits: number;
144
+ hit_rate: HitRate | null;
145
+ hit_rate_params: HitRateParams | null;
146
+ damage: DamageReport | null;
147
+ }
250
148
 
251
- export type GearCategory =
252
- | "Fighter"
253
- | "Bomber"
254
- | "Recon"
255
- | "MainGun"
256
- | "Secondary"
257
- | "Torpedo"
258
- | "AntiSub"
259
- | "Radar"
260
- | "Landing"
261
- | "Ration"
262
- | "LandBased"
263
- | "Misc";
264
-
265
- export type ShipType =
266
- | "Unknown"
267
- | "DE"
268
- | "DD"
269
- | "CL"
270
- | "CLT"
271
- | "CA"
272
- | "CAV"
273
- | "CVL"
274
- | "FBB"
275
- | "BB"
276
- | "BBV"
277
- | "CV"
278
- | "XBB"
279
- | "SS"
280
- | "SSV"
281
- | "AP"
282
- | "AV"
283
- | "LHA"
284
- | "CVB"
285
- | "AR"
286
- | "AS"
287
- | "CT"
288
- | "AO";
149
+ export interface DamageReport {
150
+ miss_damage_min: number;
151
+ miss_damage_max: number;
152
+ normal_damage_min: number;
153
+ normal_damage_max: number;
154
+ critical_damage_min: number;
155
+ critical_damage_max: number;
156
+ normal_scratch_rate: number;
157
+ critical_scratch_rate: number;
158
+ damage_density: Histogram<number, number>;
159
+ damage_state_density: Histogram<DamageState, number>;
160
+ }
289
161
 
290
- export type ShipCategory =
291
- | "Battleship"
292
- | "AircraftCarrier"
293
- | "HeavyCruiser"
294
- | "LightCruiser"
295
- | "Destroyer"
296
- | "CoastalDefenseShip"
297
- | "Submarine"
298
- | "AuxiliaryShip";
162
+ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
163
+ observation_term: number | null;
164
+ }
299
165
 
300
- export interface AttackPowerParams {
301
- is_cutin: boolean;
302
- basic: number;
303
- cap: number;
304
- precap_mod: AttackPowerModifier;
305
- postcap_mod: AttackPowerModifier;
306
- ap_shell_mod: number | null;
307
- aerial_power: number | null;
308
- proficiency_critical_mod: number;
309
- armor_penetration: number;
310
- remaining_ammo_mod: number;
311
- balloon_mod: number;
312
- special_enemy_mods: SpecialEnemyModifiers;
313
- historical_mod: AttackPowerModifier;
314
- custom_mods: CustomPowerModifiers;
166
+ export interface ShipDayCutinAnalysis {
167
+ ship_id: number;
168
+ role: Role;
169
+ index: number;
170
+ rank3: DayCutinReport;
171
+ rank2: DayCutinReport;
315
172
  }
316
173
 
317
- export interface AttackPower {
318
- precap: number;
319
- is_capped: boolean;
320
- capped: number;
321
- normal: number;
322
- critical: number;
323
- armor_penetration: number;
324
- remaining_ammo_mod: number;
174
+ export interface CompDayCutinAnalysis {
175
+ rank3_air_state: AirState;
176
+ rank2_air_state: AirState;
177
+ main_fleet_los_mod: number | null;
178
+ escort_fleet_los_mod: number | null;
179
+ ships: ShipDayCutinAnalysis[];
325
180
  }
326
181
 
327
- export interface HitRate {
328
- normal: number;
329
- critical: number;
330
- total: number;
182
+ export interface ShipNightCutinAnalysis {
183
+ ship_id: number;
184
+ index: number;
185
+ normal: NightCutinActionReport;
186
+ chuuha: NightCutinActionReport;
331
187
  }
332
188
 
333
- export interface HitRateParams {
334
- accuracy_term: number;
335
- evasion_term: number;
336
- target_morale_mod: number;
337
- critical_rate_constant: number;
338
- critical_percentage_bonus: number;
339
- hit_percentage_bonus: number;
189
+ export interface NightContactChance {
190
+ rank1: number;
191
+ rank2: number;
192
+ rank3: number;
340
193
  }
341
194
 
342
- export interface AttackAnalysis {
343
- attacker_is_player: boolean;
344
- attacker_ship_id: number;
345
- target_ship_id: number;
346
- historical_params: HistoricalParams;
347
- day: ActionReport<DayPhaseAttackStyle>;
348
- night: ActionReport<NightPhaseAttackStyle>;
349
- closing_torpedo: ActionReport<TorpedoAttackStyle>;
350
- opening_asw: ActionReport<AswAttackStyle>;
351
- support_shelling: ActionReport<SupportShellingStyle>;
195
+ export interface CompNightCutinAnalysis {
196
+ night_contact_chance: NightContactChance;
197
+ ships: ShipNightCutinAnalysis[];
352
198
  }
353
199
 
354
- export interface FleetState {
355
- id?: string;
356
- len?: number;
357
- s1?: ShipState;
358
- s2?: ShipState;
359
- s3?: ShipState;
360
- s4?: ShipState;
361
- s5?: ShipState;
362
- s6?: ShipState;
363
- s7?: ShipState;
200
+ export interface NightCutinActionReport
201
+ extends ActionReport<NightPhaseAttackStyle> {
202
+ cutin_term: number | null;
364
203
  }
365
204
 
366
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
205
+ export type StatInterval = [number | null, number | null];
367
206
 
368
- export type FhResult<T> = { Ok: T } | { Err: string };
207
+ export interface MasterShip {
208
+ ship_id: number;
209
+ name: string;
210
+ yomi: string;
211
+ stype: number;
212
+ ctype: number;
213
+ nationality?: number;
214
+ sort_id?: number;
215
+ max_hp: StatInterval;
216
+ firepower: StatInterval;
217
+ armor: StatInterval;
218
+ torpedo: StatInterval;
219
+ evasion: StatInterval;
220
+ anti_air: StatInterval;
221
+ asw: StatInterval;
222
+ los: StatInterval;
223
+ luck: StatInterval;
224
+ torpedo_accuracy?: number;
225
+ basic_evasion_term?: number;
226
+ speed: number;
227
+ range?: number;
228
+ fuel?: number;
229
+ ammo?: number;
230
+ next_id?: number;
231
+ next_level?: number;
232
+ slotnum: number;
233
+ slots: SlotSizeVec;
234
+ stock: GearState[];
235
+ speed_group?: SpeedGroup;
236
+ useful?: boolean;
237
+ }
369
238
 
370
- export interface ShipAnalyzerConfig {
371
- air_state?: AirState;
372
- engagement?: Engagement;
373
- left?: AttackAnalyzerShipConfig;
374
- right?: AttackAnalyzerShipConfig;
239
+ export interface MasterAttrRule<T> {
240
+ tag: T;
241
+ name: string;
242
+ expr: CompiledEvaler;
375
243
  }
376
244
 
377
- export interface MoveShipPayload {
378
- current: [string, string, ShipKey];
379
- target: [string | null, string, ShipKey];
245
+ export interface MasterData extends MasterBattleDefinitions {
246
+ created_at: number;
247
+ gears: MasterGear[];
248
+ gear_attrs: MasterAttrRule<GearAttr>[];
249
+ ships: MasterShip[];
250
+ ship_attrs: MasterAttrRule<ShipAttr>[];
251
+ ibonuses: MasterIBonuses;
252
+ equippability: MasterEquippability;
380
253
  }
381
254
 
382
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
255
+ export interface NationalityDef {
256
+ id: number;
257
+ ctypes: number[];
258
+ }
383
259
 
384
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
260
+ export interface SlotSizeVecState {
261
+ ss1?: number;
262
+ ss2?: number;
263
+ ss3?: number;
264
+ ss4?: number;
265
+ ss5?: number;
266
+ }
267
+
268
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
385
269
 
386
270
  export interface ShipState extends GearVecState, SlotSizeVecState {
387
271
  id?: string;
@@ -405,24 +289,44 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
405
289
  custom_power_mods?: CustomPowerModifiers;
406
290
  }
407
291
 
408
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
292
+ export interface SupportShellingStyle {
293
+ tag: "SupportShellingStyle";
294
+ attack_type: SupportShellingType;
295
+ }
409
296
 
410
- export interface SlotSizeVecState {
411
- ss1?: number;
412
- ss2?: number;
413
- ss3?: number;
414
- ss4?: number;
415
- ss5?: number;
297
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
298
+
299
+ export interface ShellingStyle {
300
+ tag: "ShellingStyle";
301
+ attack_type: ShellingType;
302
+ cutin: DayCutinLike | null;
303
+ power_mod: number;
304
+ accuracy_mod: number;
305
+ hits: number;
416
306
  }
417
307
 
418
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
308
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
419
309
 
420
- export interface AirSquadronState extends GearVecState, SlotSizeVecState {
421
- id?: string;
422
- mode?: AirSquadronMode;
310
+ export interface AswAttackStyle {
311
+ tag: "AswAttackStyle";
312
+ attack_type: AswAttackType;
423
313
  }
424
314
 
425
- export type AirSquadronMode = "Sortie" | "AirDefense";
315
+ export interface NightAttackStyle {
316
+ tag: "NightAttackStyle";
317
+ attack_type: NightAttackType;
318
+ cutin: NightCutinLike | null;
319
+ power_mod: number;
320
+ accuracy_mod: number;
321
+ hits: number;
322
+ }
323
+
324
+ export interface TorpedoAttackStyle {
325
+ tag: "TorpedoAttackStyle";
326
+ attack_type: TorpedoAttackType;
327
+ }
328
+
329
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
426
330
 
427
331
  export type SpecialEnemyType =
428
332
  | "None"
@@ -441,133 +345,61 @@ export type SpecialEnemyType =
441
345
  | "SummerAircraftCarrierDemon"
442
346
  | "EuropeanWaterPrincess";
443
347
 
444
- export interface ShipMeta {
445
- id: string;
446
- ship_id: number;
447
- }
448
-
449
- export interface CompMeta {
450
- fleets: Record<FleetType, FleetMeta>;
451
- }
452
-
453
- export interface FleetMeta {
454
- id: string;
455
- len: number;
456
- ships: [string, ShipMeta | null][];
457
- }
458
-
459
- export type Role = "Main" | "Escort";
348
+ export type Role = "Main" | "Escort";
460
349
 
461
350
  export type Side = "Player" | "Enemy";
462
351
 
463
352
  export type Align = "Left" | "Right";
464
353
 
465
- export interface GearInput {
466
- gear_id: number;
467
- types: GearTypeIdArray;
468
- firepower: number;
469
- torpedo: number;
470
- anti_air: number;
471
- armor: number;
472
- evasion: number;
473
- asw: number;
474
- los: number;
475
- bombing: number;
476
- accuracy: number;
477
- range: number;
478
- radius: number;
479
- stars: number;
480
- ace: number;
481
- }
482
-
483
- export interface ShipInput {
484
- ship_id: number;
485
- ctype: number;
486
- stype: number;
487
- yomi: string;
488
- }
489
-
490
- export type GearVecInput = GearInput[];
491
-
492
- export interface EBonuses {
493
- firepower: number;
494
- torpedo: number;
495
- anti_air: number;
496
- armor: number;
497
- evasion: number;
498
- asw: number;
499
- los: number;
500
- bombing: number;
501
- accuracy: number;
502
- range: number;
503
- }
504
-
505
- export interface OrgState {
506
- id?: string;
507
- f1?: FleetState;
508
- f2?: FleetState;
509
- f3?: FleetState;
510
- f4?: FleetState;
511
- a1?: AirSquadronState;
512
- a2?: AirSquadronState;
513
- a3?: AirSquadronState;
514
- hq_level?: number;
515
- org_type?: OrgType;
516
- sortie?: FleetKey;
517
- route_sup?: FleetKey;
518
- boss_sup?: FleetKey;
519
- }
520
-
521
- export type FleetKey = "f1" | "f2" | "f3" | "f4";
522
-
523
- export interface CompNightAnalysis {
524
- night_cutin: CompNightCutinAnalysis;
525
- fleet_cutin: FleetCutinReport<NightAttackStyle>[];
526
- }
527
-
528
- export interface CompAnalyzerConfig {
529
- engagement: Engagement;
530
- formation: Formation;
531
- anti_air_cutin: number | null;
532
- ship_anti_air_resist: number;
533
- fleet_anti_air_resist: number;
534
- left_night_fleet_conditions: NightFleetConditions;
535
- right_night_fleet_conditions: NightFleetConditions;
536
- }
537
-
538
- export interface CompDayAnalysis {
539
- day_cutin: CompDayCutinAnalysis;
540
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
541
- }
542
-
543
- export interface CompAnalysis {
544
- day: CompDayAnalysis;
545
- night: CompNightAnalysis;
546
- contact: ContactAnalysis;
547
- anti_air: CompAntiAirAnalysis;
548
- }
354
+ export type ShipType =
355
+ | "Unknown"
356
+ | "DE"
357
+ | "DD"
358
+ | "CL"
359
+ | "CLT"
360
+ | "CA"
361
+ | "CAV"
362
+ | "CVL"
363
+ | "FBB"
364
+ | "BB"
365
+ | "BBV"
366
+ | "CV"
367
+ | "XBB"
368
+ | "SS"
369
+ | "SSV"
370
+ | "AP"
371
+ | "AV"
372
+ | "LHA"
373
+ | "CVB"
374
+ | "AR"
375
+ | "AS"
376
+ | "CT"
377
+ | "AO";
549
378
 
550
- export interface AttackAnalyzerShipConfig
551
- extends ShipConditions,
552
- NightFleetConditions {
553
- balloons?: number;
554
- fleet_los_mod?: number | null;
555
- }
379
+ export type ShipCategory =
380
+ | "Battleship"
381
+ | "AircraftCarrier"
382
+ | "HeavyCruiser"
383
+ | "LightCruiser"
384
+ | "Destroyer"
385
+ | "CoastalDefenseShip"
386
+ | "Submarine"
387
+ | "AuxiliaryShip";
556
388
 
557
- export interface SimulatorResult {
558
- items: SimulatorResultItem[];
559
- sunk_vec: [number, number, number][];
389
+ export interface DayContactChance {
390
+ air_state: AirState;
391
+ trigger_rate: number;
392
+ rank3: number;
393
+ rank2: number;
394
+ rank1: number;
395
+ total: number;
560
396
  }
561
397
 
562
- export interface SimulatorResultItem {
563
- id: string;
564
- fleet_type: FleetType;
565
- index: number;
566
- damage_state_map: Record<DamageState, number>;
398
+ export interface ContactAnalysis {
399
+ single: DayContactChance[] | null;
400
+ combined: DayContactChance[] | null;
567
401
  }
568
402
 
569
- export type NodeId = string;
570
-
571
403
  export interface NodeState {
572
404
  map?: number;
573
405
  node?: NodeId;
@@ -577,109 +409,150 @@ export interface NodeState {
577
409
  landing_battle?: boolean;
578
410
  }
579
411
 
580
- export type AttackType =
581
- | { t: "Asw"; c: AswAttackType }
582
- | { t: "Shelling"; c: ShellingType }
583
- | { t: "Night"; c: NightAttackType }
584
- | { t: "Torpedo" }
585
- | { t: "SupportShelling"; c: SupportShellingType };
412
+ export type NodeId = string;
586
413
 
587
- export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
414
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
588
415
 
589
- export type ShellingType = "Normal" | "Aerial";
416
+ export interface SupportShellingSimulatorParams {
417
+ attacker_formation?: Formation;
418
+ target_formation?: Formation;
419
+ engagement: Engagement;
420
+ node_state: NodeState;
421
+ }
590
422
 
591
- export type AswAttackType = "DepthCharge" | "Aerial";
423
+ export interface NightFleetConditions {
424
+ night_contact_rank?: ContactRank | null;
425
+ starshell_index?: number | null;
426
+ searchlight_index?: number | null;
427
+ activates_large_searchlight?: boolean;
428
+ }
592
429
 
593
- export type NightPhaseAttackType =
594
- | { t: "Night"; c: NightAttackType }
595
- | { t: "Asw"; c: AswAttackType };
430
+ export interface NightConditions {
431
+ player?: NightFleetConditions;
432
+ enemy?: NightFleetConditions;
433
+ }
596
434
 
597
- export type TorpedoAttackType = null;
435
+ export interface BattleConditions {
436
+ org_type: OrgType;
437
+ role: Role;
438
+ ship_index: number;
439
+ fleet_len: number;
440
+ formation: Formation;
441
+ fleet_los_mod: number | null;
442
+ night_conditions: NightFleetConditions;
443
+ }
598
444
 
599
- export type DayPhaseAttackType =
600
- | { t: "Shelling"; c: ShellingType }
601
- | { t: "Asw"; c: AswAttackType };
445
+ export type OrgType =
446
+ | "Single"
447
+ | "CarrierTaskForce"
448
+ | "SurfaceTaskForce"
449
+ | "TransportEscort"
450
+ | "EnemySingle"
451
+ | "EnemyCombined";
602
452
 
603
- export type SupportShellingType = ShellingType;
453
+ export interface ShipPosition {
454
+ org_type?: OrgType;
455
+ fleet_type?: FleetType;
456
+ fleet_len?: number;
457
+ index?: number;
458
+ }
459
+
460
+ export interface ShipAnalyzerConfig {
461
+ air_state?: AirState;
462
+ engagement?: Engagement;
463
+ left?: AttackAnalyzerShipConfig;
464
+ right?: AttackAnalyzerShipConfig;
465
+ }
604
466
 
605
467
  export type SlotSizeVec = (number | null)[];
606
468
 
607
- export type GearTypeIdArray = [number, number, number, number, number];
469
+ export type FhResult<T> = { Ok: T } | { Err: string };
608
470
 
609
- export interface DamageReport {
610
- miss_damage_min: number;
611
- miss_damage_max: number;
612
- normal_damage_min: number;
613
- normal_damage_max: number;
614
- critical_damage_min: number;
615
- critical_damage_max: number;
616
- normal_scratch_rate: number;
617
- critical_scratch_rate: number;
618
- damage_density: Histogram<number, number>;
619
- damage_state_density: Histogram<DamageState, number>;
471
+ export interface MasterBattleDefinitions {
472
+ formation: NestedFormationDef[];
473
+ anti_air_cutin: AntiAirCutinDef[];
474
+ day_cutin: DayCutinDef[];
475
+ night_cutin: NightCutinDef[];
476
+ historical_bonuses?: HistoricalBonusDef[];
620
477
  }
621
478
 
622
- export interface ContactAnalysis {
623
- single: DayContactChance[] | null;
624
- combined: DayContactChance[] | null;
625
- }
479
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
626
480
 
627
- export interface DayContactChance {
628
- air_state: AirState;
629
- trigger_rate: number;
630
- rank3: number;
631
- rank2: number;
632
- rank1: number;
633
- total: number;
481
+ export interface GearVecState {
482
+ g1?: GearState;
483
+ g2?: GearState;
484
+ g3?: GearState;
485
+ g4?: GearState;
486
+ g5?: GearState;
487
+ gx?: GearState;
634
488
  }
635
489
 
636
- export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
637
- observation_term: number | null;
490
+ export interface GearState {
491
+ id?: string;
492
+ gear_id: number;
493
+ exp?: number;
494
+ stars?: number;
638
495
  }
639
496
 
640
- export interface ShipDayCutinAnalysis {
641
- ship_id: number;
642
- role: Role;
643
- index: number;
644
- rank3: DayCutinReport;
645
- rank2: DayCutinReport;
646
- }
497
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
647
498
 
648
- export interface CompDayCutinAnalysis {
649
- rank3_air_state: AirState;
650
- rank2_air_state: AirState;
651
- main_fleet_los_mod: number | null;
652
- escort_fleet_los_mod: number | null;
653
- ships: ShipDayCutinAnalysis[];
499
+ export interface FleetMeta {
500
+ id: string;
501
+ len: number;
502
+ ships: [string, ShipMeta | null][];
654
503
  }
655
504
 
656
- export interface CompNightCutinAnalysis {
657
- night_contact_chance: NightContactChance;
658
- ships: ShipNightCutinAnalysis[];
505
+ export interface CompMeta {
506
+ fleets: Record<FleetType, FleetMeta>;
659
507
  }
660
508
 
661
- export interface NightCutinActionReport
662
- extends ActionReport<NightPhaseAttackStyle> {
663
- cutin_term: number | null;
509
+ export interface ShipMeta {
510
+ id: string;
511
+ ship_id: number;
664
512
  }
665
513
 
666
- export interface NightContactChance {
667
- rank1: number;
668
- rank2: number;
669
- rank3: number;
514
+ export interface ActionReport<T> {
515
+ data: Record<string, AttackReport<T>>;
516
+ damage_state_density: Histogram<DamageState, number> | null;
517
+ is_active: boolean;
670
518
  }
671
519
 
672
- export interface ShipNightCutinAnalysis {
673
- ship_id: number;
520
+ export interface SimulatorResultItem {
521
+ id: string;
522
+ fleet_type: FleetType;
674
523
  index: number;
675
- normal: NightCutinActionReport;
676
- chuuha: NightCutinActionReport;
524
+ damage_state_map: Record<DamageState, number>;
525
+ }
526
+
527
+ export interface SimulatorResult {
528
+ items: SimulatorResultItem[];
529
+ sunk_vec: [number, number, number][];
677
530
  }
678
531
 
679
532
  export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
680
533
 
534
+ export interface FleetState {
535
+ id?: string;
536
+ len?: number;
537
+ s1?: ShipState;
538
+ s2?: ShipState;
539
+ s3?: ShipState;
540
+ s4?: ShipState;
541
+ s5?: ShipState;
542
+ s6?: ShipState;
543
+ s7?: ShipState;
544
+ }
545
+
681
546
  export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
682
547
 
548
+ export interface BattleDefinitions {
549
+ formation: Record<Formation, NestedFormationDef>;
550
+ anti_air_cutin: Record<number, AntiAirCutinDef>;
551
+ day_cutin: Record<DayCutin, DayCutinDef>;
552
+ night_cutin: Record<NightCutin, NightCutinDef>;
553
+ historical_bonuses: HistoricalBonusDef[];
554
+ }
555
+
683
556
  export interface NightCutinDef {
684
557
  tag: NightCutin;
685
558
  hits: number;
@@ -688,31 +561,27 @@ export interface NightCutinDef {
688
561
  accuracy_mod: number | null;
689
562
  }
690
563
 
691
- export interface FormationCombatModifiersDef {
692
- power_mod?: number;
693
- accuracy_mod?: number;
694
- evasion_mod?: number;
564
+ export interface DayCutinDef {
565
+ tag: DayCutin;
566
+ hits: number;
567
+ type_factor: number | null;
568
+ power_mod: number | null;
569
+ accuracy_mod: number | null;
695
570
  }
696
571
 
697
- export interface BattleDefinitions {
698
- formation: Record<Formation, NestedFormationDef>;
699
- anti_air_cutin: Record<number, AntiAirCutinDef>;
700
- day_cutin: Record<DayCutin, DayCutinDef>;
701
- night_cutin: Record<NightCutin, NightCutinDef>;
702
- historical_bonuses: HistoricalBonusDef[];
572
+ export interface AntiAirCutinDef {
573
+ id: number;
574
+ type_factor: number | null;
575
+ multiplier: number | null;
576
+ guaranteed: number | null;
577
+ sequential: boolean | null;
703
578
  }
704
579
 
705
- export interface HistoricalBonusDef {
706
- map?: number;
707
- node?: CompiledEvaler;
708
- phase?: number;
709
- debuff?: boolean;
710
- ship?: CompiledEvaler;
711
- enemy?: CompiledEvaler;
712
- power_mod?: AttackPowerModifier;
713
- armor_penetration?: number;
714
- accuracy_mod?: number;
715
- evasion_mod?: number;
580
+ export interface HistoricalParams {
581
+ power_mod: AttackPowerModifier;
582
+ armor_penetration: number;
583
+ accuracy_mod: number;
584
+ target_evasion_mod: number;
716
585
  }
717
586
 
718
587
  export interface FormationDef {
@@ -726,38 +595,29 @@ export interface FormationDef {
726
595
  support_shelling: FormationCombatModifiersDef;
727
596
  }
728
597
 
729
- export interface HistoricalParams {
730
- power_mod: AttackPowerModifier;
731
- armor_penetration: number;
732
- accuracy_mod: number;
733
- target_evasion_mod: number;
734
- }
735
-
736
- export interface AntiAirCutinDef {
737
- id: number;
738
- type_factor: number | null;
739
- multiplier: number | null;
740
- guaranteed: number | null;
741
- sequential: boolean | null;
598
+ export interface FormationCombatModifiersDef {
599
+ power_mod?: number;
600
+ accuracy_mod?: number;
601
+ evasion_mod?: number;
742
602
  }
743
603
 
744
- export interface DayCutinDef {
745
- tag: DayCutin;
746
- hits: number;
747
- type_factor: number | null;
748
- power_mod: number | null;
749
- accuracy_mod: number | null;
604
+ export interface HistoricalBonusDef {
605
+ map?: number;
606
+ node?: CompiledEvaler;
607
+ phase?: number;
608
+ debuff?: boolean;
609
+ ship?: CompiledEvaler;
610
+ enemy?: CompiledEvaler;
611
+ power_mod?: AttackPowerModifier;
612
+ armor_penetration?: number;
613
+ accuracy_mod?: number;
614
+ evasion_mod?: number;
750
615
  }
751
616
 
752
617
  export type NestedFormationDef =
753
618
  | FormationDef
754
619
  | { top_half: FormationDef; bottom_half: FormationDef };
755
620
 
756
- export interface AttackPowerModifier {
757
- a?: number;
758
- b?: number;
759
- }
760
-
761
621
  export interface SpecialEnemyModifiers {
762
622
  precap_general_mod: AttackPowerModifier;
763
623
  stype_mod: AttackPowerModifier;
@@ -781,6 +641,11 @@ export interface SpecialEnemyModifiers {
781
641
  pt_mod: AttackPowerModifier | null;
782
642
  }
783
643
 
644
+ export interface AttackPowerModifier {
645
+ a?: number;
646
+ b?: number;
647
+ }
648
+
784
649
  export interface CustomPowerModifiers {
785
650
  precap_mod?: AttackPowerModifier;
786
651
  postcap_mod?: AttackPowerModifier;
@@ -788,13 +653,7 @@ export interface CustomPowerModifiers {
788
653
  historical_mod?: AttackPowerModifier;
789
654
  }
790
655
 
791
- export type OrgType =
792
- | "Single"
793
- | "CarrierTaskForce"
794
- | "SurfaceTaskForce"
795
- | "TransportEscort"
796
- | "EnemySingle"
797
- | "EnemyCombined";
656
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
798
657
 
799
658
  export type AirState =
800
659
  | "AirSupremacy"
@@ -803,7 +662,7 @@ export type AirState =
803
662
  | "AirDenial"
804
663
  | "AirIncapability";
805
664
 
806
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
665
+ export type Formation = SingleFormation | CombinedFormation;
807
666
 
808
667
  export type SingleFormation =
809
668
  | "LineAhead"
@@ -819,7 +678,32 @@ export type CombinedFormation =
819
678
  | "Cruising3"
820
679
  | "Cruising4";
821
680
 
822
- export type Formation = SingleFormation | CombinedFormation;
681
+ export interface AttackPowerParams {
682
+ is_cutin: boolean;
683
+ basic: number;
684
+ cap: number;
685
+ precap_mod: AttackPowerModifier;
686
+ postcap_mod: AttackPowerModifier;
687
+ ap_shell_mod: number | null;
688
+ aerial_power: number | null;
689
+ proficiency_critical_mod: number;
690
+ armor_penetration: number;
691
+ remaining_ammo_mod: number;
692
+ balloon_mod: number;
693
+ special_enemy_mods: SpecialEnemyModifiers;
694
+ historical_mod: AttackPowerModifier;
695
+ custom_mods: CustomPowerModifiers;
696
+ }
697
+
698
+ export interface AttackPower {
699
+ precap: number;
700
+ is_capped: boolean;
701
+ capped: number;
702
+ normal: number;
703
+ critical: number;
704
+ armor_penetration: number;
705
+ remaining_ammo_mod: number;
706
+ }
823
707
 
824
708
  export interface CompAntiAirAnalysis {
825
709
  fleet_adjusted_anti_air: number;
@@ -839,6 +723,12 @@ export interface AntiAirReport {
839
723
  anti_air_propellant_barrage_chance: number | null;
840
724
  }
841
725
 
726
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
727
+ index: number;
728
+ ship_id: number;
729
+ power_mod: number;
730
+ }
731
+
842
732
  export interface FleetCutinReport<T> {
843
733
  cutin: FleetCutin;
844
734
  rate: number | null;
@@ -846,128 +736,250 @@ export interface FleetCutinReport<T> {
846
736
  attacks: FleetCutinAttackReport<T>[];
847
737
  }
848
738
 
849
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
850
- index: number;
739
+ export interface MasterGear {
740
+ gear_id: number;
741
+ name: string;
742
+ types: GearTypeIdArray;
743
+ special_type?: number;
744
+ max_hp?: number;
745
+ firepower?: number;
746
+ armor?: number;
747
+ torpedo?: number;
748
+ anti_air?: number;
749
+ speed?: number;
750
+ bombing?: number;
751
+ asw?: number;
752
+ los?: number;
753
+ luck?: number;
754
+ accuracy?: number;
755
+ evasion?: number;
756
+ range?: number;
757
+ radius?: number;
758
+ cost?: number;
759
+ improvable?: boolean;
760
+ ship_anti_air_resist?: number;
761
+ fleet_anti_air_resist?: number;
762
+ historical_aircraft_group?: number;
763
+ }
764
+
765
+ export interface MoveShipPayload {
766
+ current: [string, string, ShipKey];
767
+ target: [string | null, string, ShipKey];
768
+ }
769
+
770
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
771
+
772
+ export interface ShipConditions extends ShipPosition {
773
+ formation?: Formation;
774
+ amagiri_index?: number | null;
775
+ }
776
+
777
+ export type AirSquadronMode = "Sortie" | "AirDefense";
778
+
779
+ export interface AirSquadronState extends GearVecState, SlotSizeVecState {
780
+ id?: string;
781
+ mode?: AirSquadronMode;
782
+ }
783
+
784
+ export interface ShipInput {
851
785
  ship_id: number;
852
- power_mod: number;
786
+ ctype: number;
787
+ stype: number;
788
+ yomi: string;
789
+ }
790
+
791
+ export interface GearInput {
792
+ gear_id: number;
793
+ types: GearTypeIdArray;
794
+ firepower: number;
795
+ torpedo: number;
796
+ anti_air: number;
797
+ armor: number;
798
+ evasion: number;
799
+ asw: number;
800
+ los: number;
801
+ bombing: number;
802
+ accuracy: number;
803
+ range: number;
804
+ radius: number;
805
+ stars: number;
806
+ ace: number;
807
+ }
808
+
809
+ export interface EBonuses {
810
+ firepower: number;
811
+ torpedo: number;
812
+ anti_air: number;
813
+ armor: number;
814
+ evasion: number;
815
+ asw: number;
816
+ los: number;
817
+ bombing: number;
818
+ accuracy: number;
819
+ range: number;
853
820
  }
854
821
 
855
- export interface MasterGear {
856
- gear_id: number;
857
- name: string;
858
- types: GearTypeIdArray;
859
- special_type?: number;
860
- max_hp?: number;
861
- firepower?: number;
862
- armor?: number;
863
- torpedo?: number;
864
- anti_air?: number;
865
- speed?: number;
866
- bombing?: number;
867
- asw?: number;
868
- los?: number;
869
- luck?: number;
870
- accuracy?: number;
871
- evasion?: number;
872
- range?: number;
873
- radius?: number;
874
- cost?: number;
875
- improvable?: boolean;
876
- ship_anti_air_resist?: number;
877
- fleet_anti_air_resist?: number;
878
- historical_aircraft_group?: number;
822
+ export type GearVecInput = GearInput[];
823
+
824
+ export type GearCategory =
825
+ | "Fighter"
826
+ | "Bomber"
827
+ | "Recon"
828
+ | "MainGun"
829
+ | "Secondary"
830
+ | "Torpedo"
831
+ | "AntiSub"
832
+ | "Radar"
833
+ | "Landing"
834
+ | "Ration"
835
+ | "LandBased"
836
+ | "Misc";
837
+
838
+ export type GearType =
839
+ | "Unknown"
840
+ | "SmallMainGun"
841
+ | "MediumMainGun"
842
+ | "LargeMainGun"
843
+ | "SecondaryGun"
844
+ | "Torpedo"
845
+ | "CbFighter"
846
+ | "CbDiveBomber"
847
+ | "CbTorpedoBomber"
848
+ | "CbRecon"
849
+ | "ReconSeaplane"
850
+ | "SeaplaneBomber"
851
+ | "SmallRadar"
852
+ | "LargeRadar"
853
+ | "Sonar"
854
+ | "DepthCharge"
855
+ | "ExtraArmor"
856
+ | "Engine"
857
+ | "AntiAirShell"
858
+ | "ApShell"
859
+ | "VtFuze"
860
+ | "AntiAirGun"
861
+ | "MidgetSubmarine"
862
+ | "EmergencyRepair"
863
+ | "LandingCraft"
864
+ | "Rotorcraft"
865
+ | "AntiSubPatrolAircraft"
866
+ | "MediumArmor"
867
+ | "LargeArmor"
868
+ | "Searchlight"
869
+ | "SupplyContainer"
870
+ | "ShipRepairFacility"
871
+ | "SubmarineTorpedo"
872
+ | "Starshell"
873
+ | "CommandFacility"
874
+ | "AviationPersonnel"
875
+ | "AntiAirFireDirector"
876
+ | "AntiGroundEquipment"
877
+ | "LargeMainGun2"
878
+ | "ShipPersonnel"
879
+ | "LargeSonar"
880
+ | "LargeFlyingBoat"
881
+ | "LargeSearchlight"
882
+ | "CombatRation"
883
+ | "Supplies"
884
+ | "SeaplaneFighter"
885
+ | "AmphibiousTank"
886
+ | "LbAttacker"
887
+ | "LbFighter"
888
+ | "LbRecon"
889
+ | "TransportationMaterial"
890
+ | "SubmarineEquipment"
891
+ | "LandingForce"
892
+ | "LargeLbAircraft"
893
+ | "SurfaceEquipment"
894
+ | "JetFighter"
895
+ | "JetFighterBomber"
896
+ | "JetTorpedoBomber"
897
+ | "JetRecon"
898
+ | "LargeRadar2"
899
+ | "CbRecon2"
900
+ | "SecondaryGun2";
901
+
902
+ export interface OrgState {
903
+ id?: string;
904
+ f1?: FleetState;
905
+ f2?: FleetState;
906
+ f3?: FleetState;
907
+ f4?: FleetState;
908
+ a1?: AirSquadronState;
909
+ a2?: AirSquadronState;
910
+ a3?: AirSquadronState;
911
+ hq_level?: number;
912
+ org_type?: OrgType;
913
+ sortie?: FleetKey;
914
+ route_sup?: FleetKey;
915
+ boss_sup?: FleetKey;
879
916
  }
880
917
 
881
- export type StatInterval = [number | null, number | null];
918
+ export type FleetKey = "f1" | "f2" | "f3" | "f4";
882
919
 
883
- export interface MasterShip {
884
- ship_id: number;
885
- name: string;
886
- yomi: string;
887
- stype: number;
888
- ctype: number;
889
- nationality?: number;
890
- sort_id?: number;
891
- max_hp: StatInterval;
892
- firepower: StatInterval;
893
- armor: StatInterval;
894
- torpedo: StatInterval;
895
- evasion: StatInterval;
896
- anti_air: StatInterval;
897
- asw: StatInterval;
898
- los: StatInterval;
899
- luck: StatInterval;
900
- torpedo_accuracy?: number;
901
- basic_evasion_term?: number;
902
- speed: number;
903
- range?: number;
904
- fuel?: number;
905
- ammo?: number;
906
- next_id?: number;
907
- next_level?: number;
908
- slotnum: number;
909
- slots: SlotSizeVec;
910
- stock: GearState[];
911
- speed_group?: SpeedGroup;
912
- useful?: boolean;
920
+ export interface HitRateParams {
921
+ accuracy_term: number;
922
+ evasion_term: number;
923
+ target_morale_mod: number;
924
+ critical_rate_constant: number;
925
+ critical_percentage_bonus: number;
926
+ hit_percentage_bonus: number;
913
927
  }
914
928
 
915
- export interface GearVecState {
916
- g1?: GearState;
917
- g2?: GearState;
918
- g3?: GearState;
919
- g4?: GearState;
920
- g5?: GearState;
921
- gx?: GearState;
929
+ export interface HitRate {
930
+ normal: number;
931
+ critical: number;
932
+ total: number;
922
933
  }
923
934
 
924
- export interface GearState {
925
- id?: string;
926
- gear_id: number;
927
- exp?: number;
928
- stars?: number;
935
+ export interface CompNightAnalysis {
936
+ night_cutin: CompNightCutinAnalysis;
937
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
929
938
  }
930
939
 
931
- export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
932
-
933
- export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
934
-
935
- export interface AswAttackStyle {
936
- tag: "AswAttackStyle";
937
- attack_type: AswAttackType;
940
+ export interface CompAnalyzerConfig {
941
+ engagement: Engagement;
942
+ formation: Formation;
943
+ anti_air_cutin: number | null;
944
+ ship_anti_air_resist: number;
945
+ fleet_anti_air_resist: number;
946
+ left_night_fleet_conditions: NightFleetConditions;
947
+ right_night_fleet_conditions: NightFleetConditions;
938
948
  }
939
949
 
940
- export interface ShellingStyle {
941
- tag: "ShellingStyle";
942
- attack_type: ShellingType;
943
- cutin: DayCutinLike | null;
944
- power_mod: number;
945
- accuracy_mod: number;
946
- hits: number;
950
+ export interface CompDayAnalysis {
951
+ day_cutin: CompDayCutinAnalysis;
952
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
947
953
  }
948
954
 
949
- export interface TorpedoAttackStyle {
950
- tag: "TorpedoAttackStyle";
951
- attack_type: TorpedoAttackType;
955
+ export interface CompAnalysis {
956
+ day: CompDayAnalysis;
957
+ night: CompNightAnalysis;
958
+ contact: ContactAnalysis;
959
+ anti_air: CompAntiAirAnalysis;
952
960
  }
953
961
 
954
- export interface NightAttackStyle {
955
- tag: "NightAttackStyle";
956
- attack_type: NightAttackType;
957
- cutin: NightCutinLike | null;
958
- power_mod: number;
959
- accuracy_mod: number;
960
- hits: number;
962
+ export interface AttackAnalysis {
963
+ attacker_is_player: boolean;
964
+ attacker_ship_id: number;
965
+ target_ship_id: number;
966
+ historical_params: HistoricalParams;
967
+ day: ActionReport<DayPhaseAttackStyle>;
968
+ night: ActionReport<NightPhaseAttackStyle>;
969
+ closing_torpedo: ActionReport<TorpedoAttackStyle>;
970
+ opening_asw: ActionReport<AswAttackStyle>;
971
+ support_shelling: ActionReport<SupportShellingStyle>;
961
972
  }
962
973
 
963
- export interface SupportShellingStyle {
964
- tag: "SupportShellingStyle";
965
- attack_type: SupportShellingType;
974
+ export interface NodeAttackAnalysis {
975
+ left: AttackAnalysis;
976
+ right: AttackAnalysis;
977
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
978
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
966
979
  }
967
980
 
968
- export interface ShipConditions extends ShipPosition {
981
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
969
982
  formation?: Formation;
970
- amagiri_index?: number | null;
971
983
  }
972
984
 
973
985
  export interface NodeAttackAnalyzerConfig {
@@ -978,15 +990,16 @@ export interface NodeAttackAnalyzerConfig {
978
990
  right?: NodeAttackAnalyzerShipConfig;
979
991
  }
980
992
 
981
- export interface NodeAttackAnalysis {
982
- left: AttackAnalysis;
983
- right: AttackAnalysis;
984
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
985
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
993
+ export interface AttackAnalyzerShipConfig
994
+ extends ShipConditions,
995
+ NightFleetConditions {
996
+ balloons?: number;
997
+ fleet_los_mod?: number | null;
986
998
  }
987
999
 
988
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
989
- formation?: Formation;
1000
+ export interface MasterIBonusRule {
1001
+ expr: CompiledEvaler;
1002
+ formula: CompiledEvaler;
990
1003
  }
991
1004
 
992
1005
  export interface MasterIBonuses {
@@ -1009,17 +1022,6 @@ export interface MasterIBonuses {
1009
1022
  elos: MasterIBonusRule[];
1010
1023
  }
1011
1024
 
1012
- export interface MasterIBonusRule {
1013
- expr: CompiledEvaler;
1014
- formula: CompiledEvaler;
1015
- }
1016
-
1017
- export interface MstEquipExslotShip {
1018
- api_ctypes: Record<number, number> | null;
1019
- api_ship_ids: Record<number, number> | null;
1020
- api_stypes: Record<number, number> | null;
1021
- }
1022
-
1023
1025
  export interface MasterEquippability {
1024
1026
  equip_stype: MstStype[];
1025
1027
  equip_exslot: number[];
@@ -1028,6 +1030,10 @@ export interface MasterEquippability {
1028
1030
  rules: EquippabilityRule[];
1029
1031
  }
1030
1032
 
1033
+ export interface MstEquipShip {
1034
+ api_equip_type: Record<number, MstEquipShipValue>;
1035
+ }
1036
+
1031
1037
  export interface EquippabilityRule {
1032
1038
  ship: CompiledEvaler;
1033
1039
  keys?: string[];
@@ -1037,21 +1043,18 @@ export interface EquippabilityRule {
1037
1043
 
1038
1044
  export type MstEquipShipValue = null | number[];
1039
1045
 
1046
+ export interface MstEquipExslotShip {
1047
+ api_ctypes: Record<number, number> | null;
1048
+ api_ship_ids: Record<number, number> | null;
1049
+ api_stypes: Record<number, number> | null;
1050
+ }
1051
+
1040
1052
  export interface MstStype {
1041
1053
  api_id: number;
1042
1054
  api_equip_type: Record<number, number>;
1043
1055
  }
1044
1056
 
1045
- export interface MstEquipShip {
1046
- api_equip_type: Record<number, MstEquipShipValue>;
1047
- }
1048
-
1049
- export interface SupportShellingSimulatorParams {
1050
- attacker_formation?: Formation;
1051
- target_formation?: Formation;
1052
- engagement: Engagement;
1053
- node_state: NodeState;
1054
- }
1057
+ export type CompiledEvaler = string;
1055
1058
 
1056
1059
  export class AirSquadron {
1057
1060
  private constructor();