fleethub-core 1.10.6 → 1.10.8

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,50 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- */
5
- export function set_panic_hook(): void;
6
3
  /**
7
4
  * @param {ShipConditions} value
8
5
  * @returns {ShipConditions}
9
6
  */
10
7
  export function parse_ship_conditions(value: ShipConditions): ShipConditions;
11
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
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
-
8
+ /**
9
+ */
10
+ export function set_panic_hook(): void;
48
11
  export interface HitRate {
49
12
  normal: number;
50
13
  critical: number;
@@ -79,41 +42,71 @@ export interface NodeAttackAnalysis {
79
42
  night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
80
43
  }
81
44
 
82
- export type GearTypeIdArray = [number, number, number, number, number];
83
-
84
- export type SlotSizeVec = (number | null)[];
85
-
86
- export type Align = "Left" | "Right";
87
-
88
- export type Side = "Player" | "Enemy";
45
+ export interface ContactAnalysis {
46
+ single: DayContactChance[] | null;
47
+ combined: DayContactChance[] | null;
48
+ }
89
49
 
90
- export type Role = "Main" | "Escort";
50
+ export interface DayContactChance {
51
+ air_state: AirState;
52
+ trigger_rate: number;
53
+ rank3: number;
54
+ rank2: number;
55
+ rank1: number;
56
+ total: number;
57
+ }
91
58
 
92
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
59
+ export interface GearState {
60
+ id?: string;
61
+ gear_id: number;
62
+ exp?: number;
63
+ stars?: number;
64
+ }
93
65
 
94
- export interface NightFleetConditions {
95
- night_contact_rank?: ContactRank | null;
96
- starshell_index?: number | null;
97
- searchlight_index?: number | null;
98
- activates_large_searchlight?: boolean;
66
+ export interface GearVecState {
67
+ g1?: GearState;
68
+ g2?: GearState;
69
+ g3?: GearState;
70
+ g4?: GearState;
71
+ g5?: GearState;
72
+ gx?: GearState;
99
73
  }
100
74
 
101
- export interface NightConditions {
102
- player?: NightFleetConditions;
103
- enemy?: NightFleetConditions;
75
+ export interface SlotSizeVecState {
76
+ ss1?: number;
77
+ ss2?: number;
78
+ ss3?: number;
79
+ ss4?: number;
80
+ ss5?: number;
104
81
  }
105
82
 
106
- export interface BattleConditions {
107
- org_type: OrgType;
108
- role: Role;
109
- ship_index: number;
110
- fleet_len: number;
111
- formation: Formation;
112
- fleet_los_mod: number | null;
113
- night_conditions: NightFleetConditions;
83
+ export interface ShipState extends GearVecState, SlotSizeVecState {
84
+ id?: string;
85
+ ship_id: number;
86
+ level?: number;
87
+ current_hp?: number;
88
+ morale?: number;
89
+ ammo?: number;
90
+ fuel?: number;
91
+ max_hp_mod?: number;
92
+ firepower_mod?: number;
93
+ torpedo_mod?: number;
94
+ armor_mod?: number;
95
+ anti_air_mod?: number;
96
+ evasion_mod?: number;
97
+ asw_mod?: number;
98
+ los_mod?: number;
99
+ luck_mod?: number;
100
+ day_gunfit_accuracy?: number;
101
+ night_gunfit_accuracy?: number;
102
+ custom_power_mods?: CustomPowerModifiers;
114
103
  }
115
104
 
116
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
105
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
106
+
107
+ export type SlotSizeVec = (number | null)[];
108
+
109
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
117
110
 
118
111
  export interface EquippabilityRule {
119
112
  ship: CompiledEvaler;
@@ -151,46 +144,42 @@ export interface ActionReport<T> {
151
144
  is_active: boolean;
152
145
  }
153
146
 
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";
147
+ export type ShipCategory =
148
+ | "Battleship"
149
+ | "AircraftCarrier"
150
+ | "HeavyCruiser"
151
+ | "LightCruiser"
152
+ | "Destroyer"
153
+ | "CoastalDefenseShip"
154
+ | "Submarine"
155
+ | "AuxiliaryShip";
165
156
 
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";
157
+ export type ShipType =
158
+ | "Unknown"
159
+ | "DE"
160
+ | "DD"
161
+ | "CL"
162
+ | "CLT"
163
+ | "CA"
164
+ | "CAV"
165
+ | "CVL"
166
+ | "FBB"
167
+ | "BB"
168
+ | "BBV"
169
+ | "CV"
170
+ | "XBB"
171
+ | "SS"
172
+ | "SSV"
173
+ | "AP"
174
+ | "AV"
175
+ | "LHA"
176
+ | "CVB"
177
+ | "AR"
178
+ | "AS"
179
+ | "CT"
180
+ | "AO";
182
181
 
183
- export type DayCutin =
184
- | "Zuiun"
185
- | "AirSea"
186
- | "MainMain"
187
- | "MainAp"
188
- | "MainRadar"
189
- | "MainSec"
190
- | "DoubleAttack"
191
- | "FBA"
192
- | "BBA"
193
- | "BA";
182
+ export type GearTypeIdArray = [number, number, number, number, number];
194
183
 
195
184
  export interface MasterShip {
196
185
  ship_id: number;
@@ -226,28 +215,27 @@ export interface MasterShip {
226
215
 
227
216
  export type StatInterval = [number | null, number | null];
228
217
 
229
- export interface OrgState {
230
- id?: string;
231
- f1?: FleetState;
232
- f2?: FleetState;
233
- f3?: FleetState;
234
- f4?: FleetState;
235
- a1?: AirSquadronState;
236
- a2?: AirSquadronState;
237
- a3?: AirSquadronState;
238
- hq_level?: number;
239
- org_type?: OrgType;
240
- sortie?: FleetKey;
241
- route_sup?: FleetKey;
242
- boss_sup?: FleetKey;
218
+ export interface BattleConditions {
219
+ org_type: OrgType;
220
+ role: Role;
221
+ ship_index: number;
222
+ fleet_len: number;
223
+ formation: Formation;
224
+ fleet_los_mod: number | null;
225
+ night_conditions: NightFleetConditions;
243
226
  }
244
227
 
245
- export interface AirSquadronState extends GearVecState, SlotSizeVecState {
246
- id?: string;
247
- mode?: AirSquadronMode;
228
+ export interface NightConditions {
229
+ player?: NightFleetConditions;
230
+ enemy?: NightFleetConditions;
248
231
  }
249
232
 
250
- export type AirSquadronMode = "Sortie" | "AirDefense";
233
+ export interface NightFleetConditions {
234
+ night_contact_rank?: ContactRank | null;
235
+ starshell_index?: number | null;
236
+ searchlight_index?: number | null;
237
+ activates_large_searchlight?: boolean;
238
+ }
251
239
 
252
240
  export interface FleetState {
253
241
  id?: string;
@@ -261,74 +249,53 @@ export interface FleetState {
261
249
  s7?: ShipState;
262
250
  }
263
251
 
264
- export interface ShipState extends GearVecState, SlotSizeVecState {
265
- id?: string;
266
- ship_id: number;
267
- level?: number;
268
- current_hp?: number;
269
- morale?: number;
270
- ammo?: number;
271
- fuel?: number;
272
- max_hp_mod?: number;
273
- firepower_mod?: number;
274
- torpedo_mod?: number;
275
- armor_mod?: number;
276
- anti_air_mod?: number;
277
- evasion_mod?: number;
278
- asw_mod?: number;
279
- los_mod?: number;
280
- luck_mod?: number;
281
- day_gunfit_accuracy?: number;
282
- night_gunfit_accuracy?: number;
283
- custom_power_mods?: CustomPowerModifiers;
284
- }
252
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
285
253
 
286
- export interface SlotSizeVecState {
287
- ss1?: number;
288
- ss2?: number;
289
- ss3?: number;
290
- ss4?: number;
291
- ss5?: number;
292
- }
254
+ export type Role = "Main" | "Escort";
293
255
 
294
- export interface GearVecState {
295
- g1?: GearState;
296
- g2?: GearState;
297
- g3?: GearState;
298
- g4?: GearState;
299
- g5?: GearState;
300
- gx?: GearState;
256
+ export type Side = "Player" | "Enemy";
257
+
258
+ export type Align = "Left" | "Right";
259
+
260
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
261
+
262
+ export interface FormationCombatModifiersDef {
263
+ power_mod?: number;
264
+ accuracy_mod?: number;
265
+ evasion_mod?: number;
301
266
  }
302
267
 
303
- export interface GearState {
304
- id?: string;
305
- gear_id: number;
306
- exp?: number;
307
- stars?: number;
268
+ export interface FormationDef {
269
+ tag: Formation;
270
+ protection_rate: number | null;
271
+ fleet_anti_air_mod: number;
272
+ shelling: FormationCombatModifiersDef;
273
+ torpedo: FormationCombatModifiersDef;
274
+ asw: FormationCombatModifiersDef;
275
+ night: FormationCombatModifiersDef;
276
+ support_shelling: FormationCombatModifiersDef;
308
277
  }
309
278
 
310
- export interface BattleDefinitions {
311
- formation: Record<Formation, NestedFormationDef>;
312
- anti_air_cutin: Record<number, AntiAirCutinDef>;
313
- day_cutin: Record<DayCutin, DayCutinDef>;
314
- night_cutin: Record<NightCutin, NightCutinDef>;
315
- historical_bonuses: HistoricalBonusDef[];
279
+ export type NestedFormationDef =
280
+ | FormationDef
281
+ | { top_half: FormationDef; bottom_half: FormationDef };
282
+
283
+ export interface AntiAirCutinDef {
284
+ id: number;
285
+ type_factor: number | null;
286
+ multiplier: number | null;
287
+ guaranteed: number | null;
288
+ sequential: boolean | null;
316
289
  }
317
290
 
318
- export interface NightCutinDef {
319
- tag: NightCutin;
291
+ export interface DayCutinDef {
292
+ tag: DayCutin;
320
293
  hits: number;
321
294
  type_factor: number | null;
322
295
  power_mod: number | null;
323
296
  accuracy_mod: number | null;
324
297
  }
325
298
 
326
- export interface HistoricalParams {
327
- power_mod: number;
328
- accuracy_mod: number;
329
- target_evasion_mod: number;
330
- }
331
-
332
299
  export interface HistoricalBonusDef {
333
300
  map?: number;
334
301
  node?: CompiledEvaler;
@@ -341,54 +308,74 @@ export interface HistoricalBonusDef {
341
308
  evasion_mod?: number;
342
309
  }
343
310
 
344
- export interface DayCutinDef {
345
- tag: DayCutin;
311
+ export interface HistoricalParams {
312
+ power_mod: number;
313
+ accuracy_mod: number;
314
+ target_evasion_mod: number;
315
+ }
316
+
317
+ export interface NightCutinDef {
318
+ tag: NightCutin;
346
319
  hits: number;
347
320
  type_factor: number | null;
348
321
  power_mod: number | null;
349
322
  accuracy_mod: number | null;
350
323
  }
351
324
 
352
- export interface AntiAirCutinDef {
353
- id: number;
354
- type_factor: number | null;
355
- multiplier: number | null;
356
- guaranteed: number | null;
357
- sequential: boolean | null;
325
+ export interface BattleDefinitions {
326
+ formation: Record<Formation, NestedFormationDef>;
327
+ anti_air_cutin: Record<number, AntiAirCutinDef>;
328
+ day_cutin: Record<DayCutin, DayCutinDef>;
329
+ night_cutin: Record<NightCutin, NightCutinDef>;
330
+ historical_bonuses: HistoricalBonusDef[];
358
331
  }
359
332
 
360
- export type NestedFormationDef =
361
- | FormationDef
362
- | { top_half: FormationDef; bottom_half: FormationDef };
333
+ export type DayCutin =
334
+ | "Zuiun"
335
+ | "AirSea"
336
+ | "MainMain"
337
+ | "MainAp"
338
+ | "MainRadar"
339
+ | "MainSec"
340
+ | "DoubleAttack"
341
+ | "FBA"
342
+ | "BBA"
343
+ | "BA";
363
344
 
364
- export interface FormationDef {
365
- tag: Formation;
366
- protection_rate: number | null;
367
- fleet_anti_air_mod: number;
368
- shelling: FormationCombatModifiersDef;
369
- torpedo: FormationCombatModifiersDef;
370
- asw: FormationCombatModifiersDef;
371
- night: FormationCombatModifiersDef;
372
- support_shelling: FormationCombatModifiersDef;
373
- }
345
+ export type NightCutin =
346
+ | "MainTorpRadar"
347
+ | "TorpLookoutRadar"
348
+ | "TorpTsloTorp"
349
+ | "TorpTsloDrum"
350
+ | "DoubleAttack"
351
+ | "TorpTorpMain"
352
+ | "TorpTorpTorp"
353
+ | "MainMainSec"
354
+ | "MainMainMain"
355
+ | "SubTorpTorp"
356
+ | "SubRadarTorp"
357
+ | "Cvci1_25"
358
+ | "Cvci1_20"
359
+ | "Cvci1_18"
360
+ | "Photobomber";
374
361
 
375
- export interface FormationCombatModifiersDef {
376
- power_mod?: number;
377
- accuracy_mod?: number;
378
- evasion_mod?: number;
379
- }
362
+ export type FleetCutin =
363
+ | "NelsonTouch"
364
+ | "NagatoClassCutin"
365
+ | "ColoradoClassCutin"
366
+ | "KongouClassCutin"
367
+ | "Yamato2ShipCutin"
368
+ | "Yamato3ShipCutin";
369
+
370
+ export type DayCutinLike = DayCutin | FleetCutin;
371
+
372
+ export type NightCutinLike = NightCutin | FleetCutin;
380
373
 
381
374
  export interface MoveShipPayload {
382
375
  current: [string, string, ShipKey];
383
376
  target: [string | null, string, ShipKey];
384
377
  }
385
378
 
386
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
387
-
388
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
389
-
390
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
391
-
392
379
  export interface AttackReport<T> {
393
380
  style: T;
394
381
  proc_rate: number | null;
@@ -400,24 +387,115 @@ export interface AttackReport<T> {
400
387
  damage: DamageReport | null;
401
388
  }
402
389
 
403
- export interface ShipConditions extends ShipPosition {
404
- formation?: Formation;
405
- amagiri_index?: number | null;
390
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
391
+
392
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
393
+
394
+ export interface SimulatorResult {
395
+ items: SimulatorResultItem[];
396
+ sunk_vec: [number, number, number][];
406
397
  }
407
398
 
408
- export type GearCategory =
409
- | "Fighter"
410
- | "Bomber"
411
- | "Recon"
412
- | "MainGun"
413
- | "Secondary"
414
- | "Torpedo"
415
- | "AntiSub"
416
- | "Radar"
417
- | "Landing"
418
- | "Ration"
419
- | "LandBased"
420
- | "Misc";
399
+ export interface SimulatorResultItem {
400
+ id: string;
401
+ fleet_type: FleetType;
402
+ index: number;
403
+ damage_state_map: Record<DamageState, number>;
404
+ }
405
+
406
+ export type FhResult<T> = { Ok: T } | { Err: string };
407
+
408
+ export interface MasterGear {
409
+ gear_id: number;
410
+ name: string;
411
+ types: GearTypeIdArray;
412
+ special_type?: number;
413
+ max_hp?: number;
414
+ firepower?: number;
415
+ armor?: number;
416
+ torpedo?: number;
417
+ anti_air?: number;
418
+ speed?: number;
419
+ bombing?: number;
420
+ asw?: number;
421
+ los?: number;
422
+ luck?: number;
423
+ accuracy?: number;
424
+ evasion?: number;
425
+ range?: number;
426
+ radius?: number;
427
+ cost?: number;
428
+ improvable?: boolean;
429
+ ship_anti_air_resist?: number;
430
+ fleet_anti_air_resist?: number;
431
+ historical_aircraft_group?: number;
432
+ }
433
+
434
+ export interface AttackPower {
435
+ precap: number;
436
+ is_capped: boolean;
437
+ capped: number;
438
+ normal: number;
439
+ critical: number;
440
+ armor_penetration: number;
441
+ remaining_ammo_mod: number;
442
+ }
443
+
444
+ export interface AttackPowerParams {
445
+ basic: number;
446
+ cap: number;
447
+ precap_mod: AttackPowerModifier;
448
+ postcap_mod: AttackPowerModifier;
449
+ ap_shell_mod: number | null;
450
+ aerial_power: number | null;
451
+ proficiency_critical_mod: number;
452
+ armor_penetration: number;
453
+ remaining_ammo_mod: number;
454
+ special_enemy_mods: SpecialEnemyModifiers;
455
+ historical_mod: number;
456
+ custom_mods: CustomPowerModifiers;
457
+ }
458
+
459
+ export type AirSquadronMode = "Sortie" | "AirDefense";
460
+
461
+ export interface AirSquadronState extends GearVecState, SlotSizeVecState {
462
+ id?: string;
463
+ mode?: AirSquadronMode;
464
+ }
465
+
466
+ export type AirState =
467
+ | "AirSupremacy"
468
+ | "AirSuperiority"
469
+ | "AirParity"
470
+ | "AirDenial"
471
+ | "AirIncapability";
472
+
473
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
474
+
475
+ export interface AttackPowerModifier {
476
+ a?: number;
477
+ b?: number;
478
+ }
479
+
480
+ export interface SpecialEnemyModifiers {
481
+ precap_general_mod: AttackPowerModifier;
482
+ stype_mod: AttackPowerModifier;
483
+ landing_craft_synergy_mod: AttackPowerModifier;
484
+ toku_daihatsu_tank_mod: AttackPowerModifier;
485
+ m4a1dd_mod: AttackPowerModifier;
486
+ honi_mod: AttackPowerModifier;
487
+ postcap_general_mod: AttackPowerModifier;
488
+ pt_mod: AttackPowerModifier;
489
+ }
490
+
491
+ export interface CustomPowerModifiers {
492
+ precap_mod?: AttackPowerModifier;
493
+ postcap_mod?: AttackPowerModifier;
494
+ basic_power_mod?: AttackPowerModifier;
495
+ historical_mod?: AttackPowerModifier;
496
+ }
497
+
498
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
421
499
 
422
500
  export type GearType =
423
501
  | "Unknown"
@@ -465,96 +543,41 @@ export type GearType =
465
543
  | "LargeSearchlight"
466
544
  | "CombatRation"
467
545
  | "Supplies"
468
- | "SeaplaneFighter"
469
- | "AmphibiousTank"
470
- | "LbAttacker"
471
- | "LbFighter"
472
- | "LbRecon"
473
- | "TransportationMaterial"
474
- | "SubmarineEquipment"
475
- | "LargeLbAircraft"
476
- | "JetFighter"
477
- | "JetFighterBomber"
478
- | "JetTorpedoBomber"
479
- | "JetRecon"
480
- | "LargeRadar2"
481
- | "CbRecon2"
482
- | "SecondaryGun2";
483
-
484
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
485
-
486
- export type AirState =
487
- | "AirSupremacy"
488
- | "AirSuperiority"
489
- | "AirParity"
490
- | "AirDenial"
491
- | "AirIncapability";
492
-
493
- export interface SimulatorResult {
494
- items: SimulatorResultItem[];
495
- sunk_vec: [number, number, number][];
496
- }
497
-
498
- export interface SimulatorResultItem {
499
- id: string;
500
- fleet_type: FleetType;
501
- index: number;
502
- damage_state_map: Record<DamageState, number>;
503
- }
504
-
505
- export type FhResult<T> = { Ok: T } | { Err: string };
506
-
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;
515
- }
516
-
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;
530
- }
546
+ | "SeaplaneFighter"
547
+ | "AmphibiousTank"
548
+ | "LbAttacker"
549
+ | "LbFighter"
550
+ | "LbRecon"
551
+ | "TransportationMaterial"
552
+ | "SubmarineEquipment"
553
+ | "LargeLbAircraft"
554
+ | "JetFighter"
555
+ | "JetFighterBomber"
556
+ | "JetTorpedoBomber"
557
+ | "JetRecon"
558
+ | "LargeRadar2"
559
+ | "CbRecon2"
560
+ | "SecondaryGun2";
531
561
 
532
- export type ShipAttr =
533
- | "Unknown"
534
- | "Abyssal"
535
- | "NightCarrier"
536
- | "Installation"
537
- | "RoyalNavy"
538
- | "Kai2"
539
- | "TurbineSpeedBonus"
540
- | "Pillbox"
541
- | "IsolatedIsland"
542
- | "HarbourSummerPrincess"
543
- | "SupplyDepot"
544
- | "NewSupplyDepot"
545
- | "PtImp"
546
- | "BattleshipSummerPrincess"
547
- | "HeavyCruiserSummerPrincess";
562
+ export type GearCategory =
563
+ | "Fighter"
564
+ | "Bomber"
565
+ | "Recon"
566
+ | "MainGun"
567
+ | "Secondary"
568
+ | "Torpedo"
569
+ | "AntiSub"
570
+ | "Radar"
571
+ | "Landing"
572
+ | "Ration"
573
+ | "LandBased"
574
+ | "Misc";
548
575
 
549
- export interface ShipPosition {
550
- org_type?: OrgType;
551
- fleet_type?: FleetType;
552
- fleet_len?: number;
553
- index?: number;
576
+ export interface ShipConditions extends ShipPosition {
577
+ formation?: Formation;
578
+ amagiri_index?: number | null;
554
579
  }
555
580
 
556
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
557
-
558
581
  export interface MasterIBonuses {
559
582
  shelling_power: MasterIBonusRule[];
560
583
  shelling_accuracy: MasterIBonusRule[];
@@ -580,44 +603,9 @@ export interface MasterIBonusRule {
580
603
  formula: CompiledEvaler;
581
604
  }
582
605
 
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;
607
- }
608
-
609
- export type CompiledEvaler = string;
610
-
611
- export type OrgType =
612
- | "Single"
613
- | "CarrierTaskForce"
614
- | "SurfaceTaskForce"
615
- | "TransportEscort"
616
- | "EnemySingle"
617
- | "EnemyCombined";
618
-
619
- export interface CompMeta {
620
- fleets: Record<FleetType, FleetMeta>;
606
+ export interface ShipMeta {
607
+ id: string;
608
+ ship_id: number;
621
609
  }
622
610
 
623
611
  export interface FleetMeta {
@@ -626,91 +614,18 @@ export interface FleetMeta {
626
614
  ships: [string, ShipMeta | null][];
627
615
  }
628
616
 
629
- export interface ShipMeta {
630
- id: string;
631
- ship_id: number;
632
- }
633
-
634
- export type GearAttr =
635
- | "Unknown"
636
- | "Abyssal"
637
- | "HighAngleMount"
638
- | "NightFighter"
639
- | "NightAttacker"
640
- | "HeavyBomber"
641
- | "NightRecon"
642
- | "MainGun"
643
- | "Radar"
644
- | "SurfaceRadar"
645
- | "AirRadar"
646
- | "DepthChargeProjector"
647
- | "SynergisticDepthCharge"
648
- | "AntiSubMortar"
649
- | "AntiSubWeapon"
650
- | "ApDepthCharge"
651
- | "AntiSubAircraft"
652
- | "LateModelBowTorpedo"
653
- | "Seaplane"
654
- | "CbAircraft"
655
- | "LbAircraft"
656
- | "JetAircraft"
657
- | "Fighter"
658
- | "Recon"
659
- | "ObservationSeaplane"
660
- | "CbFighterBomber"
661
- | "AntiInstDiveBomber"
662
- | "CbSwordfish"
663
- | "SemiNightPlane"
664
- | "HighAltitudeInterceptor";
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;
617
+ export interface CompMeta {
618
+ fleets: Record<FleetType, FleetMeta>;
697
619
  }
698
620
 
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;
621
+ export interface ShipPosition {
622
+ org_type?: OrgType;
623
+ fleet_type?: FleetType;
624
+ fleet_len?: number;
625
+ index?: number;
708
626
  }
709
627
 
710
- export interface AttackPowerModifier {
711
- a?: number;
712
- b?: number;
713
- }
628
+ export type CompiledEvaler = string;
714
629
 
715
630
  export interface MasterData extends MasterBattleDefinitions {
716
631
  created_at: number;
@@ -733,6 +648,13 @@ export interface MasterAttrRule<T> {
733
648
  expr: CompiledEvaler;
734
649
  }
735
650
 
651
+ export interface ShipAnalyzerConfig {
652
+ air_state?: AirState;
653
+ engagement?: Engagement;
654
+ left?: AttackAnalyzerShipConfig;
655
+ right?: AttackAnalyzerShipConfig;
656
+ }
657
+
736
658
  export interface NightContactChance {
737
659
  rank1: number;
738
660
  rank2: number;
@@ -769,42 +691,93 @@ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
769
691
  power_mod: number;
770
692
  }
771
693
 
772
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
694
+ export type AswAttackType = "DepthCharge" | "Aerial";
773
695
 
774
- export interface SupportShellingSimulatorParams {
775
- attacker_formation?: Formation;
776
- target_formation?: Formation;
777
- engagement: Engagement;
778
- }
696
+ export type ShellingType = "Normal" | "Aerial";
779
697
 
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
- }
698
+ export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
699
+
700
+ export type SupportShellingType = ShellingType;
701
+
702
+ export type AttackType =
703
+ | { t: "Asw"; c: AswAttackType }
704
+ | { t: "Shelling"; c: ShellingType }
705
+ | { t: "Night"; c: NightAttackType }
706
+ | { t: "Torpedo" }
707
+ | { t: "SupportShelling"; c: SupportShellingType };
708
+
709
+ export type DayPhaseAttackType =
710
+ | { t: "Shelling"; c: ShellingType }
711
+ | { t: "Asw"; c: AswAttackType };
712
+
713
+ export type NightPhaseAttackType =
714
+ | { t: "Night"; c: NightAttackType }
715
+ | { t: "Asw"; c: AswAttackType };
716
+
717
+ export type TorpedoAttackType = null;
718
+
719
+ export type GearAttr =
720
+ | "Unknown"
721
+ | "Abyssal"
722
+ | "HighAngleMount"
723
+ | "NightFighter"
724
+ | "NightAttacker"
725
+ | "HeavyBomber"
726
+ | "NightRecon"
727
+ | "MainGun"
728
+ | "Radar"
729
+ | "SurfaceRadar"
730
+ | "AirRadar"
731
+ | "DepthChargeProjector"
732
+ | "SynergisticDepthCharge"
733
+ | "AntiSubMortar"
734
+ | "AntiSubWeapon"
735
+ | "ApDepthCharge"
736
+ | "AntiSubAircraft"
737
+ | "LateModelBowTorpedo"
738
+ | "Seaplane"
739
+ | "CbAircraft"
740
+ | "LbAircraft"
741
+ | "JetAircraft"
742
+ | "Fighter"
743
+ | "Recon"
744
+ | "ObservationSeaplane"
745
+ | "CbFighterBomber"
746
+ | "AntiInstDiveBomber"
747
+ | "CbSwordfish"
748
+ | "SemiNightPlane"
749
+ | "HighAltitudeInterceptor";
787
750
 
788
- export interface ShipAnalyzerConfig {
789
- air_state?: AirState;
790
- engagement?: Engagement;
791
- left?: AttackAnalyzerShipConfig;
792
- right?: AttackAnalyzerShipConfig;
793
- }
751
+ export type OrgType =
752
+ | "Single"
753
+ | "CarrierTaskForce"
754
+ | "SurfaceTaskForce"
755
+ | "TransportEscort"
756
+ | "EnemySingle"
757
+ | "EnemyCombined";
794
758
 
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
- }
759
+ export type ShipAttr =
760
+ | "Unknown"
761
+ | "Abyssal"
762
+ | "NightCarrier"
763
+ | "Installation"
764
+ | "RoyalNavy"
765
+ | "Kai2"
766
+ | "TurbineSpeedBonus"
767
+ | "Pillbox"
768
+ | "IsolatedIsland"
769
+ | "HarbourSummerPrincess"
770
+ | "SupplyDepot"
771
+ | "NewSupplyDepot"
772
+ | "PtImp"
773
+ | "BattleshipSummerPrincess"
774
+ | "HeavyCruiserSummerPrincess";
806
775
 
807
- export interface EBonuses {
776
+ export type GearVecInput = GearInput[];
777
+
778
+ export interface GearInput {
779
+ gear_id: number;
780
+ types: GearTypeIdArray;
808
781
  firepower: number;
809
782
  torpedo: number;
810
783
  anti_air: number;
@@ -815,6 +788,9 @@ export interface EBonuses {
815
788
  bombing: number;
816
789
  accuracy: number;
817
790
  range: number;
791
+ radius: number;
792
+ stars: number;
793
+ ace: number;
818
794
  }
819
795
 
820
796
  export interface ShipInput {
@@ -824,9 +800,7 @@ export interface ShipInput {
824
800
  yomi: string;
825
801
  }
826
802
 
827
- export interface GearInput {
828
- gear_id: number;
829
- types: GearTypeIdArray;
803
+ export interface EBonuses {
830
804
  firepower: number;
831
805
  torpedo: number;
832
806
  anti_air: number;
@@ -837,66 +811,20 @@ export interface GearInput {
837
811
  bombing: number;
838
812
  accuracy: number;
839
813
  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
-
865
- export interface SupportShellingStyle {
866
- tag: "SupportShellingStyle";
867
- attack_type: SupportShellingType;
868
- }
869
-
870
- export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
871
-
872
- export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
873
-
874
- export interface TorpedoAttackStyle {
875
- tag: "TorpedoAttackStyle";
876
- attack_type: TorpedoAttackType;
877
- }
878
-
879
- export interface AswAttackStyle {
880
- tag: "AswAttackStyle";
881
- attack_type: AswAttackType;
882
814
  }
883
815
 
884
- export interface NightAttackStyle {
885
- tag: "NightAttackStyle";
886
- attack_type: NightAttackType;
887
- cutin: NightCutinLike | null;
888
- power_mod: number;
889
- accuracy_mod: number;
890
- hits: number;
816
+ export interface SupportShellingSimulatorParams {
817
+ attacker_formation?: Formation;
818
+ target_formation?: Formation;
819
+ engagement: Engagement;
891
820
  }
892
821
 
893
- export interface ShellingStyle {
894
- tag: "ShellingStyle";
895
- attack_type: ShellingType;
896
- cutin: DayCutinLike | null;
897
- power_mod: number;
898
- accuracy_mod: number;
899
- hits: number;
822
+ export interface MasterBattleDefinitions {
823
+ formation: NestedFormationDef[];
824
+ anti_air_cutin: AntiAirCutinDef[];
825
+ day_cutin: DayCutinDef[];
826
+ night_cutin: NightCutinDef[];
827
+ historical_bonuses?: HistoricalBonusDef[];
900
828
  }
901
829
 
902
830
  export interface CompDayCutinAnalysis {
@@ -919,6 +847,40 @@ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
919
847
  observation_term: number | null;
920
848
  }
921
849
 
850
+ export interface AttackAnalysis {
851
+ attacker_is_player: boolean;
852
+ attacker_ship_id: number;
853
+ target_ship_id: number;
854
+ historical_params: HistoricalParams;
855
+ day: ActionReport<DayPhaseAttackStyle>;
856
+ night: ActionReport<NightPhaseAttackStyle>;
857
+ closing_torpedo: ActionReport<TorpedoAttackStyle>;
858
+ opening_asw: ActionReport<AswAttackStyle>;
859
+ support_shelling: ActionReport<SupportShellingStyle>;
860
+ }
861
+
862
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
863
+
864
+ export interface OrgState {
865
+ id?: string;
866
+ f1?: FleetState;
867
+ f2?: FleetState;
868
+ f3?: FleetState;
869
+ f4?: FleetState;
870
+ a1?: AirSquadronState;
871
+ a2?: AirSquadronState;
872
+ a3?: AirSquadronState;
873
+ hq_level?: number;
874
+ org_type?: OrgType;
875
+ sortie?: FleetKey;
876
+ route_sup?: FleetKey;
877
+ boss_sup?: FleetKey;
878
+ }
879
+
880
+ export type FleetKey = "f1" | "f2" | "f3" | "f4";
881
+
882
+ export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
883
+
922
884
  export interface CompAntiAirAnalysis {
923
885
  fleet_adjusted_anti_air: number;
924
886
  ships: AntiAirReport[];
@@ -937,27 +899,58 @@ export interface AntiAirReport {
937
899
  anti_air_propellant_barrage_chance: number | null;
938
900
  }
939
901
 
940
- export type SpecialEnemyType =
941
- | "None"
942
- | "SoftSkinned"
943
- | "Pillbox"
944
- | "IsolatedIsland"
945
- | "SupplyDepot"
946
- | "NewSupplyDepot"
947
- | "HarbourSummerPrincess"
948
- | "PtImp"
949
- | "BattleshipSummerPrincess"
950
- | "HeavyCruiserSummerPrincess";
902
+ export interface ShellingStyle {
903
+ tag: "ShellingStyle";
904
+ attack_type: ShellingType;
905
+ cutin: DayCutinLike | null;
906
+ power_mod: number;
907
+ accuracy_mod: number;
908
+ hits: number;
909
+ }
951
910
 
952
- export interface NodeState {
953
- map?: number;
954
- node?: NodeId;
955
- phase?: number;
956
- debuff?: boolean;
957
- disable_historical_mod?: boolean;
911
+ export interface NightAttackStyle {
912
+ tag: "NightAttackStyle";
913
+ attack_type: NightAttackType;
914
+ cutin: NightCutinLike | null;
915
+ power_mod: number;
916
+ accuracy_mod: number;
917
+ hits: number;
958
918
  }
959
919
 
960
- export type NodeId = string;
920
+ export interface AswAttackStyle {
921
+ tag: "AswAttackStyle";
922
+ attack_type: AswAttackType;
923
+ }
924
+
925
+ export interface TorpedoAttackStyle {
926
+ tag: "TorpedoAttackStyle";
927
+ attack_type: TorpedoAttackType;
928
+ }
929
+
930
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
931
+
932
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
933
+
934
+ export interface SupportShellingStyle {
935
+ tag: "SupportShellingStyle";
936
+ attack_type: SupportShellingType;
937
+ }
938
+
939
+ export type SingleFormation =
940
+ | "LineAhead"
941
+ | "DoubleLine"
942
+ | "Diamond"
943
+ | "Echelon"
944
+ | "LineAbreast"
945
+ | "Vanguard";
946
+
947
+ export type CombinedFormation =
948
+ | "Cruising1"
949
+ | "Cruising2"
950
+ | "Cruising3"
951
+ | "Cruising4";
952
+
953
+ export type Formation = SingleFormation | CombinedFormation;
961
954
 
962
955
  export interface DamageReport {
963
956
  miss_damage_min: number;
@@ -972,20 +965,6 @@ export interface DamageReport {
972
965
  damage_state_density: Histogram<DamageState, number>;
973
966
  }
974
967
 
975
- export interface ContactAnalysis {
976
- single: DayContactChance[] | null;
977
- combined: DayContactChance[] | null;
978
- }
979
-
980
- export interface DayContactChance {
981
- air_state: AirState;
982
- trigger_rate: number;
983
- rank3: number;
984
- rank2: number;
985
- rank1: number;
986
- total: number;
987
- }
988
-
989
968
  export interface CompAnalyzerConfig {
990
969
  engagement: Engagement;
991
970
  formation: Formation;
@@ -1019,6 +998,28 @@ export interface AttackAnalyzerShipConfig
1019
998
  fleet_los_mod?: number | null;
1020
999
  }
1021
1000
 
1001
+ export type NodeId = string;
1002
+
1003
+ export interface NodeState {
1004
+ map?: number;
1005
+ node?: NodeId;
1006
+ phase?: number;
1007
+ debuff?: boolean;
1008
+ disable_historical_mod?: boolean;
1009
+ }
1010
+
1011
+ export type SpecialEnemyType =
1012
+ | "None"
1013
+ | "SoftSkinned"
1014
+ | "Pillbox"
1015
+ | "IsolatedIsland"
1016
+ | "SupplyDepot"
1017
+ | "NewSupplyDepot"
1018
+ | "HarbourSummerPrincess"
1019
+ | "PtImp"
1020
+ | "BattleshipSummerPrincess"
1021
+ | "HeavyCruiserSummerPrincess";
1022
+
1022
1023
  /**
1023
1024
  */
1024
1025
  export class AirSquadron {