fleethub-core 1.3.1 → 1.4.0

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