tsacnhsaves 0.1.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.
- package/LICENSE +674 -0
- package/README.md +37 -0
- package/dist/encryption/aes-ctr.d.ts +14 -0
- package/dist/encryption/aes-ctr.d.ts.map +1 -0
- package/dist/encryption/aes-ctr.js +28 -0
- package/dist/encryption/aes-ctr.js.map +1 -0
- package/dist/encryption/encrypted-int32.d.ts +18 -0
- package/dist/encryption/encrypted-int32.d.ts.map +1 -0
- package/dist/encryption/encrypted-int32.js +50 -0
- package/dist/encryption/encrypted-int32.js.map +1 -0
- package/dist/encryption/encrypted-int32.test.d.ts +2 -0
- package/dist/encryption/encrypted-int32.test.d.ts.map +1 -0
- package/dist/encryption/encrypted-int32.test.js +45 -0
- package/dist/encryption/encrypted-int32.test.js.map +1 -0
- package/dist/encryption/encryption.d.ts +23 -0
- package/dist/encryption/encryption.d.ts.map +1 -0
- package/dist/encryption/encryption.js +71 -0
- package/dist/encryption/encryption.js.map +1 -0
- package/dist/encryption/index.d.ts +6 -0
- package/dist/encryption/index.d.ts.map +1 -0
- package/dist/encryption/index.js +4 -0
- package/dist/encryption/index.js.map +1 -0
- package/dist/encryption/xor-shift-128.d.ts +17 -0
- package/dist/encryption/xor-shift-128.d.ts.map +1 -0
- package/dist/encryption/xor-shift-128.js +37 -0
- package/dist/encryption/xor-shift-128.js.map +1 -0
- package/dist/encryption/xor-shift-128.test.d.ts +2 -0
- package/dist/encryption/xor-shift-128.test.d.ts.map +1 -0
- package/dist/encryption/xor-shift-128.test.js +53 -0
- package/dist/encryption/xor-shift-128.test.js.map +1 -0
- package/dist/hashing/file-hash-info.d.ts +14 -0
- package/dist/hashing/file-hash-info.d.ts.map +1 -0
- package/dist/hashing/file-hash-info.js +7 -0
- package/dist/hashing/file-hash-info.js.map +1 -0
- package/dist/hashing/file-hash-region.d.ts +14 -0
- package/dist/hashing/file-hash-region.d.ts.map +1 -0
- package/dist/hashing/file-hash-region.js +12 -0
- package/dist/hashing/file-hash-region.js.map +1 -0
- package/dist/hashing/file-hash-revision.d.ts +19 -0
- package/dist/hashing/file-hash-revision.d.ts.map +1 -0
- package/dist/hashing/file-hash-revision.js +391 -0
- package/dist/hashing/file-hash-revision.js.map +1 -0
- package/dist/hashing/index.d.ts +6 -0
- package/dist/hashing/index.d.ts.map +1 -0
- package/dist/hashing/index.js +4 -0
- package/dist/hashing/index.js.map +1 -0
- package/dist/hashing/murmur3.d.ts +21 -0
- package/dist/hashing/murmur3.d.ts.map +1 -0
- package/dist/hashing/murmur3.js +68 -0
- package/dist/hashing/murmur3.js.map +1 -0
- package/dist/hashing/murmur3.test.d.ts +2 -0
- package/dist/hashing/murmur3.test.d.ts.map +1 -0
- package/dist/hashing/murmur3.test.js +55 -0
- package/dist/hashing/murmur3.test.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/save/index.d.ts +2 -0
- package/dist/save/index.d.ts.map +1 -0
- package/dist/save/index.js +2 -0
- package/dist/save/index.js.map +1 -0
- package/dist/save/meta/encrypted-file-pair.d.ts +23 -0
- package/dist/save/meta/encrypted-file-pair.d.ts.map +1 -0
- package/dist/save/meta/encrypted-file-pair.js +51 -0
- package/dist/save/meta/encrypted-file-pair.js.map +1 -0
- package/dist/save/meta/file-header-info.d.ts +15 -0
- package/dist/save/meta/file-header-info.d.ts.map +1 -0
- package/dist/save/meta/file-header-info.js +24 -0
- package/dist/save/meta/file-header-info.js.map +1 -0
- package/dist/save/meta/horizon-save.d.ts +64 -0
- package/dist/save/meta/horizon-save.d.ts.map +1 -0
- package/dist/save/meta/horizon-save.js +126 -0
- package/dist/save/meta/horizon-save.js.map +1 -0
- package/dist/save/meta/horizon-save.test.d.ts +2 -0
- package/dist/save/meta/horizon-save.test.d.ts.map +1 -0
- package/dist/save/meta/horizon-save.test.js +86 -0
- package/dist/save/meta/horizon-save.test.js.map +1 -0
- package/dist/save/meta/index.d.ts +8 -0
- package/dist/save/meta/index.d.ts.map +1 -0
- package/dist/save/meta/index.js +4 -0
- package/dist/save/meta/index.js.map +1 -0
- package/dist/save/meta/revision-checker.d.ts +20 -0
- package/dist/save/meta/revision-checker.d.ts.map +1 -0
- package/dist/save/meta/revision-checker.js +152 -0
- package/dist/save/meta/revision-checker.js.map +1 -0
- package/dist/save/offsets/index.d.ts +4 -0
- package/dist/save/offsets/index.d.ts.map +1 -0
- package/dist/save/offsets/index.js +2 -0
- package/dist/save/offsets/index.js.map +1 -0
- package/dist/save/offsets/main-offsets.d.ts +50 -0
- package/dist/save/offsets/main-offsets.d.ts.map +1 -0
- package/dist/save/offsets/main-offsets.js +401 -0
- package/dist/save/offsets/main-offsets.js.map +1 -0
- package/dist/save/offsets/personal-offsets.d.ts +33 -0
- package/dist/save/offsets/personal-offsets.d.ts.map +1 -0
- package/dist/save/offsets/personal-offsets.js +259 -0
- package/dist/save/offsets/personal-offsets.js.map +1 -0
- package/dist/structures/achievements.d.ts +36 -0
- package/dist/structures/achievements.d.ts.map +1 -0
- package/dist/structures/achievements.js +223 -0
- package/dist/structures/achievements.js.map +1 -0
- package/dist/structures/building.d.ts +17 -0
- package/dist/structures/building.d.ts.map +1 -0
- package/dist/structures/building.js +25 -0
- package/dist/structures/building.js.map +1 -0
- package/dist/structures/catalog.d.ts +44 -0
- package/dist/structures/catalog.d.ts.map +1 -0
- package/dist/structures/catalog.js +86 -0
- package/dist/structures/catalog.js.map +1 -0
- package/dist/structures/date-time.d.ts +30 -0
- package/dist/structures/date-time.d.ts.map +1 -0
- package/dist/structures/date-time.js +42 -0
- package/dist/structures/date-time.js.map +1 -0
- package/dist/structures/enums.d.ts +126 -0
- package/dist/structures/enums.d.ts.map +1 -0
- package/dist/structures/enums.js +131 -0
- package/dist/structures/enums.js.map +1 -0
- package/dist/structures/index.d.ts +20 -0
- package/dist/structures/index.d.ts.map +1 -0
- package/dist/structures/index.js +11 -0
- package/dist/structures/index.js.map +1 -0
- package/dist/structures/item.d.ts +20 -0
- package/dist/structures/item.d.ts.map +1 -0
- package/dist/structures/item.js +38 -0
- package/dist/structures/item.js.map +1 -0
- package/dist/structures/museum.d.ts +15 -0
- package/dist/structures/museum.d.ts.map +1 -0
- package/dist/structures/museum.js +27 -0
- package/dist/structures/museum.js.map +1 -0
- package/dist/structures/reactions.d.ts +31 -0
- package/dist/structures/reactions.d.ts.map +1 -0
- package/dist/structures/reactions.js +65 -0
- package/dist/structures/reactions.js.map +1 -0
- package/dist/structures/recipe-book.d.ts +19 -0
- package/dist/structures/recipe-book.d.ts.map +1 -0
- package/dist/structures/recipe-book.js +41 -0
- package/dist/structures/recipe-book.js.map +1 -0
- package/dist/structures/turnips.d.ts +34 -0
- package/dist/structures/turnips.d.ts.map +1 -0
- package/dist/structures/turnips.js +37 -0
- package/dist/structures/turnips.js.map +1 -0
- package/dist/structures/villager.d.ts +49 -0
- package/dist/structures/villager.d.ts.map +1 -0
- package/dist/structures/villager.js +116 -0
- package/dist/structures/villager.js.map +1 -0
- package/dist/util/binary.d.ts +8 -0
- package/dist/util/binary.d.ts.map +1 -0
- package/dist/util/binary.js +29 -0
- package/dist/util/binary.js.map +1 -0
- package/dist/util/flags.d.ts +6 -0
- package/dist/util/flags.d.ts.map +1 -0
- package/dist/util/flags.js +14 -0
- package/dist/util/flags.js.map +1 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +2 -0
- package/dist/util/index.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item catalog (Nook Shopping / Critterpedia) tracking.
|
|
3
|
+
* Ported from NHSE.Core item collection bit flags.
|
|
4
|
+
*/
|
|
5
|
+
import { getFlag } from '../util/flags.js';
|
|
6
|
+
/**
|
|
7
|
+
* Check if an item ID has been catalogued by the player.
|
|
8
|
+
* @param data The player's personal.dat decrypted data.
|
|
9
|
+
* @param itemCollectBitOffset The ItemCollectBit offset from PersonalOffsets.
|
|
10
|
+
* @param itemId The item ID to check.
|
|
11
|
+
*/
|
|
12
|
+
export function isItemCatalogued(data, itemCollectBitOffset, itemId) {
|
|
13
|
+
return getFlag(data, itemCollectBitOffset, itemId);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the set of all catalogued item IDs up to maxId.
|
|
17
|
+
*/
|
|
18
|
+
export function getCataloguedItems(data, itemCollectBitOffset, maxId) {
|
|
19
|
+
const catalogued = new Set();
|
|
20
|
+
for (let i = 0; i < maxId; i++) {
|
|
21
|
+
if (getFlag(data, itemCollectBitOffset, i)) {
|
|
22
|
+
catalogued.add(i);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return catalogued;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if a specific remake variant has been catalogued.
|
|
29
|
+
* @param data The player's personal.dat decrypted data.
|
|
30
|
+
* @param remakeCollectBitOffset The ItemRemakeCollectBit offset from PersonalOffsets.
|
|
31
|
+
* @param remakeIndex The remake index of the item.
|
|
32
|
+
* @param variant The variant number (0-7).
|
|
33
|
+
*/
|
|
34
|
+
export function isRemakeVariantCatalogued(data, remakeCollectBitOffset, remakeIndex, variant) {
|
|
35
|
+
return getFlag(data, remakeCollectBitOffset, remakeIndex * 8 + variant);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the set of all catalogued remake variant bit indices.
|
|
39
|
+
*/
|
|
40
|
+
export function getCataloguedRemakeVariants(data, remakeCollectBitOffset, maxRemakeBitFlag) {
|
|
41
|
+
const catalogued = new Set();
|
|
42
|
+
for (let i = 0; i < maxRemakeBitFlag; i++) {
|
|
43
|
+
if (getFlag(data, remakeCollectBitOffset, i)) {
|
|
44
|
+
catalogued.add(i);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return catalogued;
|
|
48
|
+
}
|
|
49
|
+
// ---- Known creature/collectible item ID ranges ----
|
|
50
|
+
/** Fish item IDs (for Critterpedia fish tracking). */
|
|
51
|
+
export const FISH_IDS = [
|
|
52
|
+
// Base fish
|
|
53
|
+
...range(2215, 2285),
|
|
54
|
+
// Additional fish
|
|
55
|
+
328,
|
|
56
|
+
329,
|
|
57
|
+
...range(3466, 3471),
|
|
58
|
+
...range(4189, 4205),
|
|
59
|
+
5254,
|
|
60
|
+
12514,
|
|
61
|
+
];
|
|
62
|
+
/** Bug/insect item IDs (for Critterpedia bug tracking). */
|
|
63
|
+
export const BUG_IDS = [...range(582, 654), ...range(3477, 3541), 4702, 5157, 5339, 5859, 7374];
|
|
64
|
+
/** Sea creature item IDs (for diving collection). */
|
|
65
|
+
export const DIVE_IDS = [2620, ...range(2830, 2859), 6920, ...range(7191, 7412), 12968, 13105];
|
|
66
|
+
/** Art item IDs (paintings and sculptures). */
|
|
67
|
+
export const ART_IDS = [...range(2, 79), ...range(1331, 1347), ...range(12533, 12630)];
|
|
68
|
+
/** Fossil item IDs. */
|
|
69
|
+
export const FOSSIL_IDS = [...range(169, 304), ...range(4651, 4700), 7251];
|
|
70
|
+
function range(start, endExclusive) {
|
|
71
|
+
const r = [];
|
|
72
|
+
for (let i = start; i < endExclusive; i++)
|
|
73
|
+
r.push(i);
|
|
74
|
+
return r;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Count how many items from a given ID list are catalogued.
|
|
78
|
+
*/
|
|
79
|
+
export function countCatalogued(data, itemCollectBitOffset, itemIds) {
|
|
80
|
+
let catalogued = 0;
|
|
81
|
+
for (const id of itemIds) {
|
|
82
|
+
if (isItemCatalogued(data, itemCollectBitOffset, id))
|
|
83
|
+
catalogued++;
|
|
84
|
+
}
|
|
85
|
+
return { catalogued, total: itemIds.length };
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/structures/catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EA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EAAE;QAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,CAAC;AACV,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC9B,IAAgB,EAChB,oBAA4B,EAC5B,OAAiB;IAEjB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;QAC1B,IAAI,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,EAAE,EAAE,CAAC;YAAE,UAAU,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game date/time structures.
|
|
3
|
+
* Ported from NHSE.Core GSaveDate, GSaveTime, GSaveDateMD
|
|
4
|
+
*/
|
|
5
|
+
export declare const GSAVE_DATE_SIZE = 4;
|
|
6
|
+
export declare const GSAVE_TIME_SIZE = 8;
|
|
7
|
+
export declare const GSAVE_DATE_MD_SIZE = 2;
|
|
8
|
+
export interface GSaveDate {
|
|
9
|
+
year: number;
|
|
10
|
+
month: number;
|
|
11
|
+
day: number;
|
|
12
|
+
}
|
|
13
|
+
export interface GSaveTime {
|
|
14
|
+
year: number;
|
|
15
|
+
month: number;
|
|
16
|
+
day: number;
|
|
17
|
+
hour: number;
|
|
18
|
+
minute: number;
|
|
19
|
+
second: number;
|
|
20
|
+
}
|
|
21
|
+
export interface GSaveDateMD {
|
|
22
|
+
month: number;
|
|
23
|
+
day: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function readGSaveDate(data: Uint8Array, offset: number): GSaveDate;
|
|
26
|
+
export declare function readGSaveTime(data: Uint8Array, offset: number): GSaveTime;
|
|
27
|
+
export declare function readGSaveDateMD(data: Uint8Array, offset: number): GSaveDateMD;
|
|
28
|
+
export declare function isDateEmpty(date: GSaveDate): boolean;
|
|
29
|
+
export declare function formatDate(date: GSaveDate): string;
|
|
30
|
+
export declare function formatTime(time: GSaveTime): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time.d.ts","sourceRoot":"","sources":["../../src/structures/date-time.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAMzE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CASzE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAK7E;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEpD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAGlD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game date/time structures.
|
|
3
|
+
* Ported from NHSE.Core GSaveDate, GSaveTime, GSaveDateMD
|
|
4
|
+
*/
|
|
5
|
+
import { readU8, readU16LE } from '../util/binary.js';
|
|
6
|
+
export const GSAVE_DATE_SIZE = 4;
|
|
7
|
+
export const GSAVE_TIME_SIZE = 8;
|
|
8
|
+
export const GSAVE_DATE_MD_SIZE = 2;
|
|
9
|
+
export function readGSaveDate(data, offset) {
|
|
10
|
+
return {
|
|
11
|
+
year: readU16LE(data, offset),
|
|
12
|
+
month: readU8(data, offset + 2),
|
|
13
|
+
day: readU8(data, offset + 3),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function readGSaveTime(data, offset) {
|
|
17
|
+
return {
|
|
18
|
+
year: readU16LE(data, offset),
|
|
19
|
+
month: readU8(data, offset + 2),
|
|
20
|
+
day: readU8(data, offset + 3),
|
|
21
|
+
hour: readU8(data, offset + 4),
|
|
22
|
+
minute: readU8(data, offset + 5),
|
|
23
|
+
second: readU8(data, offset + 6),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function readGSaveDateMD(data, offset) {
|
|
27
|
+
return {
|
|
28
|
+
month: readU8(data, offset),
|
|
29
|
+
day: readU8(data, offset + 1),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function isDateEmpty(date) {
|
|
33
|
+
return date.year === 0 && date.month === 0 && date.day === 0;
|
|
34
|
+
}
|
|
35
|
+
export function formatDate(date) {
|
|
36
|
+
if (isDateEmpty(date))
|
|
37
|
+
return '';
|
|
38
|
+
return `${date.year}-${String(date.month).padStart(2, '0')}-${String(date.day).padStart(2, '0')}`;
|
|
39
|
+
}
|
|
40
|
+
export function formatTime(time) {
|
|
41
|
+
return `${time.year}-${String(time.month).padStart(2, '0')}-${String(time.day).padStart(2, '0')} ${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}`;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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|
+
export declare enum AirportColor {
|
|
10
|
+
Blue = 0,
|
|
11
|
+
Yellow = 1,
|
|
12
|
+
Orange = 2,
|
|
13
|
+
Green = 3
|
|
14
|
+
}
|
|
15
|
+
export declare enum IslandFlowers {
|
|
16
|
+
Windflower = 0,
|
|
17
|
+
Hyacinth = 1,
|
|
18
|
+
Tulip = 2,
|
|
19
|
+
Rose = 3,
|
|
20
|
+
Cosmos = 4,
|
|
21
|
+
Lily = 5,
|
|
22
|
+
Mums = 6,
|
|
23
|
+
Pansy = 7
|
|
24
|
+
}
|
|
25
|
+
export declare enum VillagerPersonality {
|
|
26
|
+
Lazy = 0,
|
|
27
|
+
Jock = 1,
|
|
28
|
+
Cranky = 2,
|
|
29
|
+
Smug = 3,
|
|
30
|
+
Normal = 4,
|
|
31
|
+
Peppy = 5,
|
|
32
|
+
Snooty = 6,
|
|
33
|
+
Uchi = 7,
|
|
34
|
+
None = 8
|
|
35
|
+
}
|
|
36
|
+
export declare enum Reaction {
|
|
37
|
+
None = 0,
|
|
38
|
+
Happiness = 1,
|
|
39
|
+
Laughter = 2,
|
|
40
|
+
Joy = 3,
|
|
41
|
+
Love = 4,
|
|
42
|
+
Glee = 5,
|
|
43
|
+
Aggravation = 7,
|
|
44
|
+
Worry = 9,
|
|
45
|
+
Sighing = 10,
|
|
46
|
+
Thought = 11,
|
|
47
|
+
Sadness = 12,
|
|
48
|
+
Distress = 13,
|
|
49
|
+
Sorrow = 14,
|
|
50
|
+
Amazed = 15,
|
|
51
|
+
Surprise = 16,
|
|
52
|
+
Shocked = 18,
|
|
53
|
+
ColdChill = 19,
|
|
54
|
+
Fearful = 20,
|
|
55
|
+
Agreement = 21,
|
|
56
|
+
Inspiration = 22,
|
|
57
|
+
Curiosity = 23,
|
|
58
|
+
Heartbreak = 24,
|
|
59
|
+
Sleepy = 25,
|
|
60
|
+
Bashfulness = 26,
|
|
61
|
+
Resignation = 27,
|
|
62
|
+
Mischief = 28,
|
|
63
|
+
Delight = 29,
|
|
64
|
+
Sneezing = 30,
|
|
65
|
+
Encouraging = 31,
|
|
66
|
+
Greetings = 32,
|
|
67
|
+
Pride = 33,
|
|
68
|
+
Smirking = 35,
|
|
69
|
+
Sheepishness = 36,
|
|
70
|
+
Shyness = 39,
|
|
71
|
+
Disagreement = 40,
|
|
72
|
+
Mistaken = 41,
|
|
73
|
+
Flourish = 42,
|
|
74
|
+
Daydreaming = 43,
|
|
75
|
+
Showmanship = 44,
|
|
76
|
+
Dozing = 45,
|
|
77
|
+
Intense = 47,
|
|
78
|
+
Pleased = 48,
|
|
79
|
+
Apologetic = 54,
|
|
80
|
+
Confident = 55,
|
|
81
|
+
Bewilderment = 58,
|
|
82
|
+
Scare = 60,
|
|
83
|
+
Haunt = 61,
|
|
84
|
+
SitDown = 62,
|
|
85
|
+
Yoga = 63,
|
|
86
|
+
HereYouGo = 64,
|
|
87
|
+
WorkOut = 65,
|
|
88
|
+
TakeAPicture = 66,
|
|
89
|
+
SniffSniff = 67,
|
|
90
|
+
Tada = 68,
|
|
91
|
+
WaveGoodbye = 69,
|
|
92
|
+
Excited = 70,
|
|
93
|
+
Confetti = 71,
|
|
94
|
+
Viva = 72,
|
|
95
|
+
LetsGo = 73,
|
|
96
|
+
FeelinIt = 74,
|
|
97
|
+
SayCheese = 76,
|
|
98
|
+
Eager = 77,
|
|
99
|
+
PostureWarmUp = 78,
|
|
100
|
+
ArmCircles = 79,
|
|
101
|
+
SideBends = 80,
|
|
102
|
+
BodyTwists = 81,
|
|
103
|
+
WideArmStretch = 82,
|
|
104
|
+
UpperBodyCircles = 83,
|
|
105
|
+
Jump = 84,
|
|
106
|
+
Hula = 85,
|
|
107
|
+
DoubleWave = 86,
|
|
108
|
+
ListeningEars = 87,
|
|
109
|
+
Flex = 88,
|
|
110
|
+
Jammin = 89,
|
|
111
|
+
Stretch = 90,
|
|
112
|
+
Behold = 91,
|
|
113
|
+
WorkIt = 92,
|
|
114
|
+
ActNatural = 93,
|
|
115
|
+
GroovingHop = 94,
|
|
116
|
+
GrooveRight = 95,
|
|
117
|
+
GrooveLeft = 96,
|
|
118
|
+
SoakItIn = 97,
|
|
119
|
+
Shimmy = 98,
|
|
120
|
+
Airplane = 99,
|
|
121
|
+
TwistyDance = 100,
|
|
122
|
+
ArmSwingDance = 101,
|
|
123
|
+
IslandStomp = 102,
|
|
124
|
+
SideToSide = 103,
|
|
125
|
+
TurnipPatch = 104
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/structures/enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,UAAU;IACrB,QAAQ,IAAI;IACZ,QAAQ,IAAI;CACZ;AAED,oBAAY,YAAY;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,MAAM,IAAI;IACV,KAAK,IAAI;CACT;AAED,oBAAY,aAAa;IACxB,UAAU,IAAI;IACd,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,IAAI,IAAI;IACR,MAAM,IAAI;IACV,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACT;AAED,oBAAY,mBAAmB;IAC9B,IAAI,IAAI;IACR,IAAI,IAAI;IACR,MAAM,IAAI;IACV,IAAI,IAAI;IACR,MAAM,IAAI;IACV,KAAK,IAAI;IACT,MAAM,IAAI;IACV,IAAI,IAAI;IACR,IAAI,IAAI;CACR;AAED,oBAAY,QAAQ;IACnB,IAAI,IAAI;IACR,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,IAAI,IAAI;IACR,IAAI,IAAI;IACR,WAAW,IAAI;IACf,KAAK,IAAI;IACT,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,MAAM,KAAK;IACX,QAAQ,KAAK;IACb,OAAO,KAAK;IACZ,SAAS,KAAK;IACd,OAAO,KAAK;IACZ,SAAS,KAAK;I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}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game enumerations.
|
|
3
|
+
* Ported from NHSE.Core
|
|
4
|
+
*/
|
|
5
|
+
export var Hemisphere;
|
|
6
|
+
(function (Hemisphere) {
|
|
7
|
+
Hemisphere[Hemisphere["Northern"] = 0] = "Northern";
|
|
8
|
+
Hemisphere[Hemisphere["Southern"] = 1] = "Southern";
|
|
9
|
+
})(Hemisphere || (Hemisphere = {}));
|
|
10
|
+
export var AirportColor;
|
|
11
|
+
(function (AirportColor) {
|
|
12
|
+
AirportColor[AirportColor["Blue"] = 0] = "Blue";
|
|
13
|
+
AirportColor[AirportColor["Yellow"] = 1] = "Yellow";
|
|
14
|
+
AirportColor[AirportColor["Orange"] = 2] = "Orange";
|
|
15
|
+
AirportColor[AirportColor["Green"] = 3] = "Green";
|
|
16
|
+
})(AirportColor || (AirportColor = {}));
|
|
17
|
+
export var IslandFlowers;
|
|
18
|
+
(function (IslandFlowers) {
|
|
19
|
+
IslandFlowers[IslandFlowers["Windflower"] = 0] = "Windflower";
|
|
20
|
+
IslandFlowers[IslandFlowers["Hyacinth"] = 1] = "Hyacinth";
|
|
21
|
+
IslandFlowers[IslandFlowers["Tulip"] = 2] = "Tulip";
|
|
22
|
+
IslandFlowers[IslandFlowers["Rose"] = 3] = "Rose";
|
|
23
|
+
IslandFlowers[IslandFlowers["Cosmos"] = 4] = "Cosmos";
|
|
24
|
+
IslandFlowers[IslandFlowers["Lily"] = 5] = "Lily";
|
|
25
|
+
IslandFlowers[IslandFlowers["Mums"] = 6] = "Mums";
|
|
26
|
+
IslandFlowers[IslandFlowers["Pansy"] = 7] = "Pansy";
|
|
27
|
+
})(IslandFlowers || (IslandFlowers = {}));
|
|
28
|
+
export var VillagerPersonality;
|
|
29
|
+
(function (VillagerPersonality) {
|
|
30
|
+
VillagerPersonality[VillagerPersonality["Lazy"] = 0] = "Lazy";
|
|
31
|
+
VillagerPersonality[VillagerPersonality["Jock"] = 1] = "Jock";
|
|
32
|
+
VillagerPersonality[VillagerPersonality["Cranky"] = 2] = "Cranky";
|
|
33
|
+
VillagerPersonality[VillagerPersonality["Smug"] = 3] = "Smug";
|
|
34
|
+
VillagerPersonality[VillagerPersonality["Normal"] = 4] = "Normal";
|
|
35
|
+
VillagerPersonality[VillagerPersonality["Peppy"] = 5] = "Peppy";
|
|
36
|
+
VillagerPersonality[VillagerPersonality["Snooty"] = 6] = "Snooty";
|
|
37
|
+
VillagerPersonality[VillagerPersonality["Uchi"] = 7] = "Uchi";
|
|
38
|
+
VillagerPersonality[VillagerPersonality["None"] = 8] = "None";
|
|
39
|
+
})(VillagerPersonality || (VillagerPersonality = {}));
|
|
40
|
+
export var Reaction;
|
|
41
|
+
(function (Reaction) {
|
|
42
|
+
Reaction[Reaction["None"] = 0] = "None";
|
|
43
|
+
Reaction[Reaction["Happiness"] = 1] = "Happiness";
|
|
44
|
+
Reaction[Reaction["Laughter"] = 2] = "Laughter";
|
|
45
|
+
Reaction[Reaction["Joy"] = 3] = "Joy";
|
|
46
|
+
Reaction[Reaction["Love"] = 4] = "Love";
|
|
47
|
+
Reaction[Reaction["Glee"] = 5] = "Glee";
|
|
48
|
+
Reaction[Reaction["Aggravation"] = 7] = "Aggravation";
|
|
49
|
+
Reaction[Reaction["Worry"] = 9] = "Worry";
|
|
50
|
+
Reaction[Reaction["Sighing"] = 10] = "Sighing";
|
|
51
|
+
Reaction[Reaction["Thought"] = 11] = "Thought";
|
|
52
|
+
Reaction[Reaction["Sadness"] = 12] = "Sadness";
|
|
53
|
+
Reaction[Reaction["Distress"] = 13] = "Distress";
|
|
54
|
+
Reaction[Reaction["Sorrow"] = 14] = "Sorrow";
|
|
55
|
+
Reaction[Reaction["Amazed"] = 15] = "Amazed";
|
|
56
|
+
Reaction[Reaction["Surprise"] = 16] = "Surprise";
|
|
57
|
+
Reaction[Reaction["Shocked"] = 18] = "Shocked";
|
|
58
|
+
Reaction[Reaction["ColdChill"] = 19] = "ColdChill";
|
|
59
|
+
Reaction[Reaction["Fearful"] = 20] = "Fearful";
|
|
60
|
+
Reaction[Reaction["Agreement"] = 21] = "Agreement";
|
|
61
|
+
Reaction[Reaction["Inspiration"] = 22] = "Inspiration";
|
|
62
|
+
Reaction[Reaction["Curiosity"] = 23] = "Curiosity";
|
|
63
|
+
Reaction[Reaction["Heartbreak"] = 24] = "Heartbreak";
|
|
64
|
+
Reaction[Reaction["Sleepy"] = 25] = "Sleepy";
|
|
65
|
+
Reaction[Reaction["Bashfulness"] = 26] = "Bashfulness";
|
|
66
|
+
Reaction[Reaction["Resignation"] = 27] = "Resignation";
|
|
67
|
+
Reaction[Reaction["Mischief"] = 28] = "Mischief";
|
|
68
|
+
Reaction[Reaction["Delight"] = 29] = "Delight";
|
|
69
|
+
Reaction[Reaction["Sneezing"] = 30] = "Sneezing";
|
|
70
|
+
Reaction[Reaction["Encouraging"] = 31] = "Encouraging";
|
|
71
|
+
Reaction[Reaction["Greetings"] = 32] = "Greetings";
|
|
72
|
+
Reaction[Reaction["Pride"] = 33] = "Pride";
|
|
73
|
+
Reaction[Reaction["Smirking"] = 35] = "Smirking";
|
|
74
|
+
Reaction[Reaction["Sheepishness"] = 36] = "Sheepishness";
|
|
75
|
+
Reaction[Reaction["Shyness"] = 39] = "Shyness";
|
|
76
|
+
Reaction[Reaction["Disagreement"] = 40] = "Disagreement";
|
|
77
|
+
Reaction[Reaction["Mistaken"] = 41] = "Mistaken";
|
|
78
|
+
Reaction[Reaction["Flourish"] = 42] = "Flourish";
|
|
79
|
+
Reaction[Reaction["Daydreaming"] = 43] = "Daydreaming";
|
|
80
|
+
Reaction[Reaction["Showmanship"] = 44] = "Showmanship";
|
|
81
|
+
Reaction[Reaction["Dozing"] = 45] = "Dozing";
|
|
82
|
+
Reaction[Reaction["Intense"] = 47] = "Intense";
|
|
83
|
+
Reaction[Reaction["Pleased"] = 48] = "Pleased";
|
|
84
|
+
Reaction[Reaction["Apologetic"] = 54] = "Apologetic";
|
|
85
|
+
Reaction[Reaction["Confident"] = 55] = "Confident";
|
|
86
|
+
Reaction[Reaction["Bewilderment"] = 58] = "Bewilderment";
|
|
87
|
+
Reaction[Reaction["Scare"] = 60] = "Scare";
|
|
88
|
+
Reaction[Reaction["Haunt"] = 61] = "Haunt";
|
|
89
|
+
Reaction[Reaction["SitDown"] = 62] = "SitDown";
|
|
90
|
+
Reaction[Reaction["Yoga"] = 63] = "Yoga";
|
|
91
|
+
Reaction[Reaction["HereYouGo"] = 64] = "HereYouGo";
|
|
92
|
+
Reaction[Reaction["WorkOut"] = 65] = "WorkOut";
|
|
93
|
+
Reaction[Reaction["TakeAPicture"] = 66] = "TakeAPicture";
|
|
94
|
+
Reaction[Reaction["SniffSniff"] = 67] = "SniffSniff";
|
|
95
|
+
Reaction[Reaction["Tada"] = 68] = "Tada";
|
|
96
|
+
Reaction[Reaction["WaveGoodbye"] = 69] = "WaveGoodbye";
|
|
97
|
+
Reaction[Reaction["Excited"] = 70] = "Excited";
|
|
98
|
+
Reaction[Reaction["Confetti"] = 71] = "Confetti";
|
|
99
|
+
Reaction[Reaction["Viva"] = 72] = "Viva";
|
|
100
|
+
Reaction[Reaction["LetsGo"] = 73] = "LetsGo";
|
|
101
|
+
Reaction[Reaction["FeelinIt"] = 74] = "FeelinIt";
|
|
102
|
+
Reaction[Reaction["SayCheese"] = 76] = "SayCheese";
|
|
103
|
+
Reaction[Reaction["Eager"] = 77] = "Eager";
|
|
104
|
+
Reaction[Reaction["PostureWarmUp"] = 78] = "PostureWarmUp";
|
|
105
|
+
Reaction[Reaction["ArmCircles"] = 79] = "ArmCircles";
|
|
106
|
+
Reaction[Reaction["SideBends"] = 80] = "SideBends";
|
|
107
|
+
Reaction[Reaction["BodyTwists"] = 81] = "BodyTwists";
|
|
108
|
+
Reaction[Reaction["WideArmStretch"] = 82] = "WideArmStretch";
|
|
109
|
+
Reaction[Reaction["UpperBodyCircles"] = 83] = "UpperBodyCircles";
|
|
110
|
+
Reaction[Reaction["Jump"] = 84] = "Jump";
|
|
111
|
+
Reaction[Reaction["Hula"] = 85] = "Hula";
|
|
112
|
+
Reaction[Reaction["DoubleWave"] = 86] = "DoubleWave";
|
|
113
|
+
Reaction[Reaction["ListeningEars"] = 87] = "ListeningEars";
|
|
114
|
+
Reaction[Reaction["Flex"] = 88] = "Flex";
|
|
115
|
+
Reaction[Reaction["Jammin"] = 89] = "Jammin";
|
|
116
|
+
Reaction[Reaction["Stretch"] = 90] = "Stretch";
|
|
117
|
+
Reaction[Reaction["Behold"] = 91] = "Behold";
|
|
118
|
+
Reaction[Reaction["WorkIt"] = 92] = "WorkIt";
|
|
119
|
+
Reaction[Reaction["ActNatural"] = 93] = "ActNatural";
|
|
120
|
+
Reaction[Reaction["GroovingHop"] = 94] = "GroovingHop";
|
|
121
|
+
Reaction[Reaction["GrooveRight"] = 95] = "GrooveRight";
|
|
122
|
+
Reaction[Reaction["GrooveLeft"] = 96] = "GrooveLeft";
|
|
123
|
+
Reaction[Reaction["SoakItIn"] = 97] = "SoakItIn";
|
|
124
|
+
Reaction[Reaction["Shimmy"] = 98] = "Shimmy";
|
|
125
|
+
Reaction[Reaction["Airplane"] = 99] = "Airplane";
|
|
126
|
+
Reaction[Reaction["TwistyDance"] = 100] = "TwistyDance";
|
|
127
|
+
Reaction[Reaction["ArmSwingDance"] = 101] = "ArmSwingDance";
|
|
128
|
+
Reaction[Reaction["IslandStomp"] = 102] = "IslandStomp";
|
|
129
|
+
Reaction[Reaction["SideToSide"] = 103] = "SideToSide";
|
|
130
|
+
Reaction[Reaction["TurnipPatch"] = 104] = "TurnipPatch";
|
|
131
|
+
})(Reaction || (Reaction = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/structures/enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACrB,mDAAY,CAAA;IACZ,mDAAY,CAAA;AACb,CAAC,E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,QA0FnB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { AchievementDefinition, AchievementEntry } from './achievements.js';
|
|
2
|
+
export { ACHIEVEMENT_DEFINITIONS, ACHIEVEMENT_LIST_SIZE, ACHIEVEMENT_MAX_COUNT, getAchievementDefinition, getCompletedMilestones, readAchievements, } from './achievements.js';
|
|
3
|
+
export type { Building } from './building.js';
|
|
4
|
+
export { BUILDING_SIZE, readBuilding, readBuildings } from './building.js';
|
|
5
|
+
export { ART_IDS, BUG_IDS, countCatalogued, DIVE_IDS, FISH_IDS, FOSSIL_IDS, getCataloguedItems, getCataloguedRemakeVariants, isItemCatalogued, isRemakeVariantCatalogued, } from './catalog.js';
|
|
6
|
+
export type { GSaveDate, GSaveDateMD, GSaveTime } from './date-time.js';
|
|
7
|
+
export { formatDate, formatTime, GSAVE_DATE_SIZE, GSAVE_TIME_SIZE, isDateEmpty, readGSaveDate, readGSaveDateMD, readGSaveTime, } from './date-time.js';
|
|
8
|
+
export { AirportColor, Hemisphere, IslandFlowers, Reaction, VillagerPersonality } from './enums.js';
|
|
9
|
+
export type { Item } from './item.js';
|
|
10
|
+
export { displayItemId, ITEM_EXTENSION, ITEM_NONE, ITEM_SIZE, isExtension, isNone, itemCount, readItem, readItemArray, } from './item.js';
|
|
11
|
+
export type { MuseumData } from './museum.js';
|
|
12
|
+
export { getDonatedItemIds, MUSEUM_ENTRY_COUNT, MUSEUM_SIZE, readMuseum } from './museum.js';
|
|
13
|
+
export type { ReactionData } from './reactions.js';
|
|
14
|
+
export { getLearnedReactions, readReactions, readReactions15, readReactionsForRevision, } from './reactions.js';
|
|
15
|
+
export type { RecipeBookData } from './recipe-book.js';
|
|
16
|
+
export { getCraftedRecipes, getKnownRecipes, isRecipeFavorite, isRecipeKnown, isRecipeMade, isRecipeNew, RECIPE_BOOK_SIZE, RECIPE_COUNT, readRecipeBook, } from './recipe-book.js';
|
|
17
|
+
export type { TurnipPrices, TurnipStonk } from './turnips.js';
|
|
18
|
+
export { readTurnipStonk, TURNIP_STONK_SIZE, TurnipPattern } from './turnips.js';
|
|
19
|
+
export type { VillagerData, VillagerMemory } from './villager.js';
|
|
20
|
+
export { getVillagerSize, readVillager, readVillager1, readVillager2, VILLAGER1_SIZE, VILLAGER2_SIZE, } from './villager.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/structures/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EACN,OAAO,EACP,OAAO,EACP,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,yBAAyB,GACzB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACpG,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACN,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,aAAa,GACb,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7F,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACjF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,GACd,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ACHIEVEMENT_DEFINITIONS, ACHIEVEMENT_LIST_SIZE, ACHIEVEMENT_MAX_COUNT, getAchievementDefinition, getCompletedMilestones, readAchievements, } from './achievements.js';
|
|
2
|
+
export { BUILDING_SIZE, readBuilding, readBuildings } from './building.js';
|
|
3
|
+
export { ART_IDS, BUG_IDS, countCatalogued, DIVE_IDS, FISH_IDS, FOSSIL_IDS, getCataloguedItems, getCataloguedRemakeVariants, isItemCatalogued, isRemakeVariantCatalogued, } from './catalog.js';
|
|
4
|
+
export { formatDate, formatTime, GSAVE_DATE_SIZE, GSAVE_TIME_SIZE, isDateEmpty, readGSaveDate, readGSaveDateMD, readGSaveTime, } from './date-time.js';
|
|
5
|
+
export { AirportColor, Hemisphere, IslandFlowers, Reaction, VillagerPersonality } from './enums.js';
|
|
6
|
+
export { displayItemId, ITEM_EXTENSION, ITEM_NONE, ITEM_SIZE, isExtension, isNone, itemCount, readItem, readItemArray, } from './item.js';
|
|
7
|
+
export { getDonatedItemIds, MUSEUM_ENTRY_COUNT, MUSEUM_SIZE, readMuseum } from './museum.js';
|
|
8
|
+
export { getLearnedReactions, readReactions, readReactions15, readReactionsForRevision, } from './reactions.js';
|
|
9
|
+
export { getCraftedRecipes, getKnownRecipes, isRecipeFavorite, isRecipeKnown, isRecipeMade, isRecipeNew, RECIPE_BOOK_SIZE, RECIPE_COUNT, readRecipeBook, } from './recipe-book.js';
|
|
10
|
+
export { readTurnipStonk, TURNIP_STONK_SIZE, TurnipPattern } from './turnips.js';
|
|
11
|
+
export { getVillagerSize, readVillager, readVillager1, readVillager2, VILLAGER1_SIZE, VILLAGER2_SIZE, } from './villager.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structures/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EACN,OAAO,EACP,OAAO,EACP,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,yBAAyB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEpG,OAAO,EACN,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,aAAa,GACb,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7F,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,GACd,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 8-byte Item structure used throughout ACNH save data.
|
|
3
|
+
* Ported from NHSE.Core
|
|
4
|
+
*/
|
|
5
|
+
export declare const ITEM_SIZE = 8;
|
|
6
|
+
export declare const ITEM_NONE = 65534;
|
|
7
|
+
export declare const ITEM_EXTENSION = 65533;
|
|
8
|
+
export interface Item {
|
|
9
|
+
itemId: number;
|
|
10
|
+
systemParam: number;
|
|
11
|
+
additionalParam: number;
|
|
12
|
+
freeParam: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function readItem(data: Uint8Array, offset: number): Item;
|
|
15
|
+
export declare function readItemArray(data: Uint8Array, offset: number, count: number): Item[];
|
|
16
|
+
export declare function isNone(item: Item): boolean;
|
|
17
|
+
export declare function isExtension(item: Item): boolean;
|
|
18
|
+
export declare function displayItemId(item: Item): number;
|
|
19
|
+
/** Item count for stackable items (lower 16 bits of freeParam). */
|
|
20
|
+
export declare function itemCount(item: Item): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/structures/item.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,SAAS,QAAS,CAAC;AAChC,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,MAAM,WAAW,IAAI;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAO/D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,CAMrF;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE1C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE/C;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAIhD;AAED,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE5C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 8-byte Item structure used throughout ACNH save data.
|
|
3
|
+
* Ported from NHSE.Core
|
|
4
|
+
*/
|
|
5
|
+
import { readU16LE, readU32LE } from '../util/binary.js';
|
|
6
|
+
export const ITEM_SIZE = 8;
|
|
7
|
+
export const ITEM_NONE = 0xfffe;
|
|
8
|
+
export const ITEM_EXTENSION = 0xfffd;
|
|
9
|
+
export function readItem(data, offset) {
|
|
10
|
+
return {
|
|
11
|
+
itemId: readU16LE(data, offset),
|
|
12
|
+
systemParam: data[offset + 2],
|
|
13
|
+
additionalParam: data[offset + 3],
|
|
14
|
+
freeParam: readU32LE(data, offset + 4),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function readItemArray(data, offset, count) {
|
|
18
|
+
const items = [];
|
|
19
|
+
for (let i = 0; i < count; i++) {
|
|
20
|
+
items.push(readItem(data, offset + i * ITEM_SIZE));
|
|
21
|
+
}
|
|
22
|
+
return items;
|
|
23
|
+
}
|
|
24
|
+
export function isNone(item) {
|
|
25
|
+
return item.itemId === ITEM_NONE;
|
|
26
|
+
}
|
|
27
|
+
export function isExtension(item) {
|
|
28
|
+
return item.itemId === ITEM_EXTENSION;
|
|
29
|
+
}
|
|
30
|
+
export function displayItemId(item) {
|
|
31
|
+
return isExtension(item)
|
|
32
|
+
? readU16LE(new Uint8Array(new Uint32Array([item.freeParam]).buffer), 0)
|
|
33
|
+
: item.itemId;
|
|
34
|
+
}
|
|
35
|
+
/** Item count for stackable items (lower 16 bits of freeParam). */
|
|
36
|
+
export function itemCount(item) {
|
|
37
|
+
return item.freeParam & 0xffff;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../src/structures/item.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AASrC,MAAM,UAAU,QAAQ,CAAC,IAAgB,EAAE,MAAc;IACxD,OAAO;QACN,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QAC/B,WAAW,EAAE,IAAI,CAAC,MAAM,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 13316;
|
|
7
|
+
export declare const MUSEUM_ENTRY_COUNT = 1024;
|
|
8
|
+
export interface MuseumData {
|
|
9
|
+
level: number;
|
|
10
|
+
items: Item[];
|
|
11
|
+
donorFlags: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
export declare function readMuseum(data: Uint8Array, offset: number): MuseumData;
|
|
14
|
+
/** Returns the set of item IDs that have been donated to the museum. */
|
|
15
|
+
export declare function getDonatedItemIds(museum: MuseumData): Set<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"museum.d.ts","sourceRoot":"","sources":["../../src/structures/museum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAa,KAAK,IAAI,EAAY,MAAM,WAAW,CAAC;AAE3D,eAAO,MAAM,WAAW,QAAS,CAAC;AAClC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAQvE;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAQjE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Museum collection data.
|
|
3
|
+
* Ported from NHSE.Core
|
|
4
|
+
*/
|
|
5
|
+
import { readI32LE } from '../util/binary.js';
|
|
6
|
+
import { ITEM_SIZE, readItem } from './item.js';
|
|
7
|
+
export const MUSEUM_SIZE = 0x3404;
|
|
8
|
+
export const MUSEUM_ENTRY_COUNT = 1024;
|
|
9
|
+
export function readMuseum(data, offset) {
|
|
10
|
+
const level = readI32LE(data, offset);
|
|
11
|
+
const items = [];
|
|
12
|
+
for (let i = 0; i < MUSEUM_ENTRY_COUNT; i++) {
|
|
13
|
+
items.push(readItem(data, offset + 0x1004 + i * ITEM_SIZE));
|
|
14
|
+
}
|
|
15
|
+
const donorFlags = data.slice(offset + 0x3004, offset + 0x3004 + 0x400);
|
|
16
|
+
return { level, items, donorFlags };
|
|
17
|
+
}
|
|
18
|
+
/** Returns the set of item IDs that have been donated to the museum. */
|
|
19
|
+
export function getDonatedItemIds(museum) {
|
|
20
|
+
const donated = new Set();
|
|
21
|
+
for (const item of museum.items) {
|
|
22
|
+
if (item.itemId !== 0xfffe) {
|
|
23
|
+
donated.add(item.itemId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return donated;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"museum.js","sourceRoot":"","sources":["../../src/structures/museum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAa,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAClC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAQvC,MAAM,UAAU,UAAU,CAAC,IAAgB,EAAE,MAAc;IAC1D,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;IACxE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrC,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAAC,MAAkB;IACnD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reaction wheel / learned reactions reader.
|
|
3
|
+
* Ported from NHSE.Core GSavePlayerManpu / GSavePlayerManpu15
|
|
4
|
+
*/
|
|
5
|
+
import { Reaction } from './enums.js';
|
|
6
|
+
/** GSavePlayerManpu (1.0-1.4): 64 slots. */
|
|
7
|
+
export declare const MANPU_SIZE = 136;
|
|
8
|
+
/** GSavePlayerManpu15 (1.5+): 256 slots. */
|
|
9
|
+
export declare const MANPU15_SIZE = 520;
|
|
10
|
+
export interface ReactionData {
|
|
11
|
+
/** All learned reaction IDs. */
|
|
12
|
+
learned: Reaction[];
|
|
13
|
+
/** The 8 reactions on the reaction wheel. */
|
|
14
|
+
wheel: Reaction[];
|
|
15
|
+
/** Whether each learned reaction is "new" (not yet viewed). */
|
|
16
|
+
newFlags: boolean[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read reactions for format 1.5+ (256 slots).
|
|
20
|
+
*/
|
|
21
|
+
export declare function readReactions15(data: Uint8Array, offset: number): ReactionData;
|
|
22
|
+
/**
|
|
23
|
+
* Read reactions for format 1.0-1.4 (64 slots).
|
|
24
|
+
*/
|
|
25
|
+
export declare function readReactions(data: Uint8Array, offset: number): ReactionData;
|
|
26
|
+
/**
|
|
27
|
+
* Read reactions based on revision index.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readReactionsForRevision(data: Uint8Array, offset: number, revisionIndex: number): ReactionData;
|
|
30
|
+
/** Get the set of non-None learned reactions. */
|
|
31
|
+
export declare function getLearnedReactions(reactions: ReactionData): Set<Reaction>;
|