fleethub-core 1.3.2 → 1.3.3

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.
@@ -3,29 +3,84 @@
3
3
  /**
4
4
  */
5
5
  export function set_panic_hook(): void;
6
- export type CompDayCutinRateInfo = {
7
- main: FleetDayCutinRateInfo;
8
- escort: FleetDayCutinRateInfo | null;
9
- };
10
-
11
- export type FleetDayCutinRateInfo = {
12
- fleet_los_mod: number | null;
13
- ships: ShipDayCutinRateInfo[];
14
- };
6
+ export interface EBonusFnGearInput {
7
+ gear_id: number;
8
+ types: GearTypeIdArray;
9
+ firepower: number;
10
+ torpedo: number;
11
+ anti_air: number;
12
+ armor: number;
13
+ evasion: number;
14
+ asw: number;
15
+ los: number;
16
+ bombing: number;
17
+ accuracy: number;
18
+ range: number;
19
+ radius: number;
20
+ stars: number;
21
+ ace: number;
22
+ }
15
23
 
16
- export type ShipDayCutinRateInfo = {
24
+ export interface EBonusFnShipInput {
17
25
  ship_id: number;
18
- air_supremacy: DayCutinRateInfo;
19
- air_superiority: DayCutinRateInfo;
20
- };
26
+ ctype: number;
27
+ stype: number;
28
+ yomi: string;
29
+ }
21
30
 
22
- export type DayCutinRateInfo = {
23
- observation_term: number | null;
24
- rates: [DayCutin | null, number | null][];
25
- total_cutin_rate: number | null;
26
- };
31
+ export interface EBonuses {
32
+ firepower: number;
33
+ torpedo: number;
34
+ anti_air: number;
35
+ armor: number;
36
+ evasion: number;
37
+ asw: number;
38
+ los: number;
39
+ bombing: number;
40
+ accuracy: number;
41
+ range: number;
42
+ }
43
+
44
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
45
+
46
+ export type AirState =
47
+ | "AirSupremacy"
48
+ | "AirSuperiority"
49
+ | "AirParity"
50
+ | "AirDenial"
51
+ | "AirIncapability";
52
+
53
+ export interface MasterIBonuses {
54
+ shelling_power: MasterIBonusRule[];
55
+ carrier_shelling_power: MasterIBonusRule[];
56
+ shelling_accuracy: MasterIBonusRule[];
57
+ torpedo_power: MasterIBonusRule[];
58
+ torpedo_accuracy: MasterIBonusRule[];
59
+ torpedo_evasion: MasterIBonusRule[];
60
+ asw_power: MasterIBonusRule[];
61
+ asw_accuracy: MasterIBonusRule[];
62
+ night_power: MasterIBonusRule[];
63
+ night_accuracy: MasterIBonusRule[];
64
+ defense_power: MasterIBonusRule[];
65
+ contact_selection: MasterIBonusRule[];
66
+ fighter_power: MasterIBonusRule[];
67
+ ship_anti_air: MasterIBonusRule[];
68
+ fleet_anti_air: MasterIBonusRule[];
69
+ elos: MasterIBonusRule[];
70
+ }
71
+
72
+ export interface MasterIBonusRule {
73
+ expr: CompiledEvaler;
74
+ formula: CompiledEvaler;
75
+ }
27
76
 
