\usepackage{tikz} \usepackage{ifthen} \usepackage[margin=0.5in,bottom=0.2in]{geometry} \usepackage{fontspec} \usepackage{xstring} \usepackage{multirow} \usepackage{forloop} \usetikzlibrary {shapes.multipart,shapes.misc,shapes.symbols,calc,positioning} \input{star-wars-icons.sty} \input{star-wars-talents.sty} \setmainfont{ITCSymbol-Book} \newfontfamily{\tn}{Elektra Medium Pro} \DeclareTextFontCommand{\texttn}{\tn} \newfontfamily{\ltn}{Elektra Light Pro} \DeclareTextFontCommand{\textltn}{\ltn} \newlength{\textlength} \pagestyle{empty} \def\career{} \def\careerskills{} \newcommand{\setcareer}[2]{% \def\career{#1}% \def\careerskills{#2}% } %%%% % Provide the command \fpeval as a copy of the code-level \fp_eval:n. \usepackage{expl3}[2012-07-08] \ExplSyntaxOn \cs_new_eq:NN \fpeval \fp_eval:n \ExplSyntaxOff %%%% \tikzset{ every node/.style={anchor=north west}, talent/.style={ chamfered rectangle, chamfered rectangle corners={north east, south west, south east}, draw, thick, double, inner xsep=-2pt, inner ysep=1pt }, talentname/.style={ chamfered rectangle, chamfered rectangle corners={north east, south east}, inner ysep=0pt, text width = 2.85cm, align=left, text=white, fill=talentcolor }, talentnamedouble/.style={ chamfered rectangle, chamfered rectangle corners={north east, south east}, inner ysep=0pt, text width = 2.85cm, align=left, text=white, fill=talentcolor }, cost/.style={ chamfered rectangle, text=white, chamfered rectangle xsep=2cm, text width= 30pt, align=center, inner ysep=-1pt, fill=talentcolor, right=of \alph{talentx}\alph{talenty}.south, left=-40pt }, forcepower/.style={ starburst, starburst points=7, random starburst=150, starburst point height=10pt, fill=talentcolor, draw=white, line width=1.5pt, minimum width=30pt, minimum height=30pt, rotate=155 } } \newcounter{talentx} \newcounter{talenty} \newcounter{tmpchar} \newcounter{tmpx} \newcounter{tmpxp} \newcounter{tmpy} \newcounter{tmpyp} \newcommand{\talentline}[2]{ \StrChar{#1}{2}[\tmpone] \StrChar{#2}{2}[\tmptwo] \ifthenelse{\equal{\tmpone}{\tmptwo}}{ \draw[line width=1.5mm] ([xshift=3.57cm,yshift=-0.7cm]#1.north west) -- ([yshift=-0.7cm]#2.north west); }{ \draw[line width=1.5mm] (#1) -- (#2); } } \newcommand{\swtalent}[4]{% \addtocounter{talentx}{1}% \ifthenelse{\equal{\arabic{talentx}}{5}}{% \addtocounter{talenty}{1}% \setcounter{talentx}{1}% }{} \node[talent] at (\arabic{talentx}*4.5,-\arabic{talenty}*4.9) (\alph{talentx}\alph{talenty}) { \settowidth{\textlength}{\footnotesize \texttn{{\uppercase{#1}}}}% \tabular{p{3cm}} \rule{0pt}{10pt}\\ \ifdim\textlength > 72.5pt \rule{0pt}{10pt}\\ \fi \scriptsize #2 \\ \endtabular }; \ifthenelse{\equal{#3}{true}}{% \definecolor{talentcolor}{HTML}{5f1111} }{% \definecolor{talentcolor}{HTML}{1e115f} } \ifthenelse{\equal{#4}{true}}{% \node[forcepower] at ($(\arabic{talentx}*4.5,-\arabic{talenty}*4.9) + (0.3,-0.6)$) {}; }{} \node[talentname] at ($(\arabic{talentx}*4.5,-\arabic{talenty}*4.9) + (0.1,-0.1)$) {% \small \hspace*{-6pt} \checkbox % \settowidth{\textlength}{\footnotesize \texttn{{\uppercase{#1}}}}% \ifdim\textlength > 74pt \\ \phantom{t} \fi }; \node[cost] {\tiny\texttn{COST \fpeval{5*\arabic{talenty}}}}; \node[text=white,text width = 2.6cm] at ($(\arabic{talentx}*4.5,-\arabic{talenty}*4.9) + (0.5,-0.15)$) (t\alph{talentx}\alph{talenty}) {\footnotesize \texttn{\uppercase{#1}}}; } \newenvironment{talenttree}[4]{% \setcounter{talentx}{0} \setcounter{talenty}{1} \center \def\bookandpage{#3} \tabular{p{0.75\textwidth} p{0.15\textwidth}} \texttn{\Huge{}\career{}:} \textltn{\Huge{}#1} & \multirow{4}*{ \begin{tikzpicture} % \ifthenelse{\equal{#4}{}}{}{% \definecolor{talentcolor}{HTML}{000000} \node[forcepower] at (0.2,-2.1) {}; \node[talentname] at (0,-1.6) {\footnotesize{}\texttn{FORCE TALENT}}; % } \definecolor{talentcolor}{HTML}{1e115f} \node[talentname] at (0,0) {\footnotesize{}\texttn{PASSIVE}}; \definecolor{talentcolor}{HTML}{5f1111} \node[talentname] at (0,-0.8) {\footnotesize{}\texttn{ACTIVE}}; \end{tikzpicture} }\\ \ifthenelse{\equal{\careerskills}{}}{}{ \texttn{\footnotesize{}Career Skills:} \textltn{\footnotesize{}\careerskills}\\ } \texttn{\footnotesize{}Additional Carreer Skills:} \textltn{\footnotesize{}#2}\\ \ifthenelse{\equal{#4}{}}{}{% \texttn{\footnotesize{}Gain Force Rating 1} } \\ \\ \endtabular \vspace*{20pt} \tikzpicture }{% \endtikzpicture \vfill {\ltn\small \bookandpage} \endcenter \newpage } \newcommand{\talentlines}[2]{ \StrDel{#1}{ }[\tmpvert] \StrDel{\tmpvert}{/}[\tmpvert] \setcounter{tmpx}{0} \setcounter{tmpy}{1} \setcounter{tmpyp}{2} \forloop{tmpchar}{1}{\value{tmpchar} < 17}{ \addtocounter{tmpx}{1}% \ifthenelse{\equal{\arabic{tmpx}}{5}}{% \addtocounter{tmpyp}{1}% \addtocounter{tmpy}{1}% \setcounter{tmpx}{1}% }{} \StrChar{\tmpvert}{\value{tmpchar}}[\tmpchar] \ifthenelse{\equal{\tmpchar}{|}}{ \talentline{\alph{tmpx}\alph{tmpy}}{\alph{tmpx}\alph{tmpyp}} }{} } \StrDel{#2}{ }[\tmphor] \StrDel{\tmphor}{/}[\tmphor] \setcounter{tmpx}{0} \setcounter{tmpxp}{1} \setcounter{tmpy}{2} \forloop{tmpchar}{1}{\value{tmpchar} < 13}{ \addtocounter{tmpx}{1}% \addtocounter{tmpxp}{1}% \ifthenelse{\equal{\arabic{tmpx}}{4}}{% \addtocounter{tmpy}{1}% \setcounter{tmpx}{1}% \setcounter{tmpxp}{2}% }{} \StrChar{\tmphor}{\value{tmpchar}}[\tmpchar] \ifthenelse{\equal{\tmpchar}{-}}{ \talentline{\alph{tmpx}\alph{tmpy}}{\alph{tmpxp}\alph{tmpy}} }{} } }