@poe2-toolkit/ggpk 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 +21 -0
- package/README.md +111 -0
- package/dist/cdnSource.d.ts +53 -0
- package/dist/cdnSource.d.ts.map +1 -0
- package/dist/cdnSource.js +129 -0
- package/dist/cdnSource.js.map +1 -0
- package/dist/image/bc7.d.ts +8 -0
- package/dist/image/bc7.d.ts.map +1 -0
- package/dist/image/bc7.js +208 -0
- package/dist/image/bc7.js.map +1 -0
- package/dist/image/dds.d.ts +9 -0
- package/dist/image/dds.d.ts.map +1 -0
- package/dist/image/dds.js +157 -0
- package/dist/image/dds.js.map +1 -0
- package/dist/image/png.d.ts +11 -0
- package/dist/image/png.d.ts.map +1 -0
- package/dist/image/png.js +126 -0
- package/dist/image/png.js.map +1 -0
- package/dist/image/types.d.ts +8 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +2 -0
- package/dist/image/types.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/source.d.ts +28 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +12 -0
- package/dist/source.js.map +1 -0
- package/dist/statDescriptions.d.ts +63 -0
- package/dist/statDescriptions.d.ts.map +1 -0
- package/dist/statDescriptions.js +192 -0
- package/dist/statDescriptions.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatDescriptions engine — renders GGG's numeric `(stat_id, value)` pairs into
|
|
3
|
+
* human-readable text, using GGG's own `stat_descriptions.csd` straight from the
|
|
4
|
+
* GGPK. Despite the `.csd` extension the file is plain UTF-16 text, not compiled
|
|
5
|
+
* binary. Shared across domains: passive nodes, item mods and gem stats all
|
|
6
|
+
* render through it.
|
|
7
|
+
*
|
|
8
|
+
* File format (one block per description):
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* description
|
|
12
|
+
* \t<N> <stat_id_1> ... <stat_id_N>
|
|
13
|
+
* \t<lineCount>
|
|
14
|
+
* \t\t<cond_1> ... <cond_N> "text with {0} {1}" [handler index]...
|
|
15
|
+
* \tlang "French" <- other languages follow; English is read here
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Every stat id is indexed to the block that renders it (a multi-stat block is
|
|
19
|
+
* indexed under each of its stats); rendering picks the line whose per-stat
|
|
20
|
+
* conditions all accept the supplied values.
|
|
21
|
+
*/
|
|
22
|
+
/** Parse a condition token: `#` = any, `a|b` = range, `n` = exactly n. */
|
|
23
|
+
function parseCondition(token) {
|
|
24
|
+
if (token === '#') {
|
|
25
|
+
return { min: -Infinity, max: Infinity };
|
|
26
|
+
}
|
|
27
|
+
if (token.includes('|')) {
|
|
28
|
+
const [lo, hi] = token.split('|');
|
|
29
|
+
return {
|
|
30
|
+
min: lo === '#' ? -Infinity : Number(lo),
|
|
31
|
+
max: hi === '#' ? Infinity : Number(hi),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const exact = Number(token);
|
|
35
|
+
return { min: exact, max: exact };
|
|
36
|
+
}
|
|
37
|
+
/** Split one description line into its conditions, text and handler tokens. */
|
|
38
|
+
function parseDescriptionLine(line) {
|
|
39
|
+
const trimmed = line.trim();
|
|
40
|
+
const firstQuote = trimmed.indexOf('"');
|
|
41
|
+
const lastQuote = trimmed.lastIndexOf('"');
|
|
42
|
+
const conditions = trimmed.slice(0, firstQuote).trim().split(/\s+/).filter(Boolean).map(parseCondition);
|
|
43
|
+
const text = trimmed.slice(firstQuote + 1, lastQuote);
|
|
44
|
+
const handlers = trimmed.slice(lastQuote + 1).trim().split(/\s+/).filter(Boolean);
|
|
45
|
+
return { conditions, text, handlers };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build a per-stat lookup from the raw text of a GGG `stat_descriptions.csd`
|
|
49
|
+
* file (decoded from UTF-16). The first language block (English) is kept; later
|
|
50
|
+
* `lang "..."` blocks are skipped by the outer loop, which only resumes on the
|
|
51
|
+
* next `description` marker.
|
|
52
|
+
*/
|
|
53
|
+
export function buildStatIndex(csd) {
|
|
54
|
+
// Drop a leading UTF-16 byte-order mark if the decoder left one in.
|
|
55
|
+
const text = csd.charCodeAt(0) === 0xfeff ? csd.slice(1) : csd;
|
|
56
|
+
const lines = text.split(/\r\n|\n/);
|
|
57
|
+
const byStat = new Map();
|
|
58
|
+
let i = 0;
|
|
59
|
+
while (i < lines.length) {
|
|
60
|
+
if (lines[i].trim() !== 'description') {
|
|
61
|
+
i += 1;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
i += 1;
|
|
65
|
+
// "\t<N> <id1> ... <idN>"
|
|
66
|
+
const header = lines[i].trim().split(/\s+/);
|
|
67
|
+
const statCount = Number(header[0]);
|
|
68
|
+
const statIds = header.slice(1, 1 + statCount);
|
|
69
|
+
i += 1;
|
|
70
|
+
// English line count (first language block, before any `lang`).
|
|
71
|
+
const lineCount = Number(lines[i].trim());
|
|
72
|
+
i += 1;
|
|
73
|
+
const variants = [];
|
|
74
|
+
for (let k = 0; k < lineCount && i < lines.length; k += 1, i += 1) {
|
|
75
|
+
variants.push(parseDescriptionLine(lines[i]));
|
|
76
|
+
}
|
|
77
|
+
for (const id of statIds) {
|
|
78
|
+
if (!byStat.has(id)) {
|
|
79
|
+
byStat.set(id, { statIds, variants });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { byStat };
|
|
84
|
+
}
|
|
85
|
+
/** GGG value handlers — transform a raw stat value for display. */
|
|
86
|
+
function applyHandlers(values, handlers) {
|
|
87
|
+
const out = [...values];
|
|
88
|
+
for (let h = 0; h + 1 < handlers.length; h += 2) {
|
|
89
|
+
const name = handlers[h];
|
|
90
|
+
const index = Number(handlers[h + 1]) - 1;
|
|
91
|
+
if (index < 0 || index >= out.length) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
switch (name) {
|
|
95
|
+
case 'negate':
|
|
96
|
+
out[index] = -out[index];
|
|
97
|
+
break;
|
|
98
|
+
case 'divide_by_one_hundred':
|
|
99
|
+
case 'divide_by_one_hundred_2dp':
|
|
100
|
+
case 'divide_by_one_hundred_2dp_if_required':
|
|
101
|
+
case 'per_minute_to_per_second':
|
|
102
|
+
out[index] /= 100;
|
|
103
|
+
break;
|
|
104
|
+
case 'milliseconds_to_seconds':
|
|
105
|
+
case 'milliseconds_to_seconds_2dp':
|
|
106
|
+
case 'milliseconds_to_seconds_2dp_if_required':
|
|
107
|
+
case 'divide_by_one_thousand':
|
|
108
|
+
out[index] /= 1000;
|
|
109
|
+
break;
|
|
110
|
+
case 'divide_by_ten_0dp':
|
|
111
|
+
out[index] /= 10;
|
|
112
|
+
break;
|
|
113
|
+
default:
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
/** Pick the variant whose per-stat conditions all accept the raw values. */
|
|
120
|
+
function selectVariant(variants, rawValues) {
|
|
121
|
+
for (const variant of variants) {
|
|
122
|
+
const ok = variant.conditions.every((cond, i) => {
|
|
123
|
+
const value = rawValues[i] ?? 0;
|
|
124
|
+
return value >= cond.min && value <= cond.max;
|
|
125
|
+
});
|
|
126
|
+
if (ok) {
|
|
127
|
+
return variant;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return variants[0] ?? null;
|
|
131
|
+
}
|
|
132
|
+
/** Fill `{0}`, `{0:+d}`, `{0:d}` placeholders with rounded values. */
|
|
133
|
+
function fillTemplate(text, values) {
|
|
134
|
+
return text.replace(/\{(\d+)(?::([^}]+))?\}/g, (_, index, format) => {
|
|
135
|
+
const value = values[Number(index)];
|
|
136
|
+
if (value == null) {
|
|
137
|
+
return '';
|
|
138
|
+
}
|
|
139
|
+
const rounded = Math.round(value);
|
|
140
|
+
return format === '+d' && rounded >= 0 ? `+${rounded}` : String(rounded);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** Strip PoE bbcode: `[Cold]` -> "Cold", `[AoESkill|AoE]` -> "AoE". */
|
|
144
|
+
function stripBbcode(text) {
|
|
145
|
+
return text.replace(/\[([^\]]+)\]/g, (_, inner) => {
|
|
146
|
+
const pipe = inner.lastIndexOf('|');
|
|
147
|
+
return pipe === -1 ? inner : inner.slice(pipe + 1);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Render a full stat block. Each stat resolves to its block; a block may render
|
|
152
|
+
* several stats together (e.g. min/max added damage), so its placeholders are
|
|
153
|
+
* filled from whichever of those stats it provides (others default to 0) and all
|
|
154
|
+
* are marked consumed so the line is not repeated.
|
|
155
|
+
*/
|
|
156
|
+
export function renderBlock(index, statIds, vals) {
|
|
157
|
+
const valueByStat = new Map(statIds.map((id, i) => [id, vals[i]]));
|
|
158
|
+
const consumed = new Set();
|
|
159
|
+
const lines = [];
|
|
160
|
+
const unresolved = [];
|
|
161
|
+
for (const statId of statIds) {
|
|
162
|
+
if (consumed.has(statId)) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
// Some stats are keyed with a "base_" prefix in the description file
|
|
166
|
+
// (e.g. curse_duration_+% -> base_curse_duration_+%).
|
|
167
|
+
const record = index.byStat.get(statId) ?? index.byStat.get(`base_${statId}`);
|
|
168
|
+
if (!record) {
|
|
169
|
+
unresolved.push(statId);
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
// The block's stat ids may carry a "base_" prefix the source stat lacks, so
|
|
173
|
+
// fall back to the prefix-stripped id when reading the value.
|
|
174
|
+
const valueFor = (id) => valueByStat.get(id) ?? valueByStat.get(id.replace(/^base_/, '')) ?? 0;
|
|
175
|
+
const rawValues = record.statIds.map(valueFor);
|
|
176
|
+
const variant = selectVariant(record.variants, rawValues);
|
|
177
|
+
if (variant?.text) {
|
|
178
|
+
lines.push(stripBbcode(fillTemplate(variant.text, applyHandlers(rawValues, variant.handlers))));
|
|
179
|
+
}
|
|
180
|
+
for (const id of record.statIds) {
|
|
181
|
+
const stripped = id.replace(/^base_/, '');
|
|
182
|
+
if (valueByStat.has(id)) {
|
|
183
|
+
consumed.add(id);
|
|
184
|
+
}
|
|
185
|
+
if (valueByStat.has(stripped)) {
|
|
186
|
+
consumed.add(stripped);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return { lines, unresolved };
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=statDescriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statDescriptions.js","sourceRoot":"","sources":["../src/statDescriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiCH,0EAA0E;AAC1E,SAAS,cAAc,CAAC,KAAa;IACnC,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAClB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;IAC3C,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAElC,OAAO;YACL,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;SACxC,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5B,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC;AAED,+EA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Y,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAClG,CAAC;QAED,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAE1C,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACnB,CAAC;YAED,IAAI,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC9B,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC/B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@poe2-toolkit/ggpk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Access layer for Path of Exile 2's official GGPK / patch server: fetches and decodes game tables and raw files, and decodes GGPK image and stat-description formats. The shared base every PoE2 data extractor builds on.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"path-of-exile",
|
|
7
|
+
"poe2",
|
|
8
|
+
"ggpk",
|
|
9
|
+
"patch-server",
|
|
10
|
+
"dds",
|
|
11
|
+
"datc64"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
30
|
+
"build": "npm run clean && tsc -p tsconfig.build.json",
|
|
31
|
+
"prepack": "npm run build",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"pathofexile-dat": "^15.1.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"typescript": "^5.7.0",
|
|
42
|
+
"vitest": "^3.0.0"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
}
|
|
50
|
+
}
|