This commit is contained in:
2023-08-25 19:12:01 +02:00
parent 5598077064
commit fddee30f6e
6 changed files with 436 additions and 4 deletions

View File

@@ -7,13 +7,14 @@
\usepackage{forloop}
\usepackage{xparse}
\usepackage{multicol}
\usepackage{calc}
\usetikzlibrary {shapes.multipart,shapes.misc,shapes.symbols,calc,positioning,fit}
\usetikzlibrary {shapes.multipart,shapes.misc,shapes.symbols,calc,positioning,fit,backgrounds}
\input{star-wars-icons.sty}
\input{star-wars-talents.sty}
\setmainfont{ITCSymbol Book}
\setmainfont{itcsymbol-book.otf}
\newfontfamily{\tn}{Elektra Medium Pro}
\DeclareTextFontCommand{\texttn}{\tn}
@@ -22,9 +23,13 @@
\newcounter{undeffed}
\setcounter{undeffed}{0}
\newcounter{x}
\setlength{\parindent}{0pt}
\newlength{\tmpwidth}
\newlength{\namewidth}
\def\specialization{}
\makeatletter
@@ -83,7 +88,8 @@
thick,
double,
inner xsep=-2pt,
inner ysep=0pt
inner ysep=0pt,
fill=white
},
talentname/.style={
chamfered rectangle,
@@ -106,6 +112,16 @@
right=of \alph{talentx}\alph{talenty}.south,
left=-40pt
},
upgradecost/.style={
chamfered rectangle,
text=white,
chamfered rectangle xsep=2cm,
text width= 30pt,
align=center,
inner ysep=-1pt,
fill=talentcolor,
below right=1pt and -40pt of big\alph{bupgradex}\alph{bupgradey}.south east
},
forcepower/.style={
starburst,
starburst points=7,
@@ -133,6 +149,11 @@
\newcounter{talentx}
\newcounter{talenty}
\newcounter{upgradex}
\newcounter{upgradey}
\newcounter{bupgradex}
\newcounter{bupgradey}
\newcounter{tmpchar}
\newcounter{tmpx}
\newcounter{tmpxp}
@@ -149,6 +170,16 @@
}
}
\newcommand{\upgradeline}[2]{
\StrChar{#1}{2}[\tmpone]
\StrChar{#2}{2}[\tmptwo]
\ifthenelse{\equal{\tmpone}{\tmptwo}}{
\draw[line width=1.5mm, color=talentcolor] ([xshift=3.57cm,yshift=-0.7cm]#1.north west) -- ([yshift=-0.7cm]#2.north west);
}{
\draw[line width=1.5mm, color=talentcolor] (#1) -- (#2);
}
}
\newcommand{\swtalent}[5]{%
\addtocounter{talentx}{1}%
\ifthenelse{\equal{\arabic{talentx}}{5}}{%
@@ -304,3 +335,143 @@
}{}
}
}
\newcommand{\upgradeplaceholder}{%
\addtocounter{upgradex}{1}%
\ifthenelse{\equal{\arabic{upgradex}}{5}}{%
\addtocounter{upgradey}{1}%
\setcounter{upgradex}{1}%
}{}
\node[text=white,text width = 2.6cm] at ($(\arabic{upgradex}*4.5,-\arabic{upgradey}*3.8) + (0.5,-0.15)$) (tmp\alph{upgradex}\alph{upgradey}) {\footnotesize \texttn{\uppercase{ }}};
\getnodedimen{tmp\alph{upgradex}\alph{upgradey}}
\node[talent,color=white] at (\arabic{upgradex}*4.5,-\arabic{upgradey}*3.8)
(\alph{upgradex}\alph{upgradey})
{
\settowidth{\textlength}{\footnotesize \texttn{{\uppercase{ }}}}%
\tabular{p{3cm}}
\rule{0pt}{13pt}\\
\endtabular
};
}
\newcommand{\swupgrade}[4]{%
\forloop{x}{0}{\value{x} < #3}{%
\upgradeplaceholder{}%
}%
\setlength{\tmpwidth}{(4.5cm * #3)-1.05cm}
\node[text=white,text width = \tmpwidth] at ($(\arabic{bupgradex}*4.5,-\arabic{bupgradey}*3.8) + (0.5,-0.15)$) (tmpup\alph{bupgradex}\alph{bupgradey}) {\footnotesize \texttn{\uppercase{#1}}};
\getnodedimen{tmpup\alph{bupgradex}\alph{bupgradey}}
\node[talent, text width = \tmpwidth, draw=talentcolor] at (\arabic{bupgradex}*4.5,-\arabic{bupgradey}*3.8)
(big\alph{bupgradex}\alph{bupgradey})
{
\settowidth{\textlength}{\footnotesize \texttn{{\uppercase{#1}}}}%
\tabular{p{\tmpwidth{} - 0.5cm}}
\rule{0pt}{13pt}\\
\ifdim\nodeheight > 15pt
\rule{0pt}{8pt} \\
\fi
\ifdim\nodeheight > 30pt
\rule{0pt}{8pt} \\
\fi
\scriptsize{} #2 \\
\endtabular
};
\setlength{\namewidth}{\tmpwidth - 0.6cm}
\node[talentname, text width = \namewidth] at ($(\arabic{bupgradex}*4.5,-\arabic{bupgradey}*3.8) + (0.13,-0.14)$) {%
\small \hspace*{-6pt} \checkbox %
\settowidth{\textlength}{\footnotesize \texttn{{\uppercase{#1}}}}%
\ifdim\nodeheight > 15pt
\\ \phantom{t}
\fi
\ifdim\nodeheight > 30pt
\\ \phantom{t}
\fi
};
\node[text=white,text width = \namewidth] at ($(\arabic{bupgradex}*4.5,-\arabic{bupgradey}*3.8) + (0.5,-0.19)$) (t\alph{bupgradex}\alph{bupgradey}) {\footnotesize \texttn{\uppercase{#1}}};
\node[upgradecost] (c\alph{bupgradex}\alph{bupgradey}) {\tiny\texttn{COST #4}};
\addtocounter{bupgradex}{#3}%
\ifthenelse{\equal{\arabic{bupgradex}}{5}}{%
\addtocounter{bupgradey}{1}%
\setcounter{bupgradex}{1}%
}{}
}
\newcommand{\upgradelines}[2]{
\begin{scope}[on background layer]
\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}{|}}{
\upgradeline{\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}{-}}{
\upgradeline{\alph{tmpx}\alph{tmpy}}{\alph{tmpxp}\alph{tmpy}}
}{}
}
\end{scope}
}
\newenvironment{forcepower}[3]{%
\setcounter{upgradex}{0}
\setcounter{upgradey}{1}
\setcounter{bupgradex}{1}
\setcounter{bupgradey}{1}
\definecolor{talentcolor}{HTML}{215e26}
\def\powername{#1}
\center
\def\bookandpage{#3}
\tabular{p{0.75\textwidth} p{0.15\textwidth}}
\texttn{\Huge{}Force Power:} \textltn{\Huge{}\powername} & \multirow{4}{*}[0.7cm]{%
\begin{tikzpicture}
\node[talentname] at (0,0) {\footnotesize{}\texttn{FORCE ABILITY}};
\end{tikzpicture}
}\\
\texttn{\footnotesize{}Prerequisite: Force Rating #2+} \\
\endtabular\\
\vspace*{20pt}
\vspace{5pt}
\vspace{10pt}
\tikzpicture
}{%
\endtikzpicture
\vfill
{\ltn\small \bookandpage}
\endcenter
\newpage
}