fleethub-core 1.12.13 → 1.12.15

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