diff --git a/src/App.jsx b/src/App.jsx index d79ee6d..2d3be71 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -297,6 +297,8 @@ const getPrimaryColor = (catalog) => { return "#44264C"; case "Ynnari": return "#536766"; + case "Leagues of Votann": + return "#7d4c08"; default: console.log(catalog); return "#536766"; diff --git a/src/Roster.jsx b/src/Roster.jsx index d347407..ccb5466 100644 --- a/src/Roster.jsx +++ b/src/Roster.jsx @@ -376,22 +376,6 @@ const ModelStats = ({ 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 (
@@ -424,19 +408,6 @@ const ModelStats = ({ ))}
)} - {degradingStuff.length > 0 && ( -
- {`Each time this model makes - an attack, subtract - ${degradingStuff.join(" and ")}.`} -
- )} ); @@ -475,9 +446,6 @@ const FactionIcon = ({ catalog }) => { }; const Keywords = ({ keywords }) => { - keywords = Array.from(keywords).filter( - (keyword) => keyword !== "Configuration" - ); return (
{ const Abilities = ({ abilities }) => { if (!abilities) return null; + let keys = [...abilities.keys()]; + keys = keys.filter( + (key) => key !== "Stratagem: Warlord Trait" && key !== "Stratagem: Relic" + ); return (
{ }} > {abilities && - [...abilities.keys()].map((ability) => ( + keys.map((ability) => (
{ }} > PSYKER - Cast - Deny + CAST + DENY - Powers Known + POWERS KNOWN @@ -845,6 +817,10 @@ const ForceRules = ({ rules, onePerPage }) => { "Melta X", "Each time an attack made with this weapon targets a unit within half range, that attack's Damagae characteristic is increased by the amount denotex by 'X'." ); + rules.set( + "Lethal Hits", + "Each time an attack is made with this weapon profile, an unmodified hit roll of 6 automatically wounds the target." + ); return (
{ const attacks = type.substring(lastWhiteSpace + 1); type = type.substring(0, lastWhiteSpace); - const bs = modelStats[0].bs; - let ws = modelStats[0].ws; + let bs = modelStats.map((modelStat) => modelStat.bs); + let ws = modelStats.map((modelStat) => modelStat.ws); const strModel = modelStats[0].str; let meleeAttacks = modelStats.map((modelStat) => modelStat.attacks); @@ -138,6 +138,12 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { ], "Melta 4" ); + replaceAbilityWithType( + [ + "Each time an attack is made with this weapon profile, an unmodified hit roll of 6 automatically wounds the target.", + ], + "Lethal Hits" + ); if ( abilities?.includes( @@ -177,7 +183,7 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { "When attacking with this weapon, you must subtract 1 from the hit rolls.", "" ); - ws = `${parseInt(ws, 10) + 1}+`; + ws = ws.map((ws) => `${parseInt(ws, 10) + 1}+`); } if ( @@ -237,6 +243,12 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { if (meleeAttacks.every((meleeAttack) => meleeAttack === meleeAttacks[0])) { meleeAttacks = meleeAttacks[0]; } + if (bs.every((b) => b === bs[0])) { + bs = bs[0]; + } + if (ws.every((w) => w === ws[0])) { + ws = ws[0]; + } name = name.replaceAll(" (Shooting)", "").replaceAll(" (Melee)", ""); @@ -256,7 +268,9 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { }} > {differentProfiles && selectionName + " - "} - {differentProfiles ? name.replaceAll(selectionName, "") : name} + {differentProfiles + ? name.replaceAll(selectionName, "").replaceAll(", ", "") + : name} {type && ( { : meleeAttacks : attacks} - {isMelee ? ws : bs} + + {isMelee + ? ws.join + ? ws.join("|") + : ws + : bs.join + ? bs.join("|") + : bs} + {calculateWeaponStrength(strModel, str)} {ap} {damage} diff --git a/src/index.css b/src/index.css index d9249f0..6c7c4cc 100644 --- a/src/index.css +++ b/src/index.css @@ -72,7 +72,7 @@ button:focus-visible { justify-content: center; gap: 8px; padding: var(--size-24) var(--size-20); - max-width: 1100px; + max-width: 1150px; margin-left: auto; margin-right: auto; }