fleethub-core 1.10.4 → 1.10.6

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.
@@ -1,17 +1,96 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ */
5
+ export function set_panic_hook(): void;
3
6
  /**
4
7
  * @param {ShipConditions} value
5
8
  * @returns {ShipConditions}
6
9
  */
7
10
  export function parse_ship_conditions(value: ShipConditions): ShipConditions;
8
- /**
9
- */
10
- export function set_panic_hook(): void;
11
11
  export type SpeedGroup = "A" | "B1" | "B2" | "C";
12
12
 
13
+ export type ShipType =
14
+ | "Unknown"
15
+ | "DE"
16
+ | "DD"
17
+ | "CL"
18
+ | "CLT"
19
+ | "CA"
20
+ | "CAV"
21
+ | "CVL"
22
+ | "FBB"
23
+ | "BB"
24
+ | "BBV"
25
+ | "CV"
26
+ | "XBB"
27
+ | "SS"
28
+ | "SSV"
29
+ | "AP"
30
+ | "AV"
31
+ | "LHA"
32
+ | "CVB"
33
+ | "AR"
34
+ | "AS"
35
+ | "CT"
36
+ | "AO";
37
+
38
+ export type ShipCategory =
39
+ | "Battleship"
40
+ | "AircraftCarrier"
41
+ | "HeavyCruiser"
42
+ | "LightCruiser"
43
+ | "Destroyer"
44
+ | "CoastalDefenseShip"
45
+ | "Submarine"
46
+ | "AuxiliaryShip";
47
+
48
+ export interface HitRate {
49
+ normal: number;
50
+ critical: number;
51
+ total: number;
52
+ }
53
+
54
+ export interface HitRateParams {
55
+ accuracy_term: number;
56
+ evasion_term: number;
57
+ target_morale_mod: number;
58
+ critical_rate_constant: number;
59
+ critical_percentage_bonus: number;
60
+ hit_percentage_bonus: number;
61
+ }
62
+
63
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
64
+ formation?: Formation;
65
+ }
66
+
67
+ export interface NodeAttackAnalyzerConfig {
68
+ air_state?: AirState;
69
+ engagement?: Engagement;
70
+ node_state?: NodeState;
71
+ left?: NodeAttackAnalyzerShipConfig;
72
+ right?: NodeAttackAnalyzerShipConfig;
73
+ }
74
+
75
+ export interface NodeAttackAnalysis {
76
+ left: AttackAnalysis;
77
+ right: AttackAnalysis;
78
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
79
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
80
+ }
81
+
82
+ export type GearTypeIdArray = [number, number, number, number, number];
83
+
13
84
  export type SlotSizeVec = (number | null)[];
14
85
 
