fleethub-core 1.12.6 → 1.12.7

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