28
- export type DamageInfo = {
77
+ export interface NightSituation {
78
+ night_contact_rank: ContactRank | null;
79
+ starshell: boolean;
80
+ searchlight: boolean;
81
+ }
82
+
83
+ export interface DamageInfo {
29
84
  miss_damage_min: number;
30
85
  miss_damage_max: number;
31
86
  normal_damage_min: number;
@@ -36,9 +91,7 @@ export type DamageInfo = {
36
91
  critical_scratch_rate: number;
37
92
  damage_map: NumMap<number, number>;
38
93
  damage_state_map: NumMap<DamageState, number>;
39
- };
40
-
41
- export type NumMap<K, V> = Partial<Record<K, V>>;
94
+ }
42
95
 
43
96
  export type OrgType =
44
97
  | "Single"
@@ -48,130 +101,159 @@ export type OrgType =
48
101
  | "EnemySingle"
49
102
  | "EnemyCombined";
50
103
 
51
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
104
+ export interface WarfareContext {
105
+ attacker_env: WarfareShipEnvironment;
106
+ target_env: WarfareShipEnvironment;
107
+ engagement: Engagement;
108
+ air_state: AirState;
109
+ custom_mods: CustomModifiers;
110
+ }
52
111
 
53
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
112
+ export interface WarfareShipEnvironment {
113
+ org_type: OrgType;
114
+ role: Role;
115
+ ship_index: number;
116
+ fleet_len: number;
117
+ formation: Formation;
118
+ fleet_los_mod: number | null;
119
+ }
54
120
 
55
- export type SimulatorResult = {
56
- items: SimulatorResultItem[];
57
- sunk_vec: [number, number, number][];
58
- };
121
+ export interface AttackPower {
122
+ precap: number;
123
+ is_capped: boolean;
124
+ capped: number;
125
+ normal: number;
126
+ critical: number;
127
+ armor_penetration: number;
128
+ remaining_ammo_mod: number;
129
+ }
59
130
 
60
- export type SimulatorResultItem = {
61
- id: string;
62
- role: Role;
63
- index: number;
64
- damage_state_map: Record<DamageState, number>;
65
- };
131
+ export interface AttackPowerParams {
132
+ basic: number;
133
+ cap: number;
134
+ precap_mod: AttackPowerModifier;
135
+ postcap_mod: AttackPowerModifier;
136
+ ap_shell_mod: number | null;
137
+ carrier_power: number | null;
138
+ proficiency_critical_mod: number | null;
139
+ armor_penetration: number;
140
+ remaining_ammo_mod: number;
141
+ special_enemy_mods: SpecialEnemyModifiers;
142
+ custom_mods: CustomModifiers;
143
+ }
66
144
 
67
- export type AswAttackType = "DepthCharge" | "Aircraft";
145
+ export interface CustomModifiers {
146
+ precap_mod: AttackPowerModifier;
147
+ postcap_mod: AttackPowerModifier;
148
+ }
68
149
 
69
- export type MasterData = {
70
- gears: MasterGear[];
71
- gear_attrs: MasterAttrRule[];
72
- ships: MasterShip[];
73
- ship_attrs: MasterAttrRule[];
74
- equippable: MasterEquippable;
75
- ibonuses: MasterIBonuses;
76
- config: BattleConfig;
77
- };
150
+ export interface SpecialEnemyModifiers {
151
+ precap_general_mod: AttackPowerModifier;
152
+ stype_mod: AttackPowerModifier;
153
+ landing_craft_synergy_mod: AttackPowerModifier;
154
+ toku_daihatsu_tank_mod: AttackPowerModifier;
155
+ m4a1dd_mod: AttackPowerModifier;
156
+ honi_mod: AttackPowerModifier;
157
+ postcap_general_mod: AttackPowerModifier;
158
+ pt_mod: AttackPowerModifier;
159
+ }
78
160
 
79
- export type MasterEquippable = {
80
- equip_stype: EquipStype[];
81
- equip_exslot: number[];
82
- equip_ship: MstEquipShip[];
83
- equip_exslot_ship: MstEquipExslotShip[];
84
- };
161
+ export interface AttackPowerModifier {
162
+ a: number;
163
+ b: number;
164
+ }
85
165
 
86
- export type MstEquipExslotShip = {
87
- api_slotitem_id: number;
88
- api_ship_ids: number[];
89
- };
166
+ export type NumMap<K, V> = Partial<Record<K, V>>;
90
167
 
91
- export type MstEquipShip = { api_ship_id: number; api_equip_type: number[] };
168
+ export type Role = "Main" | "Escort";
92
169
 
93
- export type EquipStype = { id: number; equip_type: number[] };
170
+ export interface CompMeta {
171
+ fleets: Record<FleetType, FleetMeta>;
172
+ }
173
+
174
+ export interface FleetMeta {
175
+ id: string;
176
+ len: number;
177
+ ships: [string, ShipMeta | null][];
178
+ }
94
179
 
95
- export type MasterShip = {
180
+ export interface ShipMeta {
181
+ id: string;
96
182
  ship_id: number;
97
- name: string;
98
- yomi: string;
99
- stype: number;
100
- ctype: number;
101
- sort_id?: number;
102
- max_hp: StatInterval;
103
- firepower: StatInterval;
104
- armor: StatInterval;
105
- torpedo: StatInterval;
106
- evasion: StatInterval;
107
- anti_air: StatInterval;
108
- asw: StatInterval;
109
- los: StatInterval;
110
- luck: StatInterval;
111
- speed: number;
112
- range?: number;
113
- fuel?: number;
114
- ammo?: number;
115
- next_id?: number;
116
- next_level?: number;
117
- slotnum: number;
118
- slots: SlotSizeVec;
119
- stock: Array<GearState>;
120
- speed_group?: SpeedGroup;
121
- useful?: boolean;
122
- };
183
+ }
123
184
 
124
- export type StatInterval = [number | null, number | null];
185
+ export interface CompDayCutinRateInfo {
186
+ main: FleetDayCutinRateInfo;
187
+ escort: FleetDayCutinRateInfo | null;
188
+ }
125
189
 
126
- export type MasterIBonuses = {
127
- shelling_power: MasterIBonusRule[];
128
- carrier_shelling_power: MasterIBonusRule[];
129
- shelling_accuracy: MasterIBonusRule[];
130
- torpedo_power: MasterIBonusRule[];
131
- torpedo_accuracy: MasterIBonusRule[];
132
- torpedo_evasion: MasterIBonusRule[];
133
- asw_power: MasterIBonusRule[];
134
- asw_accuracy: MasterIBonusRule[];
135
- night_power: MasterIBonusRule[];
136
- night_accuracy: MasterIBonusRule[];
137
- defense_power: MasterIBonusRule[];
138
- contact_selection: MasterIBonusRule[];
139
- fighter_power: MasterIBonusRule[];
140
- ship_anti_air: MasterIBonusRule[];
141
- fleet_anti_air: MasterIBonusRule[];
142
- elos: MasterIBonusRule[];
143
- };
190
+ export interface FleetDayCutinRateInfo {
191
+ fleet_los_mod: number | null;
192
+ ships: ShipDayCutinRateInfo[];
193
+ }
144
194
 
145
- export type MasterIBonusRule = { expr: string; formula: string };
195
+ export interface ShipDayCutinRateInfo {
196
+ ship_id: number;
197
+ air_supremacy: DayCutinRateInfo;
198
+ air_superiority: DayCutinRateInfo;
199
+ }
146
200
 
147
- export type MasterAttrRule = { tag: string; name: string; expr: string };
201
+ export interface DayCutinRateInfo {
202
+ observation_term: number | null;
203
+ rates: [DayCutin | null, number | null][];
204
+ total_cutin_rate: number | null;
205
+ }
148
206
 
149
- export type MasterVariantDef = { tag: string; id: number; name: string };
207
+ export type ShipType =
208
+ | "Unknown"
209
+ | "DE"
210
+ | "DD"
211
+ | "CL"
212
+ | "CLT"
213
+ | "CA"
214
+ | "CAV"
215
+ | "CVL"
216
+ | "FBB"
217
+ | "BB"
218
+ | "BBV"
219
+ | "CV"
220
+ | "XBB"
221
+ | "SS"
222
+ | "SSV"
223
+ | "AP"
224
+ | "AV"
225
+ | "LHA"
226
+ | "CVB"
227
+ | "AR"
228
+ | "AS"
229
+ | "CT"
230
+ | "AO";
150
231
 
151
- export type MasterGear = {
152
- gear_id: number;
153
- name: string;
154
- types: GearTypeIdArray;
155
- special_type?: number;
156
- max_hp?: number;
157
- firepower?: number;
158
- armor?: number;
159
- torpedo?: number;
160
- anti_air?: number;
161
- speed?: number;
162
- bombing?: number;
163
- asw?: number;
164
- los?: number;
165
- luck?: number;
166
- accuracy?: number;
167
- evasion?: number;
168
- range?: number;
169
- radius?: number;
170
- cost?: number;
171
- improvable?: boolean;
172
- ship_anti_air_resistance?: number;
173
- fleet_anti_air_resistance?: number;
174
- };
232
+ export type ShipCategory =
233
+ | "Battleship"
234
+ | "AircraftCarrier"
235
+ | "HeavyCruiser"
236
+ | "LightCruiser"
237
+ | "Destroyer"
238
+ | "CoastalDefenseShip"
239
+ | "Submarine"
240
+ | "AuxiliaryShip";
241
+
242
+ export type ShellingSpecialAttack =
243
+ | { DayCutin: DayCutin }
244
+ | { FleetCutin: FleetCutin };
245
+
246
+ export type DayCutin =
247
+ | "MainMain"
248
+ | "MainAp"
249
+ | "MainRadar"
250
+ | "MainSec"
251
+ | "DoubleAttack"
252
+ | "FBA"
253
+ | "BBA"
254
+ | "BA"
255
+ | "Zuiun"
256
+ | "AirSea";
175
257
 
176
258
  export type GearCategory =
177
259
  | "Fighter"
@@ -248,9 +330,75 @@ export type GearType =
248
330
  | "LargeRadar2"
249
331
  | "CbRecon2";
250
332
 
251
- export type GearTypeIdArray = [number, number, number, number, number];
333
+ export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
334
+
335
+ export interface ShellingSupportSimulatorParams {
336
+ attacker_formation: Formation;
337
+ target_formation: Formation;
338
+ engagement: Engagement;
339
+ custom_mods: CustomModifiers;
340
+ }
341
+
342
+ export interface MasterData {
343
+ gears: MasterGear[];
344
+ gear_attrs: MasterAttrRule<GearAttr>[];
345
+ ships: MasterShip[];
346
+ ship_attrs: MasterAttrRule<ShipAttr>[];
347
+ ibonuses: MasterIBonuses;
348
+ equippable: MasterEquippable;
349
+ formation: NestedFormationDef[];
350
+ anti_air_cutin: AntiAirCutinDef[];
351
+ day_cutin: DayCutinDef[];
352
+ night_cutin: NightCutinDef[];
353
+ }
354
+
355
+ export interface MasterConfig {
356
+ formation: NestedFormationDef[];
357
+ anti_air_cutin: AntiAirCutinDef[];
358
+ day_cutin: DayCutinDef[];
359
+ night_cutin: NightCutinDef[];
360
+ }
361
+
362
+ export interface MasterAttrRule<T> {
363
+ tag: T;
364
+ name: string;
365
+ expr: string;
366
+ }
367
+
368
+ export interface MasterShip {
369
+ ship_id: number;
370
+ name: string;
371
+ yomi: string;
372
+ stype: number;
373
+ ctype: number;
374
+ sort_id?: number;
375
+ max_hp: StatInterval;
376
+ firepower: StatInterval;
377
+ armor: StatInterval;
378
+ torpedo: StatInterval;
379
+ evasion: StatInterval;
380
+ anti_air: StatInterval;
381
+ asw: StatInterval;
382
+ los: StatInterval;
383
+ luck: StatInterval;
384
+ torpedo_accuracy?: number;
385
+ speed: number;
386
+ range?: number;
387
+ fuel?: number;
388
+ ammo?: number;
389
+ next_id?: number;
390
+ next_level?: number;
391
+ slotnum: number;
392
+ slots: SlotSizeVec;
393
+ stock: GearState[];
394
+ speed_group?: SpeedGroup;
395
+ useful?: boolean;
396
+ }
397
+
398
+ export type StatInterval = [number | null, number | null];
252
399
 
253
400
  export type ShipAttr =
401
+ | "Unknown"
254
402
  | "Abyssal"
255
403
  | "NightCarrier"
256
404
  | "Installation"
@@ -265,19 +413,58 @@ export type ShipAttr =
265
413
  | "BattleshipSummerPrincess"
266
414
  | "HeavyCruiserSummerPrincess";
267
415
 
268
- export type Role = "Main" | "Escort";
416
+ export type Formation = SingleFormation | CombinedFormation;
417
+
418
+ export type CombinedFormation =
419
+ | "Cruising1"
420
+ | "Cruising2"
421
+ | "Cruising3"
422
+ | "Cruising4";
423
+
424
+ export type SingleFormation =
425
+ | "LineAhead"
426
+ | "DoubleLine"
427
+ | "Diamond"
428
+ | "Echelon"
429
+ | "LineAbreast"
430
+ | "Vanguard";
269
431
 
270
- export type CompMeta = { fleets: Record<FleetType, FleetMeta> };
432
+ export type ShellingAttackType = "Normal" | "Carrier";
271
433
 
272
- export type FleetMeta = {
273
- id: string;
274
- len: number;
275
- ships: [string, ShipMeta | null][];
276
- };
434
+ export interface FleetCutinAnalysis {
435
+ shelling: FleetCutinInfo[];
436
+ night: FleetCutinInfo[];
437
+ }
277
438
 
278
- export type ShipMeta = { id: string; ship_id: number };
439
+ export interface FleetCutinInfo {
440
+ cutin: FleetCutin;
441
+ formation: Formation;
442
+ items: FleetCutinInfoItem[];
443
+ }
444
+
445
+ export interface FleetCutinInfoItem {
446
+ ship_id: number;
447
+ cutin: FleetCutin;
448
+ fleet_cutin_mod: number;
449
+ stats: AttackStats;
450
+ }
451
+
452
+ export interface CompContactChanceInfo {
453
+ single: AirstrikeContactChance[] | null;
454
+ combined: AirstrikeContactChance[] | null;
455
+ }
456
+
457
+ export interface AirstrikeContactChance {
458
+ air_state: AirState;
459
+ trigger_rate: number;
460
+ rank3: number;
461
+ rank2: number;
462
+ rank1: number;
463
+ total: number;
464
+ }
279
465
 
280
466
  export type GearAttr =
467
+ | "Unknown"
281
468
  | "Abyssal"
282
469
  | "HighAngleMount"
283
470
  | "NightFighter"
@@ -307,205 +494,58 @@ export type GearAttr =
307
494
  | "SemiNightPlane"
308
495
  | "HighAltitudeInterceptor";
309
496
 
310
- export type WarfareContext = {
311
- attacker_env: WarfareShipEnvironment;
312
- target_env: WarfareShipEnvironment;
313
- engagement: Engagement;
314
- air_state: AirState;
315
- custom_mods: CustomModifiers;
316
- };
317
-
318
- export type WarfareShipEnvironment = {
319
- org_type: OrgType;
320
- role: Role;
321
- ship_index: number;
322
- fleet_len: number;
323
- formation: Formation;
324
- fleet_los_mod: number | null;
325
- };
326
-
327
- export type ShipType =
328
- | "Unknown"
329
- | "DE"
330
- | "DD"
331
- | "CL"
332
- | "CLT"
333
- | "CA"
334
- | "CAV"
335
- | "CVL"
336
- | "FBB"
337
- | "BB"
338
- | "BBV"
339
- | "CV"
340
- | "XBB"
341
- | "SS"
342
- | "SSV"
343
- | "AP"
344
- | "AV"
345
- | "LHA"
346
- | "CVB"
347
- | "AR"
348
- | "AS"
349
- | "CT"
350
- | "AO";
351
-
352
- export type ShipCategory =
353
- | "Battleship"
354
- | "AircraftCarrier"
355
- | "HeavyCruiser"
356
- | "LightCruiser"
357
- | "Destroyer"
358
- | "CoastalDefenseShip"
359
- | "Submarine"
360
- | "AuxiliaryShip";
361
-
362
- export type ShellingSpecialAttack =
363
- | { DayCutin: DayCutin }
364
- | { FleetCutin: FleetCutin };
365
-
366
- export type DayCutin =
367
- | "MainMain"
368
- | "MainAp"
369
- | "MainRadar"
370
- | "MainSec"
371
- | "DoubleAttack"
372
- | "FBA"
373
- | "BBA"
374
- | "BA"
375
- | "Zuiun"
376
- | "AirSea";
377
-
378
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
379
-
380
- export type EBonusFnGearInput = {
381
- gear_id: number;
382
- types: GearTypeIdArray;
383
- firepower: number;
384
- torpedo: number;
385
- anti_air: number;
386
- armor: number;
387
- evasion: number;
388
- asw: number;
389
- los: number;
390
- bombing: number;
391
- accuracy: number;
392
- range: number;
393
- radius: number;
394
- stars: number;
395
- ace: number;
396
- };
397
-
398
- export type EBonusFnShipInput = {
399
- ship_id: number;
400
- ctype: number;
401
- stype: number;
402
- yomi: string;
403
- };
404
-
405
- export type EBonuses = {
406
- firepower: number;
407
- torpedo: number;
408
- anti_air: number;
409
- armor: number;
410
- evasion: number;
411
- asw: number;
412
- los: number;
413
- bombing: number;
414
- accuracy: number;
415
- range: number;
416
- };
417
-
418
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
419
-
420
- export type AirState =
421
- | "AirSupremacy"
422
- | "AirSuperiority"
423
- | "AirParity"
424
- | "AirDenial"
425
- | "AirIncapability";
426
-
427
- export type ShellingSupportSimulatorParams = {
428
- attacker_formation: Formation;
429
- target_formation: Formation;
430
- engagement: Engagement;
431
- custom_mods: CustomModifiers;
432
- };
433
-
434
- export type NightSituation = {
435
- night_contact_rank: ContactRank | null;
436
- starshell: boolean;
437
- searchlight: boolean;
438
- };
439
-
440
- export type AttackPower = {
441
- precap: number;
442
- is_capped: boolean;
443
- capped: number;
444
- normal: number;
445
- critical: number;
446
- armor_penetration: number;
447
- remaining_ammo_mod: number;
448
- };
449
-
450
- export type AttackPowerParams = {
451
- basic: number;
452
- cap: number;
453
- precap_mod: AttackPowerModifier;
454
- postcap_mod: AttackPowerModifier;
455
- ap_shell_mod: number | null;
456
- carrier_power: number | null;
457
- proficiency_critical_mod: number | null;
458
- armor_penetration: number;
459
- remaining_ammo_mod: number;
460
- special_enemy_mods: SpecialEnemyModifiers;
461
- custom_mods: CustomModifiers;
462
- };
463
-
464
- export type CustomModifiers = {
465
- precap_mod: AttackPowerModifier;
466
- postcap_mod: AttackPowerModifier;
467
- };
497
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
468
498
 
469
- export type SpecialEnemyModifiers = {
470
- precap_general_mod: AttackPowerModifier;
471
- stype_mod: AttackPowerModifier;
472
- landing_craft_synergy_mod: AttackPowerModifier;
473
- toku_daihatsu_tank_mod: AttackPowerModifier;
474
- m4a1dd_mod: AttackPowerModifier;
475
- honi_mod: AttackPowerModifier;
476
- postcap_general_mod: AttackPowerModifier;
477
- pt_mod: AttackPowerModifier;
478
- };
499
+ export interface MasterEquippable {
500
+ equip_stype: EquipStype[];
501
+ equip_exslot: number[];
502
+ equip_ship: MstEquipShip[];
503
+ equip_exslot_ship: MstEquipExslotShip[];
504
+ }
479
505
 
480
- export type AttackPowerModifier = { a: number; b: number };
506
+ export interface MstEquipExslotShip {
507
+ api_slotitem_id: number;
508
+ api_ship_ids: number[];
509
+ }
481
510
 
482
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
511
+ export interface MstEquipShip {
512
+ api_ship_id: number;
513
+ api_equip_type: number[];
514
+ }
483
515
 
484
- export type FleetCutinAnalysis = {
485
- shelling: FleetCutinInfo[];
486
- night: FleetCutinInfo[];
487
- };
516
+ export interface EquipStype {
517
+ id: number;
518
+ equip_type: number[];
519
+ }
488
520
 
489
- export type FleetCutinInfo = {
490
- cutin: FleetCutin;
491
- formation: Formation;
492
- items: FleetCutinInfoItem[];
493
- };
521
+ export interface AttackInfo<AttackType, Cutin> {
522
+ attack_type: AttackType;
523
+ items: AttackInfoItem<Cutin>[];
524
+ damage_state_map: NumMap<DamageState, number> | null;
525
+ }
494
526
 
495
- export type FleetCutinInfoItem = {
496
- ship_id: number;
497
- cutin: FleetCutin;
498
- fleet_cutin_mod: number;
527
+ export interface AttackInfoItem<Cutin> {
528
+ cutin: Cutin;
529
+ rate: number | null;
499
530
  stats: AttackStats;
500
- };
531
+ }
532
+
533
+ export interface AttackStats {
534
+ attack_power: AttackPower | null;
535
+ attack_power_params: AttackPowerParams | null;
536
+ hits: number;
537
+ hit_rate: HitRate | null;
538
+ hit_rate_params: HitRateParams | null;
539
+ damage: DamageInfo | null;
540
+ }
501
541
 
502
- export type CompAntiAirInfo = {
542
+ export interface CompAntiAirInfo {
503
543
  fleet_adjusted_anti_air: number;
504
544
  ships: ShipAntiAirInfo[];
505
545
  anti_air_cutin_chance: [number, number][];
506
- };
546
+ }
507
547
 
508
- export type ShipAntiAirInfo = {
548
+ export interface ShipAntiAirInfo {
509
549
  ship_id: number;
510
550
  adjusted_anti_air: number | null;
511
551
  proportional_shotdown_rate: number | null;
@@ -513,42 +553,72 @@ export type ShipAntiAirInfo = {
513
553
  guaranteed: number | null;
514
554
  anti_air_cutin_chance: [number, number][];
515
555
  anti_air_propellant_barrage_chance: number | null;
516
- };
556
+ }
517
557
 
518
- export type CompContactChanceInfo = {
519
- single: AirstrikeContactChance[] | null;
520
- combined: AirstrikeContactChance[] | null;
521
- };
558
+ export type Side = "Player" | "Enemy";
522
559
 
523
- export type AirstrikeContactChance = {
524
- air_state: AirState;
525
- trigger_rate: number;
526
- rank3: number;
527
- rank2: number;
528
- rank1: number;
529
- total: number;
530
- };
560
+ export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
531
561
 
532
- import * as bindings from "../bindings";
533
- export * from "../bindings";
562
+ export type NightSpecialAttack =
563
+ | { NightCutin: NightCutin }
564
+ | { FleetCutin: FleetCutin };
534
565
 
535
- export type Formation = SingleFormation | CombinedFormation;
566
+ export type NightCutin =
567
+ | "MainTorpRadar"
568
+ | "TorpLookoutRadar"
569
+ | "TorpTsloTorp"
570
+ | "TorpTsloDrum"
571
+ | "DoubleAttack"
572
+ | "TorpTorpMain"
573
+ | "TorpTorpTorp"
574
+ | "MainMainSec"
575
+ | "MainMainMain"
576
+ | "SubTorpTorp"
577
+ | "SubRadarTorp"
578
+ | "Cvci1_25"
579
+ | "Cvci1_20"
580
+ | "Cvci1_18"
581
+ | "Photobomber";
536
582
 
537
- export type CombinedFormation =
538
- | "Cruising1"
539
- | "Cruising2"
540
- | "Cruising3"
541
- | "Cruising4";
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_resistance?: number;
605
+ fleet_anti_air_resistance?: number;
606
+ }
542
607
 
543
- export type SingleFormation =
544
- | "LineAhead"
545
- | "DoubleLine"
546
- | "Diamond"
547
- | "Echelon"
548
- | "LineAbreast"
549
- | "Vanguard";
608
+ export interface HitRate {
609
+ total: number;
610
+ normal: number;
611
+ critical: number;
612
+ }
550
613
 
551
- export type ShellingAttackType = "Normal" | "Carrier";
614
+ export interface HitRateParams {
615
+ accuracy_term: number;
616
+ evasion_term: number;
617
+ target_morale_mod: number;
618
+ critical_rate_constant: number;
619
+ critical_percentage_bonus: number;
620
+ hit_percentage_bonus: number;
621
+ }
552
622
 
553
623
  export type NightBattleAttackType =
554
624
  | { t: "NightAttack"; c: NightAttackType }
@@ -558,34 +628,37 @@ export type DayBattleAttackType =
558
628
  | { t: "Shelling"; c: ShellingAttackType }
559
629
  | { t: "Asw"; c: AswAttackType };
560
630
 
561
- export type AttackInfo<AttackType, Cutin> = {
562
- attack_type: AttackType;
563
- items: AttackInfoItem<Cutin>[];
564
- damage_state_map: NumMap<DamageState, number> | null;
565
- };
566
-
567
- export type AttackInfoItem<Cutin> = {
568
- cutin: Cutin;
569
- rate: number | null;
570
- stats: AttackStats;
571
- };
631
+ export interface WarfareInfo {
632
+ day: AttackInfo<DayBattleAttackType, DayCutin | null> | null;
633
+ closing_torpedo: AttackInfo<null, null> | null;
634
+ night: AttackInfo<NightBattleAttackType, NightCutin | null> | null;
635
+ shelling_support: AttackInfo<null, null> | null;
636
+ opening_asw: AttackInfo<null, null> | null;
637
+ }
572
638
 
573
- export type AttackStats = {
574
- attack_power: AttackPower | null;
575
- attack_power_params: AttackPowerParams | null;
576
- hits: number;
577
- hit_rate: HitRate | null;
578
- hit_rate_params: HitRateParams | null;
579
- damage: DamageInfo | null;
580
- };
639
+ export interface WarfareAnalyzerContext {
640
+ attacker_env: WarfareAnalyzerShipEnvironment;
641
+ target_env: WarfareAnalyzerShipEnvironment;
642
+ engagement: Engagement;
643
+ air_state: AirState;
644
+ }
581
645
 
582
- export type SlotSizeVec = (number | null)[];
646
+ export interface WarfareAnalyzerShipEnvironment {
647
+ org_type: OrgType;
648
+ role: Role;
649
+ ship_index: number;
650
+ fleet_len: number;
651
+ formation: Formation;
652
+ fleet_los_mod: number | null;
653
+ night_situation: NightSituation;
654
+ custom_mods: CustomModifiers;
655
+ }
583
656
 
584
657
  export type ShipStateMap = Record<ShipKey, ShipState>;
585
658
 
586
659
  export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
587
660
 
588
- export type OrgState = {
661
+ export interface OrgState {
589
662
  id?: string;
590
663
  f1?: FleetState;
591
664
  f2?: FleetState;
@@ -599,9 +672,9 @@ export type OrgState = {
599
672
  sortie?: string;
600
673
  route_sup?: string;
601
674
  boss_sup?: string;
602
- };
675
+ }
603
676
 
604
- export type AirSquadronState = {
677
+ export interface AirSquadronState {
605
678
  id?: string;
606
679
  mode?: AirSquadronMode;
607
680
  g1?: GearState;
@@ -615,11 +688,11 @@ export type AirSquadronState = {
615
688
  ss3?: number;
616
689
  ss4?: number;
617
690
  ss5?: number;
618
- };
691
+ }
619
692
 
620
693
  export type AirSquadronMode = "Sortie" | "AirDefense";
621
694
 
622
- export type FleetState = {
695
+ export interface FleetState {
623
696
  id?: string;
624
697
  len?: number;
625
698
  s1?: ShipState;
@@ -629,9 +702,9 @@ export type FleetState = {
629
702
  s5?: ShipState;
630
703
  s6?: ShipState;
631
704
  s7?: ShipState;
632
- };
705
+ }
633
706
 
634
- export type ShipState = {
707
+ export interface ShipState {
635
708
  id?: string;
636
709
  ship_id: number;
637
710
  level?: number;
@@ -659,53 +732,18 @@ export type ShipState = {
659
732
  ss3?: number;
660
733
  ss4?: number;
661
734
  ss5?: number;
662
- };
735
+ }
663
736
 
664
- export type GearState = {
737
+ export interface GearState {
665
738
  id?: string;
666
739
  gear_id: number;
667
740
  exp?: number;
668
741
  stars?: number;
669
- };
670
-
671
- export type HitRate = { total: number; normal: number; critical: number };
672
-
673
- export type HitRateParams = {
674
- accuracy_term: number;
675
- evasion_term: number;
676
- target_morale_mod: number;
677
- critical_rate_constant: number;
678
- critical_percentage_bonus: number;
679
- hit_percentage_bonus: number;
680
- };
681
-
682
- export type WarfareInfo = {
683
- day: AttackInfo<DayBattleAttackType, DayCutin | null> | null;
684
- closing_torpedo: AttackInfo<null, null> | null;
685
- night: AttackInfo<NightBattleAttackType, NightCutin | null> | null;
686
- shelling_support: AttackInfo<null, null> | null;
687
- opening_asw: AttackInfo<null, null> | null;
688
- };
689
-
690
- export type WarfareAnalyzerContext = {
691
- attacker_env: WarfareAnalyzerShipEnvironment;
692
- target_env: WarfareAnalyzerShipEnvironment;
693
- engagement: Engagement;
694
- air_state: AirState;
695
- };
742
+ }
696
743
 
697
- export type WarfareAnalyzerShipEnvironment = {
698
- org_type: OrgType;
699
- role: Role;
700
- ship_index: number;
701
- fleet_len: number;
702
- formation: Formation;
703
- fleet_los_mod: number | null;
704
- night_situation: NightSituation;
705
- custom_mods: CustomModifiers;
706
- };
744
+ export type GearTypeIdArray = [number, number, number, number, number];
707
745
 
708
- export type Side = "Player" | "Enemy";
746
+ export type SlotSizeVec = (number | null)[];
709
747
 
710
748
  export type SpecialEnemyType =
711
749
  | "None"
@@ -724,71 +762,85 @@ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
724
762
 
725
763
  export type SpeedGroup = "A" | "B1" | "B2" | "C";
726
764
 
727
- export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
728
-
729
- export type NightSpecialAttack =
730
- | { NightCutin: NightCutin }
731
- | { FleetCutin: FleetCutin };
732
-
733
- export type NightCutin =
734
- | "MainTorpRadar"
735
- | "TorpLookoutRadar"
736
- | "TorpTsloTorp"
737
- | "TorpTsloDrum"
738
- | "DoubleAttack"
739
- | "TorpTorpMain"
740
- | "TorpTorpTorp"
741
- | "MainMainSec"
742
- | "MainMainMain"
743
- | "SubTorpTorp"
744
- | "SubRadarTorp"
745
- | "Cvci1_25"
746
- | "Cvci1_20"
747
- | "Cvci1_18"
748
- | "Photobomber";
749
-
750
765
  export type FleetCutin =
751
766
  | "NelsonTouch"
752
767
  | "NagatoCutin"
753
768
  | "ColoradoCutin"
754
769
  | "KongouCutin";
755
770
 
756
- export type BattleConfig = {
757
- formation: NestedFormationDef[];
758
- anti_air_cutin: AntiAirCutinDef[];
759
- day_cutin: DayCutinDef[];
760
- night_cutin: NightCutinDef[];
761
- };
771
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
772
+
773
+ export interface SimulatorResult {
774
+ items: SimulatorResultItem[];
775
+ sunk_vec: [number, number, number][];
776
+ }
777
+
778
+ export interface SimulatorResultItem {
779
+ id: string;
780
+ role: Role;
781
+ index: number;
782
+ damage_state_map: Record<DamageState, number>;
783
+ }
784
+
785
+ export interface FleetNightCutinRateInfo {
786
+ night_contact_chance: NightContactChance;
787
+ ships: ShipNightCutinRateInfo[];
788
+ }
789
+
790
+ export interface ShipNightCutinRateInfo {
791
+ ship_id: number;
792
+ normal: NightCutinRateInfo;
793
+ chuuha: NightCutinRateInfo;
794
+ }
762
795
 
763
- export type NightCutinDef = {
796
+ export interface NightCutinRateInfo {
797
+ cutin_term: number | null;
798
+ rates: [NightCutin | null, number | null][];
799
+ }
800
+
801
+ export interface NightContactChance {
802
+ rank1: number;
803
+ rank2: number;
804
+ rank3: number;
805
+ total: number;
806
+ }
807
+
808
+ export interface BattleConfig {
809
+ formation: Record<Formation, NestedFormationDef>;
810
+ anti_air_cutin: Record<number, AntiAirCutinDef>;
811
+ day_cutin: Record<DayCutin, DayCutinDef>;
812
+ night_cutin: Record<NightCutin, NightCutinDef>;
813
+ }
814
+
815
+ export interface NightCutinDef {
764
816
  tag: NightCutin;
765
817
  hits: number;
766
818
  chance_denom: number | null;
767
819
  power_mod: number | null;
768
820
  accuracy_mod: number | null;
769
- };
821
+ }
770
822
 
771
- export type DayCutinDef = {
823
+ export interface DayCutinDef {
772
824
  tag: DayCutin;
773
825
  hits: number;
774
826
  chance_denom: number | null;
775
827
  power_mod: number | null;
776
828
  accuracy_mod: number | null;
777
- };
829
+ }
778
830
 
779
- export type AntiAirCutinDef = {
831
+ export interface AntiAirCutinDef {
780
832
  id: number;
781
833
  chance_numer: number | null;
782
834
  multiplier: number | null;
783
835
  guaranteed: number | null;
784
836
  sequential: boolean | null;
785
- };
837
+ }
786
838
 
787
839
  export type NestedFormationDef =
788
840
  | FormationDef
789
841
  | { top_half: FormationDef; bottom_half: FormationDef };
790
842
 
791
- export type FormationDef = {
843
+ export interface FormationDef {
792
844
  tag: Formation;
793
845
  protection_rate: number | null;
794
846
  fleet_anti_air_mod: number;
@@ -797,36 +849,17 @@ export type FormationDef = {
797
849
  asw: FormationWarfareDef;
798
850
  night: FormationWarfareDef;
799
851
  shelling_support: FormationWarfareDef;
800
- };
852
+ }
801
853
 
802
- export type FormationWarfareDef = {
854
+ export interface FormationWarfareDef {
803
855
  power_mod: number | null;
804
856
  accuracy_mod: number | null;
805
857
  evasion_mod: number | null;
806
- };
807
-
808
- export type FleetNightCutinRateInfo = {
809
- night_contact_chance: NightContactChance;
810
- ships: ShipNightCutinRateInfo[];
811
- };
812
-
813
- export type ShipNightCutinRateInfo = {
814
- ship_id: number;
815
- normal: NightCutinRateInfo;
816
- chuuha: NightCutinRateInfo;
817
- };
858
+ }
818
859
 
819
- export type NightCutinRateInfo = {
820
- cutin_term: number | null;
821
- rates: [NightCutin | null, number | null][];
822
- };
860
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
823
861
 
824
- export type NightContactChance = {
825
- rank1: number;
826
- rank2: number;
827
- rank3: number;
828
- total: number;
829
- };
862
+ export type AswAttackType = "DepthCharge" | "Aircraft";
830
863
 
831
864
  /**
832
865
  */
@@ -1038,10 +1071,10 @@ export class Comp {
1038
1071
  export class FhCore {
1039
1072
  free(): void;
1040
1073
  /**
1041
- * @param {any} js_master
1074
+ * @param {MasterData} js_master
1042
1075
  * @param {Function} js_fn
1043
1076
  */
1044
- constructor(js_master: any, js_fn: Function);
1077
+ constructor(js_master: MasterData, js_fn: Function);
1045
1078
  /**
1046
1079
  * @param {GearState | undefined} input
1047
1080
  * @returns {Gear | undefined}