fleethub-core 1.10.20 → 1.11.0

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