fleethub-core 1.12.12 → 1.12.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,94 +26,6 @@ export type ShipAttr =
26
26
 
27
27
  export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
28
28
 
29
- export interface MasterGear {
30
- gear_id: number;
31
- name: string;
32
- types: GearTypeIdArray;
33
- special_type?: number;
34
- max_hp?: number;
35
- firepower?: number;
36
- armor?: number;
37
- torpedo?: number;
38
- anti_air?: number;
39
- speed?: number;
40
- bombing?: number;
41
- asw?: number;
42
- los?: number;
43
- luck?: number;
44
- accuracy?: number;
45
- evasion?: number;
46
- range?: number;
47
- radius?: number;
48
- cost?: number;
49
- improvable?: boolean;
50
- ship_anti_air_resist?: number;
51
- fleet_anti_air_resist?: number;
52
- historical_aircraft_group?: number;
53
- }
54
-
55
- export interface MasterIBonuses {
56
- shelling_power: MasterIBonusRule[];
57
- shelling_accuracy: MasterIBonusRule[];
58
- shelling_aerial_power: MasterIBonusRule[];
59
- torpedo_power: MasterIBonusRule[];
60
- torpedo_accuracy: MasterIBonusRule[];
61
- torpedo_evasion: MasterIBonusRule[];
62
- asw_power: MasterIBonusRule[];
63
- asw_accuracy: MasterIBonusRule[];
64
- night_power: MasterIBonusRule[];
65
- night_aerial_power: MasterIBonusRule[];
66
- night_accuracy: MasterIBonusRule[];
67
- defense_power: MasterIBonusRule[];
68
- contact_selection: MasterIBonusRule[];
69
- fighter_power: MasterIBonusRule[];
70
- ship_anti_air: MasterIBonusRule[];
71
- fleet_anti_air: MasterIBonusRule[];
72
- elos: MasterIBonusRule[];
73
- }
74
-
75
- export interface MasterIBonusRule {
76
- expr: CompiledEvaler;
77
- formula: CompiledEvaler;
78
- }
79
-
80
- export interface MasterBattleDefinitions {
81
- formation: NestedFormationDef[];
82
- anti_air_cutin: AntiAirCutinDef[];
83
- day_cutin: DayCutinDef[];
84
- night_cutin: NightCutinDef[];
85
- historical_bonuses?: HistoricalBonusDef[];
86
- }
87
-
88
- export interface FleetState {
89
- id?: string;
90
- len?: number;
91
- s1?: ShipState;
92
- s2?: ShipState;
93
- s3?: ShipState;
94
- s4?: ShipState;
95
- s5?: ShipState;
96
- s6?: ShipState;
97
- s7?: ShipState;
98
- }
99
-
100
- export interface ActionReport<T> {
101
- data: Record<string, AttackReport<T>>;
102
- damage_state_density: Histogram<DamageState, number> | null;
103
- is_active: boolean;
104
- }
105
-
106
- export interface AttackReport<T> {
107
- style: T;
108
- proc_rate: number | null;
109
- attack_power: AttackPower | null;
110
- attack_power_params: AttackPowerParams | null;
111
- hits: number;
112
- hit_rate: HitRate | null;
113
- hit_rate_params: HitRateParams | null;
114
- damage: DamageReport | null;
115
- }
116
-
117
29
  export interface MoveShipPayload {
118
30
  current: [string, string, ShipKey];
119
31
  target: [string | null, string, ShipKey];
@@ -123,6 +35,16 @@ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
123
35
 
124
36
  export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
125
37
 
38
+ export interface SlotSizeVecState {
39
+ ss1?: number;
40
+ ss2?: number;
41
+ ss3?: number;
42
+ ss4?: number;
43
+ ss5?: number;
44
+ }
45
+
46
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
47
+
126
48
  export interface ShipState extends GearVecState, SlotSizeVecState {
127
49
  id?: string;
128
50
  ship_id: number;
@@ -145,45 +67,42 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
145
67
  custom_power_mods?: CustomPowerModifiers;
146
68
  }
147
69
 
148
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
149
-
150
- export interface SlotSizeVecState {
151
- ss1?: number;
152
- ss2?: number;
153
- ss3?: number;
154
- ss4?: number;
155
- ss5?: number;
156
- }
70
+ export type AirSquadronMode = "Sortie" | "AirDefense";
157
71
 
158
72
  export interface AirSquadronState extends GearVecState, SlotSizeVecState {
159
73
  id?: string;
160
74
  mode?: AirSquadronMode;
161
75
  }
162
76
 
163
- export type AirSquadronMode = "Sortie" | "AirDefense";
77
+ export interface CompMeta {
78
+ fleets: Record<FleetType, FleetMeta>;
79
+ }
164
80
 
165
81
  export interface ShipMeta {
166
82
  id: string;
167
83
  ship_id: number;
168
84
  }
169
85
 
170
- export interface CompMeta {
171
- fleets: Record<FleetType, FleetMeta>;
172
- }
173
-
174
86
  export interface FleetMeta {
175
87
  id: string;
176
88
  len: number;
177
89
  ships: [string, ShipMeta | null][];
178
90
  }
179
91
 
92
+ export type Role = "Main" | "Escort";
93
+
180
94
  export type Align = "Left" | "Right";
181
95
 
182
96
  export type Side = "Player" | "Enemy";
183
97
 
184
- export interface GearInput {
185
- gear_id: number;
186
- types: GearTypeIdArray;
98
+ export interface ShipInput {
99
+ ship_id: number;
100
+ ctype: number;
101
+ stype: number;
102
+ yomi: string;
103
+ }
104
+
105
+ export interface EBonuses {
187
106
  firepower: number;
188
107
  torpedo: number;
189
108
  anti_air: number;
@@ -194,21 +113,11 @@ export interface GearInput {
194
113
  bombing: number;
195
114
  accuracy: number;
196
115
  range: number;
197
- radius: number;
198
- stars: number;
199
- ace: number;
200
- }
201
-
202
- export interface ShipInput {
203
- ship_id: number;
204
- ctype: number;
205
- stype: number;
206
- yomi: string;
207
116
  }
208
117
 
209
- export type GearVecInput = GearInput[];
210
-
211
- export interface EBonuses {
118
+ export interface GearInput {
119
+ gear_id: number;
120
+ types: GearTypeIdArray;
212
121
  firepower: number;
213
122
  torpedo: number;
214
123
  anti_air: number;
@@ -219,8 +128,13 @@ export interface EBonuses {
219
128
  bombing: number;
220
129
  accuracy: number;
221
130
  range: number;
131
+ radius: number;
132
+ stars: number;
133
+ ace: number;
222
134
  }
223
135
 
136
+ export type GearVecInput = GearInput[];
137
+
224
138
  export type GearCategory =
225
139
  | "Fighter"
226
140
  | "Bomber"
@@ -299,8 +213,6 @@ export type GearType =
299
213
  | "CbRecon2"
300
214
  | "SecondaryGun2";
301
215
 
302
- export type FleetKey = "f1" | "f2" | "f3" | "f4";
303
-
304
216
  export interface OrgState {
305
217
  id?: string;
306
218
  f1?: FleetState;
@@ -317,9 +229,16 @@ export interface OrgState {
317
229
  boss_sup?: FleetKey;
318
230
  }
319
231
 
320
- export interface CompDayAnalysis {
321
- day_cutin: CompDayCutinAnalysis;
322
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
232
+ export type FleetKey = "f1" | "f2" | "f3" | "f4";
233
+
234
+ export interface CompAnalyzerConfig {
235
+ engagement: Engagement;
236
+ formation: Formation;
237
+ anti_air_cutin: number | null;
238
+ ship_anti_air_resist: number;
239
+ fleet_anti_air_resist: number;
240
+ left_night_fleet_conditions: NightFleetConditions;
241
+ right_night_fleet_conditions: NightFleetConditions;
323
242
  }
324
243
 
325
244
  export interface CompAnalysis {
@@ -329,21 +248,16 @@ export interface CompAnalysis {
329
248
  anti_air: CompAntiAirAnalysis;
330
249
  }
331
250
 
251
+ export interface CompDayAnalysis {
252
+ day_cutin: CompDayCutinAnalysis;
253
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
254
+ }
255
+
332
256
  export interface CompNightAnalysis {
333
257
  night_cutin: CompNightCutinAnalysis;
334
258
  fleet_cutin: FleetCutinReport<NightAttackStyle>[];
335
259
  }
336
260
 
337
- export interface CompAnalyzerConfig {
338
- engagement: Engagement;
339
- formation: Formation;
340
- anti_air_cutin: number | null;
341
- ship_anti_air_resist: number;
342
- fleet_anti_air_resist: number;
343
- left_night_fleet_conditions: NightFleetConditions;
344
- right_night_fleet_conditions: NightFleetConditions;
345
- }
346
-
347
261
  export interface ShipAnalyzerConfig {
348
262
  air_state?: AirState;
349
263
  engagement?: Engagement;
@@ -358,11 +272,6 @@ export interface AttackAnalyzerShipConfig
358
272
  fleet_los_mod?: number | null;
359
273
  }
360
274
 
361
- export interface SimulatorResult {
362
- items: SimulatorResultItem[];
363
- sunk_vec: [number, number, number][];
364
- }
365
-
366
275
  export interface SimulatorResultItem {
367
276
  id: string;
368
277
  fleet_type: FleetType;
@@ -370,40 +279,172 @@ export interface SimulatorResultItem {
370
279
  damage_state_map: Record<DamageState, number>;
371
280
  }
372
281
 
373
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
374
-
375
- export interface SupportShellingSimulatorParams {
376
- attacker_formation?: Formation;
377
- target_formation?: Formation;
378
- engagement: Engagement;
379
- node_state: NodeState;
282
+ export interface SimulatorResult {
283
+ items: SimulatorResultItem[];
284
+ sunk_vec: [number, number, number][];
380
285
  }
381
286
 
382
- export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
383
-
384
- export type SupportShellingType = ShellingType;
385
-
386
- export type ShellingType = "Normal" | "Aerial";
387
-
388
- export type NightPhaseAttackType =
389
- | { t: "Night"; c: NightAttackType }
390
- | { t: "Asw"; c: AswAttackType };
287
+ export interface MasterShip {
288
+ ship_id: number;
289
+ name: string;
290
+ yomi: string;
291
+ stype: number;
292
+ ctype: number;
293
+ nationality?: number;
294
+ sort_id?: number;
295
+ max_hp: StatInterval;
296
+ firepower: StatInterval;
297
+ armor: StatInterval;
298
+ torpedo: StatInterval;
299
+ evasion: StatInterval;
300
+ anti_air: StatInterval;
301
+ asw: StatInterval;
302
+ los: StatInterval;
303
+ luck: StatInterval;
304
+ torpedo_accuracy?: number;
305
+ basic_evasion_term?: number;
306
+ speed: number;
307
+ range?: number;
308
+ fuel?: number;
309
+ ammo?: number;
310
+ next_id?: number;
311
+ next_level?: number;
312
+ slotnum: number;
313
+ slots: SlotSizeVec;
314
+ stock: GearState[];
315
+ speed_group?: SpeedGroup;
316
+ useful?: boolean;
317
+ }
391
318
 
392
- export type AswAttackType = "DepthCharge" | "Aerial";
319
+ export type StatInterval = [number | null, number | null];
393
320
 
394
- export type TorpedoAttackType = null;
321
+ export interface GearVecState {
322
+ g1?: GearState;
323
+ g2?: GearState;
324
+ g3?: GearState;
325
+ g4?: GearState;
326
+ g5?: GearState;
327
+ gx?: GearState;
328
+ }
395
329
 
396
- export type DayPhaseAttackType =
397
- | { t: "Shelling"; c: ShellingType }
398
- | { t: "Asw"; c: AswAttackType };
330
+ export interface GearState {
331
+ id?: string;
332
+ gear_id: number;
333
+ exp?: number;
334
+ stars?: number;
335
+ }
399
336
 
400
- export type AttackType =
337
+ export interface FleetState {
338
+ id?: string;
339
+ len?: number;
340
+ s1?: ShipState;
341
+ s2?: ShipState;
342
+ s3?: ShipState;
343
+ s4?: ShipState;
344
+ s5?: ShipState;
345
+ s6?: ShipState;
346
+ s7?: ShipState;
347
+ }
348
+
349
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
350
+
351
+ export interface ShellingStyle {
352
+ tag: "ShellingStyle";
353
+ attack_type: ShellingType;
354
+ cutin: DayCutinLike | null;
355
+ power_mod: number;
356
+ accuracy_mod: number;
357
+ hits: number;
358
+ }
359
+
360
+ export interface SupportShellingStyle {
361
+ tag: "SupportShellingStyle";
362
+ attack_type: SupportShellingType;
363
+ }
364
+
365
+ export interface AswAttackStyle {
366
+ tag: "AswAttackStyle";
367
+ attack_type: AswAttackType;
368
+ }
369
+
370
+ export interface NightAttackStyle {
371
+ tag: "NightAttackStyle";
372
+ attack_type: NightAttackType;
373
+ cutin: NightCutinLike | null;
374
+ power_mod: number;
375
+ accuracy_mod: number;
376
+ hits: number;
377
+ }
378
+
379
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
380
+
381
+ export interface TorpedoAttackStyle {
382
+ tag: "TorpedoAttackStyle";
383
+ attack_type: TorpedoAttackType;
384
+ }
385
+
386
+ export interface ShipConditions extends ShipPosition {
387
+ formation?: Formation;
388
+ amagiri_index?: number | null;
389
+ }
390
+
391
+ export interface NodeAttackAnalyzerConfig {
392
+ air_state?: AirState;
393
+ engagement?: Engagement;
394
+ node_state?: NodeState;
395
+ left?: NodeAttackAnalyzerShipConfig;
396
+ right?: NodeAttackAnalyzerShipConfig;
397
+ }
398
+
399
+ export interface NodeAttackAnalysis {
400
+ left: AttackAnalysis;
401
+ right: AttackAnalysis;
402
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
403
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
404
+ }
405
+
406
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
407
+ formation?: Formation;
408
+ }
409
+
410
+ export interface NodeState {
411
+ map?: number;
412
+ node?: NodeId;
413
+ phase?: number;
414
+ debuff?: boolean;
415
+ disable_historical_mod?: boolean;
416
+ landing_battle?: boolean;
417
+ }
418
+
419
+ export type NodeId = string;
420
+
421
+ export type DayPhaseAttackType =
422
+ | { t: "Shelling"; c: ShellingType }
423
+ | { t: "Asw"; c: AswAttackType };
424
+
425
+ export type ShellingType = "Normal" | "Aerial";
426
+
427
+ export type SupportShellingType = ShellingType;
428
+
429
+ export type AttackType =
401
430
  | { t: "Asw"; c: AswAttackType }
402
431
  | { t: "Shelling"; c: ShellingType }
403
432
  | { t: "Night"; c: NightAttackType }
404
433
  | { t: "Torpedo" }
405
434
  | { t: "SupportShelling"; c: SupportShellingType };
406
435
 
436
+ export type NightPhaseAttackType =
437
+ | { t: "Night"; c: NightAttackType }
438
+ | { t: "Asw"; c: AswAttackType };
439
+
440
+ export type TorpedoAttackType = null;
441
+
442
+ export type AswAttackType = "DepthCharge" | "Aerial";
443
+
444
+ export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
445
+
446
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
447
+
407
448
  export type SlotSizeVec = (number | null)[];
408
449
 
409
450
  export type GearTypeIdArray = [number, number, number, number, number];
@@ -425,10 +466,6 @@ export type SpecialEnemyType =
425
466
  | "SummerAircraftCarrierDemon"
426
467
  | "EuropeanWaterPrincess";
427
468
 
428
- export type Role = "Main" | "Escort";
429
-
430
- export type NightCutinLike = NightCutin | FleetCutin;
431
-
432
469
  export type FleetCutin =
433
470
  | "NelsonTouch"
434
471
  | "NagatoClassCutin"
@@ -439,6 +476,8 @@ export type FleetCutin =
439
476
  | "QueenElizabethClassCutin"
440
477
  | "RichelieuClassCutin";
441
478
 
479
+ export type NightCutinLike = NightCutin | FleetCutin;
480
+
442
481
  export type NightCutin =
443
482
  | "MainTorpRadar"
444
483
  | "TorpLookoutRadar"
@@ -460,6 +499,8 @@ export type NightCutin =
460
499
  | "Cvci1_18"
461
500
  | "Photobomber";
462
501
 
502
+ export type DayCutinLike = DayCutin | FleetCutin;
503
+
463
504
  export type DayCutin =
464
505
  | "Zuiun"
465
506
  | "AirSea"
@@ -472,7 +513,15 @@ export type DayCutin =
472
513
  | "BBA"
473
514
  | "BA";
474
515
 
475
- export type DayCutinLike = DayCutin | FleetCutin;
516
+ export type ShipCategory =
517
+ | "Battleship"
518
+ | "AircraftCarrier"
519
+ | "HeavyCruiser"
520
+ | "LightCruiser"
521
+ | "Destroyer"
522
+ | "CoastalDefenseShip"
523
+ | "Submarine"
524
+ | "AuxiliaryShip";
476
525
 
477
526
  export type ShipType =
478
527
  | "Unknown"
@@ -499,16 +548,6 @@ export type ShipType =
499
548
  | "CT"
500
549
  | "AO";
501
550
 
502
- export type ShipCategory =
503
- | "Battleship"
504
- | "AircraftCarrier"
505
- | "HeavyCruiser"
506
- | "LightCruiser"
507
- | "Destroyer"
508
- | "CoastalDefenseShip"
509
- | "Submarine"
510
- | "AuxiliaryShip";
511
-
512
551
  export interface HitRateParams {
513
552
  accuracy_term: number;
514
553
  evasion_term: number;
@@ -524,8 +563,6 @@ export interface HitRate {
524
563
  total: number;
525
564
  }
526
565
 
527
- export type FhResult<T> = { Ok: T } | { Err: string };
528
-
529
566
  export interface DamageReport {
530
567
  miss_damage_min: number;
531
568
  miss_damage_max: number;
@@ -543,6 +580,14 @@ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
543
580
  observation_term: number | null;
544
581
  }
545
582
 
583
+ export interface ShipDayCutinAnalysis {
584
+ ship_id: number;
585
+ role: Role;
586
+ index: number;
587
+ rank3: DayCutinReport;
588
+ rank2: DayCutinReport;
589
+ }
590
+
546
591
  export interface CompDayCutinAnalysis {
547
592
  rank3_air_state: AirState;
548
593
  rank2_air_state: AirState;
@@ -551,12 +596,11 @@ export interface CompDayCutinAnalysis {
551
596
  ships: ShipDayCutinAnalysis[];
552
597
  }
553
598
 
554
- export interface ShipDayCutinAnalysis {
599
+ export interface ShipNightCutinAnalysis {
555
600
  ship_id: number;
556
- role: Role;
557
601
  index: number;
558
- rank3: DayCutinReport;
559
- rank2: DayCutinReport;
602
+ normal: NightCutinActionReport;
603
+ chuuha: NightCutinActionReport;
560
604
  }
561
605
 
562
606
  export interface NightCutinActionReport
@@ -570,32 +614,185 @@ export interface NightContactChance {
570
614
  rank3: number;
571
615
  }
572
616
 
573
- export interface ShipNightCutinAnalysis {
574
- ship_id: number;
575
- index: number;
576
- normal: NightCutinActionReport;
577
- chuuha: NightCutinActionReport;
578
- }
579
-
580
617
  export interface CompNightCutinAnalysis {
581
618
  night_contact_chance: NightContactChance;
582
619
  ships: ShipNightCutinAnalysis[];
583
620
  }
584
621
 
585
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
622
+ export interface MasterGear {
623
+ gear_id: number;
624
+ name: string;
625
+ types: GearTypeIdArray;
626
+ special_type?: number;
627
+ max_hp?: number;
628
+ firepower?: number;
629
+ armor?: number;
630
+ torpedo?: number;
631
+ anti_air?: number;
632
+ speed?: number;
633
+ bombing?: number;
634
+ asw?: number;
635
+ los?: number;
636
+ luck?: number;
637
+ accuracy?: number;
638
+ evasion?: number;
639
+ range?: number;
640
+ radius?: number;
641
+ cost?: number;
642
+ improvable?: boolean;
643
+ ship_anti_air_resist?: number;
644
+ fleet_anti_air_resist?: number;
645
+ historical_aircraft_group?: number;
646
+ }
586
647
 
587
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
648
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
588
649
 
589
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
650
+ export type FhResult<T> = { Ok: T } | { Err: string };
590
651
 
591
- export interface NightCutinDef {
592
- tag: NightCutin;
652
+ export interface SupportShellingSimulatorParams {
653
+ attacker_formation?: Formation;
654
+ target_formation?: Formation;
655
+ engagement: Engagement;
656
+ node_state: NodeState;
657
+ }
658
+
659
+ export interface MasterData extends MasterBattleDefinitions {
660
+ created_at: number;
661
+ gears: MasterGear[];
662
+ gear_attrs: MasterAttrRule<GearAttr>[];
663
+ ships: MasterShip[];
664
+ ship_attrs: MasterAttrRule<ShipAttr>[];
665
+ ibonuses: MasterIBonuses;
666
+ equippability: MasterEquippability;
667
+ }
668
+
669
+ export interface NationalityDef {
670
+ id: number;
671
+ ctypes: number[];
672
+ }
673
+
674
+ export interface MasterAttrRule<T> {
675
+ tag: T;
676
+ name: string;
677
+ expr: CompiledEvaler;
678
+ }
679
+
680
+ export type CompiledEvaler = string;
681
+
682
+ export interface NightConditions {
683
+ player?: NightFleetConditions;
684
+ enemy?: NightFleetConditions;
685
+ }
686
+
687
+ export interface BattleConditions {
688
+ org_type: OrgType;
689
+ role: Role;
690
+ ship_index: number;
691
+ fleet_len: number;
692
+ formation: Formation;
693
+ fleet_los_mod: number | null;
694
+ night_conditions: NightFleetConditions;
695
+ }
696
+
697
+ export interface NightFleetConditions {
698
+ night_contact_rank?: ContactRank | null;
699
+ starshell_index?: number | null;
700
+ searchlight_index?: number | null;
701
+ activates_large_searchlight?: boolean;
702
+ }
703
+
704
+ export interface ShipPosition {
705
+ org_type?: OrgType;
706
+ fleet_type?: FleetType;
707
+ fleet_len?: number;
708
+ index?: number;
709
+ }
710
+
711
+ export type GearAttr =
712
+ | "Unknown"
713
+ | "HighAngleMount"
714
+ | "NightFighter"
715
+ | "NightAttacker"
716
+ | "HeavyBomber"
717
+ | "NightRecon"
718
+ | "MainGun"
719
+ | "Radar"
720
+ | "SurfaceRadar"
721
+ | "AirRadar"
722
+ | "DepthChargeProjector"
723
+ | "SynergisticDepthCharge"
724
+ | "AntiSubMortar"
725
+ | "AntiSubWeapon"
726
+ | "ApDepthCharge"
727
+ | "AntiSubAircraft"
728
+ | "LateModelBowTorpedo"
729
+ | "Seaplane"
730
+ | "CbAircraft"
731
+ | "LbAircraft"
732
+ | "JetAircraft"
733
+ | "Fighter"
734
+ | "Recon"
735
+ | "ObservationSeaplane"
736
+ | "CbFighterBomber"
737
+ | "AntiInstDiveBomber"
738
+ | "CbSwordfish"
739
+ | "SemiNightPlane"
740
+ | "HighAltitudeInterceptor";
741
+
742
+ export interface MasterIBonuses {
743
+ shelling_power: MasterIBonusRule[];
744
+ shelling_accuracy: MasterIBonusRule[];
745
+ shelling_aerial_power: MasterIBonusRule[];
746
+ torpedo_power: MasterIBonusRule[];
747
+ torpedo_accuracy: MasterIBonusRule[];
748
+ torpedo_evasion: MasterIBonusRule[];
749
+ asw_power: MasterIBonusRule[];
750
+ asw_accuracy: MasterIBonusRule[];
751
+ night_power: MasterIBonusRule[];
752
+ night_aerial_power: MasterIBonusRule[];
753
+ night_accuracy: MasterIBonusRule[];
754
+ defense_power: MasterIBonusRule[];
755
+ contact_selection: MasterIBonusRule[];
756
+ fighter_power: MasterIBonusRule[];
757
+ ship_anti_air: MasterIBonusRule[];
758
+ fleet_anti_air: MasterIBonusRule[];
759
+ elos: MasterIBonusRule[];
760
+ }
761
+
762
+ export interface MasterIBonusRule {
763
+ expr: CompiledEvaler;
764
+ formula: CompiledEvaler;
765
+ }
766
+
767
+ export interface MasterBattleDefinitions {
768
+ formation: NestedFormationDef[];
769
+ anti_air_cutin: AntiAirCutinDef[];
770
+ day_cutin: DayCutinDef[];
771
+ night_cutin: NightCutinDef[];
772
+ historical_bonuses?: HistoricalBonusDef[];
773
+ }
774
+
775
+ export interface ActionReport<T> {
776
+ data: Record<string, AttackReport<T>>;
777
+ damage_state_density: Histogram<DamageState, number> | null;
778
+ is_active: boolean;
779
+ }
780
+
781
+ export interface AttackReport<T> {
782
+ style: T;
783
+ proc_rate: number | null;
784
+ attack_power: AttackPower | null;
785
+ attack_power_params: AttackPowerParams | null;
593
786
  hits: number;
594
- type_factor: number | null;
595
- power_mod: number | null;
596
- accuracy_mod: number | null;
787
+ hit_rate: HitRate | null;
788
+ hit_rate_params: HitRateParams | null;
789
+ damage: DamageReport | null;
597
790
  }
598
791
 
792
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
793
+
794
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
795
+
599
796
  export interface HistoricalParams {
600
797
  power_mod: AttackPowerModifier;
601
798
  armor_penetration: number;
@@ -603,20 +800,33 @@ export interface HistoricalParams {
603
800
  target_evasion_mod: number;
604
801
  }
605
802
 
803
+ export interface BattleDefinitions {
804
+ formation: Record<Formation, NestedFormationDef>;
805
+ anti_air_cutin: Record<number, AntiAirCutinDef>;
806
+ day_cutin: Record<DayCutin, DayCutinDef>;
807
+ night_cutin: Record<NightCutin, NightCutinDef>;
808
+ historical_bonuses: HistoricalBonusDef[];
809
+ }
810
+
811
+ export interface HistoricalBonusDef {
812
+ map?: number;
813
+ node?: CompiledEvaler;
814
+ phase?: number;
815
+ debuff?: boolean;
816
+ ship?: CompiledEvaler;
817
+ enemy?: CompiledEvaler;
818
+ power_mod?: AttackPowerModifier;
819
+ armor_penetration?: number;
820
+ accuracy_mod?: number;
821
+ evasion_mod?: number;
822
+ }
823
+
606
824
  export type NestedFormationDef =
607
825
  | FormationDef
608
826
  | { top_half: FormationDef; bottom_half: FormationDef };
609
827
 
610
- export interface AntiAirCutinDef {
611
- id: number;
612
- type_factor: number | null;
613
- multiplier: number | null;
614
- guaranteed: number | null;
615
- sequential: boolean | null;
616
- }
617
-
618
- export interface DayCutinDef {
619
- tag: DayCutin;
828
+ export interface NightCutinDef {
829
+ tag: NightCutin;
620
830
  hits: number;
621
831
  type_factor: number | null;
622
832
  power_mod: number | null;
@@ -629,14 +839,6 @@ export interface FormationCombatModifiersDef {
629
839
  evasion_mod?: number;
630
840
  }
631
841
 
632
- export interface BattleDefinitions {
633
- formation: Record<Formation, NestedFormationDef>;
634
- anti_air_cutin: Record<number, AntiAirCutinDef>;
635
- day_cutin: Record<DayCutin, DayCutinDef>;
636
- night_cutin: Record<NightCutin, NightCutinDef>;
637
- historical_bonuses: HistoricalBonusDef[];
638
- }
639
-
640
842
  export interface FormationDef {
641
843
  tag: Formation;
642
844
  protection_rate: number | null;
@@ -648,22 +850,20 @@ export interface FormationDef {
648
850
  support_shelling: FormationCombatModifiersDef;
649
851
  }
650
852
 
651
- export interface HistoricalBonusDef {
652
- map?: number;
653
- node?: CompiledEvaler;
654
- phase?: number;
655
- debuff?: boolean;
656
- ship?: CompiledEvaler;
657
- enemy?: CompiledEvaler;
658
- power_mod?: AttackPowerModifier;
659
- armor_penetration?: number;
660
- accuracy_mod?: number;
661
- evasion_mod?: number;
853
+ export interface DayCutinDef {
854
+ tag: DayCutin;
855
+ hits: number;
856
+ type_factor: number | null;
857
+ power_mod: number | null;
858
+ accuracy_mod: number | null;
662
859
  }
663
860
 
664
- export interface AttackPowerModifier {
665
- a?: number;
666
- b?: number;
861
+ export interface AntiAirCutinDef {
862
+ id: number;
863
+ type_factor: number | null;
864
+ multiplier: number | null;
865
+ guaranteed: number | null;
866
+ sequential: boolean | null;
667
867
  }
668
868
 
669
869
  export interface SpecialEnemyModifiers {
@@ -675,12 +875,25 @@ export interface SpecialEnemyModifiers {
675
875
  honi_mod: AttackPowerModifier;
676
876
  toku_daihatsu_chiha_mod: AttackPowerModifier;
677
877
  toku_daihatsu_chiha_kai_mod: AttackPowerModifier;
878
+ army_infantry_mod: AttackPowerModifier;
879
+ army_infantry_chiha_kai_mod: AttackPowerModifier;
880
+ t97_tank_chiha_mod: AttackPowerModifier;
881
+ t97_tank_chiha_kai_mod: AttackPowerModifier;
882
+ landing_forces_mod: AttackPowerModifier;
883
+ landing_forces_group_mod: AttackPowerModifier;
884
+ landing_forces_t4_mod: AttackPowerModifier;
885
+ landing_forces_t4kai_mod: AttackPowerModifier;
678
886
  t4_tank_group_mod: AttackPowerModifier;
679
887
  t4_tank_kai_mod: AttackPowerModifier;
680
888
  postcap_general_mod: AttackPowerModifier;
681
889
  pt_mod: AttackPowerModifier | null;
682
890
  }
683
891
 
892
+ export interface AttackPowerModifier {
893
+ a?: number;
894
+ b?: number;
895
+ }
896
+
684
897
  export interface CustomPowerModifiers {
685
898
  precap_mod?: AttackPowerModifier;
686
899
  postcap_mod?: AttackPowerModifier;
@@ -699,19 +912,11 @@ export type OrgType =
699
912
  export type AirState =
700
913
  | "AirSupremacy"
701
914
  | "AirSuperiority"
702
- | "AirParity"
703
- | "AirDenial"
704
- | "AirIncapability";
705
-
706
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
707
-
708
- export type SingleFormation =
709
- | "LineAhead"
710
- | "DoubleLine"
711
- | "Diamond"
712
- | "Echelon"
713
- | "LineAbreast"
714
- | "Vanguard";
915
+ | "AirParity"
916
+ | "AirDenial"
917
+ | "AirIncapability";
918
+
919
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
715
920
 
716
921
  export type Formation = SingleFormation | CombinedFormation;
717
922
 
@@ -721,11 +926,13 @@ export type CombinedFormation =
721
926
  | "Cruising3"
722
927
  | "Cruising4";
723
928
 
724
- export interface CompAntiAirAnalysis {
725
- fleet_adjusted_anti_air: number;
726
- ships: AntiAirReport[];
727
- anti_air_cutin_chance: [number, number][];
728
- }
929
+ export type SingleFormation =
930
+ | "LineAhead"
931
+ | "DoubleLine"
932
+ | "Diamond"
933
+ | "Echelon"
934
+ | "LineAbreast"
935
+ | "Vanguard";
729
936
 
730
937
  export interface AntiAirReport {
731
938
  ship_id: number;
@@ -739,10 +946,10 @@ export interface AntiAirReport {
739
946
  anti_air_propellant_barrage_chance: number | null;
740
947
  }
741
948
 
742
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
743
- index: number;
744
- ship_id: number;
745
- power_mod: number;
949
+ export interface CompAntiAirAnalysis {
950
+ fleet_adjusted_anti_air: number;
951
+ ships: AntiAirReport[];
952
+ anti_air_cutin_chance: [number, number][];
746
953
  }
747
954
 
748
955
  export interface FleetCutinReport<T> {
@@ -752,6 +959,12 @@ export interface FleetCutinReport<T> {
752
959
  attacks: FleetCutinAttackReport<T>[];
753
960
  }
754
961
 
962
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
963
+ index: number;
964
+ ship_id: number;
965
+ power_mod: number;
966
+ }
967
+
755
968
  export interface AttackPower {
756
969
  precap: number;
757
970
  is_capped: boolean;
@@ -805,198 +1018,9 @@ export interface DayContactChance {
805
1018
  total: number;
806
1019
  }
807
1020
 
808
- export interface MasterData extends MasterBattleDefinitions {
809
- created_at: number;
810
- gears: MasterGear[];
811
- gear_attrs: MasterAttrRule<GearAttr>[];
812
- ships: MasterShip[];
813
- ship_attrs: MasterAttrRule<ShipAttr>[];
814
- ibonuses: MasterIBonuses;
815
- equippability: MasterEquippability;
816
- }
817
-
818
- export interface MasterAttrRule<T> {
819
- tag: T;
820
- name: string;
821
- expr: CompiledEvaler;
822
- }
823
-
824
- export interface NationalityDef {
825
- id: number;
826
- ctypes: number[];
827
- }
828
-
829
- export type CompiledEvaler = string;
830
-
831
- export interface BattleConditions {
832
- org_type: OrgType;
833
- role: Role;
834
- ship_index: number;
835
- fleet_len: number;
836
- formation: Formation;
837
- fleet_los_mod: number | null;
838
- night_conditions: NightFleetConditions;
839
- }
840
-
841
- export interface NightConditions {
842
- player?: NightFleetConditions;
843
- enemy?: NightFleetConditions;
844
- }
845
-
846
- export interface NightFleetConditions {
847
- night_contact_rank?: ContactRank | null;
848
- starshell_index?: number | null;
849
- searchlight_index?: number | null;
850
- activates_large_searchlight?: boolean;
851
- }
852
-
853
- export interface ShipPosition {
854
- org_type?: OrgType;
855
- fleet_type?: FleetType;
856
- fleet_len?: number;
857
- index?: number;
858
- }
859
-
860
- export type GearAttr =
861
- | "Unknown"
862
- | "HighAngleMount"
863
- | "NightFighter"
864
- | "NightAttacker"
865
- | "HeavyBomber"
866
- | "NightRecon"
867
- | "MainGun"
868
- | "Radar"
869
- | "SurfaceRadar"
870
- | "AirRadar"
871
- | "DepthChargeProjector"
872
- | "SynergisticDepthCharge"
873
- | "AntiSubMortar"
874
- | "AntiSubWeapon"
875
- | "ApDepthCharge"
876
- | "AntiSubAircraft"
877
- | "LateModelBowTorpedo"
878
- | "Seaplane"
879
- | "CbAircraft"
880
- | "LbAircraft"
881
- | "JetAircraft"
882
- | "Fighter"
883
- | "Recon"
884
- | "ObservationSeaplane"
885
- | "CbFighterBomber"
886
- | "AntiInstDiveBomber"
887
- | "CbSwordfish"
888
- | "SemiNightPlane"
889
- | "HighAltitudeInterceptor";
890
-
891
- export interface MasterShip {
892
- ship_id: number;
893
- name: string;
894
- yomi: string;
895
- stype: number;
896
- ctype: number;
897
- nationality?: number;
898
- sort_id?: number;
899
- max_hp: StatInterval;
900
- firepower: StatInterval;
901
- armor: StatInterval;
902
- torpedo: StatInterval;
903
- evasion: StatInterval;
904
- anti_air: StatInterval;
905
- asw: StatInterval;
906
- los: StatInterval;
907
- luck: StatInterval;
908
- torpedo_accuracy?: number;
909
- basic_evasion_term?: number;
910
- speed: number;
911
- range?: number;
912
- fuel?: number;
913
- ammo?: number;
914
- next_id?: number;
915
- next_level?: number;
916
- slotnum: number;
917
- slots: SlotSizeVec;
918
- stock: GearState[];
919
- speed_group?: SpeedGroup;
920
- useful?: boolean;
921
- }
922
-
923
- export type StatInterval = [number | null, number | null];
924
-
925
- export interface GearVecState {
926
- g1?: GearState;
927
- g2?: GearState;
928
- g3?: GearState;
929
- g4?: GearState;
930
- g5?: GearState;
931
- gx?: GearState;
932
- }
933
-
934
- export interface GearState {
935
- id?: string;
936
- gear_id: number;
937
- exp?: number;
938
- stars?: number;
939
- }
940
-
941
- export interface ShellingStyle {
942
- tag: "ShellingStyle";
943
- attack_type: ShellingType;
944
- cutin: DayCutinLike | null;
945
- power_mod: number;
946
- accuracy_mod: number;
947
- hits: number;
948
- }
949
-
950
- export interface AswAttackStyle {
951
- tag: "AswAttackStyle";
952
- attack_type: AswAttackType;
953
- }
954
-
955
- export interface NightAttackStyle {
956
- tag: "NightAttackStyle";
957
- attack_type: NightAttackType;
958
- cutin: NightCutinLike | null;
959
- power_mod: number;
960
- accuracy_mod: number;
961
- hits: number;
962
- }
963
-
964
- export interface SupportShellingStyle {
965
- tag: "SupportShellingStyle";
966
- attack_type: SupportShellingType;
967
- }
968
-
969
- export interface TorpedoAttackStyle {
970
- tag: "TorpedoAttackStyle";
971
- attack_type: TorpedoAttackType;
972
- }
973
-
974
- export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
975
-
976
- export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
977
-
978
- export interface ShipConditions extends ShipPosition {
979
- formation?: Formation;
980
- amagiri_index?: number | null;
981
- }
982
-
983
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
984
- formation?: Formation;
985
- }
986
-
987
- export interface NodeAttackAnalysis {
988
- left: AttackAnalysis;
989
- right: AttackAnalysis;
990
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
991
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
992
- }
993
-
994
- export interface NodeAttackAnalyzerConfig {
995
- air_state?: AirState;
996
- engagement?: Engagement;
997
- node_state?: NodeState;
998
- left?: NodeAttackAnalyzerShipConfig;
999
- right?: NodeAttackAnalyzerShipConfig;
1021
+ export interface MstStype {
1022
+ api_id: number;
1023
+ api_equip_type: Record<number, number>;
1000
1024
  }
1001
1025
 
1002
1026
  export interface MasterEquippability {
@@ -1007,10 +1031,7 @@ export interface MasterEquippability {
1007
1031
  rules: EquippabilityRule[];
1008
1032
  }
1009
1033
 
1010
- export interface MstStype {
1011
- api_id: number;
1012
- api_equip_type: Record<number, number>;
1013
- }
1034
+ export type MstEquipShipValue = null | number[];
1014
1035
 
1015
1036
  export interface EquippabilityRule {
1016
1037
  ship: CompiledEvaler;
@@ -1029,19 +1050,6 @@ export interface MstEquipExslotShip {
1029
1050
  api_stypes: Record<number, number> | null;
1030
1051
  }
1031
1052
 
1032
- export type MstEquipShipValue = null | number[];
1033
-
1034
- export type NodeId = string;
1035
-
1036
- export interface NodeState {
1037
- map?: number;
1038
- node?: NodeId;
1039
- phase?: number;
1040
- debuff?: boolean;
1041
- disable_historical_mod?: boolean;
1042
- landing_battle?: boolean;
1043
- }
1044
-
1045
1053
  export type ContactRank = "Rank1" | "Rank2" | "Rank3";
1046
1054
 
1047
1055
  export class AirSquadron {
@@ -1311,12 +1319,6 @@ export class Ship {
1311
1319
  private constructor();
1312
1320
  free(): void;
1313
1321
  [Symbol.dispose](): void;
1314
- /**
1315
- * フィット砲補正
1316
- */
1317
- gunfit_accuracy(is_night: boolean): number;
1318
- state_day_gunfit_accuracy(): number | undefined;
1319
- state_night_gunfit_accuracy(): number | undefined;
1320
1322
  get_ebonus(key: string): number;
1321
1323
  is_abyssal(): boolean;
1322
1324
  is_amagiri(): boolean;
@@ -1375,6 +1377,12 @@ export class Ship {
1375
1377
  can_equip(gear: Gear, key: string): boolean;
1376
1378
  gear_keys(): string[];
1377
1379
  is_pt_imp(): boolean;
1380
+ /**
1381
+ * フィット砲補正
1382
+ */
1383
+ gunfit_accuracy(is_night: boolean): number;
1384
+ state_day_gunfit_accuracy(): number | undefined;
1385
+ state_night_gunfit_accuracy(): number | undefined;
1378
1386
  id: string;
1379
1387
  readonly hash: bigint;
1380
1388
  readonly ship_id: number;