feat: parse cost and effect lines separately from feature descriptions in ikonis-data.js

This commit is contained in:
CPTN Cosmo 2026-04-26 19:12:35 +02:00
parent a9185baf99
commit 608ba09a94

View file

@ -25,12 +25,18 @@ export function getAugments() {
for (const [id, feature] of Object.entries(allFeatures)) { for (const [id, feature] of Object.entries(allFeatures)) {
const name = feature.label || feature.name || ""; const name = feature.label || feature.name || "";
if (name.startsWith("Ikonis:")) { if (name.startsWith("Ikonis:")) {
const desc = feature.description ? feature.description.replace(/<[^>]*>?/gm, '').trim() : "";
const lines = desc.split(/\n|\r/).map(l => l.trim()).filter(l => l.length > 0);
const costLine = lines.find(l => l.toLowerCase().startsWith("cost:"));
const effectLine = lines.find(l => !l.toLowerCase().startsWith("cost:"));
augments.push({ augments.push({
id: id, id: id,
name: name.replace("Ikonis:", "").trim(), name: name.replace("Ikonis:", "").trim(),
fullName: name, fullName: name,
effect: feature.description ? feature.description.replace(/<[^>]*>?/gm, '').substring(0, 200).trim() : "Native Feature", effect: effectLine || "Native Feature",
cost: "" // Cost is included in the description cost: costLine || ""
}); });
} }
} }