fleethub-core 1.11.15 → 1.11.16

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