86
+ export type Align = "Left" | "Right";
87
+
88
+ export type Side = "Player" | "Enemy";
89
+
90
+ export type Role = "Main" | "Escort";
91
+
92
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
93
+
15
94
  export interface NightFleetConditions {
16
95
  night_contact_rank?: ContactRank | null;
17
96
  starshell_index?: number | null;
@@ -34,59 +113,119 @@ export interface BattleConditions {
34
113
  night_conditions: NightFleetConditions;
35
114
  }
36
115
 
37
- export interface MasterGear {
38
- gear_id: number;
39
- name: string;
40
- types: GearTypeIdArray;
41
- special_type?: number;
42
- max_hp?: number;
43
- firepower?: number;
44
- armor?: number;
45
- torpedo?: number;
46
- anti_air?: number;
47
- speed?: number;
48
- bombing?: number;
49
- asw?: number;
50
- los?: number;
51
- luck?: number;
52
- accuracy?: number;
53
- evasion?: number;
54
- range?: number;
55
- radius?: number;
56
- cost?: number;
57
- improvable?: boolean;
58
- ship_anti_air_resist?: number;
59
- fleet_anti_air_resist?: number;
60
- historical_aircraft_group?: number;
116
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
117
+
118
+ export interface EquippabilityRule {
119
+ ship: CompiledEvaler;
120
+ keys?: string[];
121
+ include?: string;
122
+ exclude?: string;
61
123
  }
62
124
 
63
- export interface CompAnalyzerConfig {
64
- engagement: Engagement;
65
- formation: Formation;
66
- anti_air_cutin: number | null;
67
- ship_anti_air_resist: number;
68
- fleet_anti_air_resist: number;
69
- left_night_fleet_conditions: NightFleetConditions;
70
- right_night_fleet_conditions: NightFleetConditions;
125
+ export interface MasterEquippability {
126
+ equip_stype: EquipStype[];
127
+ equip_exslot: number[];
128
+ equip_ship: MstEquipShip[];
129
+ equip_exslot_ship: MstEquipExslotShip[];
130
+ rules: EquippabilityRule[];
71
131
  }
72
132
 
73
- export interface CompNightAnalysis {
74
- night_cutin: CompNightCutinAnalysis;
75
- fleet_cutin: FleetCutinReport<NightAttackStyle>[];
133
+ export interface MstEquipExslotShip {
134
+ api_slotitem_id: number;
135
+ api_ship_ids: number[];
76
136
  }
77
137
 
78
- export interface CompDayAnalysis {
79
- day_cutin: CompDayCutinAnalysis;
80
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
138
+ export interface MstEquipShip {
139
+ api_ship_id: number;
140
+ api_equip_type: number[];
81
141
  }
82
142
 
83
- export interface CompAnalysis {
84
- day: CompDayAnalysis;
85
- night: CompNightAnalysis;
86
- contact: ContactAnalysis;
87
- anti_air: CompAntiAirAnalysis;
143
+ export interface EquipStype {
144
+ id: number;
145
+ equip_type: number[];
146
+ }
147
+
148
+ export interface ActionReport<T> {
149
+ data: Record<string, AttackReport<T>>;
150
+ damage_state_density: Histogram<DamageState, number> | null;
151
+ is_active: boolean;
152
+ }
153
+
154
+ export type NightCutinLike = NightCutin | FleetCutin;
155
+
156
+ export type DayCutinLike = DayCutin | FleetCutin;
157
+
158
+ export type FleetCutin =
159
+ | "NelsonTouch"
160
+ | "NagatoClassCutin"
161
+ | "ColoradoClassCutin"
162
+ | "KongouClassCutin"
163
+ | "Yamato2ShipCutin"
164
+ | "Yamato3ShipCutin";
165
+
166
+ export type NightCutin =
167
+ | "MainTorpRadar"
168
+ | "TorpLookoutRadar"
169
+ | "TorpTsloTorp"
170
+ | "TorpTsloDrum"
171
+ | "DoubleAttack"
172
+ | "TorpTorpMain"
173
+ | "TorpTorpTorp"
174
+ | "MainMainSec"
175
+ | "MainMainMain"
176
+ | "SubTorpTorp"
177
+ | "SubRadarTorp"
178
+ | "Cvci1_25"
179
+ | "Cvci1_20"
180
+ | "Cvci1_18"
181
+ | "Photobomber";
182
+
183
+ export type DayCutin =
184
+ | "Zuiun"
185
+ | "AirSea"
186
+ | "MainMain"
187
+ | "MainAp"
188
+ | "MainRadar"
189
+ | "MainSec"
190
+ | "DoubleAttack"
191
+ | "FBA"
192
+ | "BBA"
193
+ | "BA";
194
+
195
+ export interface MasterShip {
196
+ ship_id: number;
197
+ name: string;
198
+ yomi: string;
199
+ stype: number;
200
+ ctype: number;
201
+ nationality?: number;
202
+ sort_id?: number;
203
+ max_hp: StatInterval;
204
+ firepower: StatInterval;
205
+ armor: StatInterval;
206
+ torpedo: StatInterval;
207
+ evasion: StatInterval;
208
+ anti_air: StatInterval;
209
+ asw: StatInterval;
210
+ los: StatInterval;
211
+ luck: StatInterval;
212
+ torpedo_accuracy?: number;
213
+ basic_evasion_term?: number;
214
+ speed: number;
215
+ range?: number;
216
+ fuel?: number;
217
+ ammo?: number;
218
+ next_id?: number;
219
+ next_level?: number;
220
+ slotnum: number;
221
+ slots: SlotSizeVec;
222
+ stock: GearState[];
223
+ speed_group?: SpeedGroup;
224
+ useful?: boolean;
88
225
  }
89
226
 
227
+ export type StatInterval = [number | null, number | null];
228
+
90
229
  export interface OrgState {
91
230
  id?: string;
92
231
  f1?: FleetState;
@@ -168,162 +307,6 @@ export interface GearState {
168
307
  stars?: number;
169
308
  }
170
309
 
171
- export type ShipType =
172
- | "Unknown"
173
- | "DE"
174
- | "DD"
175
- | "CL"
176
- | "CLT"
177
- | "CA"
178
- | "CAV"
179
- | "CVL"
180
- | "FBB"
181
- | "BB"
182
- | "BBV"
183
- | "CV"
184
- | "XBB"
185
- | "SS"
186
- | "SSV"
187
- | "AP"
188
- | "AV"
189
- | "LHA"
190
- | "CVB"
191
- | "AR"
192
- | "AS"
193
- | "CT"
194
- | "AO";
195
-
196
- export type ShipCategory =
197
- | "Battleship"
198
- | "AircraftCarrier"
199
- | "HeavyCruiser"
200
- | "LightCruiser"
201
- | "Destroyer"
202
- | "CoastalDefenseShip"
203
- | "Submarine"
204
- | "AuxiliaryShip";
205
-
206
- export type Role = "Main" | "Escort";
207
-
208
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
209
- formation?: Formation;
210
- }
211
-
212
- export interface NodeAttackAnalyzerConfig {
213
- air_state?: AirState;
214
- engagement?: Engagement;
215
- node_state?: NodeState;
216
- left?: NodeAttackAnalyzerShipConfig;
217
- right?: NodeAttackAnalyzerShipConfig;
218
- }
219
-
220
- export interface NodeAttackAnalysis {
221
- left: AttackAnalysis;
222
- right: AttackAnalysis;
223
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
224
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
225
- }
226
-
227
- export interface ActionReport<T> {
228
- data: Record<string, AttackReport<T>>;
229
- damage_state_density: Histogram<DamageState, number> | null;
230
- is_active: boolean;
231
- }
232
-
233
- export type GearTypeIdArray = [number, number, number, number, number];
234
-
235
- export type Align = "Left" | "Right";
236
-
237
- export type Side = "Player" | "Enemy";
238
-
239
- export interface MasterIBonuses {
240
- shelling_power: MasterIBonusRule[];
241
- shelling_accuracy: MasterIBonusRule[];
242
- shelling_aerial_power: MasterIBonusRule[];
243
- torpedo_power: MasterIBonusRule[];
244
- torpedo_accuracy: MasterIBonusRule[];
245
- torpedo_evasion: MasterIBonusRule[];
246
- asw_power: MasterIBonusRule[];
247
- asw_accuracy: MasterIBonusRule[];
248
- night_power: MasterIBonusRule[];
249
- night_aerial_power: MasterIBonusRule[];
250
- night_accuracy: MasterIBonusRule[];
251
- defense_power: MasterIBonusRule[];
252
- contact_selection: MasterIBonusRule[];
253
- fighter_power: MasterIBonusRule[];
254
- ship_anti_air: MasterIBonusRule[];
255
- fleet_anti_air: MasterIBonusRule[];
256
- elos: MasterIBonusRule[];
257
- }
258
-
259
- export interface MasterIBonusRule {
260
- expr: CompiledEvaler;
261
- formula: CompiledEvaler;
262
- }
263
-
264
- export interface AttackReport<T> {
265
- style: T;
266
- proc_rate: number | null;
267
- attack_power: AttackPower | null;
268
- attack_power_params: AttackPowerParams | null;
269
- hits: number;
270
- hit_rate: HitRate | null;
271
- hit_rate_params: HitRateParams | null;
272
- damage: DamageReport | null;
273
- }
274
-
275
- export interface MoveShipPayload {
276
- current: [string, string, ShipKey];
277
- target: [string | null, string, ShipKey];
278
- }
279
-
280
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
281
-
282
- export type NightCutinLike = NightCutin | FleetCutin;
283
-
284
- export type DayCutinLike = DayCutin | FleetCutin;
285
-
286
- export type FleetCutin =
287
- | "NelsonTouch"
288
- | "NagatoClassCutin"
289
- | "ColoradoClassCutin"
290
- | "KongouClassCutin"
291
- | "Yamato2ShipCutin"
292
- | "Yamato3ShipCutin";
293
-
294
- export type NightCutin =
295
- | "MainTorpRadar"
296
- | "TorpLookoutRadar"
297
- | "TorpTsloTorp"
298
- | "TorpTsloDrum"
299
- | "DoubleAttack"
300
- | "TorpTorpMain"
301
- | "TorpTorpTorp"
302
- | "MainMainSec"
303
- | "MainMainMain"
304
- | "SubTorpTorp"
305
- | "SubRadarTorp"
306
- | "Cvci1_25"
307
- | "Cvci1_20"
308
- | "Cvci1_18"
309
- | "Photobomber";
310
-
311
- export type DayCutin =
312
- | "Zuiun"
313
- | "AirSea"
314
- | "MainMain"
315
- | "MainAp"
316
- | "MainRadar"
317
- | "MainSec"
318
- | "DoubleAttack"
319
- | "FBA"
320
- | "BBA"
321
- | "BA";
322
-
323
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
324
-
325
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
326
-
327
310
  export interface BattleDefinitions {
328
311
  formation: Record<Formation, NestedFormationDef>;
329
312
  anti_air_cutin: Record<number, AntiAirCutinDef>;
@@ -340,6 +323,12 @@ export interface NightCutinDef {
340
323
  accuracy_mod: number | null;
341
324
  }
342
325
 
326
+ export interface HistoricalParams {
327
+ power_mod: number;
328
+ accuracy_mod: number;
329
+ target_evasion_mod: number;
330
+ }
331
+
343
332
  export interface HistoricalBonusDef {
344
333
  map?: number;
345
334
  node?: CompiledEvaler;
@@ -389,44 +378,27 @@ export interface FormationCombatModifiersDef {
389
378
  evasion_mod?: number;
390
379
  }
391
380
 
392
- export interface SimulatorResult {
393
- items: SimulatorResultItem[];
394
- sunk_vec: [number, number, number][];
381
+ export interface MoveShipPayload {
382
+ current: [string, string, ShipKey];
383
+ target: [string | null, string, ShipKey];
395
384
  }
396
385
 
397
- export interface SimulatorResultItem {
398
- id: string;
399
- fleet_type: FleetType;
400
- index: number;
401
- damage_state_map: Record<DamageState, number>;
402
- }
386
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
403
387
 
404
- export interface AttackPower {
405
- precap: number;
406
- is_capped: boolean;
407
- capped: number;
408
- normal: number;
409
- critical: number;
410
- armor_penetration: number;
411
- remaining_ammo_mod: number;
412
- }
388
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
413
389
 
414
- export interface AttackPowerParams {
415
- basic: number;
416
- cap: number;
417
- precap_mod: AttackPowerModifier;
418
- postcap_mod: AttackPowerModifier;
419
- ap_shell_mod: number | null;
420
- aerial_power: number | null;
421
- proficiency_critical_mod: number;
422
- armor_penetration: number;
423
- remaining_ammo_mod: number;
424
- special_enemy_mods: SpecialEnemyModifiers;
425
- historical_mod: number;
426
- custom_mods: CustomPowerModifiers;
427
- }
390
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
428
391
 
429
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
392
+ export interface AttackReport<T> {
393
+ style: T;
394
+ proc_rate: number | null;
395
+ attack_power: AttackPower | null;
396
+ attack_power_params: AttackPowerParams | null;
397
+ hits: number;
398
+ hit_rate: HitRate | null;
399
+ hit_rate_params: HitRateParams | null;
400
+ damage: DamageReport | null;
401
+ }
430
402
 
431
403
  export interface ShipConditions extends ShipPosition {
432
404
  formation?: Formation;
@@ -509,54 +481,6 @@ export type GearType =
509
481
  | "CbRecon2"
510
482
  | "SecondaryGun2";
511
483
 
512
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
513
-
514
- export interface MasterData extends MasterBattleDefinitions {
515
- created_at: number;
516
- gears: MasterGear[];
517
- gear_attrs: MasterAttrRule<GearAttr>[];
518
- ships: MasterShip[];
519
- ship_attrs: MasterAttrRule<ShipAttr>[];
520
- ibonuses: MasterIBonuses;
521
- equippability: MasterEquippability;
522
- }
523
-
524
- export interface NationalityDef {
525
- id: number;
526
- ctypes: number[];
527
- }
528
-
529
- export interface MasterAttrRule<T> {
530
- tag: T;
531
- name: string;
532
- expr: CompiledEvaler;
533
- }
534
-
535
- export type TorpedoAttackType = null;
536
-
537
- export type NightPhaseAttackType =
538
- | { t: "Night"; c: NightAttackType }
539
- | { t: "Asw"; c: AswAttackType };
540
-
541
- export type DayPhaseAttackType =
542
- | { t: "Shelling"; c: ShellingType }
543
- | { t: "Asw"; c: AswAttackType };
544
-
545
- export type AttackType =
546
- | { t: "Asw"; c: AswAttackType }
547
- | { t: "Shelling"; c: ShellingType }
548
- | { t: "Night"; c: NightAttackType }
549
- | { t: "Torpedo" }
550
- | { t: "SupportShelling"; c: SupportShellingType };
551
-
552
- export type SupportShellingType = ShellingType;
553
-
554
- export type NightAttackType = "Normal" | "Swordfish" | "Carrier";
555
-
556
- export type ShellingType = "Normal" | "Carrier";
557
-
558
- export type AswAttackType = "DepthCharge" | "Aircraft";
559
-
560
484
  export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
561
485
 
562
486
  export type AirState =
@@ -566,96 +490,45 @@ export type AirState =
566
490
  | "AirDenial"
567
491
  | "AirIncapability";
568
492
 
569
- export type FhResult<T> = { Ok: T } | { Err: string };
570
-
571
- export interface ShipPosition {
572
- org_type?: OrgType;
573
- fleet_type?: FleetType;
574
- fleet_len?: number;
575
- index?: number;
576
- }
577
-
578
- export interface CompMeta {
579
- fleets: Record<FleetType, FleetMeta>;
493
+ export interface SimulatorResult {
494
+ items: SimulatorResultItem[];
495
+ sunk_vec: [number, number, number][];
580
496
  }
581
497
 
582
- export interface FleetMeta {
498
+ export interface SimulatorResultItem {
583
499
  id: string;
584
- len: number;
585
- ships: [string, ShipMeta | null][];
500
+ fleet_type: FleetType;
501
+ index: number;
502
+ damage_state_map: Record<DamageState, number>;
586
503
  }
587
504
 
588
- export interface ShipMeta {
589
- id: string;
590
- ship_id: number;
591
- }
505
+ export type FhResult<T> = { Ok: T } | { Err: string };
592
506
 
593
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
594
-
595
- export interface CustomPowerModifiers {
596
- precap_mod?: AttackPowerModifier;
597
- postcap_mod?: AttackPowerModifier;
598
- basic_power_mod?: AttackPowerModifier;
599
- }
600
-
601
- export interface SpecialEnemyModifiers {
602
- precap_general_mod: AttackPowerModifier;
603
- stype_mod: AttackPowerModifier;
604
- landing_craft_synergy_mod: AttackPowerModifier;
605
- toku_daihatsu_tank_mod: AttackPowerModifier;
606
- m4a1dd_mod: AttackPowerModifier;
607
- honi_mod: AttackPowerModifier;
608
- postcap_general_mod: AttackPowerModifier;
609
- pt_mod: AttackPowerModifier;
610
- }
611
-
612
- export interface AttackPowerModifier {
613
- a?: number;
614
- b?: number;
615
- }
616
-
617
- export type CompiledEvaler = string;
618
-
619
- export interface EBonuses {
620
- firepower: number;
621
- torpedo: number;
622
- anti_air: number;
623
- armor: number;
624
- evasion: number;
625
- asw: number;
626
- los: number;
627
- bombing: number;
628
- accuracy: number;
629
- range: number;
630
- }
631
-
632
- export interface ShipInput {
633
- ship_id: number;
634
- ctype: number;
635
- stype: number;
636
- yomi: string;
507
+ export interface AttackPower {
508
+ precap: number;
509
+ is_capped: boolean;
510
+ capped: number;
511
+ normal: number;
512
+ critical: number;
513
+ armor_penetration: number;
514
+ remaining_ammo_mod: number;
637
515
  }
638
516
 
639
- export interface GearInput {
640
- gear_id: number;
641
- types: GearTypeIdArray;
642
- firepower: number;
643
- torpedo: number;
644
- anti_air: number;
645
- armor: number;
646
- evasion: number;
647
- asw: number;
648
- los: number;
649
- bombing: number;
650
- accuracy: number;
651
- range: number;
652
- radius: number;
653
- stars: number;
654
- ace: number;
517
+ export interface AttackPowerParams {
518
+ basic: number;
519
+ cap: number;
520
+ precap_mod: AttackPowerModifier;
521
+ postcap_mod: AttackPowerModifier;
522
+ ap_shell_mod: number | null;
523
+ aerial_power: number | null;
524
+ proficiency_critical_mod: number;
525
+ armor_penetration: number;
526
+ remaining_ammo_mod: number;
527
+ special_enemy_mods: SpecialEnemyModifiers;
528
+ historical_mod: number;
529
+ custom_mods: CustomPowerModifiers;
655
530
  }
656
531
 
657
- export type GearVecInput = GearInput[];
658
-
659
532
  export type ShipAttr =
660
533
  | "Unknown"
661
534
  | "Abyssal"
@@ -673,94 +546,91 @@ export type ShipAttr =
673
546
  | "BattleshipSummerPrincess"
674
547
  | "HeavyCruiserSummerPrincess";
675
548
 
676
- export type OrgType =
677
- | "Single"
678
- | "CarrierTaskForce"
679
- | "SurfaceTaskForce"
680
- | "TransportEscort"
681
- | "EnemySingle"
682
- | "EnemyCombined";
683
-
684
- export type FleetKey = "f1" | "f2" | "f3" | "f4";
685
-
686
- export interface SupportShellingSimulatorParams {
687
- attacker_formation?: Formation;
688
- target_formation?: Formation;
689
- engagement: Engagement;
549
+ export interface ShipPosition {
550
+ org_type?: OrgType;
551
+ fleet_type?: FleetType;
552
+ fleet_len?: number;
553
+ index?: number;
690
554
  }
691
555
 
692
- export interface MasterBattleDefinitions {
693
- formation: NestedFormationDef[];
694
- anti_air_cutin: AntiAirCutinDef[];
695
- day_cutin: DayCutinDef[];
696
- night_cutin: NightCutinDef[];
697
- historical_bonuses?: HistoricalBonusDef[];
698
- }
556
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
699
557
 
700
- export interface ShipAnalyzerConfig {
701
- air_state?: AirState;
702
- engagement?: Engagement;
703
- left?: AttackAnalyzerShipConfig;
704
- right?: AttackAnalyzerShipConfig;
558
+ export interface MasterIBonuses {
559
+ shelling_power: MasterIBonusRule[];
560
+ shelling_accuracy: MasterIBonusRule[];
561
+ shelling_aerial_power: MasterIBonusRule[];
562
+ torpedo_power: MasterIBonusRule[];
563
+ torpedo_accuracy: MasterIBonusRule[];
564
+ torpedo_evasion: MasterIBonusRule[];
565
+ asw_power: MasterIBonusRule[];
566
+ asw_accuracy: MasterIBonusRule[];
567
+ night_power: MasterIBonusRule[];
568
+ night_aerial_power: MasterIBonusRule[];
569
+ night_accuracy: MasterIBonusRule[];
570
+ defense_power: MasterIBonusRule[];
571
+ contact_selection: MasterIBonusRule[];
572
+ fighter_power: MasterIBonusRule[];
573
+ ship_anti_air: MasterIBonusRule[];
574
+ fleet_anti_air: MasterIBonusRule[];
575
+ elos: MasterIBonusRule[];
705
576
  }
706
577
 
707
- export interface NightContactChance {
708
- rank1: number;
709
- rank2: number;
710
- rank3: number;
578
+ export interface MasterIBonusRule {
579
+ expr: CompiledEvaler;
580
+ formula: CompiledEvaler;
711
581
  }
712
582
 
713
- export interface CompNightCutinAnalysis {
714
- night_contact_chance: NightContactChance;
715
- ships: ShipNightCutinAnalysis[];
583
+ export interface MasterGear {
584
+ gear_id: number;
585
+ name: string;
586
+ types: GearTypeIdArray;
587
+ special_type?: number;
588
+ max_hp?: number;
589
+ firepower?: number;
590
+ armor?: number;
591
+ torpedo?: number;
592
+ anti_air?: number;
593
+ speed?: number;
594
+ bombing?: number;
595
+ asw?: number;
596
+ los?: number;
597
+ luck?: number;
598
+ accuracy?: number;
599
+ evasion?: number;
600
+ range?: number;
601
+ radius?: number;
602
+ cost?: number;
603
+ improvable?: boolean;
604
+ ship_anti_air_resist?: number;
605
+ fleet_anti_air_resist?: number;
606
+ historical_aircraft_group?: number;
716
607
  }
717
608
 
718
- export interface ShipNightCutinAnalysis {
719
- ship_id: number;
720
- index: number;
721
- normal: NightCutinActionReport;
722
- chuuha: NightCutinActionReport;
723
- }
609
+ export type CompiledEvaler = string;
724
610
 
725
- export interface NightCutinActionReport
726
- extends ActionReport<NightPhaseAttackStyle> {
727
- cutin_term: number | null;
728
- }
611
+ export type OrgType =
612
+ | "Single"
613
+ | "CarrierTaskForce"
614
+ | "SurfaceTaskForce"
615
+ | "TransportEscort"
616
+ | "EnemySingle"
617
+ | "EnemyCombined";
729
618
 
730
- export interface AttackAnalyzerShipConfig
731
- extends ShipConditions,
732
- NightFleetConditions {
733
- fleet_los_mod?: number | null;
619
+ export interface CompMeta {
620
+ fleets: Record<FleetType, FleetMeta>;
734
621
  }
735
622
 
736
- export interface CompAntiAirAnalysis {
737
- fleet_adjusted_anti_air: number;
738
- ships: AntiAirReport[];
739
- anti_air_cutin_chance: [number, number][];
623
+ export interface FleetMeta {
624
+ id: string;
625
+ len: number;
626
+ ships: [string, ShipMeta | null][];
740
627
  }
741
628
 
742
- export interface AntiAirReport {
629
+ export interface ShipMeta {
630
+ id: string;
743
631
  ship_id: number;
744
- role: Role;
745
- index: number;
746
- adjusted_anti_air: number | null;
747
- proportional_shotdown_rate: number | null;
748
- fixed_shotdown_number: number | null;
749
- guaranteed: number | null;
750
- anti_air_cutin_chance: [number, number][];
751
- anti_air_propellant_barrage_chance: number | null;
752
632
  }
753
633
 
754
- export interface NodeState {
755
- map?: number;
756
- node?: NodeId;
757
- phase?: number;
758
- debuff?: boolean;
759
- disable_historical_mod?: boolean;
760
- }
761
-
762
- export type NodeId = string;
763
-
764
634
  export type GearAttr =
765
635
  | "Unknown"
766
636
  | "Abyssal"
@@ -793,6 +663,205 @@ export type GearAttr =
793
663
  | "SemiNightPlane"
794
664
  | "HighAltitudeInterceptor";
795
665
 
666
+ export type FleetKey = "f1" | "f2" | "f3" | "f4";
667
+
668
+ export type TorpedoAttackType = null;
669
+
670
+ export type NightPhaseAttackType =
671
+ | { t: "Night"; c: NightAttackType }
672
+ | { t: "Asw"; c: AswAttackType };
673
+
674
+ export type DayPhaseAttackType =
675
+ | { t: "Shelling"; c: ShellingType }
676
+ | { t: "Asw"; c: AswAttackType };
677
+
678
+ export type AttackType =
679
+ | { t: "Asw"; c: AswAttackType }
680
+ | { t: "Shelling"; c: ShellingType }
681
+ | { t: "Night"; c: NightAttackType }
682
+ | { t: "Torpedo" }
683
+ | { t: "SupportShelling"; c: SupportShellingType };
684
+
685
+ export type SupportShellingType = ShellingType;
686
+
687
+ export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
688
+
689
+ export type ShellingType = "Normal" | "Aerial";
690
+
691
+ export type AswAttackType = "DepthCharge" | "Aerial";
692
+
693
+ export interface CustomPowerModifiers {
694
+ precap_mod?: AttackPowerModifier;
695
+ postcap_mod?: AttackPowerModifier;
696
+ basic_power_mod?: AttackPowerModifier;
697
+ }
698
+
699
+ export interface SpecialEnemyModifiers {
700
+ precap_general_mod: AttackPowerModifier;
701
+ stype_mod: AttackPowerModifier;
702
+ landing_craft_synergy_mod: AttackPowerModifier;
703
+ toku_daihatsu_tank_mod: AttackPowerModifier;
704
+ m4a1dd_mod: AttackPowerModifier;
705
+ honi_mod: AttackPowerModifier;
706
+ postcap_general_mod: AttackPowerModifier;
707
+ pt_mod: AttackPowerModifier;
708
+ }
709
+
710
+ export interface AttackPowerModifier {
711
+ a?: number;
712
+ b?: number;
713
+ }
714
+
715
+ export interface MasterData extends MasterBattleDefinitions {
716
+ created_at: number;
717
+ gears: MasterGear[];
718
+ gear_attrs: MasterAttrRule<GearAttr>[];
719
+ ships: MasterShip[];
720
+ ship_attrs: MasterAttrRule<ShipAttr>[];
721
+ ibonuses: MasterIBonuses;
722
+ equippability: MasterEquippability;
723
+ }
724
+
725
+ export interface NationalityDef {
726
+ id: number;
727
+ ctypes: number[];
728
+ }
729
+
730
+ export interface MasterAttrRule<T> {
731
+ tag: T;
732
+ name: string;
733
+ expr: CompiledEvaler;
734
+ }
735
+
736
+ export interface NightContactChance {
737
+ rank1: number;
738
+ rank2: number;
739
+ rank3: number;
740
+ }
741
+
742
+ export interface CompNightCutinAnalysis {
743
+ night_contact_chance: NightContactChance;
744
+ ships: ShipNightCutinAnalysis[];
745
+ }
746
+
747
+ export interface ShipNightCutinAnalysis {
748
+ ship_id: number;
749
+ index: number;
750
+ normal: NightCutinActionReport;
751
+ chuuha: NightCutinActionReport;
752
+ }
753
+
754
+ export interface NightCutinActionReport
755
+ extends ActionReport<NightPhaseAttackStyle> {
756
+ cutin_term: number | null;
757
+ }
758
+
759
+ export interface FleetCutinReport<T> {
760
+ cutin: FleetCutin;
761
+ rate: number | null;
762
+ formation: Formation;
763
+ attacks: FleetCutinAttackReport<T>[];
764
+ }
765
+
766
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
767
+ index: number;
768
+ ship_id: number;
769
+ power_mod: number;
770
+ }
771
+
772
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
773
+
774
+ export interface SupportShellingSimulatorParams {
775
+ attacker_formation?: Formation;
776
+ target_formation?: Formation;
777
+ engagement: Engagement;
778
+ }
779
+
780
+ export interface MasterBattleDefinitions {
781
+ formation: NestedFormationDef[];
782
+ anti_air_cutin: AntiAirCutinDef[];
783
+ day_cutin: DayCutinDef[];
784
+ night_cutin: NightCutinDef[];
785
+ historical_bonuses?: HistoricalBonusDef[];
786
+ }
787
+
788
+ export interface ShipAnalyzerConfig {
789
+ air_state?: AirState;
790
+ engagement?: Engagement;
791
+ left?: AttackAnalyzerShipConfig;
792
+ right?: AttackAnalyzerShipConfig;
793
+ }
794
+
795
+ export interface AttackAnalysis {
796
+ attacker_is_player: boolean;
797
+ attacker_ship_id: number;
798
+ target_ship_id: number;
799
+ historical_params: HistoricalParams;
800
+ day: ActionReport<DayPhaseAttackStyle>;
801
+ night: ActionReport<NightPhaseAttackStyle>;
802
+ closing_torpedo: ActionReport<TorpedoAttackStyle>;
803
+ opening_asw: ActionReport<AswAttackStyle>;
804
+ support_shelling: ActionReport<SupportShellingStyle>;
805
+ }
806
+
807
+ export interface EBonuses {
808
+ firepower: number;
809
+ torpedo: number;
810
+ anti_air: number;
811
+ armor: number;
812
+ evasion: number;
813
+ asw: number;
814
+ los: number;
815
+ bombing: number;
816
+ accuracy: number;
817
+ range: number;
818
+ }
819
+
820
+ export interface ShipInput {
821
+ ship_id: number;
822
+ ctype: number;
823
+ stype: number;
824
+ yomi: string;
825
+ }
826
+
827
+ export interface GearInput {
828
+ gear_id: number;
829
+ types: GearTypeIdArray;
830
+ firepower: number;
831
+ torpedo: number;
832
+ anti_air: number;
833
+ armor: number;
834
+ evasion: number;
835
+ asw: number;
836
+ los: number;
837
+ bombing: number;
838
+ accuracy: number;
839
+ range: number;
840
+ radius: number;
841
+ stars: number;
842
+ ace: number;
843
+ }
844
+
845
+ export type GearVecInput = GearInput[];
846
+
847
+ export type Histogram<K, V> = Partial<Record<K, V>>;
848
+
849
+ export type Formation = SingleFormation | CombinedFormation;
850
+
851
+ export type CombinedFormation =
852
+ | "Cruising1"
853
+ | "Cruising2"
854
+ | "Cruising3"
855
+ | "Cruising4";
856
+
857
+ export type SingleFormation =
858
+ | "LineAhead"
859
+ | "DoubleLine"
860
+ | "Diamond"
861
+ | "Echelon"
862
+ | "LineAbreast"
863
+ | "Vanguard";
864
+
796
865
  export interface SupportShellingStyle {
797
866
  tag: "SupportShellingStyle";
798
867
  attack_type: SupportShellingType;
@@ -830,61 +899,42 @@ export interface ShellingStyle {
830
899
  hits: number;
831
900
  }
832
901
 
833
- export interface FleetCutinReport<T> {
834
- cutin: FleetCutin;
835
- rate: number | null;
836
- formation: Formation;
837
- attacks: FleetCutinAttackReport<T>[];
902
+ export interface CompDayCutinAnalysis {
903
+ rank3_air_state: AirState;
904
+ rank2_air_state: AirState;
905
+ main_fleet_los_mod: number | null;
906
+ escort_fleet_los_mod: number | null;
907
+ ships: ShipDayCutinAnalysis[];
838
908
  }
839
909
 
840
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
841
- index: number;
910
+ export interface ShipDayCutinAnalysis {
842
911
  ship_id: number;
843
- power_mod: number;
912
+ role: Role;
913
+ index: number;
914
+ rank3: DayCutinReport;
915
+ rank2: DayCutinReport;
844
916
  }
845
917
 
846
- export interface DamageReport {
847
- miss_damage_min: number;
848
- miss_damage_max: number;
849
- normal_damage_min: number;
850
- normal_damage_max: number;
851
- critical_damage_min: number;
852
- critical_damage_max: number;
853
- normal_scratch_rate: number;
854
- critical_scratch_rate: number;
855
- damage_density: Histogram<number, number>;
856
- damage_state_density: Histogram<DamageState, number>;
918
+ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
919
+ observation_term: number | null;
857
920
  }
858
921
 
859
- export type Histogram<K, V> = Partial<Record<K, V>>;
860
-
861
- export type Formation = SingleFormation | CombinedFormation;
862
-
863
- export type CombinedFormation =
864
- | "Cruising1"
865
- | "Cruising2"
866
- | "Cruising3"
867
- | "Cruising4";
868
-
869
- export type SingleFormation =
870
- | "LineAhead"
871
- | "DoubleLine"
872
- | "Diamond"
873
- | "Echelon"
874
- | "LineAbreast"
875
- | "Vanguard";
876
-
877
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
922
+ export interface CompAntiAirAnalysis {
923
+ fleet_adjusted_anti_air: number;
924
+ ships: AntiAirReport[];
925
+ anti_air_cutin_chance: [number, number][];
926
+ }
878
927
 
879
- export interface AttackAnalysis {
880
- attacker_is_player: boolean;
881
- attacker_ship_id: number;
882
- target_ship_id: number;
883
- day: ActionReport<DayPhaseAttackStyle>;
884
- night: ActionReport<NightPhaseAttackStyle>;
885
- closing_torpedo: ActionReport<TorpedoAttackStyle>;
886
- opening_asw: ActionReport<AswAttackStyle>;
887
- support_shelling: ActionReport<SupportShellingStyle>;
928
+ export interface AntiAirReport {
929
+ ship_id: number;
930
+ role: Role;
931
+ index: number;
932
+ adjusted_anti_air: number | null;
933
+ proportional_shotdown_rate: number | null;
934
+ fixed_shotdown_number: number | null;
935
+ guaranteed: number | null;
936
+ anti_air_cutin_chance: [number, number][];
937
+ anti_air_propellant_barrage_chance: number | null;
888
938
  }
889
939
 
890
940
  export type SpecialEnemyType =
@@ -899,117 +949,74 @@ export type SpecialEnemyType =
899
949
  | "BattleshipSummerPrincess"
900
950
  | "HeavyCruiserSummerPrincess";
901
951
 
902
- export interface MasterShip {
903
- ship_id: number;
904
- name: string;
905
- yomi: string;
906
- stype: number;
907
- ctype: number;
908
- nationality?: number;
909
- sort_id?: number;
910
- max_hp: StatInterval;
911
- firepower: StatInterval;
912
- armor: StatInterval;
913
- torpedo: StatInterval;
914
- evasion: StatInterval;
915
- anti_air: StatInterval;
916
- asw: StatInterval;
917
- los: StatInterval;
918
- luck: StatInterval;
919
- torpedo_accuracy?: number;
920
- basic_evasion_term?: number;
921
- speed: number;
922
- range?: number;
923
- fuel?: number;
924
- ammo?: number;
925
- next_id?: number;
926
- next_level?: number;
927
- slotnum: number;
928
- slots: SlotSizeVec;
929
- stock: GearState[];
930
- speed_group?: SpeedGroup;
931
- useful?: boolean;
932
- }
933
-
934
- export type StatInterval = [number | null, number | null];
935
-
936
- export interface EquippabilityRule {
937
- ship: CompiledEvaler;
938
- keys?: string[];
939
- include?: string;
940
- exclude?: string;
941
- }
942
-
943
- export interface MasterEquippability {
944
- equip_stype: EquipStype[];
945
- equip_exslot: number[];
946
- equip_ship: MstEquipShip[];
947
- equip_exslot_ship: MstEquipExslotShip[];
948
- rules: EquippabilityRule[];
952
+ export interface NodeState {
953
+ map?: number;
954
+ node?: NodeId;
955
+ phase?: number;
956
+ debuff?: boolean;
957
+ disable_historical_mod?: boolean;
949
958
  }
950
959
 
951
- export interface MstEquipExslotShip {
952
- api_slotitem_id: number;
953
- api_ship_ids: number[];
954
- }
960
+ export type NodeId = string;
955
961
 
956
- export interface MstEquipShip {
957
- api_ship_id: number;
958
- api_equip_type: number[];
962
+ export interface DamageReport {
963
+ miss_damage_min: number;
964
+ miss_damage_max: number;
965
+ normal_damage_min: number;
966
+ normal_damage_max: number;
967
+ critical_damage_min: number;
968
+ critical_damage_max: number;
969
+ normal_scratch_rate: number;
970
+ critical_scratch_rate: number;
971
+ damage_density: Histogram<number, number>;
972
+ damage_state_density: Histogram<DamageState, number>;
959
973
  }
960
974
 
961
- export interface EquipStype {
962
- id: number;
963
- equip_type: number[];
975
+ export interface ContactAnalysis {
976
+ single: DayContactChance[] | null;
977
+ combined: DayContactChance[] | null;
964
978
  }
965
979
 
966
- export interface HitRate {
967
- normal: number;
968
- critical: number;
980
+ export interface DayContactChance {
981
+ air_state: AirState;
982
+ trigger_rate: number;
983
+ rank3: number;
984
+ rank2: number;
985
+ rank1: number;
969
986
  total: number;
970
987
  }
971
988
 
972
- export interface HitRateParams {
973
- accuracy_term: number;
974
- evasion_term: number;
975
- target_morale_mod: number;
976
- critical_rate_constant: number;
977
- critical_percentage_bonus: number;
978
- hit_percentage_bonus: number;
979
- }
980
-
981
- export interface CompDayCutinAnalysis {
982
- rank3_air_state: AirState;
983
- rank2_air_state: AirState;
984
- main_fleet_los_mod: number | null;
985
- escort_fleet_los_mod: number | null;
986
- ships: ShipDayCutinAnalysis[];
989
+ export interface CompAnalyzerConfig {
990
+ engagement: Engagement;
991
+ formation: Formation;
992
+ anti_air_cutin: number | null;
993
+ ship_anti_air_resist: number;
994
+ fleet_anti_air_resist: number;
995
+ left_night_fleet_conditions: NightFleetConditions;
996
+ right_night_fleet_conditions: NightFleetConditions;
987
997
  }
988
998
 
989
- export interface ShipDayCutinAnalysis {
990
- ship_id: number;
991
- role: Role;
992
- index: number;
993
- rank3: DayCutinReport;
994
- rank2: DayCutinReport;
999
+ export interface CompNightAnalysis {
1000
+ night_cutin: CompNightCutinAnalysis;
1001
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
995
1002
  }
996
1003
 
997
- export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
998
- observation_term: number | null;
1004
+ export interface CompDayAnalysis {
1005
+ day_cutin: CompDayCutinAnalysis;
1006
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
999
1007
  }
1000
1008
 
1001
- export interface ContactAnalysis {
1002
- single: DayContactChance[] | null;
1003
- combined: DayContactChance[] | null;
1009
+ export interface CompAnalysis {
1010
+ day: CompDayAnalysis;
1011
+ night: CompNightAnalysis;
1012
+ contact: ContactAnalysis;
1013
+ anti_air: CompAntiAirAnalysis;
1004
1014
  }
1005
1015
 
1006
- export interface DayContactChance {
1007
- air_state: AirState;
1008
- trigger_rate: number;
1009
- rank3: number;
1010
- rank2: number;
1011
- rank1: number;
1012
- total: number;
1016
+ export interface AttackAnalyzerShipConfig
1017
+ extends ShipConditions,
1018
+ NightFleetConditions {
1019
+ fleet_los_mod?: number | null;
1013
1020
  }
1014
1021
 
1015
1022
  /**
@@ -1804,9 +1811,9 @@ export class Ship {
1804
1811
  */
1805
1812
  has_attr(attr: ShipAttr): boolean;
1806
1813
  /**
1807
- * @returns {any}
1814
+ * @returns {(string)[]}
1808
1815
  */
1809
- gear_keys(): any;
1816
+ gear_keys(): string[];
1810
1817
  /**
1811
1818
  * @param {string} key
1812
1819
  * @returns {Gear | undefined}