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