fleethub-core 1.8.2 → 1.8.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.
@@ -8,10 +8,37 @@ export function parse_ship_conditions(value: ShipConditions): ShipConditions;
8
8
  /**
9
9
  */
10
10
  export function set_panic_hook(): void;
11
+ declare namespace Side {
12
+ export type Player = "Player";
13
+ export type Enemy = "Enemy";
14
+ }
15
+
16
+ export type Side = Side.Player | Side.Enemy;
17
+
11
18
  export interface ShipConditions extends ShipPosition {
12
19
  formation?: Formation;
13
20
  }
14
21
 
22
+ declare namespace Role {
23
+ export type Main = "Main";
24
+ export type Escort = "Escort";
25
+ }
26
+
27
+ export type Role = Role.Main | Role.Escort;
28
+
29
+ declare namespace Engagement {
30
+ export type GreenT = "GreenT";
31
+ export type Parallel = "Parallel";
32
+ export type HeadOn = "HeadOn";
33
+ export type RedT = "RedT";
34
+ }
35
+
36
+ export type Engagement =
37
+ | Engagement.GreenT
38
+ | Engagement.Parallel
39
+ | Engagement.HeadOn
40
+ | Engagement.RedT;
41
+
15
42
  export interface BattleDefinitions {
16
43
  formation: Record<Formation, NestedFormationDef>;
17
44
  anti_air_cutin: Record<number, AntiAirCutinDef>;
@@ -73,12 +100,6 @@ export interface FormationCombatModifiersDef {
73
100
  evasion_mod?: number;
74
101
  }
75
102
 
76
- export interface SupportShellingSimulatorParams {
77
- attacker_formation?: Formation;
78
- target_formation?: Formation;
79
- engagement: Engagement;
80
- }
81
-
82
103
  export interface ShipAnalyzerConfig {
83
104
  air_state?: AirState;
84
105
  engagement?: Engagement;
@@ -86,6 +107,8 @@ export interface ShipAnalyzerConfig {
86
107
  right?: AttackAnalyzerShipConfig;
87
108
  }
88
109
 
110
+ export type GearTypeIdArray = [number, number, number, number, number];
111
+
89
112
  declare namespace SpecialEnemyType {
90
113
  export type None = "None";
91
114
  export type SoftSkinned = "SoftSkinned";
@@ -109,6 +132,19 @@ export type SpecialEnemyType =
109
132
  | SpecialEnemyType.BattleshipSummerPrincess
110
133
  | SpecialEnemyType.HeavyCruiserSummerPrincess;
111
134
 
135
+ declare namespace MoraleState {
136
+ export type Sparkle = "Sparkle";
137
+ export type Normal = "Normal";
138
+ export type Orange = "Orange";
139
+ export type Red = "Red";
140
+ }
141
+
142
+ export type MoraleState =
143
+ | MoraleState.Sparkle
144
+ | MoraleState.Normal
145
+ | MoraleState.Orange
146
+ | MoraleState.Red;
147
+
112
148
  type __NightCutinLikeFleetCutin = FleetCutin;
113
149
  type __NightCutinLikeNightCutin = NightCutin;
114
150
  declare namespace NightCutinLike {
@@ -240,21 +276,6 @@ export interface SimulatorResultItem {
240
276
  damage_state_map: Record<DamageState, number>;
241
277
  }
242
278
 
243
- declare namespace DamageState {
244
- export type Normal = "Normal";
245
- export type Shouha = "Shouha";
246
- export type Chuuha = "Chuuha";
247
- export type Taiha = "Taiha";
248
- export type Sunk = "Sunk";
249
- }
250
-
251
- export type DamageState =
252
- | DamageState.Normal
253
- | DamageState.Shouha
254
- | DamageState.Chuuha
255
- | DamageState.Taiha
256
- | DamageState.Sunk;
257
-
258
279
  declare namespace GearCategory {
259
280
  export type Fighter = "Fighter";
260
281
  export type Bomber = "Bomber";
@@ -409,48 +430,37 @@ export type GearType =
409
430
  | GearType.CbRecon2
410
431
  | GearType.SecondaryGun2;
411
432
 
412
- declare namespace AirStateRank {
413
- export type Rank0 = "Rank0";
414
- export type Rank1 = "Rank1";
415
- export type Rank2 = "Rank2";
416
- export type Rank3 = "Rank3";
433
+ declare namespace DamageState {
434
+ export type Normal = "Normal";
435
+ export type Shouha = "Shouha";
436
+ export type Chuuha = "Chuuha";
437
+ export type Taiha = "Taiha";
438
+ export type Sunk = "Sunk";
417
439
  }
418
440
 
419
- export type AirStateRank =
420
- | AirStateRank.Rank0
421
- | AirStateRank.Rank1
422
- | AirStateRank.Rank2
423
- | AirStateRank.Rank3;
441
+ export type DamageState =
442
+ | DamageState.Normal
443
+ | DamageState.Shouha
444
+ | DamageState.Chuuha
445
+ | DamageState.Taiha
446
+ | DamageState.Sunk;
424
447
 
425
- declare namespace AirState {
426
- export type AirSupremacy = "AirSupremacy";
427
- export type AirSuperiority = "AirSuperiority";
428
- export type AirParity = "AirParity";
429
- export type AirDenial = "AirDenial";
430
- export type AirIncapability = "AirIncapability";
448
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
449
+ formation?: Formation;
431
450
  }
432
451
 
433
- export type AirState =
434
- | AirState.AirSupremacy
435
- | AirState.AirSuperiority
436
- | AirState.AirParity
437
- | AirState.AirDenial
438
- | AirState.AirIncapability;
439
-
440
- declare namespace Side {
441
- export type Player = "Player";
442
- export type Enemy = "Enemy";
452
+ export interface NodeAttackAnalyzerConfig {
453
+ air_state?: AirState;
454
+ engagement?: Engagement;
455
+ left?: NodeAttackAnalyzerShipConfig;
456
+ right?: NodeAttackAnalyzerShipConfig;
443
457
  }
444
458
 
445
- export type Side = Side.Player | Side.Enemy;
446
-
447
- declare namespace Role {
448
- export type Main = "Main";
449
- export type Escort = "Escort";
459
+ export interface NodeAttackAnalysis {
460
+ left: AttackAnalysis;
461
+ right: AttackAnalysis;
450
462
  }
451
463
 
452
- export type Role = Role.Main | Role.Escort;
453
-
454
464
  export interface ShipPosition {
455
465
  org_type?: OrgType;
456
466
  fleet_type?: FleetType;
@@ -473,19 +483,6 @@ export interface ShipMeta {
473
483
  ship_id: number;
474
484
  }
475
485
 
476
- declare namespace Engagement {
477
- export type GreenT = "GreenT";
478
- export type Parallel = "Parallel";
479
- export type HeadOn = "HeadOn";
480
- export type RedT = "RedT";
481
- }
482
-
483
- export type Engagement =
484
- | Engagement.GreenT
485
- | Engagement.Parallel
486
- | Engagement.HeadOn
487
- | Engagement.RedT;
488
-
489
486
  export type TorpedoAttackType = null;
490
487
 
491
488
  type __NightPhaseAttackTypeAswAttackType = AswAttackType;
@@ -559,7 +556,36 @@ declare namespace AswAttackType {
559
556
 
560
557
  export type AswAttackType = AswAttackType.DepthCharge | AswAttackType.Aircraft;
561
558
 
559
+ declare namespace AirStateRank {
560
+ export type Rank0 = "Rank0";
561
+ export type Rank1 = "Rank1";
562
+ export type Rank2 = "Rank2";
563
+ export type Rank3 = "Rank3";
564
+ }
565
+
566
+ export type AirStateRank =
567
+ | AirStateRank.Rank0
568
+ | AirStateRank.Rank1
569
+ | AirStateRank.Rank2
570
+ | AirStateRank.Rank3;
571
+
572
+ declare namespace AirState {
573
+ export type AirSupremacy = "AirSupremacy";
574
+ export type AirSuperiority = "AirSuperiority";
575
+ export type AirParity = "AirParity";
576
+ export type AirDenial = "AirDenial";
577
+ export type AirIncapability = "AirIncapability";
578
+ }
579
+
580
+ export type AirState =
581
+ | AirState.AirSupremacy
582
+ | AirState.AirSuperiority
583
+ | AirState.AirParity
584
+ | AirState.AirDenial
585
+ | AirState.AirIncapability;
586
+
562
587
  export interface MasterData {
588
+ created_at: number;
563
589
  gears: MasterGear[];
564
590
  gear_attrs: MasterAttrRule<GearAttr>[];
565
591
  ships: MasterShip[];
@@ -585,35 +611,6 @@ export interface MasterAttrRule<T> {
585
611
  expr: string;
586
612
  }
587
613
 
588
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
589
- formation?: Formation;
590
- }
591
-
592
- export interface NodeAttackAnalyzerConfig {
593
- air_state?: AirState;
594
- engagement?: Engagement;
595
- left?: NodeAttackAnalyzerShipConfig;
596
- right?: NodeAttackAnalyzerShipConfig;
597
- }
598
-
599
- export interface NodeAttackAnalysis {
600
- left: AttackAnalysis;
601
- right: AttackAnalysis;
602
- }
603
-
604
- export interface AttackAnalyzerConfig {
605
- air_state?: AirState;
606
- engagement?: Engagement;
607
- attacker?: AttackAnalyzerShipConfig;
608
- target?: AttackAnalyzerShipConfig;
609
- }
610
-
611
- export interface AttackAnalyzerShipConfig
612
- extends ShipConditions,
613
- NightFleetConditions {
614
- fleet_los_mod?: number | null;
615
- }
616
-
617
614
  export interface EBonuses {
618
615
  firepower: number;
619
616
  torpedo: number;
@@ -704,6 +701,12 @@ export type OrgType =
704
701
  | OrgType.EnemySingle
705
702
  | OrgType.EnemyCombined;
706
703
 
704
+ export interface SupportShellingSimulatorParams {
705
+ attacker_formation?: Formation;
706
+ target_formation?: Formation;
707
+ engagement: Engagement;
708
+ }
709
+
707
710
  declare namespace GearAttr {
708
711
  export type Unknown = "Unknown";
709
712
  export type Abyssal = "Abyssal";
@@ -1084,6 +1087,12 @@ export interface DayContactChance {
1084
1087
  total: number;
1085
1088
  }
1086
1089
 
1090
+ export interface AttackAnalyzerShipConfig
1091
+ extends ShipConditions,
1092
+ NightFleetConditions {
1093
+ fleet_los_mod?: number | null;
1094
+ }
1095
+
1087
1096
  export interface AttackAnalysis {
1088
1097
  attacker_is_player: boolean;
1089
1098
  attacker_ship_id: number;
@@ -1095,6 +1104,28 @@ export interface AttackAnalysis {
1095
1104
  support_shelling: ActionReport<SupportShellingStyle>;
1096
1105
  }
1097
1106
 
1107
+ export interface NightFleetConditions {
1108
+ night_contact_rank?: ContactRank | null;
1109
+ starshell_index?: number | null;
1110
+ searchlight_index?: number | null;
1111
+ activates_large_searchlight?: boolean;
1112
+ }
1113
+
1114
+ export interface NightConditions {
1115
+ player?: NightFleetConditions;
1116
+ enemy?: NightFleetConditions;
1117
+ }
1118
+
1119
+ export interface BattleConditions {
1120
+ org_type: OrgType;
1121
+ role: Role;
1122
+ ship_index: number;
1123
+ fleet_len: number;
1124
+ formation: Formation;
1125
+ fleet_los_mod: number | null;
1126
+ night_conditions: NightFleetConditions;
1127
+ }
1128
+
1098
1129
  export interface MasterShip {
1099
1130
  ship_id: number;
1100
1131
  name: string;
@@ -1275,43 +1306,6 @@ export interface GearState {
1275
1306
  stars?: number;
1276
1307
  }
1277
1308
 
1278
- declare namespace SpeedGroup {
1279
- export type A = "A";
1280
- export type B1 = "B1";
1281
- export type B2 = "B2";
1282
- export type C = "C";
1283
- }
1284
-
1285
- export type SpeedGroup =
1286
- | SpeedGroup.A
1287
- | SpeedGroup.B1
1288
- | SpeedGroup.B2
1289
- | SpeedGroup.C;
1290
-
1291
- export type SlotSizeVec = (number | null)[];
1292
-
1293
- export interface NightFleetConditions {
1294
- night_contact_rank?: ContactRank | null;
1295
- starshell_index?: number | null;
1296
- searchlight_index?: number | null;
1297
- activates_large_searchlight?: boolean;
1298
- }
1299
-
1300
- export interface NightConditions {
1301
- player?: NightFleetConditions;
1302
- enemy?: NightFleetConditions;
1303
- }
1304
-
1305
- export interface BattleConditions {
1306
- org_type: OrgType;
1307
- role: Role;
1308
- ship_index: number;
1309
- fleet_len: number;
1310
- formation: Formation;
1311
- fleet_los_mod: number | null;
1312
- night_conditions: NightFleetConditions;
1313
- }
1314
-
1315
1309
  export interface MasterGear {
1316
1310
  gear_id: number;
1317
1311
  name: string;
@@ -1343,7 +1337,20 @@ export interface ActionReport<T> {
1343
1337
  is_active: boolean;
1344
1338
  }
1345
1339
 
1346
- export type GearTypeIdArray = [number, number, number, number, number];
1340
+ declare namespace SpeedGroup {
1341
+ export type A = "A";
1342
+ export type B1 = "B1";
1343
+ export type B2 = "B2";
1344
+ export type C = "C";
1345
+ }
1346
+
1347
+ export type SpeedGroup =
1348
+ | SpeedGroup.A
1349
+ | SpeedGroup.B1
1350
+ | SpeedGroup.B2
1351
+ | SpeedGroup.C;
1352
+
1353
+ export type SlotSizeVec = (number | null)[];
1347
1354
 
1348
1355
  declare namespace ShipType {
1349
1356
  export type Unknown = "Unknown";
@@ -1417,19 +1424,6 @@ export type ShipCategory =
1417
1424
  | ShipCategory.Submarine
1418
1425
  | ShipCategory.AuxiliaryShip;
1419
1426
 
1420
- declare namespace MoraleState {
1421
- export type Sparkle = "Sparkle";
1422
- export type Normal = "Normal";
1423
- export type Orange = "Orange";
1424
- export type Red = "Red";
1425
- }
1426
-
1427
- export type MoraleState =
1428
- | MoraleState.Sparkle
1429
- | MoraleState.Normal
1430
- | MoraleState.Orange
1431
- | MoraleState.Red;
1432
-
1433
1427
  export interface FleetCutinAnalysis {
1434
1428
  shelling: FleetCutinReport<ShellingStyle>[];
1435
1429
  night: FleetCutinReport<NightAttackStyle>[];
@@ -1494,17 +1488,6 @@ export class AirSquadron {
1494
1488
  */
1495
1489
  export class Analyzer {
1496
1490
  free(): void;
1497
- /**
1498
- * @param {AttackAnalyzerConfig} config
1499
- * @param {Ship} attacker
1500
- * @param {Ship} target
1501
- * @returns {AttackAnalysis}
1502
- */
1503
- analyze_attack(
1504
- config: AttackAnalyzerConfig,
1505
- attacker: Ship,
1506
- target: Ship
1507
- ): AttackAnalysis;
1508
1491
  /**
1509
1492
  * @param {ShipAnalyzerConfig} config
1510
1493
  * @param {Ship} left
@@ -1512,7 +1495,7 @@ export class Analyzer {
1512
1495
  * @param {boolean} attacker_is_left
1513
1496
  * @returns {AttackAnalysis}
1514
1497
  */
1515
- analyze_attack_by_ship_analyzer(
1498
+ analyze_ship_attack(
1516
1499
  config: ShipAnalyzerConfig,
1517
1500
  left: Ship,
1518
1501
  right: Ship,
@@ -2341,6 +2324,10 @@ export class Ship {
2341
2324
  * @returns {boolean}
2342
2325
  */
2343
2326
  is_installation(): boolean;
2327
+ /**
2328
+ * @returns {boolean}
2329
+ */
2330
+ is_pt_imp(): boolean;
2344
2331
  /**
2345
2332
  * @param {number} index
2346
2333
  * @returns {number | undefined}
@@ -122,6 +122,16 @@ module.exports.parse_ship_conditions = function(value) {
122
122
  return takeObject(ret);
123
123
  };
124
124
 
125
+ /**
126
+ */
127
+ module.exports.set_panic_hook = function() {
128
+ wasm.set_panic_hook();
129
+ };
130
+
131
+ const u32CvtShim = new Uint32Array(2);
132
+
133
+ const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
134
+
125
135
  function _assertClass(instance, klass) {
126
136
  if (!(instance instanceof klass)) {
127
137
  throw new Error(`expected instance of ${klass.name}`);
@@ -129,10 +139,6 @@ function _assertClass(instance, klass) {
129
139
  return instance.ptr;
130
140
  }
131
141
 
132
- const u32CvtShim = new Uint32Array(2);
133
-
134
- const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
135
-
136
142
  let cachedFloat64Memory0 = new Float64Array();
137
143
 
138
144
  function getFloat64Memory0() {
@@ -188,11 +194,6 @@ function getUint16Memory0() {
188
194
  function getArrayU16FromWasm0(ptr, len) {
189
195
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
190
196
  }
191
- /**
192
- */
193
- module.exports.set_panic_hook = function() {
194
- wasm.set_panic_hook();
195
- };
196
197
 
197
198
  function passArray16ToWasm0(arg, malloc) {
198
199
  const ptr = malloc(arg.length * 2);
@@ -391,28 +392,16 @@ class Analyzer {
391
392
  wasm.__wbg_analyzer_free(ptr);
392
393
  }
393
394
  /**
394
- * @param {AttackAnalyzerConfig} config
395
- * @param {Ship} attacker
396
- * @param {Ship} target
397
- * @returns {AttackAnalysis}
398
- */
399
- analyze_attack(config, attacker, target) {
400
- _assertClass(attacker, Ship);
401
- _assertClass(target, Ship);
402
- const ret = wasm.analyzer_analyze_attack(this.ptr, addHeapObject(config), attacker.ptr, target.ptr);
403
- return takeObject(ret);
404
- }
405
- /**
406
395
  * @param {ShipAnalyzerConfig} config
407
396
  * @param {Ship} left
408
397
  * @param {Ship} right
409
398
  * @param {boolean} attacker_is_left
410
399
  * @returns {AttackAnalysis}
411
400
  */
412
- analyze_attack_by_ship_analyzer(config, left, right, attacker_is_left) {
401
+ analyze_ship_attack(config, left, right, attacker_is_left) {
413
402
  _assertClass(left, Ship);
414
403
  _assertClass(right, Ship);
415
- const ret = wasm.analyzer_analyze_attack_by_ship_analyzer(this.ptr, addHeapObject(config), left.ptr, right.ptr, attacker_is_left);
404
+ const ret = wasm.analyzer_analyze_ship_attack(this.ptr, addHeapObject(config), left.ptr, right.ptr, attacker_is_left);
416
405
  return takeObject(ret);
417
406
  }
418
407
  /**
@@ -2905,6 +2894,13 @@ class Ship {
2905
2894
  return ret !== 0;
2906
2895
  }
2907
2896
  /**
2897
+ * @returns {boolean}
2898
+ */
2899
+ is_pt_imp() {
2900
+ const ret = wasm.ship_is_pt_imp(this.ptr);
2901
+ return ret !== 0;
2902
+ }
2903
+ /**
2908
2904
  * @param {number} index
2909
2905
  * @returns {number | undefined}
2910
2906
  */
@@ -3149,7 +3145,7 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
3149
3145
  return addHeapObject(ret);
3150
3146
  };
3151
3147
 
3152
- module.exports.__wbg_createEquipmentBonuses_4dfd93761a82c393 = function(arg0, arg1) {
3148
+ module.exports.__wbg_createEquipmentBonuses_20d68e94d9cee574 = function(arg0, arg1) {
3153
3149
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3154
3150
  return addHeapObject(ret);
3155
3151
  };
Binary file
@@ -2,12 +2,7 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export function parse_ship_conditions(a: number): number;
5
- export function __wbg_analyzer_free(a: number): void;
6
- export function analyzer_analyze_attack(a: number, b: number, c: number, d: number): number;
7
- export function analyzer_analyze_attack_by_ship_analyzer(a: number, b: number, c: number, d: number, e: number): number;
8
- export function analyzer_analyze_node_attack(a: number, b: number, c: number, d: number, e: number, f: number): number;
9
- export function analyzer_analyze_comp(a: number, b: number, c: number): number;
10
- export function analyzer_simulate_support_shelling(a: number, b: number, c: number, d: number, e: number, f: number): void;
5
+ export function set_panic_hook(): void;
11
6
  export function __wbg_ship_free(a: number): void;
12
7
  export function __wbg_get_ship_id(a: number, b: number): void;
13
8
  export function __wbg_set_ship_id(a: number, b: number, c: number): void;
@@ -79,6 +74,7 @@ export function ship_speed(a: number): number;
79
74
  export function ship_accuracy(a: number): number;
80
75
  export function ship_innate_torpedo_accuracy(a: number): number;
81
76
  export function ship_is_installation(a: number): number;
77
+ export function ship_is_pt_imp(a: number): number;
82
78
  export function ship_get_slot_size(a: number, b: number): number;
83
79
  export function ship_get_max_slot_size(a: number, b: number): number;
84
80
  export function ship_remaining_ammo_mod(a: number): number;
@@ -217,6 +213,11 @@ export function comp_fighter_power(a: number, b: number, c: number, d: number):
217
213
  export function comp_elos(a: number, b: number, c: number): void;
218
214
  export function comp_transport_point(a: number): number;
219
215
  export function comp_get_ship_conditions(a: number, b: number, c: number): number;
216
+ export function __wbg_analyzer_free(a: number): void;
217
+ export function analyzer_analyze_ship_attack(a: number, b: number, c: number, d: number, e: number): number;
218
+ export function analyzer_analyze_node_attack(a: number, b: number, c: number, d: number, e: number, f: number): number;
219
+ export function analyzer_analyze_comp(a: number, b: number, c: number): number;
220
+ export function analyzer_simulate_support_shelling(a: number, b: number, c: number, d: number, e: number, f: number): void;
220
221
  export function __wbg_org_free(a: number): void;
221
222
  export function __wbg_get_org_id(a: number, b: number): void;
222
223
  export function __wbg_set_org_id(a: number, b: number, c: number): void;
@@ -302,7 +303,6 @@ export function fhcore_create_all_ships(a: number): number;
302
303
  export function fhcore_create_comp_by_map_enemy(a: number, b: number, c: number, d: number, e: number): number;
303
304
  export function fhcore_create_default_ship(a: number): number;
304
305
  export function fhcore_create_analyzer(a: number): number;
305
- export function set_panic_hook(): void;
306
306
  export function __wbindgen_malloc(a: number): number;
307
307
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
308
308
  export function __wbindgen_add_to_stack_pointer(a: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleethub-core",
3
- "version": "1.8.2",
3
+ "version": "1.8.5",
4
4
  "license": "UNLICENSED",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -8,10 +8,37 @@ export function parse_ship_conditions(value: ShipConditions): ShipConditions;
8
8
  /**
9
9
  */
10
10
  export function set_panic_hook(): void;
11
+ declare namespace Side {
12
+ export type Player = "Player";
13
+ export type Enemy = "Enemy";
14
+ }
15
+
16
+ export type Side = Side.Player | Side.Enemy;
17
+
11
18
  export interface ShipConditions extends ShipPosition {
12
19
  formation?: Formation;
13
20
  }
14
21
 
22
+ declare namespace Role {
23
+ export type Main = "Main";
24
+ export type Escort = "Escort";
25
+ }
26
+
27
+ export type Role = Role.Main | Role.Escort;
28
+
29
+ declare namespace Engagement {
30
+ export type GreenT = "GreenT";
31
+ export type Parallel = "Parallel";
32
+ export type HeadOn = "HeadOn";
33
+ export type RedT = "RedT";
34
+ }
35
+
36
+ export type Engagement =
37
+ | Engagement.GreenT
38
+ | Engagement.Parallel
39
+ | Engagement.HeadOn
40
+ | Engagement.RedT;
41
+
15
42
  export interface BattleDefinitions {
16
43
  formation: Record<Formation, NestedFormationDef>;
17
44
  anti_air_cutin: Record<number, AntiAirCutinDef>;
@@ -73,12 +100,6 @@ export interface FormationCombatModifiersDef {
73
100
  evasion_mod?: number;
74
101
  }
75
102
 
76
- export interface SupportShellingSimulatorParams {
77
- attacker_formation?: Formation;
78
- target_formation?: Formation;
79
- engagement: Engagement;
80
- }
81
-
82
103
  export interface ShipAnalyzerConfig {
83
104
  air_state?: AirState;
84
105
  engagement?: Engagement;
@@ -86,6 +107,8 @@ export interface ShipAnalyzerConfig {
86
107
  right?: AttackAnalyzerShipConfig;
87
108
  }
88
109
 
110
+ export type GearTypeIdArray = [number, number, number, number, number];
111
+
89
112
  declare namespace SpecialEnemyType {
90
113
  export type None = "None";
91
114
  export type SoftSkinned = "SoftSkinned";
@@ -109,6 +132,19 @@ export type SpecialEnemyType =
109
132
  | SpecialEnemyType.BattleshipSummerPrincess
110
133
  | SpecialEnemyType.HeavyCruiserSummerPrincess;
111
134
 
135
+ declare namespace MoraleState {
136
+ export type Sparkle = "Sparkle";
137
+ export type Normal = "Normal";
138
+ export type Orange = "Orange";
139
+ export type Red = "Red";
140
+ }
141
+
142
+ export type MoraleState =
143
+ | MoraleState.Sparkle
144
+ | MoraleState.Normal
145
+ | MoraleState.Orange
146
+ | MoraleState.Red;
147
+
112
148
  type __NightCutinLikeFleetCutin = FleetCutin;
113
149
  type __NightCutinLikeNightCutin = NightCutin;
114
150
  declare namespace NightCutinLike {
@@ -240,21 +276,6 @@ export interface SimulatorResultItem {
240
276
  damage_state_map: Record<DamageState, number>;
241
277
  }
242
278
 
243
- declare namespace DamageState {
244
- export type Normal = "Normal";
245
- export type Shouha = "Shouha";
246
- export type Chuuha = "Chuuha";
247
- export type Taiha = "Taiha";
248
- export type Sunk = "Sunk";
249
- }
250
-
251
- export type DamageState =
252
- | DamageState.Normal
253
- | DamageState.Shouha
254
- | DamageState.Chuuha
255
- | DamageState.Taiha
256
- | DamageState.Sunk;
257
-
258
279
  declare namespace GearCategory {
259
280
  export type Fighter = "Fighter";
260
281
  export type Bomber = "Bomber";
@@ -409,48 +430,37 @@ export type GearType =
409
430
  | GearType.CbRecon2
410
431
  | GearType.SecondaryGun2;
411
432
 
412
- declare namespace AirStateRank {
413
- export type Rank0 = "Rank0";
414
- export type Rank1 = "Rank1";
415
- export type Rank2 = "Rank2";
416
- export type Rank3 = "Rank3";
433
+ declare namespace DamageState {
434
+ export type Normal = "Normal";
435
+ export type Shouha = "Shouha";
436
+ export type Chuuha = "Chuuha";
437
+ export type Taiha = "Taiha";
438
+ export type Sunk = "Sunk";
417
439
  }
418
440
 
419
- export type AirStateRank =
420
- | AirStateRank.Rank0
421
- | AirStateRank.Rank1
422
- | AirStateRank.Rank2
423
- | AirStateRank.Rank3;
441
+ export type DamageState =
442
+ | DamageState.Normal
443
+ | DamageState.Shouha
444
+ | DamageState.Chuuha
445
+ | DamageState.Taiha
446
+ | DamageState.Sunk;
424
447
 
425
- declare namespace AirState {
426
- export type AirSupremacy = "AirSupremacy";
427
- export type AirSuperiority = "AirSuperiority";
428
- export type AirParity = "AirParity";
429
- export type AirDenial = "AirDenial";
430
- export type AirIncapability = "AirIncapability";
448
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
449
+ formation?: Formation;
431
450
  }
432
451
 
433
- export type AirState =
434
- | AirState.AirSupremacy
435
- | AirState.AirSuperiority
436
- | AirState.AirParity
437
- | AirState.AirDenial
438
- | AirState.AirIncapability;
439
-
440
- declare namespace Side {
441
- export type Player = "Player";
442
- export type Enemy = "Enemy";
452
+ export interface NodeAttackAnalyzerConfig {
453
+ air_state?: AirState;
454
+ engagement?: Engagement;
455
+ left?: NodeAttackAnalyzerShipConfig;
456
+ right?: NodeAttackAnalyzerShipConfig;
443
457
  }
444
458
 
445
- export type Side = Side.Player | Side.Enemy;
446
-
447
- declare namespace Role {
448
- export type Main = "Main";
449
- export type Escort = "Escort";
459
+ export interface NodeAttackAnalysis {
460
+ left: AttackAnalysis;
461
+ right: AttackAnalysis;
450
462
  }
451
463
 
452
- export type Role = Role.Main | Role.Escort;
453
-
454
464
  export interface ShipPosition {
455
465
  org_type?: OrgType;
456
466
  fleet_type?: FleetType;
@@ -473,19 +483,6 @@ export interface ShipMeta {
473
483
  ship_id: number;
474
484
  }
475
485
 
476
- declare namespace Engagement {
477
- export type GreenT = "GreenT";
478
- export type Parallel = "Parallel";
479
- export type HeadOn = "HeadOn";
480
- export type RedT = "RedT";
481
- }
482
-
483
- export type Engagement =
484
- | Engagement.GreenT
485
- | Engagement.Parallel
486
- | Engagement.HeadOn
487
- | Engagement.RedT;
488
-
489
486
  export type TorpedoAttackType = null;
490
487
 
491
488
  type __NightPhaseAttackTypeAswAttackType = AswAttackType;
@@ -559,7 +556,36 @@ declare namespace AswAttackType {
559
556
 
560
557
  export type AswAttackType = AswAttackType.DepthCharge | AswAttackType.Aircraft;
561
558
 
559
+ declare namespace AirStateRank {
560
+ export type Rank0 = "Rank0";
561
+ export type Rank1 = "Rank1";
562
+ export type Rank2 = "Rank2";
563
+ export type Rank3 = "Rank3";
564
+ }
565
+
566
+ export type AirStateRank =
567
+ | AirStateRank.Rank0
568
+ | AirStateRank.Rank1
569
+ | AirStateRank.Rank2
570
+ | AirStateRank.Rank3;
571
+
572
+ declare namespace AirState {
573
+ export type AirSupremacy = "AirSupremacy";
574
+ export type AirSuperiority = "AirSuperiority";
575
+ export type AirParity = "AirParity";
576
+ export type AirDenial = "AirDenial";
577
+ export type AirIncapability = "AirIncapability";
578
+ }
579
+
580
+ export type AirState =
581
+ | AirState.AirSupremacy
582
+ | AirState.AirSuperiority
583
+ | AirState.AirParity
584
+ | AirState.AirDenial
585
+ | AirState.AirIncapability;
586
+
562
587
  export interface MasterData {
588
+ created_at: number;
563
589
  gears: MasterGear[];
564
590
  gear_attrs: MasterAttrRule<GearAttr>[];
565
591
  ships: MasterShip[];
@@ -585,35 +611,6 @@ export interface MasterAttrRule<T> {
585
611
  expr: string;
586
612
  }
587
613
 
588
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
589
- formation?: Formation;
590
- }
591
-
592
- export interface NodeAttackAnalyzerConfig {
593
- air_state?: AirState;
594
- engagement?: Engagement;
595
- left?: NodeAttackAnalyzerShipConfig;
596
- right?: NodeAttackAnalyzerShipConfig;
597
- }
598
-
599
- export interface NodeAttackAnalysis {
600
- left: AttackAnalysis;
601
- right: AttackAnalysis;
602
- }
603
-
604
- export interface AttackAnalyzerConfig {
605
- air_state?: AirState;
606
- engagement?: Engagement;
607
- attacker?: AttackAnalyzerShipConfig;
608
- target?: AttackAnalyzerShipConfig;
609
- }
610
-
611
- export interface AttackAnalyzerShipConfig
612
- extends ShipConditions,
613
- NightFleetConditions {
614
- fleet_los_mod?: number | null;
615
- }
616
-
617
614
  export interface EBonuses {
618
615
  firepower: number;
619
616
  torpedo: number;
@@ -704,6 +701,12 @@ export type OrgType =
704
701
  | OrgType.EnemySingle
705
702
  | OrgType.EnemyCombined;
706
703
 
704
+ export interface SupportShellingSimulatorParams {
705
+ attacker_formation?: Formation;
706
+ target_formation?: Formation;
707
+ engagement: Engagement;
708
+ }
709
+
707
710
  declare namespace GearAttr {
708
711
  export type Unknown = "Unknown";
709
712
  export type Abyssal = "Abyssal";
@@ -1084,6 +1087,12 @@ export interface DayContactChance {
1084
1087
  total: number;
1085
1088
  }
1086
1089
 
1090
+ export interface AttackAnalyzerShipConfig
1091
+ extends ShipConditions,
1092
+ NightFleetConditions {
1093
+ fleet_los_mod?: number | null;
1094
+ }
1095
+
1087
1096
  export interface AttackAnalysis {
1088
1097
  attacker_is_player: boolean;
1089
1098
  attacker_ship_id: number;
@@ -1095,6 +1104,28 @@ export interface AttackAnalysis {
1095
1104
  support_shelling: ActionReport<SupportShellingStyle>;
1096
1105
  }
1097
1106
 
1107
+ export interface NightFleetConditions {
1108
+ night_contact_rank?: ContactRank | null;
1109
+ starshell_index?: number | null;
1110
+ searchlight_index?: number | null;
1111
+ activates_large_searchlight?: boolean;
1112
+ }
1113
+
1114
+ export interface NightConditions {
1115
+ player?: NightFleetConditions;
1116
+ enemy?: NightFleetConditions;
1117
+ }
1118
+
1119
+ export interface BattleConditions {
1120
+ org_type: OrgType;
1121
+ role: Role;
1122
+ ship_index: number;
1123
+ fleet_len: number;
1124
+ formation: Formation;
1125
+ fleet_los_mod: number | null;
1126
+ night_conditions: NightFleetConditions;
1127
+ }
1128
+
1098
1129
  export interface MasterShip {
1099
1130
  ship_id: number;
1100
1131
  name: string;
@@ -1275,43 +1306,6 @@ export interface GearState {
1275
1306
  stars?: number;
1276
1307
  }
1277
1308
 
1278
- declare namespace SpeedGroup {
1279
- export type A = "A";
1280
- export type B1 = "B1";
1281
- export type B2 = "B2";
1282
- export type C = "C";
1283
- }
1284
-
1285
- export type SpeedGroup =
1286
- | SpeedGroup.A
1287
- | SpeedGroup.B1
1288
- | SpeedGroup.B2
1289
- | SpeedGroup.C;
1290
-
1291
- export type SlotSizeVec = (number | null)[];
1292
-
1293
- export interface NightFleetConditions {
1294
- night_contact_rank?: ContactRank | null;
1295
- starshell_index?: number | null;
1296
- searchlight_index?: number | null;
1297
- activates_large_searchlight?: boolean;
1298
- }
1299
-
1300
- export interface NightConditions {
1301
- player?: NightFleetConditions;
1302
- enemy?: NightFleetConditions;
1303
- }
1304
-
1305
- export interface BattleConditions {
1306
- org_type: OrgType;
1307
- role: Role;
1308
- ship_index: number;
1309
- fleet_len: number;
1310
- formation: Formation;
1311
- fleet_los_mod: number | null;
1312
- night_conditions: NightFleetConditions;
1313
- }
1314
-
1315
1309
  export interface MasterGear {
1316
1310
  gear_id: number;
1317
1311
  name: string;
@@ -1343,7 +1337,20 @@ export interface ActionReport<T> {
1343
1337
  is_active: boolean;
1344
1338
  }
1345
1339
 
1346
- export type GearTypeIdArray = [number, number, number, number, number];
1340
+ declare namespace SpeedGroup {
1341
+ export type A = "A";
1342
+ export type B1 = "B1";
1343
+ export type B2 = "B2";
1344
+ export type C = "C";
1345
+ }
1346
+
1347
+ export type SpeedGroup =
1348
+ | SpeedGroup.A
1349
+ | SpeedGroup.B1
1350
+ | SpeedGroup.B2
1351
+ | SpeedGroup.C;
1352
+
1353
+ export type SlotSizeVec = (number | null)[];
1347
1354
 
1348
1355
  declare namespace ShipType {
1349
1356
  export type Unknown = "Unknown";
@@ -1417,19 +1424,6 @@ export type ShipCategory =
1417
1424
  | ShipCategory.Submarine
1418
1425
  | ShipCategory.AuxiliaryShip;
1419
1426
 
1420
- declare namespace MoraleState {
1421
- export type Sparkle = "Sparkle";
1422
- export type Normal = "Normal";
1423
- export type Orange = "Orange";
1424
- export type Red = "Red";
1425
- }
1426
-
1427
- export type MoraleState =
1428
- | MoraleState.Sparkle
1429
- | MoraleState.Normal
1430
- | MoraleState.Orange
1431
- | MoraleState.Red;
1432
-
1433
1427
  export interface FleetCutinAnalysis {
1434
1428
  shelling: FleetCutinReport<ShellingStyle>[];
1435
1429
  night: FleetCutinReport<NightAttackStyle>[];
@@ -1494,17 +1488,6 @@ export class AirSquadron {
1494
1488
  */
1495
1489
  export class Analyzer {
1496
1490
  free(): void;
1497
- /**
1498
- * @param {AttackAnalyzerConfig} config
1499
- * @param {Ship} attacker
1500
- * @param {Ship} target
1501
- * @returns {AttackAnalysis}
1502
- */
1503
- analyze_attack(
1504
- config: AttackAnalyzerConfig,
1505
- attacker: Ship,
1506
- target: Ship
1507
- ): AttackAnalysis;
1508
1491
  /**
1509
1492
  * @param {ShipAnalyzerConfig} config
1510
1493
  * @param {Ship} left
@@ -1512,7 +1495,7 @@ export class Analyzer {
1512
1495
  * @param {boolean} attacker_is_left
1513
1496
  * @returns {AttackAnalysis}
1514
1497
  */
1515
- analyze_attack_by_ship_analyzer(
1498
+ analyze_ship_attack(
1516
1499
  config: ShipAnalyzerConfig,
1517
1500
  left: Ship,
1518
1501
  right: Ship,
@@ -2341,6 +2324,10 @@ export class Ship {
2341
2324
  * @returns {boolean}
2342
2325
  */
2343
2326
  is_installation(): boolean;
2327
+ /**
2328
+ * @returns {boolean}
2329
+ */
2330
+ is_pt_imp(): boolean;
2344
2331
  /**
2345
2332
  * @param {number} index
2346
2333
  * @returns {number | undefined}
@@ -123,6 +123,16 @@ export function parse_ship_conditions(value) {
123
123
  return takeObject(ret);
124
124
  }
125
125
 
126
+ /**
127
+ */
128
+ export function set_panic_hook() {
129
+ wasm.set_panic_hook();
130
+ }
131
+
132
+ const u32CvtShim = new Uint32Array(2);
133
+
134
+ const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
135
+
126
136
  function _assertClass(instance, klass) {
127
137
  if (!(instance instanceof klass)) {
128
138
  throw new Error(`expected instance of ${klass.name}`);
@@ -130,10 +140,6 @@ function _assertClass(instance, klass) {
130
140
  return instance.ptr;
131
141
  }
132
142
 
133
- const u32CvtShim = new Uint32Array(2);
134
-
135
- const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
136
-
137
143
  let cachedFloat64Memory0 = new Float64Array();
138
144
 
139
145
  function getFloat64Memory0() {
@@ -189,11 +195,6 @@ function getUint16Memory0() {
189
195
  function getArrayU16FromWasm0(ptr, len) {
190
196
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
191
197
  }
192
- /**
193
- */
194
- export function set_panic_hook() {
195
- wasm.set_panic_hook();
196
- }
197
198
 
198
199
  function passArray16ToWasm0(arg, malloc) {
199
200
  const ptr = malloc(arg.length * 2);
@@ -391,28 +392,16 @@ export class Analyzer {
391
392
  wasm.__wbg_analyzer_free(ptr);
392
393
  }
393
394
  /**
394
- * @param {AttackAnalyzerConfig} config
395
- * @param {Ship} attacker
396
- * @param {Ship} target
397
- * @returns {AttackAnalysis}
398
- */
399
- analyze_attack(config, attacker, target) {
400
- _assertClass(attacker, Ship);
401
- _assertClass(target, Ship);
402
- const ret = wasm.analyzer_analyze_attack(this.ptr, addHeapObject(config), attacker.ptr, target.ptr);
403
- return takeObject(ret);
404
- }
405
- /**
406
395
  * @param {ShipAnalyzerConfig} config
407
396
  * @param {Ship} left
408
397
  * @param {Ship} right
409
398
  * @param {boolean} attacker_is_left
410
399
  * @returns {AttackAnalysis}
411
400
  */
412
- analyze_attack_by_ship_analyzer(config, left, right, attacker_is_left) {
401
+ analyze_ship_attack(config, left, right, attacker_is_left) {
413
402
  _assertClass(left, Ship);
414
403
  _assertClass(right, Ship);
415
- const ret = wasm.analyzer_analyze_attack_by_ship_analyzer(this.ptr, addHeapObject(config), left.ptr, right.ptr, attacker_is_left);
404
+ const ret = wasm.analyzer_analyze_ship_attack(this.ptr, addHeapObject(config), left.ptr, right.ptr, attacker_is_left);
416
405
  return takeObject(ret);
417
406
  }
418
407
  /**
@@ -2898,6 +2887,13 @@ export class Ship {
2898
2887
  return ret !== 0;
2899
2888
  }
2900
2889
  /**
2890
+ * @returns {boolean}
2891
+ */
2892
+ is_pt_imp() {
2893
+ const ret = wasm.ship_is_pt_imp(this.ptr);
2894
+ return ret !== 0;
2895
+ }
2896
+ /**
2901
2897
  * @param {number} index
2902
2898
  * @returns {number | undefined}
2903
2899
  */
@@ -3141,7 +3137,7 @@ export function __wbindgen_string_new(arg0, arg1) {
3141
3137
  return addHeapObject(ret);
3142
3138
  };
3143
3139
 
3144
- export function __wbg_createEquipmentBonuses_4dfd93761a82c393(arg0, arg1) {
3140
+ export function __wbg_createEquipmentBonuses_20d68e94d9cee574(arg0, arg1) {
3145
3141
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3146
3142
  return addHeapObject(ret);
3147
3143
  };
Binary file
@@ -2,12 +2,7 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export function parse_ship_conditions(a: number): number;
5
- export function __wbg_analyzer_free(a: number): void;
6
- export function analyzer_analyze_attack(a: number, b: number, c: number, d: number): number;
7
- export function analyzer_analyze_attack_by_ship_analyzer(a: number, b: number, c: number, d: number, e: number): number;
8
- export function analyzer_analyze_node_attack(a: number, b: number, c: number, d: number, e: number, f: number): number;
9
- export function analyzer_analyze_comp(a: number, b: number, c: number): number;
10
- export function analyzer_simulate_support_shelling(a: number, b: number, c: number, d: number, e: number, f: number): void;
5
+ export function set_panic_hook(): void;
11
6
  export function __wbg_ship_free(a: number): void;
12
7
  export function __wbg_get_ship_id(a: number, b: number): void;
13
8
  export function __wbg_set_ship_id(a: number, b: number, c: number): void;
@@ -79,6 +74,7 @@ export function ship_speed(a: number): number;
79
74
  export function ship_accuracy(a: number): number;
80
75
  export function ship_innate_torpedo_accuracy(a: number): number;
81
76
  export function ship_is_installation(a: number): number;
77
+ export function ship_is_pt_imp(a: number): number;
82
78
  export function ship_get_slot_size(a: number, b: number): number;
83
79
  export function ship_get_max_slot_size(a: number, b: number): number;
84
80
  export function ship_remaining_ammo_mod(a: number): number;
@@ -217,6 +213,11 @@ export function comp_fighter_power(a: number, b: number, c: number, d: number):
217
213
  export function comp_elos(a: number, b: number, c: number): void;
218
214
  export function comp_transport_point(a: number): number;
219
215
  export function comp_get_ship_conditions(a: number, b: number, c: number): number;
216
+ export function __wbg_analyzer_free(a: number): void;
217
+ export function analyzer_analyze_ship_attack(a: number, b: number, c: number, d: number, e: number): number;
218
+ export function analyzer_analyze_node_attack(a: number, b: number, c: number, d: number, e: number, f: number): number;
219
+ export function analyzer_analyze_comp(a: number, b: number, c: number): number;
220
+ export function analyzer_simulate_support_shelling(a: number, b: number, c: number, d: number, e: number, f: number): void;
220
221
  export function __wbg_org_free(a: number): void;
221
222
  export function __wbg_get_org_id(a: number, b: number): void;
222
223
  export function __wbg_set_org_id(a: number, b: number, c: number): void;
@@ -302,7 +303,6 @@ export function fhcore_create_all_ships(a: number): number;
302
303
  export function fhcore_create_comp_by_map_enemy(a: number, b: number, c: number, d: number, e: number): number;
303
304
  export function fhcore_create_default_ship(a: number): number;
304
305
  export function fhcore_create_analyzer(a: number): number;
305
- export function set_panic_hook(): void;
306
306
  export function __wbindgen_malloc(a: number): number;
307
307
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
308
308
  export function __wbindgen_add_to_stack_pointer(a: number): number;