fleethub-core 1.12.5 → 1.12.6

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