fleethub-core 1.7.3 → 1.7.5

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.
@@ -54,16 +54,43 @@ export type DayCutin =
54
54
  | "Zuiun"
55
55
  | "AirSea";
56
56
 
57
- export interface ShellingSupportSimulatorParams {
58
- attacker_formation: Formation;
59
- target_formation: Formation;
60
- engagement: Engagement;
61
- custom_mods: CustomModifiers;
57
+ export type ShellingAttackType = "Normal" | "Carrier";
58
+
59
+ export interface FleetCutinAnalysis {
60
+ shelling: FleetCutinInfo[];
61
+ night: FleetCutinInfo[];
62
62
  }
63
63
 
64
- export type ShellingAttackType = "Normal" | "Carrier";
64
+ export interface FleetCutinInfo {
65
+ cutin: FleetCutin;
66
+ rate: number | null;
67
+ formation: Formation;
68
+ items: FleetCutinInfoItem[];
69
+ }
65
70
 
66
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
71
+ export interface FleetCutinInfoItem {
72
+ ship_id: number;
73
+ cutin: FleetCutin;
74
+ fleet_cutin_mod: number;
75
+ stats: AttackStats;
76
+ }
77
+
78
+ export type SpecialEnemyType =
79
+ | "None"
80
+ | "SoftSkinned"
81
+ | "Pillbox"
82
+ | "IsolatedIsland"
83
+ | "SupplyDepot"
84
+ | "HarbourSummerPrincess"
85
+ | "PtImp"
86
+ | "BattleshipSummerPrincess"
87
+ | "HeavyCruiserSummerPrincess";
88
+
89
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
90
+
91
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
92
+
93
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
67
94
 
68
95
  export type AswAttackType = "DepthCharge" | "Aircraft";
69
96
 
@@ -83,22 +110,11 @@ export type FleetCutin =
83
110
  | "Yamato2ShipCutin"
84
111
  | "Yamato3ShipCutin";
85
112
 
86
- export interface WarfareContext {
87
- attacker_env: WarfareShipEnvironment;
88
- target_env: WarfareShipEnvironment;
89
- engagement: Engagement;
90
- air_state: AirState;
91
- custom_mods: CustomModifiers;
92
- }
113
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
93
114
 
94
- export interface WarfareShipEnvironment {
95
- org_type: OrgType;
96
- role: Role;
97
- ship_index: number;
98
- fleet_len: number;
99
- formation: Formation;
100
- fleet_los_mod: number | null;
101
- }
115
+ export type NumMap<K, V> = Partial<Record<K, V>>;
116
+
117
+ export type Role = "Main" | "Escort";
102
118
 
103
119
  export interface CompMeta {
104
120
  fleets: Record<FleetType, FleetMeta>;
@@ -115,52 +131,6 @@ export interface ShipMeta {
115
131
  ship_id: number;
116
132
  }
117
133
 
118
- export interface AttackPower {
119
- precap: number;
120
- is_capped: boolean;
121
- capped: number;
122
- normal: number;
123
- critical: number;
124
- armor_penetration: number;
125
- remaining_ammo_mod: number;
126
- }
127
-
128
- export interface AttackPowerParams {
129
- basic: number;
130
- cap: number;
131
- precap_mod: AttackPowerModifier;
132
- postcap_mod: AttackPowerModifier;
133
- ap_shell_mod: number | null;
134
- carrier_power: number | null;
135
- proficiency_critical_mod: number | null;
136
- armor_penetration: number;
137
- remaining_ammo_mod: number;
138
- special_enemy_mods: SpecialEnemyModifiers;
139
- custom_mods: CustomModifiers;
140
- }
141
-
142
- export interface CustomModifiers {
143
- precap_mod?: AttackPowerModifier;
144
- postcap_mod?: AttackPowerModifier;
145
- basic_power_mod?: AttackPowerModifier;
146
- }
147
-
148
- export interface SpecialEnemyModifiers {
149
- precap_general_mod: AttackPowerModifier;
150
- stype_mod: AttackPowerModifier;
151
- landing_craft_synergy_mod: AttackPowerModifier;
152
- toku_daihatsu_tank_mod: AttackPowerModifier;
153
- m4a1dd_mod: AttackPowerModifier;
154
- honi_mod: AttackPowerModifier;
155
- postcap_general_mod: AttackPowerModifier;
156
- pt_mod: AttackPowerModifier;
157
- }
158
-
159
- export interface AttackPowerModifier {
160
- a: number;
161
- b: number;
162
- }
163
-
164
134
  export interface MasterData {
165
135
  gears: MasterGear[];
166
136
  gear_attrs: MasterAttrRule<GearAttr>[];
@@ -187,6 +157,22 @@ export interface MasterAttrRule<T> {
187
157
  expr: string;
188
158
  }
189
159
 
160
+ export interface WarfareContext {
161
+ attacker_env: WarfareShipEnvironment;
162
+ target_env: WarfareShipEnvironment;
163
+ engagement: Engagement;
164
+ air_state: AirState;
165
+ }
166
+
167
+ export interface WarfareShipEnvironment {
168
+ org_type: OrgType;
169
+ role: Role;
170
+ ship_index: number;
171
+ fleet_len: number;
172
+ formation: Formation;
173
+ fleet_los_mod: number | null;
174
+ }
175
+
190
176
  export interface CompDayCutinRateInfo {
191
177
  main: FleetDayCutinRateInfo;
192
178
  escort: FleetDayCutinRateInfo | null;
@@ -209,10 +195,6 @@ export interface DayCutinRateInfo {
209
195
  total_cutin_rate: number | null;
210
196
  }
211
197
 
212
- export type NumMap<K, V> = Partial<Record<K, V>>;
213
-
214
- export type Role = "Main" | "Escort";
215
-
216
198
  export type GearCategory =
217
199
  | "Fighter"
218
200
  | "Bomber"
@@ -339,6 +321,12 @@ export type AirState =
339
321
  | "AirDenial"
340
322
  | "AirIncapability";
341
323
 
324
+ export interface ShellingSupportSimulatorParams {
325
+ attacker_formation: Formation;
326
+ target_formation: Formation;
327
+ engagement: Engagement;
328
+ }
329
+
342
330
  export interface MasterIBonuses {
343
331
  shelling_power: MasterIBonusRule[];
344
332
  carrier_shelling_power: MasterIBonusRule[];
@@ -369,25 +357,6 @@ export interface NightSituation {
369
357
  searchlight: boolean;
370
358
  }
371
359
 
372
- export interface FleetCutinAnalysis {
373
- shelling: FleetCutinInfo[];
374
- night: FleetCutinInfo[];
375
- }
376
-
377
- export interface FleetCutinInfo {
378
- cutin: FleetCutin;
379
- rate: number | null;
380
- formation: Formation;
381
- items: FleetCutinInfoItem[];
382
- }
383
-
384
- export interface FleetCutinInfoItem {
385
- ship_id: number;
386
- cutin: FleetCutin;
387
- fleet_cutin_mod: number;
388
- stats: AttackStats;
389
- }
390
-
391
360
  export interface DamageInfo {
392
361
  miss_damage_min: number;
393
362
  miss_damage_max: number;
@@ -417,37 +386,6 @@ export type ShipAttr =
417
386
  | "BattleshipSummerPrincess"
418
387
  | "HeavyCruiserSummerPrincess";
419
388
 
420
- export type GearAttr =
421
- | "Unknown"
422
- | "Abyssal"
423
- | "HighAngleMount"
424
- | "NightFighter"
425
- | "NightAttacker"
426
- | "HeavyBomber"
427
- | "MainGun"
428
- | "Radar"
429
- | "SurfaceRadar"
430
- | "AirRadar"
431
- | "DepthChargeProjector"
432
- | "SynergisticDepthCharge"
433
- | "AntiSubMortar"
434
- | "AntiSubWeapon"
435
- | "AntiSubAircraft"
436
- | "LateModelBowTorpedo"
437
- | "Seaplane"
438
- | "CbAircraft"
439
- | "LbAircraft"
440
- | "JetAircraft"
441
- | "Fighter"
442
- | "Recon"
443
- | "ObservationSeaplane"
444
- | "CbFighterBomber"
445
- | "AntiInstDiveBomber"
446
- | "NightRecon"
447
- | "CbSwordfish"
448
- | "SemiNightPlane"
449
- | "HighAltitudeInterceptor";
450
-
451
389
  export type Formation = SingleFormation | CombinedFormation;
452
390
 
453
391
  export type CombinedFormation =
@@ -464,6 +402,63 @@ export type SingleFormation =
464
402
  | "LineAbreast"
465
403
  | "Vanguard";
466
404
 
405
+ export interface CustomPowerModifiers {
406
+ precap_mod?: AttackPowerModifier;
407
+ postcap_mod?: AttackPowerModifier;
408
+ basic_power_mod?: AttackPowerModifier;
409
+ }
410
+
411
+ export interface SpecialEnemyModifiers {
412
+ precap_general_mod: AttackPowerModifier;
413
+ stype_mod: AttackPowerModifier;
414
+ landing_craft_synergy_mod: AttackPowerModifier;
415
+ toku_daihatsu_tank_mod: AttackPowerModifier;
416
+ m4a1dd_mod: AttackPowerModifier;
417
+ honi_mod: AttackPowerModifier;
418
+ postcap_general_mod: AttackPowerModifier;
419
+ pt_mod: AttackPowerModifier;
420
+ }
421
+
422
+ export interface AttackPowerModifier {
423
+ a?: number;
424
+ b?: number;
425
+ }
426
+
427
+ export interface AttackPower {
428
+ precap: number;
429
+ is_capped: boolean;
430
+ capped: number;
431
+ normal: number;
432
+ critical: number;
433
+ armor_penetration: number;
434
+ remaining_ammo_mod: number;
435
+ }
436
+
437
+ export interface AttackPowerParams {
438
+ basic: number;
439
+ cap: number;
440
+ precap_mod: AttackPowerModifier;
441
+ postcap_mod: AttackPowerModifier;
442
+ ap_shell_mod: number | null;
443
+ carrier_power: number | null;
444
+ proficiency_critical_mod: number | null;
445
+ armor_penetration: number;
446
+ remaining_ammo_mod: number;
447
+ special_enemy_mods: SpecialEnemyModifiers;
448
+ custom_mods: CustomPowerModifiers;
449
+ }
450
+
451
+ export interface SpecialEnemyModifiers {
452
+ precap_general_mod: AttackPowerModifier;
453
+ stype_mod: AttackPowerModifier;
454
+ landing_craft_synergy_mod: AttackPowerModifier;
455
+ toku_daihatsu_tank_mod: AttackPowerModifier;
456
+ m4a1dd_mod: AttackPowerModifier;
457
+ honi_mod: AttackPowerModifier;
458
+ postcap_general_mod: AttackPowerModifier;
459
+ pt_mod: AttackPowerModifier;
460
+ }
461
+
467
462
  export interface CompAntiAirInfo {
468
463
  fleet_adjusted_anti_air: number;
469
464
  ships: ShipAntiAirInfo[];
@@ -494,6 +489,41 @@ export interface AirstrikeContactChance {
494
489
  total: number;
495
490
  }
496
491
 
492
+ export type SlotSizeVec = (number | null)[];
493
+
494
+ export type Side = "Player" | "Enemy";
495
+
496
+ export type GearAttr =
497
+ | "Unknown"
498
+ | "Abyssal"
499
+ | "HighAngleMount"
500
+ | "NightFighter"
501
+ | "NightAttacker"
502
+ | "HeavyBomber"
503
+ | "MainGun"
504
+ | "Radar"
505
+ | "SurfaceRadar"
506
+ | "AirRadar"
507
+ | "DepthChargeProjector"
508
+ | "SynergisticDepthCharge"
509
+ | "AntiSubMortar"
510
+ | "AntiSubWeapon"
511
+ | "AntiSubAircraft"
512
+ | "LateModelBowTorpedo"
513
+ | "Seaplane"
514
+ | "CbAircraft"
515
+ | "LbAircraft"
516
+ | "JetAircraft"
517
+ | "Fighter"
518
+ | "Recon"
519
+ | "ObservationSeaplane"
520
+ | "CbFighterBomber"
521
+ | "AntiInstDiveBomber"
522
+ | "NightRecon"
523
+ | "CbSwordfish"
524
+ | "SemiNightPlane"
525
+ | "HighAltitudeInterceptor";
526
+
497
527
  export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
498
528
 
499
529
  export interface MasterEquippable {
@@ -605,6 +635,7 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
605
635
  luck_mod?: number;
606
636
  day_gunfit_accuracy?: number;
607
637
  night_gunfit_accuracy?: number;
638
+ custom_power_mods?: CustomPowerModifiers;
608
639
  }
609
640
 
610
641
  export interface SlotSizeVecState {
@@ -631,29 +662,6 @@ export interface GearState {
631
662
  stars?: number;
632
663
  }
633
664
 
634
- export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
635
-
636
- export type NightSpecialAttack =
637
- | { NightCutin: NightCutin }
638
- | { FleetCutin: FleetCutin };
639
-
640
- export type NightCutin =
641
- | "MainTorpRadar"
642
- | "TorpLookoutRadar"
643
- | "TorpTsloTorp"
644
- | "TorpTsloDrum"
645
- | "DoubleAttack"
646
- | "TorpTorpMain"
647
- | "TorpTorpTorp"
648
- | "MainMainSec"
649
- | "MainMainMain"
650
- | "SubTorpTorp"
651
- | "SubRadarTorp"
652
- | "Cvci1_25"
653
- | "Cvci1_20"
654
- | "Cvci1_18"
655
- | "Photobomber";
656
-
657
665
  export interface MasterGear {
658
666
  gear_id: number;
659
667
  name: string;
@@ -694,6 +702,29 @@ export interface HitRateParams {
694
702
  hit_percentage_bonus: number;
695
703
  }
696
704
 
705
+ export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
706
+
707
+ export type NightSpecialAttack =
708
+ | { NightCutin: NightCutin }
709
+ | { FleetCutin: FleetCutin };
710
+
711
+ export type NightCutin =
712
+ | "MainTorpRadar"
713
+ | "TorpLookoutRadar"
714
+ | "TorpTsloTorp"
715
+ | "TorpTsloDrum"
716
+ | "DoubleAttack"
717
+ | "TorpTorpMain"
718
+ | "TorpTorpTorp"
719
+ | "MainMainSec"
720
+ | "MainMainMain"
721
+ | "SubTorpTorp"
722
+ | "SubRadarTorp"
723
+ | "Cvci1_25"
724
+ | "Cvci1_20"
725
+ | "Cvci1_18"
726
+ | "Photobomber";
727
+
697
728
  export interface BattleConfig {
698
729
  formation: Record<Formation, NestedFormationDef>;
699
730
  anti_air_cutin: Record<number, AntiAirCutinDef>;
@@ -779,6 +810,22 @@ export interface MasterShip {
779
810
 
780
811
  export type StatInterval = [number | null, number | null];
781
812
 
813
+ export type GearTypeIdArray = [number, number, number, number, number];
814
+
815
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
816
+
817
+ export interface SimulatorResult {
818
+ items: SimulatorResultItem[];
819
+ sunk_vec: [number, number, number][];
820
+ }
821
+
822
+ export interface SimulatorResultItem {
823
+ id: string;
824
+ role: Role;
825
+ index: number;
826
+ damage_state_map: Record<DamageState, number>;
827
+ }
828
+
782
829
  export interface WarfareInfo {
783
830
  day: AttackInfo<DayBattleAttackType, DayCutin | null> | null;
784
831
  closing_torpedo: AttackInfo<null, null> | null;
@@ -802,44 +849,6 @@ export interface WarfareAnalyzerShipEnvironment {
802
849
  formation: Formation;
803
850
  fleet_los_mod: number | null;
804
851
  night_situation: NightSituation;
805
- custom_mods: CustomModifiers;
806
- }
807
-
808
- export type GearTypeIdArray = [number, number, number, number, number];
809
-
810
- export type SlotSizeVec = (number | null)[];
811
-
812
- export type Side = "Player" | "Enemy";
813
-
814
- export type SpecialEnemyType =
815
- | "None"
816
- | "SoftSkinned"
817
- | "Pillbox"
818
- | "IsolatedIsland"
819
- | "SupplyDepot"
820
- | "HarbourSummerPrincess"
821
- | "PtImp"
822
- | "BattleshipSummerPrincess"
823
- | "HeavyCruiserSummerPrincess";
824
-
825
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
826
-
827
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
828
-
829
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
830
-
831
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
832
-
833
- export interface SimulatorResult {
834
- items: SimulatorResultItem[];
835
- sunk_vec: [number, number, number][];
836
- }
837
-
838
- export interface SimulatorResultItem {
839
- id: string;
840
- role: Role;
841
- index: number;
842
- damage_state_map: Record<DamageState, number>;
843
852
  }
844
853
 
845
854
  export interface FleetNightCutinRateInfo {
@@ -1666,6 +1675,10 @@ export class Ship {
1666
1675
  * @returns {ShipState}
1667
1676
  */
1668
1677
  state(): ShipState;
1678
+ /**
1679
+ * @returns {CustomPowerModifiers}
1680
+ */
1681
+ custom_power_mods(): CustomPowerModifiers;
1669
1682
  /**
1670
1683
  * @returns {ShipMeta}
1671
1684
  */
@@ -164,6 +164,11 @@ function getUint16Memory0() {
164
164
  function getArrayU16FromWasm0(ptr, len) {
165
165
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
166
166
  }
167
+ /**
168
+ */
169
+ module.exports.set_panic_hook = function() {
170
+ wasm.set_panic_hook();
171
+ };
167
172
 
168
173
  function passArray16ToWasm0(arg, malloc) {
169
174
  const ptr = malloc(arg.length * 2);
@@ -171,11 +176,6 @@ function passArray16ToWasm0(arg, malloc) {
171
176
  WASM_VECTOR_LEN = arg.length;
172
177
  return ptr;
173
178
  }
174
- /**
175
- */
176
- module.exports.set_panic_hook = function() {
177
- wasm.set_panic_hook();
178
- };
179
179
 
180
180
  function getArrayU8FromWasm0(ptr, len) {
181
181
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -2662,6 +2662,13 @@ class Ship {
2662
2662
  return takeObject(ret);
2663
2663
  }
2664
2664
  /**
2665
+ * @returns {CustomPowerModifiers}
2666
+ */
2667
+ custom_power_mods() {
2668
+ const ret = wasm.ship_custom_power_mods(this.ptr);
2669
+ return takeObject(ret);
2670
+ }
2671
+ /**
2665
2672
  * @returns {ShipMeta}
2666
2673
  */
2667
2674
  meta() {
@@ -3202,13 +3209,13 @@ module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
3202
3209
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3203
3210
  };
3204
3211
 
3205
- module.exports.__wbg_createEquipmentBonuses_a27fec520ac90d68 = function(arg0, arg1) {
3206
- const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3212
+ module.exports.__wbg_ship_new = function(arg0) {
3213
+ const ret = Ship.__wrap(arg0);
3207
3214
  return addHeapObject(ret);
3208
3215
  };
3209
3216
 
3210
- module.exports.__wbg_ship_new = function(arg0) {
3211
- const ret = Ship.__wrap(arg0);
3217
+ module.exports.__wbg_createEquipmentBonuses_d9b8540538a6cce0 = function(arg0, arg1) {
3218
+ const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3212
3219
  return addHeapObject(ret);
3213
3220
  };
3214
3221
 
@@ -3238,14 +3245,6 @@ module.exports.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
3238
3245
  }
3239
3246
  };
3240
3247
 
3241
- module.exports.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
3242
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3243
- }, arguments) };
3244
-
3245
- module.exports.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
3246
- getObject(arg0).getRandomValues(getObject(arg1));
3247
- }, arguments) };
3248
-
3249
3248
  module.exports.__wbg_process_e56fd54cf6319b6c = function(arg0) {
3250
3249
  const ret = getObject(arg0).process;
3251
3250
  return addHeapObject(ret);
@@ -3292,6 +3291,14 @@ module.exports.__wbg_msCrypto_5a86d77a66230f81 = function(arg0) {
3292
3291
  return addHeapObject(ret);
3293
3292
  };
3294
3293
 
3294
+ module.exports.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
3295
+ getObject(arg0).getRandomValues(getObject(arg1));
3296
+ }, arguments) };
3297
+
3298
+ module.exports.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
3299
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3300
+ }, arguments) };
3301
+
3295
3302
  module.exports.__wbg_new_2ab697f1555e0dbc = function() {
3296
3303
  const ret = new Array();
3297
3304
  return addHeapObject(ret);
Binary file
@@ -41,6 +41,7 @@ export function ship_los(a: number): number;
41
41
  export function ship_default(): number;
42
42
  export function ship_eq_id(a: number, b: number, c: number): number;
43
43
  export function ship_state(a: number): number;
44
+ export function ship_custom_power_mods(a: number): number;
44
45
  export function ship_meta(a: number): number;
45
46
  export function ship_name(a: number, b: number): void;
46
47
  export function ship_yomi(a: number, b: number): void;
@@ -220,10 +221,10 @@ export function fhcore_create_comp_by_map_enemy(a: number, b: number, c: number,
220
221
  export function fhcore_create_default_ship(a: number): number;
221
222
  export function fhcore_create_analyzer(a: number): number;
222
223
  export function fhcore_simulate_shelling_support(a: number, b: number, c: number, d: number, e: number, f: number): void;
224
+ export function set_panic_hook(): void;
223
225
  export function ship_state_day_gunfit_accuracy(a: number, b: number): void;
224
226
  export function ship_state_night_gunfit_accuracy(a: number, b: number): void;
225
227
  export function ship_gunfit_accuracy(a: number, b: number): number;
226
- export function set_panic_hook(): void;
227
228
  export function __wbg_ibonuses_free(a: number): void;
228
229
  export function __wbg_get_ibonuses_shelling_power(a: number): number;
229
230
  export function __wbg_set_ibonuses_shelling_power(a: number, b: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleethub-core",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "license": "UNLICENSED",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -54,16 +54,43 @@ export type DayCutin =
54
54
  | "Zuiun"
55
55
  | "AirSea";
56
56
 
57
- export interface ShellingSupportSimulatorParams {
58
- attacker_formation: Formation;
59
- target_formation: Formation;
60
- engagement: Engagement;
61
- custom_mods: CustomModifiers;
57
+ export type ShellingAttackType = "Normal" | "Carrier";
58
+
59
+ export interface FleetCutinAnalysis {
60
+ shelling: FleetCutinInfo[];
61
+ night: FleetCutinInfo[];
62
62
  }
63
63
 
64
- export type ShellingAttackType = "Normal" | "Carrier";
64
+ export interface FleetCutinInfo {
65
+ cutin: FleetCutin;
66
+ rate: number | null;
67
+ formation: Formation;
68
+ items: FleetCutinInfoItem[];
69
+ }
65
70
 
66
- export type AirWaveType = "Jet" | "LandBase" | "Carrier";
71
+ export interface FleetCutinInfoItem {
72
+ ship_id: number;
73
+ cutin: FleetCutin;
74
+ fleet_cutin_mod: number;
75
+ stats: AttackStats;
76
+ }
77
+
78
+ export type SpecialEnemyType =
79
+ | "None"
80
+ | "SoftSkinned"
81
+ | "Pillbox"
82
+ | "IsolatedIsland"
83
+ | "SupplyDepot"
84
+ | "HarbourSummerPrincess"
85
+ | "PtImp"
86
+ | "BattleshipSummerPrincess"
87
+ | "HeavyCruiserSummerPrincess";
88
+
89
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
90
+
91
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
92
+
93
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
67
94
 
68
95
  export type AswAttackType = "DepthCharge" | "Aircraft";
69
96
 
@@ -83,22 +110,11 @@ export type FleetCutin =
83
110
  | "Yamato2ShipCutin"
84
111
  | "Yamato3ShipCutin";
85
112
 
86
- export interface WarfareContext {
87
- attacker_env: WarfareShipEnvironment;
88
- target_env: WarfareShipEnvironment;
89
- engagement: Engagement;
90
- air_state: AirState;
91
- custom_mods: CustomModifiers;
92
- }
113
+ export type AirWaveType = "Jet" | "LandBase" | "Carrier";
93
114
 
94
- export interface WarfareShipEnvironment {
95
- org_type: OrgType;
96
- role: Role;
97
- ship_index: number;
98
- fleet_len: number;
99
- formation: Formation;
100
- fleet_los_mod: number | null;
101
- }
115
+ export type NumMap<K, V> = Partial<Record<K, V>>;
116
+
117
+ export type Role = "Main" | "Escort";
102
118
 
103
119
  export interface CompMeta {
104
120
  fleets: Record<FleetType, FleetMeta>;
@@ -115,52 +131,6 @@ export interface ShipMeta {
115
131
  ship_id: number;
116
132
  }
117
133
 
118
- export interface AttackPower {
119
- precap: number;
120
- is_capped: boolean;
121
- capped: number;
122
- normal: number;
123
- critical: number;
124
- armor_penetration: number;
125
- remaining_ammo_mod: number;
126
- }
127
-
128
- export interface AttackPowerParams {
129
- basic: number;
130
- cap: number;
131
- precap_mod: AttackPowerModifier;
132
- postcap_mod: AttackPowerModifier;
133
- ap_shell_mod: number | null;
134
- carrier_power: number | null;
135
- proficiency_critical_mod: number | null;
136
- armor_penetration: number;
137
- remaining_ammo_mod: number;
138
- special_enemy_mods: SpecialEnemyModifiers;
139
- custom_mods: CustomModifiers;
140
- }
141
-
142
- export interface CustomModifiers {
143
- precap_mod?: AttackPowerModifier;
144
- postcap_mod?: AttackPowerModifier;
145
- basic_power_mod?: AttackPowerModifier;
146
- }
147
-
148
- export interface SpecialEnemyModifiers {
149
- precap_general_mod: AttackPowerModifier;
150
- stype_mod: AttackPowerModifier;
151
- landing_craft_synergy_mod: AttackPowerModifier;
152
- toku_daihatsu_tank_mod: AttackPowerModifier;
153
- m4a1dd_mod: AttackPowerModifier;
154
- honi_mod: AttackPowerModifier;
155
- postcap_general_mod: AttackPowerModifier;
156
- pt_mod: AttackPowerModifier;
157
- }
158
-
159
- export interface AttackPowerModifier {
160
- a: number;
161
- b: number;
162
- }
163
-
164
134
  export interface MasterData {
165
135
  gears: MasterGear[];
166
136
  gear_attrs: MasterAttrRule<GearAttr>[];
@@ -187,6 +157,22 @@ export interface MasterAttrRule<T> {
187
157
  expr: string;
188
158
  }
189
159
 
160
+ export interface WarfareContext {
161
+ attacker_env: WarfareShipEnvironment;
162
+ target_env: WarfareShipEnvironment;
163
+ engagement: Engagement;
164
+ air_state: AirState;
165
+ }
166
+
167
+ export interface WarfareShipEnvironment {
168
+ org_type: OrgType;
169
+ role: Role;
170
+ ship_index: number;
171
+ fleet_len: number;
172
+ formation: Formation;
173
+ fleet_los_mod: number | null;
174
+ }
175
+
190
176
  export interface CompDayCutinRateInfo {
191
177
  main: FleetDayCutinRateInfo;
192
178
  escort: FleetDayCutinRateInfo | null;
@@ -209,10 +195,6 @@ export interface DayCutinRateInfo {
209
195
  total_cutin_rate: number | null;
210
196
  }
211
197
 
212
- export type NumMap<K, V> = Partial<Record<K, V>>;
213
-
214
- export type Role = "Main" | "Escort";
215
-
216
198
  export type GearCategory =
217
199
  | "Fighter"
218
200
  | "Bomber"
@@ -339,6 +321,12 @@ export type AirState =
339
321
  | "AirDenial"
340
322
  | "AirIncapability";
341
323
 
324
+ export interface ShellingSupportSimulatorParams {
325
+ attacker_formation: Formation;
326
+ target_formation: Formation;
327
+ engagement: Engagement;
328
+ }
329
+
342
330
  export interface MasterIBonuses {
343
331
  shelling_power: MasterIBonusRule[];
344
332
  carrier_shelling_power: MasterIBonusRule[];
@@ -369,25 +357,6 @@ export interface NightSituation {
369
357
  searchlight: boolean;
370
358
  }
371
359
 
372
- export interface FleetCutinAnalysis {
373
- shelling: FleetCutinInfo[];
374
- night: FleetCutinInfo[];
375
- }
376
-
377
- export interface FleetCutinInfo {
378
- cutin: FleetCutin;
379
- rate: number | null;
380
- formation: Formation;
381
- items: FleetCutinInfoItem[];
382
- }
383
-
384
- export interface FleetCutinInfoItem {
385
- ship_id: number;
386
- cutin: FleetCutin;
387
- fleet_cutin_mod: number;
388
- stats: AttackStats;
389
- }
390
-
391
360
  export interface DamageInfo {
392
361
  miss_damage_min: number;
393
362
  miss_damage_max: number;
@@ -417,37 +386,6 @@ export type ShipAttr =
417
386
  | "BattleshipSummerPrincess"
418
387
  | "HeavyCruiserSummerPrincess";
419
388
 
420
- export type GearAttr =
421
- | "Unknown"
422
- | "Abyssal"
423
- | "HighAngleMount"
424
- | "NightFighter"
425
- | "NightAttacker"
426
- | "HeavyBomber"
427
- | "MainGun"
428
- | "Radar"
429
- | "SurfaceRadar"
430
- | "AirRadar"
431
- | "DepthChargeProjector"
432
- | "SynergisticDepthCharge"
433
- | "AntiSubMortar"
434
- | "AntiSubWeapon"
435
- | "AntiSubAircraft"
436
- | "LateModelBowTorpedo"
437
- | "Seaplane"
438
- | "CbAircraft"
439
- | "LbAircraft"
440
- | "JetAircraft"
441
- | "Fighter"
442
- | "Recon"
443
- | "ObservationSeaplane"
444
- | "CbFighterBomber"
445
- | "AntiInstDiveBomber"
446
- | "NightRecon"
447
- | "CbSwordfish"
448
- | "SemiNightPlane"
449
- | "HighAltitudeInterceptor";
450
-
451
389
  export type Formation = SingleFormation | CombinedFormation;
452
390
 
453
391
  export type CombinedFormation =
@@ -464,6 +402,63 @@ export type SingleFormation =
464
402
  | "LineAbreast"
465
403
  | "Vanguard";
466
404
 
405
+ export interface CustomPowerModifiers {
406
+ precap_mod?: AttackPowerModifier;
407
+ postcap_mod?: AttackPowerModifier;
408
+ basic_power_mod?: AttackPowerModifier;
409
+ }
410
+
411
+ export interface SpecialEnemyModifiers {
412
+ precap_general_mod: AttackPowerModifier;
413
+ stype_mod: AttackPowerModifier;
414
+ landing_craft_synergy_mod: AttackPowerModifier;
415
+ toku_daihatsu_tank_mod: AttackPowerModifier;
416
+ m4a1dd_mod: AttackPowerModifier;
417
+ honi_mod: AttackPowerModifier;
418
+ postcap_general_mod: AttackPowerModifier;
419
+ pt_mod: AttackPowerModifier;
420
+ }
421
+
422
+ export interface AttackPowerModifier {
423
+ a?: number;
424
+ b?: number;
425
+ }
426
+
427
+ export interface AttackPower {
428
+ precap: number;
429
+ is_capped: boolean;
430
+ capped: number;
431
+ normal: number;
432
+ critical: number;
433
+ armor_penetration: number;
434
+ remaining_ammo_mod: number;
435
+ }
436
+
437
+ export interface AttackPowerParams {
438
+ basic: number;
439
+ cap: number;
440
+ precap_mod: AttackPowerModifier;
441
+ postcap_mod: AttackPowerModifier;
442
+ ap_shell_mod: number | null;
443
+ carrier_power: number | null;
444
+ proficiency_critical_mod: number | null;
445
+ armor_penetration: number;
446
+ remaining_ammo_mod: number;
447
+ special_enemy_mods: SpecialEnemyModifiers;
448
+ custom_mods: CustomPowerModifiers;
449
+ }
450
+
451
+ export interface SpecialEnemyModifiers {
452
+ precap_general_mod: AttackPowerModifier;
453
+ stype_mod: AttackPowerModifier;
454
+ landing_craft_synergy_mod: AttackPowerModifier;
455
+ toku_daihatsu_tank_mod: AttackPowerModifier;
456
+ m4a1dd_mod: AttackPowerModifier;
457
+ honi_mod: AttackPowerModifier;
458
+ postcap_general_mod: AttackPowerModifier;
459
+ pt_mod: AttackPowerModifier;
460
+ }
461
+
467
462
  export interface CompAntiAirInfo {
468
463
  fleet_adjusted_anti_air: number;
469
464
  ships: ShipAntiAirInfo[];
@@ -494,6 +489,41 @@ export interface AirstrikeContactChance {
494
489
  total: number;
495
490
  }
496
491
 
492
+ export type SlotSizeVec = (number | null)[];
493
+
494
+ export type Side = "Player" | "Enemy";
495
+
496
+ export type GearAttr =
497
+ | "Unknown"
498
+ | "Abyssal"
499
+ | "HighAngleMount"
500
+ | "NightFighter"
501
+ | "NightAttacker"
502
+ | "HeavyBomber"
503
+ | "MainGun"
504
+ | "Radar"
505
+ | "SurfaceRadar"
506
+ | "AirRadar"
507
+ | "DepthChargeProjector"
508
+ | "SynergisticDepthCharge"
509
+ | "AntiSubMortar"
510
+ | "AntiSubWeapon"
511
+ | "AntiSubAircraft"
512
+ | "LateModelBowTorpedo"
513
+ | "Seaplane"
514
+ | "CbAircraft"
515
+ | "LbAircraft"
516
+ | "JetAircraft"
517
+ | "Fighter"
518
+ | "Recon"
519
+ | "ObservationSeaplane"
520
+ | "CbFighterBomber"
521
+ | "AntiInstDiveBomber"
522
+ | "NightRecon"
523
+ | "CbSwordfish"
524
+ | "SemiNightPlane"
525
+ | "HighAltitudeInterceptor";
526
+
497
527
  export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
498
528
 
499
529
  export interface MasterEquippable {
@@ -605,6 +635,7 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
605
635
  luck_mod?: number;
606
636
  day_gunfit_accuracy?: number;
607
637
  night_gunfit_accuracy?: number;
638
+ custom_power_mods?: CustomPowerModifiers;
608
639
  }
609
640
 
610
641
  export interface SlotSizeVecState {
@@ -631,29 +662,6 @@ export interface GearState {
631
662
  stars?: number;
632
663
  }
633
664
 
634
- export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
635
-
636
- export type NightSpecialAttack =
637
- | { NightCutin: NightCutin }
638
- | { FleetCutin: FleetCutin };
639
-
640
- export type NightCutin =
641
- | "MainTorpRadar"
642
- | "TorpLookoutRadar"
643
- | "TorpTsloTorp"
644
- | "TorpTsloDrum"
645
- | "DoubleAttack"
646
- | "TorpTorpMain"
647
- | "TorpTorpTorp"
648
- | "MainMainSec"
649
- | "MainMainMain"
650
- | "SubTorpTorp"
651
- | "SubRadarTorp"
652
- | "Cvci1_25"
653
- | "Cvci1_20"
654
- | "Cvci1_18"
655
- | "Photobomber";
656
-
657
665
  export interface MasterGear {
658
666
  gear_id: number;
659
667
  name: string;
@@ -694,6 +702,29 @@ export interface HitRateParams {
694
702
  hit_percentage_bonus: number;
695
703
  }
696
704
 
705
+ export type NightAttackType = "Normal" | "ArkRoyal" | "Carrier";
706
+
707
+ export type NightSpecialAttack =
708
+ | { NightCutin: NightCutin }
709
+ | { FleetCutin: FleetCutin };
710
+
711
+ export type NightCutin =
712
+ | "MainTorpRadar"
713
+ | "TorpLookoutRadar"
714
+ | "TorpTsloTorp"
715
+ | "TorpTsloDrum"
716
+ | "DoubleAttack"
717
+ | "TorpTorpMain"
718
+ | "TorpTorpTorp"
719
+ | "MainMainSec"
720
+ | "MainMainMain"
721
+ | "SubTorpTorp"
722
+ | "SubRadarTorp"
723
+ | "Cvci1_25"
724
+ | "Cvci1_20"
725
+ | "Cvci1_18"
726
+ | "Photobomber";
727
+
697
728
  export interface BattleConfig {
698
729
  formation: Record<Formation, NestedFormationDef>;
699
730
  anti_air_cutin: Record<number, AntiAirCutinDef>;
@@ -779,6 +810,22 @@ export interface MasterShip {
779
810
 
780
811
  export type StatInterval = [number | null, number | null];
781
812
 
813
+ export type GearTypeIdArray = [number, number, number, number, number];
814
+
815
+ export type ContactRank = "Rank1" | "Rank2" | "Rank3";
816
+
817
+ export interface SimulatorResult {
818
+ items: SimulatorResultItem[];
819
+ sunk_vec: [number, number, number][];
820
+ }
821
+
822
+ export interface SimulatorResultItem {
823
+ id: string;
824
+ role: Role;
825
+ index: number;
826
+ damage_state_map: Record<DamageState, number>;
827
+ }
828
+
782
829
  export interface WarfareInfo {
783
830
  day: AttackInfo<DayBattleAttackType, DayCutin | null> | null;
784
831
  closing_torpedo: AttackInfo<null, null> | null;
@@ -802,44 +849,6 @@ export interface WarfareAnalyzerShipEnvironment {
802
849
  formation: Formation;
803
850
  fleet_los_mod: number | null;
804
851
  night_situation: NightSituation;
805
- custom_mods: CustomModifiers;
806
- }
807
-
808
- export type GearTypeIdArray = [number, number, number, number, number];
809
-
810
- export type SlotSizeVec = (number | null)[];
811
-
812
- export type Side = "Player" | "Enemy";
813
-
814
- export type SpecialEnemyType =
815
- | "None"
816
- | "SoftSkinned"
817
- | "Pillbox"
818
- | "IsolatedIsland"
819
- | "SupplyDepot"
820
- | "HarbourSummerPrincess"
821
- | "PtImp"
822
- | "BattleshipSummerPrincess"
823
- | "HeavyCruiserSummerPrincess";
824
-
825
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
826
-
827
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
828
-
829
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
830
-
831
- export type ContactRank = "Rank1" | "Rank2" | "Rank3";
832
-
833
- export interface SimulatorResult {
834
- items: SimulatorResultItem[];
835
- sunk_vec: [number, number, number][];
836
- }
837
-
838
- export interface SimulatorResultItem {
839
- id: string;
840
- role: Role;
841
- index: number;
842
- damage_state_map: Record<DamageState, number>;
843
852
  }
844
853
 
845
854
  export interface FleetNightCutinRateInfo {
@@ -1666,6 +1675,10 @@ export class Ship {
1666
1675
  * @returns {ShipState}
1667
1676
  */
1668
1677
  state(): ShipState;
1678
+ /**
1679
+ * @returns {CustomPowerModifiers}
1680
+ */
1681
+ custom_power_mods(): CustomPowerModifiers;
1669
1682
  /**
1670
1683
  * @returns {ShipMeta}
1671
1684
  */
@@ -165,6 +165,11 @@ function getUint16Memory0() {
165
165
  function getArrayU16FromWasm0(ptr, len) {
166
166
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
167
167
  }
168
+ /**
169
+ */
170
+ export function set_panic_hook() {
171
+ wasm.set_panic_hook();
172
+ }
168
173
 
169
174
  function passArray16ToWasm0(arg, malloc) {
170
175
  const ptr = malloc(arg.length * 2);
@@ -172,11 +177,6 @@ function passArray16ToWasm0(arg, malloc) {
172
177
  WASM_VECTOR_LEN = arg.length;
173
178
  return ptr;
174
179
  }
175
- /**
176
- */
177
- export function set_panic_hook() {
178
- wasm.set_panic_hook();
179
- }
180
180
 
181
181
  function getArrayU8FromWasm0(ptr, len) {
182
182
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -2655,6 +2655,13 @@ export class Ship {
2655
2655
  return takeObject(ret);
2656
2656
  }
2657
2657
  /**
2658
+ * @returns {CustomPowerModifiers}
2659
+ */
2660
+ custom_power_mods() {
2661
+ const ret = wasm.ship_custom_power_mods(this.ptr);
2662
+ return takeObject(ret);
2663
+ }
2664
+ /**
2658
2665
  * @returns {ShipMeta}
2659
2666
  */
2660
2667
  meta() {
@@ -3194,13 +3201,13 @@ export function __wbindgen_json_serialize(arg0, arg1) {
3194
3201
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3195
3202
  };
3196
3203
 
3197
- export function __wbg_createEquipmentBonuses_a27fec520ac90d68(arg0, arg1) {
3198
- const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3204
+ export function __wbg_ship_new(arg0) {
3205
+ const ret = Ship.__wrap(arg0);
3199
3206
  return addHeapObject(ret);
3200
3207
  };
3201
3208
 
3202
- export function __wbg_ship_new(arg0) {
3203
- const ret = Ship.__wrap(arg0);
3209
+ export function __wbg_createEquipmentBonuses_d9b8540538a6cce0(arg0, arg1) {
3210
+ const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3204
3211
  return addHeapObject(ret);
3205
3212
  };
3206
3213
 
@@ -3230,14 +3237,6 @@ export function __wbg_error_09919627ac0992f5(arg0, arg1) {
3230
3237
  }
3231
3238
  };
3232
3239
 
3233
- export function __wbg_randomFillSync_91e2b39becca6147() { return handleError(function (arg0, arg1, arg2) {
3234
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3235
- }, arguments) };
3236
-
3237
- export function __wbg_getRandomValues_b14734aa289bc356() { return handleError(function (arg0, arg1) {
3238
- getObject(arg0).getRandomValues(getObject(arg1));
3239
- }, arguments) };
3240
-
3241
3240
  export function __wbg_process_e56fd54cf6319b6c(arg0) {
3242
3241
  const ret = getObject(arg0).process;
3243
3242
  return addHeapObject(ret);
@@ -3284,6 +3283,14 @@ export function __wbg_msCrypto_5a86d77a66230f81(arg0) {
3284
3283
  return addHeapObject(ret);
3285
3284
  };
3286
3285
 
3286
+ export function __wbg_getRandomValues_b14734aa289bc356() { return handleError(function (arg0, arg1) {
3287
+ getObject(arg0).getRandomValues(getObject(arg1));
3288
+ }, arguments) };
3289
+
3290
+ export function __wbg_randomFillSync_91e2b39becca6147() { return handleError(function (arg0, arg1, arg2) {
3291
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3292
+ }, arguments) };
3293
+
3287
3294
  export function __wbg_new_2ab697f1555e0dbc() {
3288
3295
  const ret = new Array();
3289
3296
  return addHeapObject(ret);
Binary file
@@ -41,6 +41,7 @@ export function ship_los(a: number): number;
41
41
  export function ship_default(): number;
42
42
  export function ship_eq_id(a: number, b: number, c: number): number;
43
43
  export function ship_state(a: number): number;
44
+ export function ship_custom_power_mods(a: number): number;
44
45
  export function ship_meta(a: number): number;
45
46
  export function ship_name(a: number, b: number): void;
46
47
  export function ship_yomi(a: number, b: number): void;
@@ -220,10 +221,10 @@ export function fhcore_create_comp_by_map_enemy(a: number, b: number, c: number,
220
221
  export function fhcore_create_default_ship(a: number): number;
221
222
  export function fhcore_create_analyzer(a: number): number;
222
223
  export function fhcore_simulate_shelling_support(a: number, b: number, c: number, d: number, e: number, f: number): void;
224
+ export function set_panic_hook(): void;
223
225
  export function ship_state_day_gunfit_accuracy(a: number, b: number): void;
224
226
  export function ship_state_night_gunfit_accuracy(a: number, b: number): void;
225
227
  export function ship_gunfit_accuracy(a: number, b: number): number;
226
- export function set_panic_hook(): void;
227
228
  export function __wbg_ibonuses_free(a: number): void;
228
229
  export function __wbg_get_ibonuses_shelling_power(a: number): number;
229
230
  export function __wbg_set_ibonuses_shelling_power(a: number, b: number): void;