diff --git a/src/10th/Roster.jsx b/src/10th/Roster.jsx index 9a2151e..8fa4221 100644 --- a/src/10th/Roster.jsx +++ b/src/10th/Roster.jsx @@ -74,7 +74,6 @@ const Unit = ({ unit, index, catalog, onePerPage, forceRules }) => { rules, modelStats, modelList, - psykers, spells, cost, woundTracker, @@ -266,8 +265,6 @@ const Unit = ({ unit, index, catalog, onePerPage, forceRules }) => { } /> ))} - -
{ flexDirection: "column", }} > - { modelStats={modelStats} forceRules={forceRules} /> +
{ - + @@ -608,9 +605,7 @@ const Rules = ({ rules }) => { const Abilities = ({ abilities }) => { if (!abilities) return null; let keys = [...abilities.keys()]; - keys = keys.filter( - (key) => key !== "Stratagem: Warlord Trait" && key !== "Stratagem: Relic" - ); + return (
{ ); }; -const Psykers = ({ title, psykers }) => { - return ( -
- {psykers.length > 0 && ( +const OtherAbilities = ({ abilities }) => { + let keys = [...Object.keys(abilities)?.filter((key) => key !== "Abilities")]; + return keys.map((key) => { + return ( + <> { color: "#fff", }} > - - - - + - )} - - {psykers.map((psyker, index) => ( - - ))} - {psykers.length > 0 && ( - - - - )} - -
PSYKERCASTDENY - POWERS KNOWN + + {key}
- ); -}; - -const Psyker = ({ psyker, index }) => { - let { name, cast, deny, powers } = psyker; - - return ( - - - {cast} - {deny} - - {powers} - - - ); -}; - -const WoundTracker = ({ woundTracker }) => { - if (!woundTracker || woundTracker.length === 0) return null; - const uniqueWoundTracker = woundTracker.filter((woundTrack, index) => { - const firstIndex = woundTracker.findIndex( - (woundTrack2) => woundTrack2.name === woundTrack.name - ); - return firstIndex === index; - }); - - return ( -
-
- - - - {[...uniqueWoundTracker[0].table.keys()].map((key) => ( - - ))} + + {[...abilities[key]].map(([name, value]) => ( + + + - - - {uniqueWoundTracker.map((woundTrack, index) => ( - - {[...woundTrack.table.values()].map((entry) => ( - - ))} - - ))} - -
{key}
+ {name}: {value} +
- {entry} -
-
-
- ); -}; - -const Spells = ({ title, spells }) => { - return ( - - {spells.length > 0 && ( - - - - - - - - - )} - - {spells.map((spell, index) => ( - - ))} - {spells.length > 0 && ( - - - - - )} - -
-
- -
-
{title}RANGEWARP CHARGE
- ); -}; - -const Spell = ({ spell, index, className }) => { - let { name, range, manifest, details } = spell; - return ( - <> - - - -
- {name} -
- - {range} - {manifest} - - - - - {details} - - - - ); -}; - -const getSpellClassNames = (spells, index) => { - let differentColor = false; - for (let i = 1; i <= index; i++) { - let { name } = spells[i]; - if (name !== spells[i - 1].name) { - differentColor = !differentColor; - } - } - const classes = []; - if (differentColor) classes.push("rowOtherColor"); - if (index === 0) classes.push("noBorderTop"); - if (index > 0 && spells[index].name === spells[index - 1].name) - classes.push("noBorderTop"); - return classes.join(" "); + ))} + + + ); + }); }; const ForceRules = ({ rules, onePerPage }) => { diff --git a/src/10th/Weapons.jsx b/src/10th/Weapons.jsx index 3f18604..89eede6 100644 --- a/src/10th/Weapons.jsx +++ b/src/10th/Weapons.jsx @@ -62,15 +62,7 @@ export const hasDifferentProfiles = (selectionName, name) => { ); }; -const Weapon = ({ - weapon, - previousWeapon, - nextWeapon, - modelStats, - isMelee, - className, - forceRules, -}) => { +const Weapon = ({ weapon, previousWeapon, nextWeapon, isMelee, className }) => { let { name, selectionName, diff --git a/src/roster40k-10th.js b/src/roster40k-10th.js index 0caff55..da35719 100644 --- a/src/roster40k-10th.js +++ b/src/roster40k-10th.js @@ -959,13 +959,7 @@ function ParseModelProfiles(profiles, model, unit) { } else if (typeName == "Psychic Power") { const power = ParsePsychicPowerProfile(profile); model.psychicPowers.push(power); - } else if (typeName.includes("Explosion")) { - const explosion = ParseExplosionProfile(profile); - model.explosions.push(explosion); - } else if (typeName == "Psyker") { - model.psyker = ParsePsykerProfile(profile); - } else { - // Everything else, like Prayers and Warlord Traits. + } else if (typeName == "Abilities") { if (!unit.abilities.Abilities) unit.abilities["Abilities"] = new Map(); ParseProfileCharacteristics( profile, @@ -973,6 +967,15 @@ function ParseModelProfiles(profiles, model, unit) { typeName, unit.abilities.Abilities ); + } else { + // Everything else, like Prayers and Warlord Traits. + if (!unit.abilities[typeName]) unit.abilities[typeName] = new Map(); + ParseProfileCharacteristics( + profile, + profileName, + typeName, + unit.abilities[typeName] + ); } } }