feat: parse cost and effect lines separately from feature descriptions in ikonis-data.js
This commit is contained in:
parent
a9185baf99
commit
608ba09a94
1 changed files with 8 additions and 2 deletions
|
|
@ -25,12 +25,18 @@ export function getAugments() {
|
|||
for (const [id, feature] of Object.entries(allFeatures)) {
|
||||
const name = feature.label || feature.name || "";
|
||||
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({
|
||||
id: id,
|
||||
name: name.replace("Ikonis:", "").trim(),
|
||||
fullName: name,
|
||||
effect: feature.description ? feature.description.replace(/<[^>]*>?/gm, '').substring(0, 200).trim() : "Native Feature",
|
||||
cost: "" // Cost is included in the description
|
||||
effect: effectLine || "Native Feature",
|
||||
cost: costLine || ""
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue