diff --git a/src/Roster.jsx b/src/Roster.jsx
index 234a081..5472e53 100644
--- a/src/Roster.jsx
+++ b/src/Roster.jsx
@@ -142,9 +142,7 @@ const Unit = ({ unit, catalog }) => {
const rangedWeapons = weapons
.filter((weapon) => weapon.range !== "Melee" && weapon.range !== "-")
.sort((a, b) => a.selectionName.localeCompare(b.selectionName));
- if (!modelStats.some((model) => model.name.includes("wounds remaining)"))) {
- modelStats = modelStats.sort((a, b) => b.name.length - a.name.length); // Sort by length of name, so that for example "Primaris Intercessor Sergeant" is before "Primaris Intercessor"
- }
+
return (
{
- let { move, toughness, save, wounds, leadership, name, bs, ws } = modelStat;
+ let { move, toughness, save, wounds, leadership, name, bs, ws, attacks } =
+ modelStat;
if (!wounds) {
wounds = "/";
}
@@ -360,8 +359,22 @@ const ModelStats = ({
modelListMatches = modelListMatches.map((model) =>
model.replaceAll(name, "")
);
+
+ const degradingStuff = [];
const bsChange = Math.abs(parseInt(modelStats[0].bs, 10) - parseInt(bs, 10));
+ if (bsChange > 0) {
+ degradingStuff.push(`${bsChange} from the balistic skill`);
+ }
const wsChange = Math.abs(parseInt(modelStats[0].ws, 10) - parseInt(ws, 10));
+ if (wsChange > 0) {
+ degradingStuff.push(`${wsChange} from the weapon skill`);
+ }
+ const attacksChange = Math.abs(
+ parseInt(modelStats[0].attacks, 10) - parseInt(attacks, 10)
+ );
+ if (attacksChange > 0) {
+ degradingStuff.push(`${attacksChange} from the number of attacks`);
+ }
return (
@@ -395,22 +408,19 @@ const ModelStats = ({
))}
)}
- {name.toLowerCase().includes("wounds remaining") &&
- (bsChange !== 0 || wsChange !== 0) && (
-
- {` Each time this model makes
+ {degradingStuff.length > 0 && (
+
+ {`Each time this model makes
an attack, subtract
- ${bsChange ? `${bsChange} from the balistic skill` : ""}
- ${bsChange !== 0 && wsChange !== 0 ? " and " : ""}
- ${wsChange ? `${wsChange} from the weapon skill` : ""}.`}
-
- )}
+ ${degradingStuff.join(" and ")}.`}
+
+ )}
);
};
diff --git a/src/Weapons.jsx b/src/Weapons.jsx
index c5bb7cb..86b28dc 100644
--- a/src/Weapons.jsx
+++ b/src/Weapons.jsx
@@ -228,7 +228,7 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => {
}}
>
{differentProfiles && selectionName + " - "}
- {name}
+ {differentProfiles ? name.replaceAll(selectionName, "") : name}
{type && (