fleethub-core 1.3.0 → 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.
@@ -1,102 +1,56 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * @param {Gear} gear
5
- * @returns {boolean}
6
- */
7
- export function air_squadron_can_equip(gear: Gear): boolean;
8
3
  /**
9
4
  */
10
5
  export function set_panic_hook(): void;
11
- /**
12
- * @param {OrgType} org_type
13
- * @returns {boolean}
14
- */
15
- export function org_type_is_single(org_type: OrgType): boolean;
16
- /**
17
- * @param {OrgType} org_type
18
- * @returns {Formation}
19
- */
20
- export function org_type_default_formation(org_type: OrgType): Formation;
21
- /**
22
- * @param {OrgType} org_type
23
- * @returns {boolean}
24
- */
25
- export function org_type_is_player(org_type: OrgType): boolean;
26
- /**
27
- * @param {OrgType} org_type
28
- * @returns {Side}
29
- */
30
- export function org_type_side(org_type: OrgType): Side;
31
- export type CompDayCutinRateInfo = {
32
- main: FleetDayCutinRateInfo;
33
- escort: FleetDayCutinRateInfo | null;
34
- };
35
-
36
- export type FleetDayCutinRateInfo = {
37
- fleet_los_mod: number | null;
38
- ships: ShipDayCutinRateInfo[];
39
- };
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
+ }
40
23
 
41
- export type ShipDayCutinRateInfo = {
24
+ export interface EBonusFnShipInput {
42
25
  ship_id: number;
43
- air_supremacy: DayCutinRateInfo;
44
- air_superiority: DayCutinRateInfo;
45
- };
46
-
47
- export type DayCutinRateInfo = {
48
- observation_term: number | null;
49
- rates: [DayCutin | null, number | null][];
50
- total_cutin_rate: number | null;
51
- };
52
-
53
- export type DamageInfo = {
54
- miss_damage_min: number;
55
- miss_damage_max: number;
56
- normal_damage_min: number;
57
- normal_damage_max: number;
58
- critical_damage_min: number;
59
- critical_damage_max: number;
60
- normal_scratch_rate: number;
61
- critical_scratch_rate: number;
62
- damage_map: NumMap<number, number>;
63
- damage_state_map: NumMap<DamageState, number>;
64
- };
65
-
66
- export type GearTypes = [number, number, number, number, number];
67
-
68
- export type MasterGear = {
69
- gear_id: number;
70
- name: string;
71
- types: GearTypes;
72
- special_type?: number;
73
- max_hp?: number;
74
- firepower?: number;
75
- armor?: number;
76
- torpedo?: number;
77
- anti_air?: number;
78
- speed?: number;
79
- bombing?: number;
80
- asw?: number;
81
- los?: number;
82
- luck?: number;
83
- accuracy?: number;
84
- evasion?: number;
85
- range?: number;
86
- radius?: number;
87
- cost?: number;
88
- improvable?: boolean;
89
- adjusted_anti_air_resistance?: number;
90
- fleet_anti_air_resistance?: number;
91
- };
26
+ ctype: number;
27
+ stype: number;
28
+ yomi: string;
29
+ }
92
30
 
93
- export type MasterVariantDef = { tag: string; id: number; name: string };
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
+ }
94
43
 
95
- export type MasterAttrRule = { tag: string; name: string; expr: string };
44
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
96
45
 
97
- export type MasterIBonusRule = { expr: string; formula: string };
46
+ export type AirState =
47
+ | "AirSupremacy"
48
+ | "AirSuperiority"
49
+ | "AirParity"
50
+ | "AirDenial"
51
+ | "AirIncapability";
98
52
 
