fleethub-core 1.12.16 → 1.12.17

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,83 @@ 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 AttackType =
62
+ | { t: "Asw"; c: AswAttackType }
63
+ | { t: "Shelling"; c: ShellingType }
64
+ | { t: "Night"; c: NightAttackType }
65
+ | { t: "Torpedo" }
66
+ | { t: "SupportShelling"; c: SupportShellingType };
128
67
 
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
- }
68
+ export type SupportShellingType = ShellingType;
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 NightAttackType = "Normal" | "Swordfish" | "Aerial";
75
+
76
+ export type ShellingType = "Normal" | "Aerial";
77
+
78
+ export type TorpedoAttackType = null;
79
+
80
+ export type NightPhaseAttackType =
81
+ | { t: "Night"; c: NightAttackType }
82
+ | { t: "Asw"; c: AswAttackType };
83
+
84
+ export type AswAttackType = "DepthCharge" | "Aerial";
85
+
86
+ export type GearTypeIdArray = [number, number, number, number, number];
87
+
88
+ export type FleetCutin =
89
+ | "NelsonTouch"
90
+ | "NagatoClassCutin"
91
+ | "ColoradoClassCutin"
92
+ | "KongouClassCutin"
93
+ | "Yamato2ShipCutin"
94
+ | "Yamato3ShipCutin"
95
+ | "QueenElizabethClassCutin"
96
+ | "RichelieuClassCutin";
97
+
98
+ export type NightCutinLike = NightCutin | FleetCutin;
99
+
100
+ export type DayCutin =
101
+ | "Zuiun"
102
+ | "AirSea"
103
+ | "MainMain"
104
+ | "MainAp"
105
+ | "MainRadar"
106
+ | "MainSec"
107
+ | "DoubleAttack"
108
+ | "JFJBJB"
109
+ | "JFJB"
110
+ | "JFBA"
111
+ | "FBA"
112
+ | "BBA"
113
+ | "BA";
141
114
 
142
115
  export type NightCutin =
143
116
  | "MainTorpRadar"
@@ -160,228 +133,139 @@ export type NightCutin =
160
133
  | "Photobomber"
161
134
  | "Cvci1_18";
162
135
 
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
- export type FleetCutin =
176
- | "NelsonTouch"
177
- | "NagatoClassCutin"
178
- | "ColoradoClassCutin"
179
- | "KongouClassCutin"
180
- | "Yamato2ShipCutin"
181
- | "Yamato3ShipCutin"
182
- | "QueenElizabethClassCutin"
183
- | "RichelieuClassCutin";
184
-
185
- export type NightCutinLike = NightCutin | FleetCutin;
186
-
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";
250
-
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";
136
+ export type DayCutinLike = DayCutin | FleetCutin;
264
137
 
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";
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
+ }
289
148
 
290
- export type ShipCategory =
291
- | "Battleship"
292
- | "AircraftCarrier"
293
- | "HeavyCruiser"
294
- | "LightCruiser"
295
- | "Destroyer"
296
- | "CoastalDefenseShip"
297
- | "Submarine"
298
- | "AuxiliaryShip";
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
+ }
299
161
 
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;
162
+ export interface ShipDayCutinAnalysis {
163
+ ship_id: number;
164
+ role: Role;
165
+ index: number;
166
+ rank3: DayCutinReport;
167
+ rank2: DayCutinReport;
315
168
  }
316
169
 
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;
170
+ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
171
+ observation_term: number | null;
325
172
  }
326
173
 
327
- export interface HitRate {
328
- normal: number;
329
- critical: number;
330
- total: 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[];
331
180
  }
332
181
 
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;
182
+ export interface CompNightCutinAnalysis {
183
+ night_contact_chance: NightContactChance;
184
+ ships: ShipNightCutinAnalysis[];
340
185
  }
341
186
 
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>;
187
+ export interface NightContactChance {
188
+ rank1: number;
189
+ rank2: number;
190
+ rank3: number;
352
191
  }
353
192
 
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;
193
+ export interface NightCutinActionReport
194
+ extends ActionReport<NightPhaseAttackStyle> {
195
+ cutin_term: number | null;
364
196
  }
365
197
 
366
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
198
+ export interface ShipNightCutinAnalysis {
199
+ ship_id: number;
200
+ index: number;
201
+ normal: NightCutinActionReport;
202
+ chuuha: NightCutinActionReport;
203
+ }
367
204
 
