diff --git a/src/App.jsx b/src/App.jsx index e1430d0..d79af23 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -58,7 +58,7 @@ function App() { const rosterName = info.getAttribute("name"); if (rosterName) { - document.title = `PrettyScribe ${rosterName}`; + document.title = `FancyScribe ${rosterName}`; } if (gameType == "Warhammer 40,000 9th Edition") { @@ -90,6 +90,7 @@ function App() { > FancyScribe - ) . + ).
Output Examples diff --git a/src/Roster.jsx b/src/Roster.jsx index 3622d7c..5767fe2 100644 --- a/src/Roster.jsx +++ b/src/Roster.jsx @@ -115,6 +115,7 @@ const Unit = ({ unit, catalog }) => { modelStats, modelList, psykers, + spells, cost, } = unit; @@ -238,7 +239,8 @@ const Unit = ({ unit, catalog }) => { {modelStats.map((model, index) => ( 1} @@ -261,10 +263,8 @@ const Unit = ({ unit, catalog }) => { flexDirection: "column", }} > - + +
{ weapons={meleeWeapons} modelStats={modelStats} /> -
{hasDifferentProfiles && ( - - - - + + + + + +
{Arrow} - Before selecting targets for this weapon, select one of its - profiles to make attacks with. -
{Arrow} + Before selecting targets for this weapon, select one of its + profiles to make attacks with. +
)} @@ -323,6 +324,7 @@ const Unit = ({ unit, catalog }) => {
+ @@ -333,12 +335,13 @@ const Unit = ({ unit, catalog }) => { const ModelStats = ({ modelStats, + modelStat, index, showName, showWeapons, modelList, }) => { - let { move, toughness, save, wounds, leadership, name } = modelStats; + let { move, toughness, save, wounds, leadership, name, bs, ws } = modelStat; if (!wounds) { wounds = "/"; } @@ -357,6 +360,9 @@ const ModelStats = ({ modelListMatches = modelListMatches.map((model) => model.replaceAll(name, "") ); + const bsChange = Math.abs(parseInt(modelStats[0].bs, 10) - parseInt(bs, 10)); + const wsChange = Math.abs(parseInt(modelStats[0].ws, 10) - parseInt(ws, 10)); + return (
@@ -374,6 +380,13 @@ const ModelStats = ({ }} > {name} + {name.toLowerCase().includes("wounds remaining") && + (bsChange !== 0 || wsChange !== 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` : "" + }.`}
)} {showWeapons && ( @@ -385,7 +398,7 @@ const ModelStats = ({ }} > {modelListMatches.map((model, index) => ( -
{model}
+
{model}
))} )} @@ -578,7 +591,10 @@ const FancyBox = ({ children }) => { const Psykers = ({ title, psykers }) => { return ( - <> + {psykers.length > 0 && ( { color: "#fff", }} > - @@ -607,12 +618,12 @@ const Psykers = ({ title, psykers }) => { ))} {psykers.length > 0 && ( - + )} - +
-
- -
-
{title} Cast Deny
); }; @@ -620,8 +631,10 @@ const Psyker = ({ psyker, index }) => { let { name, cast, deny, powers } = psyker; return ( - - +
{ ); }; +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 }) => { return (
{ type = "Plague Weapon"; } } - if ( + /* if ( abilities?.includes( "Each time an attack made with this weapon targets an enemy within half range, that attack has a Damage characteristic of D6+2." ) || @@ -119,7 +119,7 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { } else { type = "Melta 2"; } - } + } */ if ( abilities?.includes( @@ -251,7 +251,7 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { {damage} {abilities && abilities !== "-" && ( - +