99
- export type MasterIBonuses = {
53
+ export interface MasterIBonuses {
100
54
  shelling_power: MasterIBonusRule[];
101
55
  carrier_shelling_power: MasterIBonusRule[];
102
56
  shelling_accuracy: MasterIBonusRule[];
@@ -110,197 +64,61 @@ export type MasterIBonuses = {
110
64
  defense_power: MasterIBonusRule[];
111
65
  contact_selection: MasterIBonusRule[];
112
66
  fighter_power: MasterIBonusRule[];
113
- adjusted_anti_air: MasterIBonusRule[];
67
+ ship_anti_air: MasterIBonusRule[];
114
68
  fleet_anti_air: MasterIBonusRule[];
115
69
  elos: MasterIBonusRule[];
116
- };
117
-
118
- export type StatInterval = [number | null, number | null];
119
-
120
- export type MasterShip = {
121
- ship_id: number;
122
- name: string;
123
- yomi: string;
124
- stype: number;
125
- ctype: number;
126
- sort_id?: number;
127
- max_hp: StatInterval;
128
- firepower: StatInterval;
129
- armor: StatInterval;
130
- torpedo: StatInterval;
131
- evasion: StatInterval;
132
- anti_air: StatInterval;
133
- asw: StatInterval;
134
- los: StatInterval;
135
- luck: StatInterval;
136
- speed: number;
137
- range?: number;
138
- fuel?: number;
139
- ammo?: number;
140
- next_id?: number;
141
- next_level?: number;
142
- slotnum: number;
143
- slots: Array<number | null>;
144
- stock: Array<GearState>;
145
- speed_group?: SpeedGroup;
146
- useful?: boolean;
147
- };
148
-
149
- export type EquipStype = { id: number; equip_type: number[] };
150
-
151
- export type MstEquipShip = { api_ship_id: number; api_equip_type: number[] };
152
-
153
- export type MstEquipExslotShip = {
154
- api_slotitem_id: number;
155
- api_ship_ids: number[];
156
- };
157
-
158
- export type MasterEquippable = {
159
- equip_stype: EquipStype[];
160
- equip_exslot: number[];
161
- equip_ship: MstEquipShip[];
162
- equip_exslot_ship: MstEquipExslotShip[];
163
- };
164
-
165
- export type MasterData = {
166
- gears: MasterGear[];
167
- gear_attrs: MasterAttrRule[];
168
- ships: MasterShip[];
169
- ship_attrs: MasterAttrRule[];
170
- equippable: MasterEquippable;
171
- ibonuses: MasterIBonuses;
172
- config: BattleConfig;
173
- };
174
-
175
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
176
-
177
- export type SimulatorResult = {
178
- items: SimulatorResultItem[];
179
- sunk_vec: [number, number, number][];
180
- };
181
-
182
- export type SimulatorResultItem = {
183
- id: string;
184
- role: Role;
185
- index: number;
186
- damage_state_map: Record<DamageState, number>;
187
- };
188
-
189
- export type AswAttackType = "DepthCharge" | "Aircraft";
190
-
191
- export type SpecialEnemyType =
192
- | "None"
193
- | "SoftSkinned"
194
- | "Pillbox"
195
- | "IsolatedIsland"
196
- | "SupplyDepot"
197
- | "HarbourSummerPrincess"
198
- | "PtImp"
199
- | "BattleshipSummerPrincess"
200
- | "HeavyCruiserSummerPrincess";
201
-
202
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
203
-
204
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
70
+ }
205
71
 
206
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
72
+ export interface MasterIBonusRule {
73
+ expr: CompiledEvaler;
74
+ formula: CompiledEvaler;
75
+ }
207
76
 
208
- export type ShipAttr =
209
- | "Abyssal"
210
- | "NightCarrier"
211
- | "Installation"
212
- | "RoyalNavy"
213
- | "Kai2"
214
- | "TurbineSpeedBonus"
215
- | "Pillbox"
216
- | "IsolatedIsland"
217
- | "HarbourSummerPrincess"
218
- | "SupplyDepot"
219
- | "PtImp"
220
- | "BattleshipSummerPrincess"
221
- | "HeavyCruiserSummerPrincess";
77
+ export interface NightSituation {
78
+ night_contact_rank: ContactRank | null;
79
+ starshell: boolean;
80
+ searchlight: boolean;
81
+ }
222
82
 
223
- export type ShipType =
224
- | "Unknown"
225
- | "DE"
226
- | "DD"
227
- | "CL"
228
- | "CLT"
229
- | "CA"
230
- | "CAV"
231
- | "CVL"
232
- | "FBB"
233
- | "BB"
234
- | "BBV"
235
- | "CV"
236
- | "XBB"
237
- | "SS"
238
- | "SSV"
239
- | "AP"
240
- | "AV"
241
- | "LHA"
242
- | "CVB"
243
- | "AR"
244
- | "AS"
245
- | "CT"
246
- | "AO";
83
+ export interface DamageInfo {
84
+ miss_damage_min: number;
85
+ miss_damage_max: number;
86
+ normal_damage_min: number;
87
+ normal_damage_max: number;
88
+ critical_damage_min: number;
89
+ critical_damage_max: number;
90
+ normal_scratch_rate: number;
91
+ critical_scratch_rate: number;
92
+ damage_map: NumMap<number, number>;
93
+ damage_state_map: NumMap<DamageState, number>;
94
+ }
247
95
 
248
- export type ShipCategory =
249
- | "Battleship"
250
- | "AircraftCarrier"
251
- | "HeavyCruiser"
252
- | "LightCruiser"
253
- | "Destroyer"
254
- | "CoastalDefenseShip"
255
- | "Submarine"
256
- | "AuxiliaryShip";
96
+ export type OrgType =
97
+ | "Single"
98
+ | "CarrierTaskForce"
99
+ | "SurfaceTaskForce"
100
+ | "TransportEscort"
101
+ | "EnemySingle"
102
+ | "EnemyCombined";
257
103
 
258
- export type WarfareContext = {
104
+ export interface WarfareContext {
259
105
  attacker_env: WarfareShipEnvironment;
260
106
  target_env: WarfareShipEnvironment;
261
107
  engagement: Engagement;
262
108
  air_state: AirState;
263
109
  custom_mods: CustomModifiers;
264
- };
110
+ }
265
111
 
266
- export type WarfareShipEnvironment = {
112
+ export interface WarfareShipEnvironment {
267
113
  org_type: OrgType;
268
114
  role: Role;
269
115
  ship_index: number;
270
116
  fleet_len: number;
271
117
  formation: Formation;
272
118
  fleet_los_mod: number | null;
273
- };
274
-
275
- export type ShellingSpecialAttack =
276
- | { DayCutin: DayCutin }
277
- | { FleetCutin: FleetCutin };
278
-
279
- export type DayCutin =
280
- | "MainMain"
281
- | "MainAp"
282
- | "MainRadar"
283
- | "MainSec"
284
- | "DoubleAttack"
285
- | "FBA"
286
- | "BBA"
287
- | "BA"
288
- | "Zuiun"
289
- | "AirSea";
290
-
291
- export type CompMeta = { fleets: Record<FleetType, FleetMeta> };
292
-
293
- export type FleetMeta = {
294
- id: string;
295
- len: number;
296
- ships: [string, ShipMeta | null][];
297
- };
298
-
299
- export type ShipMeta = { id: string; ship_id: number };
300
-
301
- export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
119
+ }
302
120
 
303
- export type AttackPower = {
121
+ export interface AttackPower {
304
122
  precap: number;
305
123
  is_capped: boolean;
306
124
  capped: number;
@@ -308,9 +126,9 @@ export type AttackPower = {
308
126
  critical: number;
309
127
  armor_penetration: number;
310
128
  remaining_ammo_mod: number;
311
- };
129
+ }
312
130
 
313
- export type AttackPowerParams = {
131
+ export interface AttackPowerParams {
314
132
  basic: number;
315
133
  cap: number;
316
134
  precap_mod: AttackPowerModifier;
@@ -322,14 +140,14 @@ export type AttackPowerParams = {
322
140
  remaining_ammo_mod: number;
323
141
  special_enemy_mods: SpecialEnemyModifiers;
324
142
  custom_mods: CustomModifiers;
325
- };
143
+ }
326
144
 
327
- export type CustomModifiers = {
145
+ export interface CustomModifiers {
328
146
  precap_mod: AttackPowerModifier;
329
147
  postcap_mod: AttackPowerModifier;
330
- };
148
+ }
331
149
 
332
- export type SpecialEnemyModifiers = {
150
+ export interface SpecialEnemyModifiers {
333
151
  precap_general_mod: AttackPowerModifier;
334
152
  stype_mod: AttackPowerModifier;
335
153
  landing_craft_synergy_mod: AttackPowerModifier;
@@ -338,216 +156,104 @@ export type SpecialEnemyModifiers = {
338
156
  honi_mod: AttackPowerModifier;
339
157
  postcap_general_mod: AttackPowerModifier;
340
158
  pt_mod: AttackPowerModifier;
341
- };
342
-
343
- export type AttackPowerModifier = { a: number; b: number };
344
-
345
- export type EBonusFnGearInput = {
346
- gear_id: number;
347
- types: GearTypes;
348
- firepower: number;
349
- torpedo: number;
350
- anti_air: number;
351
- armor: number;
352
- evasion: number;
353
- asw: number;
354
- los: number;
355
- bombing: number;
356
- accuracy: number;
357
- range: number;
358
- radius: number;
359
- stars: number;
360
- ace: number;
361
- };
362
-
363
- export type EBonusFnShipInput = {
364
- ship_id: number;
365
- ctype: number;
366
- stype: number;
367
- yomi: string;
368
- };
369
-
370
- export type EBonuses = {
371
- firepower: number;
372
- torpedo: number;
373
- anti_air: number;
374
- armor: number;
375
- evasion: number;
376
- asw: number;
377
- los: number;
378
- bombing: number;
379
- accuracy: number;
380
- range: number;
381
- };
159
+ }
382
160
 
383
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
161
+ export interface AttackPowerModifier {
162
+ a: number;
163
+ b: number;
164
+ }
384
165
 
385
- export type AirState =
386
- | "AirSupremacy"
387
- | "AirSuperiority"
388
- | "AirParity"
389
- | "AirDenial"
390
- | "AirIncapability";
166
+ export type NumMap<K, V> = Partial<Record<K, V>>;
391
167
 
392
- export type ShellingSupportSimulatorParams = {
393
- attacker_formation: Formation;
394
- target_formation: Formation;
395
- engagement: Engagement;
396
- custom_mods: CustomModifiers;
397
- };
168
+ export type Role = "Main" | "Escort";
398
169
 
399
- export type NightSituation = {
400
- night_contact_rank: ContactRank | null;
401
- starshell: boolean;
402
- searchlight: boolean;
403
- };
170
+ export interface CompMeta {
171
+ fleets: Record<FleetType, FleetMeta>;
172
+ }
404
173
 
405
- export type GearState = {
406
- id?: string;
407
- gear_id: number;
408
- exp?: number;
409
- stars?: number;
410
- };
174
+ export interface FleetMeta {
175
+ id: string;
176
+ len: number;
177
+ ships: [string, ShipMeta | null][];
178
+ }
411
179
 
412
- export type ShipState = {
413
- id?: string;
180
+ export interface ShipMeta {
181
+ id: string;
414
182
  ship_id: number;
415
- level?: number;
416
- current_hp?: number;
417
- morale?: number;
418
- ammo?: number;
419
- fuel?: number;
420
- max_hp_mod?: number;
421
- firepower_mod?: number;
422
- torpedo_mod?: number;
423
- armor_mod?: number;
424
- anti_air_mod?: number;
425
- evasion_mod?: number;
426
- asw_mod?: number;
427
- los_mod?: number;
428
- luck_mod?: number;
429
- g1?: GearState;
430
- g2?: GearState;
431
- g3?: GearState;
432
- g4?: GearState;
433
- g5?: GearState;
434
- gx?: GearState;
435
- ss1?: number;
436
- ss2?: number;
437
- ss3?: number;
438
- ss4?: number;
439
- ss5?: number;
440
- };
441
-
442
- export type FleetState = {
443
- id?: string;
444
- len?: number;
445
- s1?: ShipState;
446
- s2?: ShipState;
447
- s3?: ShipState;
448
- s4?: ShipState;
449
- s5?: ShipState;
450
- s6?: ShipState;
451
- s7?: ShipState;
452
- };
453
-
454
- export type AirSquadronMode = "Sortie" | "AirDefense";
455
-
456
- export type AirSquadronState = {
457
- id?: string;
458
- mode?: AirSquadronMode;
459
- g1?: GearState;
460
- g2?: GearState;
461
- g3?: GearState;
462
- g4?: GearState;
463
- g5?: GearState;
464
- gx?: GearState;
465
- ss1?: number;
466
- ss2?: number;
467
- ss3?: number;
468
- ss4?: number;
469
- ss5?: number;
470
- };
471
-
472
- export type Side = "Player" | "Enemy";
473
-
474
- export type OrgType =
475
- | "Single"
476
- | "CarrierTaskForce"
477
- | "SurfaceTaskForce"
478
- | "TransportEscort"
479
- | "EnemySingle"
480
- | "EnemyCombined";
183
+ }
481
184
 
482
- export type Role = "Main" | "Escort";
185
+ export interface CompDayCutinRateInfo {
186
+ main: FleetDayCutinRateInfo;
187
+ escort: FleetDayCutinRateInfo | null;
188
+ }
483
189
 
484
- export type OrgState = {
485
- id?: string;
486
- f1?: FleetState;
487
- f2?: FleetState;
488
- f3?: FleetState;
489
- f4?: FleetState;
490
- a1?: AirSquadronState;
491
- a2?: AirSquadronState;
492
- a3?: AirSquadronState;
493
- hq_level?: number;
494
- org_type?: OrgType;
495
- sortie?: string;
496
- route_sup?: string;
497
- boss_sup?: string;
498
- };
190
+ export interface FleetDayCutinRateInfo {
191
+ fleet_los_mod: number | null;
192
+ ships: ShipDayCutinRateInfo[];
193
+ }
499
194
 
500
- export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
195
+ export interface ShipDayCutinRateInfo {
196
+ ship_id: number;
197
+ air_supremacy: DayCutinRateInfo;
198
+ air_superiority: DayCutinRateInfo;
199
+ }
501
200
 
502
- export type ShipStateMap = Record<ShipKey, ShipState>;
201
+ export interface DayCutinRateInfo {
202
+ observation_term: number | null;
203
+ rates: [DayCutin | null, number | null][];
204
+ total_cutin_rate: number | null;
205
+ }
503
206
 
504
- export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
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";
505
231
 
506
- export type CompAntiAirInfo = {
507
- fleet_anti_air: number;
508
- ships: ShipAntiAirInfo[];
509
- anti_air_cutin_chance: [number, number][];
510
- };
232
+ export type ShipCategory =
233
+ | "Battleship"
234
+ | "AircraftCarrier"
235
+ | "HeavyCruiser"
236
+ | "LightCruiser"
237
+ | "Destroyer"
238
+ | "CoastalDefenseShip"
239
+ | "Submarine"
240
+ | "AuxiliaryShip";
511
241
 
512
- export type ShipAntiAirInfo = {
513
- ship_id: number;
514
- adjusted_anti_air: number | null;
515
- proportional_shotdown_rate: number | null;
516
- fixed_shotdown_number: number | null;
517
- minimum_bonus: number | null;
518
- anti_air_cutin_chance: [number, number][];
519
- anti_air_propellant_barrage_chance: number | null;
520
- };
242
+ export type ShellingSpecialAttack =
243
+ | { DayCutin: DayCutin }
244
+ | { FleetCutin: FleetCutin };
521
245
 
522
- export type GearAttr =
523
- | "Abyssal"
524
- | "HighAngleMount"
525
- | "NightFighter"
526
- | "NightAttacker"
527
- | "HeavyBomber"
528
- | "MainGun"
529
- | "Radar"
530
- | "SurfaceRadar"
531
- | "AirRadar"
532
- | "DepthChargeProjector"
533
- | "AdditionalDepthCharge"
534
- | "AntiSubMortar"
535
- | "AntiSubWeapon"
536
- | "AntiSubAircraft"
537
- | "LateModelBowTorpedo"
538
- | "Seaplane"
539
- | "CbAircraft"
540
- | "LbAircraft"
541
- | "JetAircraft"
542
- | "Fighter"
543
- | "Recon"
544
- | "ObservationSeaplane"
545
- | "CbFighterBomber"
546
- | "AntiInstDiveBomber"
547
- | "NightRecon"
548
- | "CbSwordfish"
549
- | "SemiNightPlane"
550
- | "HighAltitudeInterceptor";
246
+ export type DayCutin =
247
+ | "MainMain"
248
+ | "MainAp"
249
+ | "MainRadar"
250
+ | "MainSec"
251
+ | "DoubleAttack"
252
+ | "FBA"
253
+ | "BBA"
254
+ | "BA"
255
+ | "Zuiun"
256
+ | "AirSea";
551
257
 
552
258
  export type GearCategory =
553
259
  | "Fighter"
@@ -624,6 +330,89 @@ export type GearType =
624
330
  | "LargeRadar2"
625
331
  | "CbRecon2";
626
332
 
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];
399
+
400
+ export type ShipAttr =
401
+ | "Unknown"
402
+ | "Abyssal"
403
+ | "NightCarrier"
404
+ | "Installation"
405
+ | "RoyalNavy"
406
+ | "Kai2"
407
+ | "TurbineSpeedBonus"
408
+ | "Pillbox"
409
+ | "IsolatedIsland"
410
+ | "HarbourSummerPrincess"
411
+ | "SupplyDepot"
412
+ | "PtImp"
413
+ | "BattleshipSummerPrincess"
414
+ | "HeavyCruiserSummerPrincess";
415
+
627
416
  export type Formation = SingleFormation | CombinedFormation;
628
417
 
629
418
  export type CombinedFormation =
@@ -640,71 +429,133 @@ export type SingleFormation =
640
429
  | "LineAbreast"
641
430
  | "Vanguard";
642
431
 
643
- export type FleetCutinAnalysis = {
432
+ export type ShellingAttackType = "Normal" | "Carrier";
433
+
434
+ export interface FleetCutinAnalysis {
644
435
  shelling: FleetCutinInfo[];
645
436
  night: FleetCutinInfo[];
646
- };
437
+ }
438
+
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
+ }
465
+
466
+ export type GearAttr =
467
+ | "Unknown"
468
+ | "Abyssal"
469
+ | "HighAngleMount"
470
+ | "NightFighter"
471
+ | "NightAttacker"
472
+ | "HeavyBomber"
473
+ | "MainGun"
474
+ | "Radar"
475
+ | "SurfaceRadar"
476
+ | "AirRadar"
477
+ | "DepthChargeProjector"
478
+ | "AdditionalDepthCharge"
479
+ | "AntiSubMortar"
480
+ | "AntiSubWeapon"
481
+ | "AntiSubAircraft"
482
+ | "LateModelBowTorpedo"
483
+ | "Seaplane"
484
+ | "CbAircraft"
485
+ | "LbAircraft"
486
+ | "JetAircraft"
487
+ | "Fighter"
488
+ | "Recon"
489
+ | "ObservationSeaplane"
490
+ | "CbFighterBomber"
491
+ | "AntiInstDiveBomber"
492
+ | "NightRecon"
493
+ | "CbSwordfish"
494
+ | "SemiNightPlane"
495
+ | "HighAltitudeInterceptor";
496
+
497
+ export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
498
+
499
+ export interface MasterEquippable {
500
+ equip_stype: EquipStype[];
501
+ equip_exslot: number[];
502
+ equip_ship: MstEquipShip[];
503
+ equip_exslot_ship: MstEquipExslotShip[];
504
+ }
505
+
506
+ export interface MstEquipExslotShip {
507
+ api_slotitem_id: number;
508
+ api_ship_ids: number[];
509
+ }
647
510
 
648
- export type FleetCutinInfo = {
649
- cutin: FleetCutin;
650
- formation: Formation;
651
- items: FleetCutinInfoItem[];
652
- };
511
+ export interface MstEquipShip {
512
+ api_ship_id: number;
513
+ api_equip_type: number[];
514
+ }
653
515
 
654
- export type FleetCutinInfoItem = {
655
- ship_id: number;
656
- cutin: FleetCutin;
657
- fleet_cutin_mod: number;
658
- stats: AttackStats;
659
- };
516
+ export interface EquipStype {
517
+ id: number;
518
+ equip_type: number[];
519
+ }
660
520
 
661
- export type AttackInfo<AttackType, Cutin> = {
521
+ export interface AttackInfo<AttackType, Cutin> {
662
522
  attack_type: AttackType;
663
523
  items: AttackInfoItem<Cutin>[];
664
524
  damage_state_map: NumMap<DamageState, number> | null;
665
- };
525
+ }
666
526
 
667
- export type AttackInfoItem<Cutin> = {
527
+ export interface AttackInfoItem<Cutin> {
668
528
  cutin: Cutin;
669
529
  rate: number | null;
670
530
  stats: AttackStats;
671
- };
531
+ }
672
532
 
673
- export type AttackStats = {
533
+ export interface AttackStats {
674
534
  attack_power: AttackPower | null;
675
535
  attack_power_params: AttackPowerParams | null;
676
536
  hits: number;
677
537
  hit_rate: HitRate | null;
678
538
  hit_rate_params: HitRateParams | null;
679
539
  damage: DamageInfo | null;
680
- };
681
-
682
- export type CompContactChanceInfo = {
683
- single: AirstrikeContactChance[] | null;
684
- combined: AirstrikeContactChance[] | null;
685
- };
686
-
687
- export type AirstrikeContactChance = {
688
- air_state: AirState;
689
- trigger_rate: number;
690
- rank3: number;
691
- rank2: number;
692
- rank1: number;
693
- total: number;
694
- };
695
-
696
- export type ShellingAttackType = "Normal" | "Carrier";
540
+ }
697
541
 
698
- export type NightBattleAttackType =
699
- | { t: "NightAttack"; c: NightAttackType }
700
- | { t: "Asw"; c: AswAttackType };
542
+ export interface CompAntiAirInfo {
543
+ fleet_adjusted_anti_air: number;
544
+ ships: ShipAntiAirInfo[];
545
+ anti_air_cutin_chance: [number, number][];
546
+ }
701
547
 
702
- export type DayBattleAttackType =
703
- | { t: "Shelling"; c: ShellingAttackType }
704
- | { t: "Asw"; c: AswAttackType };
548
+ export interface ShipAntiAirInfo {
549
+ ship_id: number;
550
+ adjusted_anti_air: number | null;
551
+ proportional_shotdown_rate: number | null;
552
+ fixed_shotdown_number: number | null;
553
+ guaranteed: number | null;
554
+ anti_air_cutin_chance: [number, number][];
555
+ anti_air_propellant_barrage_chance: number | null;
556
+ }
705
557
 
706
- import * as bindings from "../bindings";
707
- export * from "../bindings";
558
+ export type Side = "Player" | "Enemy";
708
559
 
709
560
  export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
710
561
 
@@ -729,33 +580,70 @@ export type NightCutin =
729
580
  | "Cvci1_18"
730
581
  | "Photobomber";
731
582
 
732
- export type HitRate = { total: number; normal: number; critical: number };
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
+ }
607
+
608
+ export interface HitRate {
609
+ total: number;
610
+ normal: number;
611
+ critical: number;
612
+ }
733
613
 
734
- export type HitRateParams = {
614
+ export interface HitRateParams {
735
615
  accuracy_term: number;
736
616
  evasion_term: number;
737
617
  target_morale_mod: number;
738
618
  critical_rate_constant: number;
739
619
  critical_percentage_bonus: number;
740
620
  hit_percentage_bonus: number;
741
- };
621
+ }
622
+
623
+ export type NightBattleAttackType =
624
+ | { t: "NightAttack"; c: NightAttackType }
625
+ | { t: "Asw"; c: AswAttackType };
626
+
627
+ export type DayBattleAttackType =
628
+ | { t: "Shelling"; c: ShellingAttackType }
629
+ | { t: "Asw"; c: AswAttackType };
742
630
 
743
- export type WarfareInfo = {
631
+ export interface WarfareInfo {
744
632
  day: AttackInfo<DayBattleAttackType, DayCutin | null> | null;
745
633
  closing_torpedo: AttackInfo<null, null> | null;
746
634
  night: AttackInfo<NightBattleAttackType, NightCutin | null> | null;
747
635
  shelling_support: AttackInfo<null, null> | null;
748
636
  opening_asw: AttackInfo<null, null> | null;
749
- };
637
+ }
750
638
 
751
- export type WarfareAnalyzerContext = {
639
+ export interface WarfareAnalyzerContext {
752
640
  attacker_env: WarfareAnalyzerShipEnvironment;
753
641
  target_env: WarfareAnalyzerShipEnvironment;
754
642
  engagement: Engagement;
755
643
  air_state: AirState;
756
- };
644
+ }
757
645
 
758
- export type WarfareAnalyzerShipEnvironment = {
646
+ export interface WarfareAnalyzerShipEnvironment {
759
647
  org_type: OrgType;
760
648
  role: Role;
761
649
  ship_index: number;
@@ -764,7 +652,115 @@ export type WarfareAnalyzerShipEnvironment = {
764
652
  fleet_los_mod: number | null;
765
653
  night_situation: NightSituation;
766
654
  custom_mods: CustomModifiers;
767
- };
655
+ }
656
+
657
+ export type ShipStateMap = Record<ShipKey, ShipState>;
658
+
659
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
660
+
661
+ export interface OrgState {
662
+ id?: string;
663
+ f1?: FleetState;
664
+ f2?: FleetState;
665
+ f3?: FleetState;
666
+ f4?: FleetState;
667
+ a1?: AirSquadronState;
668
+ a2?: AirSquadronState;
669
+ a3?: AirSquadronState;
670
+ hq_level?: number;
671
+ org_type?: OrgType;
672
+ sortie?: string;
673
+ route_sup?: string;
674
+ boss_sup?: string;
675
+ }
676
+
677
+ export interface AirSquadronState {
678
+ id?: string;
679
+ mode?: AirSquadronMode;
680
+ g1?: GearState;
681
+ g2?: GearState;
682
+ g3?: GearState;
683
+ g4?: GearState;
684
+ g5?: GearState;
685
+ gx?: GearState;
686
+ ss1?: number;
687
+ ss2?: number;
688
+ ss3?: number;
689
+ ss4?: number;
690
+ ss5?: number;
691
+ }
692
+
693
+ export type AirSquadronMode = "Sortie" | "AirDefense";
694
+
695
+ export interface FleetState {
696
+ id?: string;
697
+ len?: number;
698
+ s1?: ShipState;
699
+ s2?: ShipState;
700
+ s3?: ShipState;
701
+ s4?: ShipState;
702
+ s5?: ShipState;
703
+ s6?: ShipState;
704
+ s7?: ShipState;
705
+ }
706
+
707
+ export interface ShipState {
708
+ id?: string;
709
+ ship_id: number;
710
+ level?: number;
711
+ current_hp?: number;
712
+ morale?: number;
713
+ ammo?: number;
714
+ fuel?: number;
715
+ max_hp_mod?: number;
716
+ firepower_mod?: number;
717
+ torpedo_mod?: number;
718
+ armor_mod?: number;
719
+ anti_air_mod?: number;
720
+ evasion_mod?: number;
721
+ asw_mod?: number;
722
+ los_mod?: number;
723
+ luck_mod?: number;
724
+ g1?: GearState;
725
+ g2?: GearState;
726
+ g3?: GearState;
727
+ g4?: GearState;
728
+ g5?: GearState;
729
+ gx?: GearState;
730
+ ss1?: number;
731
+ ss2?: number;
732
+ ss3?: number;
733
+ ss4?: number;
734
+ ss5?: number;
735
+ }
736
+
737
+ export interface GearState {
738
+ id?: string;
739
+ gear_id: number;
740
+ exp?: number;
741
+ stars?: number;
742
+ }
743
+
744
+ export type GearTypeIdArray = [number, number, number, number, number];
745
+
746
+ export type SlotSizeVec = (number | null)[];
747
+
748
+ export type SpecialEnemyType =
749
+ | "None"
750
+ | "SoftSkinned"
751
+ | "Pillbox"
752
+ | "IsolatedIsland"
753
+ | "SupplyDepot"
754
+ | "HarbourSummerPrincess"
755
+ | "PtImp"
756
+ | "BattleshipSummerPrincess"
757
+ | "HeavyCruiserSummerPrincess";
758
+
759
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
760
+
761
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
762
+
763
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
768
764
 
769
765
  export type FleetCutin =
770
766
  | "NelsonTouch"
@@ -772,42 +768,79 @@ export type FleetCutin =
772
768
  | "ColoradoCutin"
773
769
  | "KongouCutin";
774
770
 
775
- export type BattleConfig = {
776
- formation: NestedFormationDef[];
777
- anti_air_cutin: AntiAirCutinDef[];
778
- day_cutin: DayCutinDef[];
779
- night_cutin: NightCutinDef[];
780
- };
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
+ }
795
+
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
+ }
781
807
 
