add 11th edition support

This commit is contained in:
NilsUeter
2026-06-23 18:45:14 +02:00
parent d5c1dda11a
commit 040536d18c
4 changed files with 1190 additions and 13 deletions
+1 -1
View File
@@ -822,7 +822,7 @@ const ModelStats = ({ modelStat, index, showName, abilities }) => {
wounds = "/";
}
const hasInvul = checkAbilitiesForInvul(abilities, name);
const hasInvul = modelStat.invulnerableSave || checkAbilitiesForInvul(abilities, name);
return (
<div className="flex flex-col">
<div style={{ display: "flex", gap: "1.2rem" }}>
+2 -1
View File
@@ -9,6 +9,7 @@ import { Roster } from "./9th/Roster";
import { Roster as Roster10th } from "./10th/Roster";
import { useLocalStorage } from "./helpers/useLocalStorage";
import { parseJSON, stringifyJSON } from "./helpers/json";
import { Create40kRoster11th } from "./roster40k-11th";
const throttle = (func, limit) => {
let lastFunc;
@@ -170,7 +171,7 @@ function App() {
setError("");
}
} else if (gameType == "Warhammer 40,000 11th Edition") {
roster = Create40kRoster10th(doc, gameType);
roster = Create40kRoster11th(doc, gameType);
if (roster && roster.forces.length > 0) {
setRoster(roster);
setEdition(11);
+18 -11
View File
@@ -101,6 +101,7 @@ export class Model extends BaseNotes {
attacks = "";
leadership = 7;
save = "";
invulnerableSave = "";
rangedWeapons = [];
meleeWeapons = [];
@@ -870,37 +871,43 @@ function ParseModelStatsProfiles(profiles, unit, unitName) {
const charName = char.getAttribute("name");
if (!charName) continue;
if (char.textContent) {
const charValue = char.textContent?.trim();
if (charValue) {
switch (charName) {
case "M":
model.move = char.textContent;
model.move = charValue;
break;
case "WS":
model.ws = char.textContent;
model.ws = charValue;
break;
case "BS":
model.bs = char.textContent;
model.bs = charValue;
break;
case "S":
model.str = +char.textContent;
model.str = +charValue;
break;
case "T":
model.toughness = +char.textContent;
model.toughness = +charValue;
break;
case "W":
model.wounds = +char.textContent;
model.wounds = +charValue;
break;
case "A":
model.attacks = char.textContent;
model.attacks = charValue;
break;
case "LD":
model.leadership = char.textContent;
model.leadership = charValue;
break;
case "SV":
model.save = char.textContent;
case "Sv":
model.save = charValue;
break;
case "InSv":
case "Invulnerable Save":
if (charValue !== "-") model.invulnerableSave = charValue;
break;
case "OC":
model.oc = char.textContent;
model.oc = charValue;
break;
}
}
File diff suppressed because it is too large Load Diff