368
- export type FhResult<T> = { Ok: T } | { Err: string };
205
+ export interface MasterShip {
206
+ ship_id: number;
207
+ name: string;
208
+ yomi: string;
209
+ stype: number;
210
+ ctype: number;
211
+ nationality?: number;
212
+ sort_id?: number;
213
+ max_hp: StatInterval;
214
+ firepower: StatInterval;
215
+ armor: StatInterval;
216
+ torpedo: StatInterval;
217
+ evasion: StatInterval;
218
+ anti_air: StatInterval;
219
+ asw: StatInterval;
220
+ los: StatInterval;
221
+ luck: StatInterval;
222
+ torpedo_accuracy?: number;
223
+ basic_evasion_term?: number;
224
+ speed: number;
225
+ range?: number;
226
+ fuel?: number;
227
+ ammo?: number;
228
+ next_id?: number;
229
+ next_level?: number;
230
+ slotnum: number;
231
+ slots: SlotSizeVec;
232
+ stock: GearState[];
233
+ speed_group?: SpeedGroup;
234
+ useful?: boolean;
235
+ }
369
236
 
370
- export interface ShipAnalyzerConfig {
371
- air_state?: AirState;
372
- engagement?: Engagement;
373
- left?: AttackAnalyzerShipConfig;
374
- right?: AttackAnalyzerShipConfig;
237
+ export type StatInterval = [number | null, number | null];
238
+
239
+ export interface MasterData extends MasterBattleDefinitions {
240
+ created_at: number;
241
+ gears: MasterGear[];
242
+ gear_attrs: MasterAttrRule<GearAttr>[];
243
+ ships: MasterShip[];
244
+ ship_attrs: MasterAttrRule<ShipAttr>[];
245
+ ibonuses: MasterIBonuses;
246
+ equippability: MasterEquippability;
375
247
  }
376
248
 
377
- export interface MoveShipPayload {
378
- current: [string, string, ShipKey];
379
- target: [string | null, string, ShipKey];
249
+ export interface NationalityDef {
250
+ id: number;
251
+ ctypes: number[];
380
252
  }
381
253
 
382
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
254
+ export interface MasterAttrRule<T> {
255
+ tag: T;
256
+ name: string;
257
+ expr: CompiledEvaler;
258
+ }
383
259
 
384
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
260
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
261
+
262
+ export interface SlotSizeVecState {
263
+ ss1?: number;
264
+ ss2?: number;
265
+ ss3?: number;
266
+ ss4?: number;
267
+ ss5?: number;
268
+ }
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 TorpedoAttackStyle {
293
+ tag: "TorpedoAttackStyle";
294
+ attack_type: TorpedoAttackType;
295
+ }
409
296
 
410
- export interface SlotSizeVecState {
411
- ss1?: number;
412
- ss2?: number;
413
- ss3?: number;
414
- ss4?: number;
415
- ss5?: number;
297
+ export interface SupportShellingStyle {
298
+ tag: "SupportShellingStyle";
299
+ attack_type: SupportShellingType;
416
300
  }
417
301
 
418
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
302
+ export interface ShellingStyle {
303
+ tag: "ShellingStyle";
304
+ attack_type: ShellingType;
305
+ cutin: DayCutinLike | null;
306
+ power_mod: number;
307
+ accuracy_mod: number;
308
+ hits: number;
309
+ }
419
310
 
420
- export interface AirSquadronState extends GearVecState, SlotSizeVecState {
421
- id?: string;
422
- mode?: AirSquadronMode;
311
+ export interface NightAttackStyle {
312
+ tag: "NightAttackStyle";
313
+ attack_type: NightAttackType;
314
+ cutin: NightCutinLike | null;
315
+ power_mod: number;
316
+ accuracy_mod: number;
317
+ hits: number;
423
318
  }
424
319
 
425
- export type AirSquadronMode = "Sortie" | "AirDefense";
320
+ export interface AswAttackStyle {
321
+ tag: "AswAttackStyle";
322
+ attack_type: AswAttackType;
323
+ }
324
+
325
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
326
+
327
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
328
+
329
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
426
330
 
427
331
  export type SpecialEnemyType =
428
332
  | "None"
@@ -441,129 +345,59 @@ 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
348
  export type Role = "Main" | "Escort";
460
349
 
461
- export type Side = "Player" | "Enemy";
462
-
463
350
  export type Align = "Left" | "Right";
464
351
 
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
- }
352
+ export type Side = "Player" | "Enemy";
542
353
 
543
- export interface CompAnalysis {
544
- day: CompDayAnalysis;
545
- night: CompNightAnalysis;
546
- contact: ContactAnalysis;
547
- anti_air: CompAntiAirAnalysis;
548
- }
354
+ export type ShipCategory =
355
+ | "Battleship"
356
+ | "AircraftCarrier"
357
+ | "HeavyCruiser"
358
+ | "LightCruiser"
359
+ | "Destroyer"
360
+ | "CoastalDefenseShip"
361
+ | "Submarine"
362
+ | "AuxiliaryShip";
549
363
 
550
- export interface AttackAnalyzerShipConfig
551
- extends ShipConditions,
552
- NightFleetConditions {
553
- balloons?: number;
554
- fleet_los_mod?: number | null;
555
- }
364
+ export type ShipType =
365
+ | "Unknown"
366
+ | "DE"
367
+ | "DD"
368
+ | "CL"
369
+ | "CLT"
370
+ | "CA"
371
+ | "CAV"
372
+ | "CVL"
373
+ | "FBB"
374
+ | "BB"
375
+ | "BBV"
376
+ | "CV"
377
+ | "XBB"
378
+ | "SS"
379
+ | "SSV"
380
+ | "AP"
381
+ | "AV"
382
+ | "LHA"
383
+ | "CVB"
384
+ | "AR"
385
+ | "AS"
386
+ | "CT"
387
+ | "AO";
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
403
  export type NodeId = string;
@@ -577,144 +411,104 @@ export interface NodeState {
577
411
  landing_battle?: boolean;
578
412
  }
579
413
 
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 };
586
-
587
- export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
588
-
589
- export type ShellingType = "Normal" | "Aerial";
590
-
591
- export type AswAttackType = "DepthCharge" | "Aerial";
592
-
593
- export type NightPhaseAttackType =
594
- | { t: "Night"; c: NightAttackType }
595
- | { t: "Asw"; c: AswAttackType };
596
-
597
- export type TorpedoAttackType = null;
598
-
599
- export type DayPhaseAttackType =
600
- | { t: "Shelling"; c: ShellingType }
601
- | { t: "Asw"; c: AswAttackType };
414
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
602
415
 
603
- export type SupportShellingType = ShellingType;
416
+ export interface SupportShellingSimulatorParams {
417
+ attacker_formation?: Formation;
418
+ target_formation?: Formation;
419
+ engagement: Engagement;
420
+ node_state: NodeState;
421
+ }
604
422
 
605
423
  export type SlotSizeVec = (number | null)[];
606
424
 
607
- export type GearTypeIdArray = [number, number, number, number, number];
425
+ export type FhResult<T> = { Ok: T } | { Err: string };
608
426
 
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>;
427
+ export interface MasterBattleDefinitions {
428
+ formation: NestedFormationDef[];
429
+ anti_air_cutin: AntiAirCutinDef[];
430
+ day_cutin: DayCutinDef[];
431
+ night_cutin: NightCutinDef[];
432
+ historical_bonuses?: HistoricalBonusDef[];
620
433
  }
621
434
 
622
- export interface ContactAnalysis {
623
- single: DayContactChance[] | null;
624
- combined: DayContactChance[] | null;
625
- }
435
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
626
436
 
627
- export interface DayContactChance {
628
- air_state: AirState;
629
- trigger_rate: number;
630
- rank3: number;
631
- rank2: number;
632
- rank1: number;
633
- total: number;
437
+ export interface GearState {
438
+ id?: string;
439
+ gear_id: number;
440
+ exp?: number;
441
+ stars?: number;
634
442
  }
635
443
 
636
- export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
637
- observation_term: number | null;
444
+ export interface GearVecState {
445
+ g1?: GearState;
446
+ g2?: GearState;
447
+ g3?: GearState;
448
+ g4?: GearState;
449
+ g5?: GearState;
450
+ gx?: GearState;
638
451
  }
639
452
 
640
- export interface ShipDayCutinAnalysis {
641
- ship_id: number;
642
- role: Role;
643
- index: number;
644
- rank3: DayCutinReport;
645
- rank2: DayCutinReport;
453
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
454
+
455
+ export interface FleetMeta {
456
+ id: string;
457
+ len: number;
458
+ ships: [string, ShipMeta | null][];
646
459
  }
647
460
 
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[];
461
+ export interface CompMeta {
462
+ fleets: Record<FleetType, FleetMeta>;
654
463
  }
655
464
 
656
- export interface CompNightCutinAnalysis {
657
- night_contact_chance: NightContactChance;
658
- ships: ShipNightCutinAnalysis[];
465
+ export interface ShipMeta {
466
+ id: string;
467
+ ship_id: number;
659
468
  }
660
469
 
661
- export interface NightCutinActionReport
662
- extends ActionReport<NightPhaseAttackStyle> {
663
- cutin_term: number | null;
470
+ export interface ActionReport<T> {
471
+ data: Record<string, AttackReport<T>>;
472
+ damage_state_density: Histogram<DamageState, number> | null;
473
+ is_active: boolean;
664
474
  }
665
475
 
666
- export interface NightContactChance {
667
- rank1: number;
668
- rank2: number;
669
- rank3: number;
476
+ export interface SimulatorResult {
477
+ items: SimulatorResultItem[];
478
+ sunk_vec: [number, number, number][];
670
479
  }
671
480
 
672
- export interface ShipNightCutinAnalysis {
673
- ship_id: number;
481
+ export interface SimulatorResultItem {
482
+ id: string;
483
+ fleet_type: FleetType;
674
484
  index: number;
675
- normal: NightCutinActionReport;
676
- chuuha: NightCutinActionReport;
485
+ damage_state_map: Record<DamageState, number>;
677
486
  }
678
487
 
679
488
  export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
680
489
 
490
+ export interface FleetState {
491
+ id?: string;
492
+ len?: number;
493
+ s1?: ShipState;
494
+ s2?: ShipState;
495
+ s3?: ShipState;
496
+ s4?: ShipState;
497
+ s5?: ShipState;
498
+ s6?: ShipState;
499
+ s7?: ShipState;
500
+ }
501
+
681
502
  export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
682
503
 
683
- export interface NightCutinDef {
684
- tag: NightCutin;
504
+ export interface DayCutinDef {
505
+ tag: DayCutin;
685
506
  hits: number;
686
507
  type_factor: number | null;
687
508
  power_mod: number | null;
688
509
  accuracy_mod: number | null;
689
510
  }
690
511
 
691
- export interface FormationCombatModifiersDef {
692
- power_mod?: number;
693
- accuracy_mod?: number;
694
- evasion_mod?: number;
695
- }
696
-
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[];
703
- }
704
-
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;
716
- }
717
-
718
512
  export interface FormationDef {
719
513
  tag: Formation;
720
514
  protection_rate: number | null;
@@ -726,6 +520,10 @@ export interface FormationDef {
726
520
  support_shelling: FormationCombatModifiersDef;
727
521
  }
728
522
 
523
+ export type NestedFormationDef =
524
+ | FormationDef
525
+ | { top_half: FormationDef; bottom_half: FormationDef };
526
+
729
527
  export interface HistoricalParams {
730
528
  power_mod: AttackPowerModifier;
731
529
  armor_penetration: number;
@@ -741,23 +539,53 @@ export interface AntiAirCutinDef {
741
539
  sequential: boolean | null;
742
540
  }
743
541
 
744
- export interface DayCutinDef {
745
- tag: DayCutin;
542
+ export interface FormationCombatModifiersDef {
543
+ power_mod?: number;
544
+ accuracy_mod?: number;
545
+ evasion_mod?: number;
546
+ }
547
+
548
+ export interface NightCutinDef {
549
+ tag: NightCutin;
746
550
  hits: number;
747
551
  type_factor: number | null;
748
552
  power_mod: number | null;
749
553
  accuracy_mod: number | null;
750
554
  }
751
555
 
752
- export type NestedFormationDef =
753
- | FormationDef
754
- | { top_half: FormationDef; bottom_half: FormationDef };
556
+ export interface BattleDefinitions {
557
+ formation: Record<Formation, NestedFormationDef>;
558
+ anti_air_cutin: Record<number, AntiAirCutinDef>;
559
+ day_cutin: Record<DayCutin, DayCutinDef>;
560
+ night_cutin: Record<NightCutin, NightCutinDef>;
561
+ historical_bonuses: HistoricalBonusDef[];
562
+ }
563
+
564
+ export interface HistoricalBonusDef {
565
+ map?: number;
566
+ node?: CompiledEvaler;
567
+ phase?: number;
568
+ debuff?: boolean;
569
+ ship?: CompiledEvaler;
570
+ enemy?: CompiledEvaler;
571
+ power_mod?: AttackPowerModifier;
572
+ armor_penetration?: number;
573
+ accuracy_mod?: number;
574
+ evasion_mod?: number;
575
+ }
755
576
 
756
577
  export interface AttackPowerModifier {
757
578
  a?: number;
758
579
  b?: number;
759
580
  }
760
581
 
582
+ export interface CustomPowerModifiers {
583
+ precap_mod?: AttackPowerModifier;
584
+ postcap_mod?: AttackPowerModifier;
585
+ basic_power_mod?: AttackPowerModifier;
586
+ historical_mod?: AttackPowerModifier;
587
+ }
588
+
761
589
  export interface SpecialEnemyModifiers {
762
590
  precap_general_mod: AttackPowerModifier;
763
591
  stype_mod: AttackPowerModifier;
@@ -775,27 +603,12 @@ export interface SpecialEnemyModifiers {
775
603
  landing_forces_group_mod: AttackPowerModifier;
776
604
  landing_forces_t4_mod: AttackPowerModifier;
777
605
  landing_forces_t4kai_mod: AttackPowerModifier;
778
- t4_tank_group_mod: AttackPowerModifier;
779
- t4_tank_kai_mod: AttackPowerModifier;
780
- postcap_general_mod: AttackPowerModifier;
781
- pt_mod: AttackPowerModifier | null;
782
- }
783
-
784
- export interface CustomPowerModifiers {
785
- precap_mod?: AttackPowerModifier;
786
- postcap_mod?: AttackPowerModifier;
787
- basic_power_mod?: AttackPowerModifier;
788
- historical_mod?: AttackPowerModifier;
606
+ t4_tank_group_mod: AttackPowerModifier;
607
+ t4_tank_kai_mod: AttackPowerModifier;
608
+ postcap_general_mod: AttackPowerModifier;
609
+ pt_mod: AttackPowerModifier | null;
789
610
  }
790
611
 
791
- export type OrgType =
792
- | "Single"
793
- | "CarrierTaskForce"
794
- | "SurfaceTaskForce"
795
- | "TransportEscort"
796
- | "EnemySingle"
797
- | "EnemyCombined";
798
-
799
612
  export type AirState =
800
613
  | "AirSupremacy"
801
614
  | "AirSuperiority"
@@ -805,6 +618,14 @@ export type AirState =
805
618
 
806
619
  export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
807
620
 
621
+ export type CombinedFormation =
622
+ | "Cruising1"
623
+ | "Cruising2"
624
+ | "Cruising3"
625
+ | "Cruising4";
626
+
627
+ export type Formation = SingleFormation | CombinedFormation;
628
+
808
629
  export type SingleFormation =
809
630
  | "LineAhead"
810
631
  | "DoubleLine"
@@ -813,18 +634,31 @@ export type SingleFormation =
813
634
  | "LineAbreast"
814
635
  | "Vanguard";
815
636
 
816
- export type CombinedFormation =
817
- | "Cruising1"
818
- | "Cruising2"
819
- | "Cruising3"
820
- | "Cruising4";
821
-
822
- export type Formation = SingleFormation | CombinedFormation;
637
+ export interface AttackPower {
638
+ precap: number;
639
+ is_capped: boolean;
640
+ capped: number;
641
+ normal: number;
642
+ critical: number;
643
+ armor_penetration: number;
644
+ remaining_ammo_mod: number;
645
+ }
823
646
 
824
- export interface CompAntiAirAnalysis {
825
- fleet_adjusted_anti_air: number;
826
- ships: AntiAirReport[];
827
- anti_air_cutin_chance: [number, number][];
647
+ export interface AttackPowerParams {
648
+ is_cutin: boolean;
649
+ basic: number;
650
+ cap: number;
651
+ precap_mod: AttackPowerModifier;
652
+ postcap_mod: AttackPowerModifier;
653
+ ap_shell_mod: number | null;
654
+ aerial_power: number | null;
655
+ proficiency_critical_mod: number;
656
+ armor_penetration: number;
657
+ remaining_ammo_mod: number;
658
+ balloon_mod: number;
659
+ special_enemy_mods: SpecialEnemyModifiers;
660
+ historical_mod: AttackPowerModifier;
661
+ custom_mods: CustomPowerModifiers;
828
662
  }
829
663
 
830
664
  export interface AntiAirReport {
@@ -839,6 +673,12 @@ export interface AntiAirReport {
839
673
  anti_air_propellant_barrage_chance: number | null;
840
674
  }
841
675
 
676
+ export interface CompAntiAirAnalysis {
677
+ fleet_adjusted_anti_air: number;
678
+ ships: AntiAirReport[];
679
+ anti_air_cutin_chance: [number, number][];
680
+ }
681
+
842
682
  export interface FleetCutinReport<T> {
843
683
  cutin: FleetCutin;
844
684
  rate: number | null;
@@ -852,6 +692,102 @@ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
852
692
  power_mod: number;
853
693
  }
854
694
 
695
+ export interface BattleConditions {
696
+ org_type: OrgType;
697
+ role: Role;
698
+ ship_index: number;
699
+ fleet_len: number;
700
+ formation: Formation;
701
+ fleet_los_mod: number | null;
702
+ night_conditions: NightFleetConditions;
703
+ }
704
+
705
+ export interface NightFleetConditions {
706
+ night_contact_rank?: ContactRank | null;
707
+ starshell_index?: number | null;
708
+ searchlight_index?: number | null;
709
+ activates_large_searchlight?: boolean;
710
+ }
711
+
712
+ export interface NightConditions {
713
+ player?: NightFleetConditions;
714
+ enemy?: NightFleetConditions;
715
+ }
716
+
717
+ export type OrgType =
718
+ | "Single"
719
+ | "CarrierTaskForce"
720
+ | "SurfaceTaskForce"
721
+ | "TransportEscort"
722
+ | "EnemySingle"
723
+ | "EnemyCombined";
724
+
725
+ export interface ShipPosition {
726
+ org_type?: OrgType;
727
+ fleet_type?: FleetType;
728
+ fleet_len?: number;
729
+ index?: number;
730
+ }
731
+
732
+ export interface MasterIBonusRule {
733
+ expr: CompiledEvaler;
734
+ formula: CompiledEvaler;
735
+ }
736
+
737
+ export interface MasterIBonuses {
738
+ shelling_power: MasterIBonusRule[];
739
+ shelling_accuracy: MasterIBonusRule[];
740
+ shelling_aerial_power: MasterIBonusRule[];
741
+ torpedo_power: MasterIBonusRule[];
742
+ torpedo_accuracy: MasterIBonusRule[];
743
+ torpedo_evasion: MasterIBonusRule[];
744
+ asw_power: MasterIBonusRule[];
745
+ asw_accuracy: MasterIBonusRule[];
746
+ night_power: MasterIBonusRule[];
747
+ night_aerial_power: MasterIBonusRule[];
748
+ night_accuracy: MasterIBonusRule[];
749
+ defense_power: MasterIBonusRule[];
750
+ contact_selection: MasterIBonusRule[];
751
+ fighter_power: MasterIBonusRule[];
752
+ ship_anti_air: MasterIBonusRule[];
753
+ fleet_anti_air: MasterIBonusRule[];
754
+ elos: MasterIBonusRule[];
755
+ }
756
+
757
+ export interface EquippabilityRule {
758
+ ship: CompiledEvaler;
759
+ keys?: string[];
760
+ include?: string;
761
+ exclude?: string;
762
+ }
763
+
764
+ export type MstEquipShipValue = null | number[];
765
+
766
+ export interface MstEquipExslotShip {
767
+ api_ctypes: Record<number, number> | null;
768
+ api_ship_ids: Record<number, number> | null;
769
+ api_stypes: Record<number, number> | null;
770
+ }
771
+
772
+ export interface MstStype {
773
+ api_id: number;
774
+ api_equip_type: Record<number, number>;
775
+ }
776
+
777
+ export interface MasterEquippability {
778
+ equip_stype: MstStype[];
779
+ equip_exslot: number[];
780
+ equip_ship: Record<number, MstEquipShip>;
781
+ equip_exslot_ship: Record<number, MstEquipExslotShip>;
782
+ rules: EquippabilityRule[];
783
+ }
784
+
785
+ export interface MstEquipShip {
786
+ api_equip_type: Record<number, MstEquipShipValue>;
787
+ }
788
+
789
+ export type CompiledEvaler = string;
790
+
855
791
  export interface MasterGear {
856
792
  gear_id: number;
857
793
  name: string;
@@ -878,179 +814,246 @@ export interface MasterGear {
878
814
  historical_aircraft_group?: number;
879
815
  }
880
816
 
881
- export type StatInterval = [number | null, number | null];
817
+ export interface MoveShipPayload {
818
+ current: [string, string, ShipKey];
819
+ target: [string | null, string, ShipKey];
820
+ }
882
821
 
883
- export interface MasterShip {
822
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
823
+
824
+ export interface ShipConditions extends ShipPosition {
825
+ formation?: Formation;
826
+ amagiri_index?: number | null;
827
+ }
828
+
829
+ export interface AirSquadronState extends GearVecState, SlotSizeVecState {
830
+ id?: string;
831
+ mode?: AirSquadronMode;
832
+ }
833
+
834
+ export type AirSquadronMode = "Sortie" | "AirDefense";
835
+
836
+ export type GearVecInput = GearInput[];
837
+
838
+ export interface ShipInput {
884
839
  ship_id: number;
885
- name: string;
886
- yomi: string;
887
- stype: number;
888
840
  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;
841
+ stype: number;
842
+ yomi: string;
843
+ }
844
+
845
+ export interface EBonuses {
846
+ firepower: number;
847
+ torpedo: number;
848
+ anti_air: number;
849
+ armor: number;
850
+ evasion: number;
851
+ asw: number;
852
+ los: number;
853
+ bombing: number;
854
+ accuracy: number;
855
+ range: number;
856
+ }
857
+
858
+ export interface GearInput {
859
+ gear_id: number;
860
+ types: GearTypeIdArray;
861
+ firepower: number;
862
+ torpedo: number;
863
+ anti_air: number;
864
+ armor: number;
865
+ evasion: number;
866
+ asw: number;
867
+ los: number;
868
+ bombing: number;
869
+ accuracy: number;
870
+ range: number;
871
+ radius: number;
872
+ stars: number;
873
+ ace: number;
913
874
  }
914
875
 
915
- export interface GearVecState {
916
- g1?: GearState;
917
- g2?: GearState;
918
- g3?: GearState;
919
- g4?: GearState;
920
- g5?: GearState;
921
- gx?: GearState;
922
- }
876
+ export type GearCategory =
877
+ | "Fighter"
878
+ | "Bomber"
879
+ | "Recon"
880
+ | "MainGun"
881
+ | "Secondary"
882
+ | "Torpedo"
883
+ | "AntiSub"
884
+ | "Radar"
885
+ | "Landing"
886
+ | "Ration"
887
+ | "LandBased"
888
+ | "Misc";
889
+
890
+ export type GearType =
891
+ | "Unknown"
892
+ | "SmallMainGun"
893
+ | "MediumMainGun"
894
+ | "LargeMainGun"
895
+ | "SecondaryGun"
896
+ | "Torpedo"
897
+ | "CbFighter"
898
+ | "CbDiveBomber"
899
+ | "CbTorpedoBomber"
900
+ | "CbRecon"
901
+ | "ReconSeaplane"
902
+ | "SeaplaneBomber"
903
+ | "SmallRadar"
904
+ | "LargeRadar"
905
+ | "Sonar"
906
+ | "DepthCharge"
907
+ | "ExtraArmor"
908
+ | "Engine"
909
+ | "AntiAirShell"
910
+ | "ApShell"
911
+ | "VtFuze"
912
+ | "AntiAirGun"
913
+ | "MidgetSubmarine"
914
+ | "EmergencyRepair"
915
+ | "LandingCraft"
916
+ | "Rotorcraft"
917
+ | "AntiSubPatrolAircraft"
918
+ | "MediumArmor"
919
+ | "LargeArmor"
920
+ | "Searchlight"
921
+ | "SupplyContainer"
922
+ | "ShipRepairFacility"
923
+ | "SubmarineTorpedo"
924
+ | "Starshell"
925
+ | "CommandFacility"
926
+ | "AviationPersonnel"
927
+ | "AntiAirFireDirector"
928
+ | "AntiGroundEquipment"
929
+ | "LargeMainGun2"
930
+ | "ShipPersonnel"
931
+ | "LargeSonar"
932
+ | "LargeFlyingBoat"
933
+ | "LargeSearchlight"
934
+ | "CombatRation"
935
+ | "Supplies"
936
+ | "SeaplaneFighter"
937
+ | "AmphibiousTank"
938
+ | "LbAttacker"
939
+ | "LbFighter"
940
+ | "LbRecon"
941
+ | "TransportationMaterial"
942
+ | "SubmarineEquipment"
943
+ | "LandingForce"
944
+ | "LargeLbAircraft"
945
+ | "SurfaceEquipment"
946
+ | "JetFighter"
947
+ | "JetFighterBomber"
948
+ | "JetTorpedoBomber"
949
+ | "JetRecon"
950
+ | "LargeRadar2"
951
+ | "CbRecon2"
952
+ | "SecondaryGun2";
953
+
954
+ export type FleetKey = "f1" | "f2" | "f3" | "f4";
923
955
 
924
- export interface GearState {
956
+ export interface OrgState {
925
957
  id?: string;
926
- gear_id: number;
927
- exp?: number;
928
- stars?: number;
958
+ f1?: FleetState;
959
+ f2?: FleetState;
960
+ f3?: FleetState;
961
+ f4?: FleetState;
962
+ a1?: AirSquadronState;
963
+ a2?: AirSquadronState;
964
+ a3?: AirSquadronState;
965
+ hq_level?: number;
966
+ org_type?: OrgType;
967
+ sortie?: FleetKey;
968
+ route_sup?: FleetKey;
969
+ boss_sup?: FleetKey;
929
970
  }
930
971
 
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;
972
+ export interface HitRateParams {
973
+ accuracy_term: number;
974
+ evasion_term: number;
975
+ target_morale_mod: number;
976
+ critical_rate_constant: number;
977
+ critical_percentage_bonus: number;
978
+ hit_percentage_bonus: number;
938
979
  }
939
980
 
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;
981
+ export interface HitRate {
982
+ normal: number;
983
+ critical: number;
984
+ total: number;
947
985
  }
948
986
 
949
- export interface TorpedoAttackStyle {
950
- tag: "TorpedoAttackStyle";
951
- attack_type: TorpedoAttackType;
987
+ export interface CompNightAnalysis {
988
+ night_cutin: CompNightCutinAnalysis;
989
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
952
990
  }
953
991
 
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;
992
+ export interface CompAnalysis {
993
+ day: CompDayAnalysis;
994
+ night: CompNightAnalysis;
995
+ contact: ContactAnalysis;
996
+ anti_air: CompAntiAirAnalysis;
961
997
  }
962
998
 
963
- export interface SupportShellingStyle {
964
- tag: "SupportShellingStyle";
965
- attack_type: SupportShellingType;
999
+ export interface CompAnalyzerConfig {
1000
+ engagement: Engagement;
1001
+ formation: Formation;
1002
+ anti_air_cutin: number | null;
1003
+ ship_anti_air_resist: number;
1004
+ fleet_anti_air_resist: number;
1005
+ left_night_fleet_conditions: NightFleetConditions;
1006
+ right_night_fleet_conditions: NightFleetConditions;
966
1007
  }
967
1008
 
968
- export interface ShipConditions extends ShipPosition {
969
- formation?: Formation;
970
- amagiri_index?: number | null;
1009
+ export interface CompDayAnalysis {
1010
+ day_cutin: CompDayCutinAnalysis;
1011
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
971
1012
  }
972
1013
 
973
- export interface NodeAttackAnalyzerConfig {
1014
+ export interface ShipAnalyzerConfig {
974
1015
  air_state?: AirState;
975
1016
  engagement?: Engagement;
976
- node_state?: NodeState;
977
- left?: NodeAttackAnalyzerShipConfig;
978
- right?: NodeAttackAnalyzerShipConfig;
1017
+ left?: AttackAnalyzerShipConfig;
1018
+ right?: AttackAnalyzerShipConfig;
979
1019
  }
980
1020
 
981
- export interface NodeAttackAnalysis {
982
- left: AttackAnalysis;
983
- right: AttackAnalysis;
984
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
985
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
1021
+ export interface AttackAnalysis {
1022
+ attacker_is_player: boolean;
1023
+ attacker_ship_id: number;
1024
+ target_ship_id: number;
1025
+ historical_params: HistoricalParams;
1026
+ day: ActionReport<DayPhaseAttackStyle>;
1027
+ night: ActionReport<NightPhaseAttackStyle>;
1028
+ closing_torpedo: ActionReport<TorpedoAttackStyle>;
1029
+ opening_asw: ActionReport<AswAttackStyle>;
1030
+ support_shelling: ActionReport<SupportShellingStyle>;
986
1031
  }
987
1032
 
988
1033
  export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
989
1034
  formation?: Formation;
990
1035
  }
991
1036
 
992
- export interface MasterIBonuses {
993
- shelling_power: MasterIBonusRule[];
994
- shelling_accuracy: MasterIBonusRule[];
995
- shelling_aerial_power: MasterIBonusRule[];
996
- torpedo_power: MasterIBonusRule[];
997
- torpedo_accuracy: MasterIBonusRule[];
998
- torpedo_evasion: MasterIBonusRule[];
999
- asw_power: MasterIBonusRule[];
1000
- asw_accuracy: MasterIBonusRule[];
1001
- night_power: MasterIBonusRule[];
1002
- night_aerial_power: MasterIBonusRule[];
1003
- night_accuracy: MasterIBonusRule[];
1004
- defense_power: MasterIBonusRule[];
1005
- contact_selection: MasterIBonusRule[];
1006
- fighter_power: MasterIBonusRule[];
1007
- ship_anti_air: MasterIBonusRule[];
1008
- fleet_anti_air: MasterIBonusRule[];
1009
- elos: MasterIBonusRule[];
1010
- }
1011
-
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
- export interface MasterEquippability {
1024
- equip_stype: MstStype[];
1025
- equip_exslot: number[];
1026
- equip_ship: Record<number, MstEquipShip>;
1027
- equip_exslot_ship: Record<number, MstEquipExslotShip>;
1028
- rules: EquippabilityRule[];
1029
- }
1030
-
1031
- export interface EquippabilityRule {
1032
- ship: CompiledEvaler;
1033
- keys?: string[];
1034
- include?: string;
1035
- exclude?: string;
1036
- }
1037
-
1038
- export type MstEquipShipValue = null | number[];
1039
-
1040
- export interface MstStype {
1041
- api_id: number;
1042
- api_equip_type: Record<number, number>;
1037
+ export interface NodeAttackAnalysis {
1038
+ left: AttackAnalysis;
1039
+ right: AttackAnalysis;
1040
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
1041
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
1043
1042
  }
1044
1043
 
1045
- export interface MstEquipShip {
1046
- api_equip_type: Record<number, MstEquipShipValue>;
1044
+ export interface NodeAttackAnalyzerConfig {
1045
+ air_state?: AirState;
1046
+ engagement?: Engagement;
1047
+ node_state?: NodeState;
1048
+ left?: NodeAttackAnalyzerShipConfig;
1049
+ right?: NodeAttackAnalyzerShipConfig;
1047
1050
  }
1048
1051
 
1049
- export interface SupportShellingSimulatorParams {
1050
- attacker_formation?: Formation;
1051
- target_formation?: Formation;
1052
- engagement: Engagement;
1053
- node_state: NodeState;
1052
+ export interface AttackAnalyzerShipConfig
1053
+ extends ShipConditions,
1054
+ NightFleetConditions {
1055
+ balloons?: number;
1056
+ fleet_los_mod?: number | null;
1054
1057
  }
1055
1058
 
1056
1059
  export class AirSquadron {
@@ -1321,12 +1324,6 @@ export class Ship {
1321
1324
  private constructor();
1322
1325
  free(): void;
1323
1326
  [Symbol.dispose](): void;
1324
- /**
1325
- * フィット砲補正
1326
- */
1327
- gunfit_accuracy(is_night: boolean): number;
1328
- state_day_gunfit_accuracy(): number | undefined;
1329
- state_night_gunfit_accuracy(): number | undefined;
1330
1327
  get_ebonus(key: string): number;
1331
1328
  is_abyssal(): boolean;
1332
1329
  is_amagiri(): boolean;
@@ -1385,6 +1382,12 @@ export class Ship {
1385
1382
  can_equip(gear: Gear, key: string): boolean;
1386
1383
  gear_keys(): string[];
1387
1384
  is_pt_imp(): boolean;
1385
+ /**
1386
+ * フィット砲補正
1387
+ */
1388
+ gunfit_accuracy(is_night: boolean): number;
1389
+ state_day_gunfit_accuracy(): number | undefined;
1390
+ state_night_gunfit_accuracy(): number | undefined;
1388
1391
  id: string;
1389
1392
  readonly hash: bigint;
1390
1393
  readonly ship_id: number;