782
- export type NightCutinDef = {
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 {
783
816
  tag: NightCutin;
784
817
  hits: number;
785
818
  chance_denom: number | null;
786
819
  power_mod: number | null;
787
820
  accuracy_mod: number | null;
788
- };
821
+ }
789
822
 
790
- export type DayCutinDef = {
823
+ export interface DayCutinDef {
791
824
  tag: DayCutin;
792
825
  hits: number;
793
826
  chance_denom: number | null;
794
827
  power_mod: number | null;
795
828
  accuracy_mod: number | null;
796
- };
829
+ }
797
830
 
798
- export type AntiAirCutinDef = {
831
+ export interface AntiAirCutinDef {
799
832
  id: number;
800
833
  chance_numer: number | null;
801
834
  multiplier: number | null;
802
- minimum_bonus: number | null;
835
+ guaranteed: number | null;
803
836
  sequential: boolean | null;
804
- };
837
+ }
805
838
 
806
839
  export type NestedFormationDef =
807
840
  | FormationDef
808
841
  | { top_half: FormationDef; bottom_half: FormationDef };
809
842
 
810
- export type FormationDef = {
843
+ export interface FormationDef {
811
844
  tag: Formation;
812
845
  protection_rate: number | null;
813
846
  fleet_anti_air_mod: number;
@@ -816,38 +849,17 @@ export type FormationDef = {
816
849
  asw: FormationWarfareDef;
817
850
  night: FormationWarfareDef;
818
851
  shelling_support: FormationWarfareDef;
819
- };
852
+ }
820
853
 
821
- export type FormationWarfareDef = {
854
+ export interface FormationWarfareDef {
822
855
  power_mod: number | null;
823
856
  accuracy_mod: number | null;
824
857
  evasion_mod: number | null;
825
- };
858
+ }
826
859
 
827
860
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
828
861
 
829
- export type FleetNightCutinRateInfo = {
830
- night_contact_chance: NightContactChance;
831
- ships: ShipNightCutinRateInfo[];
832
- };
833
-
834
- export type ShipNightCutinRateInfo = {
835
- ship_id: number;
836
- normal: NightCutinRateInfo;
837
- chuuha: NightCutinRateInfo;
838
- };
839
-
840
- export type NightCutinRateInfo = {
841
- cutin_term: number | null;
842
- rates: [NightCutin | null, number | null][];
843
- };
844
-
845
- export type NightContactChance = {
846
- rank1: number;
847
- rank2: number;
848
- rank3: number;
849
- total: number;
850
- };
862
+ export type AswAttackType = "DepthCharge" | "Aircraft";
851
863
 
852
864
  /**
853
865
  */
@@ -858,11 +870,6 @@ export class AirSquadron {
858
870
  * @returns {Gear | undefined}
859
871
  */
860
872
  get_gear(key: string): Gear | undefined;
861
- /**
862
- * @param {Gear} gear
863
- * @returns {boolean}
864
- */
865
- can_equip(gear: Gear): boolean;
866
873
  /**
867
874
  * @param {number} index
868
875
  * @returns {number}
@@ -903,7 +910,7 @@ export class Analyzer {
903
910
  /**
904
911
  * @param {Comp} comp
905
912
  * @param {Formation} formation
906
- * @param {number} adjusted_anti_air_resist
913
+ * @param {number} ship_anti_air_resist
907
914
  * @param {number} fleet_anti_air_resist
908
915
  * @param {number | undefined} aaci
909
916
  * @returns {CompAntiAirInfo}
@@ -911,7 +918,7 @@ export class Analyzer {
911
918
  analyze_anti_air(
912
919
  comp: Comp,
913
920
  formation: Formation,
914
- adjusted_anti_air_resist: number,
921
+ ship_anti_air_resist: number,
915
922
  fleet_anti_air_resist: number,
916
923
  aaci?: number
917
924
  ): CompAntiAirInfo;
@@ -1005,11 +1012,11 @@ export class Comp {
1005
1012
  */
1006
1013
  default_formation(): Formation;
1007
1014
  /**
1008
- * 艦隊対空値
1015
+ * 艦隊防空値
1009
1016
  * @param {number} formation_mod
1010
1017
  * @returns {number}
1011
1018
  */
1012
- fleet_anti_air(formation_mod: number): number;
1019
+ adjusted_anti_air(formation_mod: number): number;
1013
1020
  /**
1014
1021
  * 制空値
1015
1022
  * @param {boolean} escort_participates
@@ -1064,10 +1071,10 @@ export class Comp {
1064
1071
  export class FhCore {
1065
1072
  free(): void;
1066
1073
  /**
1067
- * @param {any} js_master
1074
+ * @param {MasterData} js_master
1068
1075
  * @param {Function} js_fn
1069
1076
  */
1070
- constructor(js_master: any, js_fn: Function);
1077
+ constructor(js_master: MasterData, js_fn: Function);
1071
1078
  /**
1072
1079
  * @param {GearState | undefined} input
1073
1080
  * @returns {Gear | undefined}
@@ -1277,11 +1284,11 @@ export class Gear {
1277
1284
  /**
1278
1285
  * @returns {number}
1279
1286
  */
1280
- fleet_anti_air(): number;
1287
+ fleet_anti_air_mod(): number;
1281
1288
  /**
1282
1289
  * @returns {number}
1283
1290
  */
1284
- adjusted_anti_air(): number;
1291
+ ship_anti_air_mod(): number;
1285
1292
  /**
1286
1293
  * @param {number} slot_size
1287
1294
  * @returns {number}
@@ -1327,6 +1334,10 @@ export class Gear {
1327
1334
  * @returns {number}
1328
1335
  */
1329
1336
  expedition_bonus(): number;
1337
+ /**
1338
+ * @returns {boolean}
1339
+ */
1340
+ can_be_deployed_to_land_base(): boolean;
1330
1341
  /**
1331
1342
  */
1332
1343
  accuracy: number;
@@ -1334,9 +1345,6 @@ export class Gear {
1334
1345
  * @returns {number}
1335
1346
  */
1336
1347
  readonly ace: number;
1337
- /**
1338
- */
1339
- adjusted_anti_air_resistance: number;
1340
1348
  /**
1341
1349
  */
1342
1350
  anti_air: number;
@@ -1413,6 +1421,9 @@ export class Gear {
1413
1421
  /**
1414
1422
  */
1415
1423
  range: number;
1424
+ /**
1425
+ */
1426
+ ship_anti_air_resistance: number;
1416
1427
  /**
1417
1428
  * @returns {number}
1418
1429
  */
@@ -1427,9 +1438,8 @@ export class Gear {
1427
1438
  */
1428
1439
  torpedo: number;
1429
1440
  /**
1430
- * @returns {any}
1431
1441
  */
1432
- readonly types: any;
1442
+ types: Uint8Array;
1433
1443
  /**
1434
1444
  */
1435
1445
  xxh3: BigInt;
@@ -1438,9 +1448,6 @@ export class Gear {
1438
1448
  */
1439
1449
  export class IBonuses {
1440
1450
  free(): void;
1441
- /**
1442
- */
1443
- adjusted_anti_air: number;
1444
1451
  /**
1445
1452
  */
1446
1453
  asw_accuracy: number;
@@ -1477,6 +1484,9 @@ export class IBonuses {
1477
1484
  /**
1478
1485
  */
1479
1486
  shelling_power: number;
1487
+ /**
1488
+ */
1489
+ ship_anti_air: number;
1480
1490
  /**
1481
1491
  */
1482
1492
  torpedo_accuracy: number;
@@ -1778,7 +1788,7 @@ export class Ship {
1778
1788
  /**
1779
1789
  * @returns {number}
1780
1790
  */
1781
- fleet_anti_air(): number;
1791
+ fleet_anti_air_mod(): number;
1782
1792
  /**
1783
1793
  * @returns {number}
1784
1794
  */
@@ -1948,6 +1958,9 @@ export class Ship {
1948
1958
  * @returns {number}
1949
1959
  */
1950
1960
  readonly slotnum: number;
1961
+ /**
1962
+ */
1963
+ slots: SlotSizeVec;
1951
1964
  /**
1952
1965
  * @returns {number}
1953
1966
  */