fleethub-core 1.11.25 → 1.12.1

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