From 3a845849d6d63dbfc363c0d34a4acdf1c975124d Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 23 Oct 2011 15:10:57 +0100 Subject: fattorizzazione, e poteri --- incantesimi/incantesimi.cmd.tex | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'incantesimi/incantesimi.cmd.tex') diff --git a/incantesimi/incantesimi.cmd.tex b/incantesimi/incantesimi.cmd.tex index 3ceb4b9..d4c09f1 100644 --- a/incantesimi/incantesimi.cmd.tex +++ b/incantesimi/incantesimi.cmd.tex @@ -5,6 +5,7 @@ \usepackage[OT1]{fontenc} \usepackage{pgfkeys} \usepackage{tikz} +\usepackage{ifthen} \usetikzlibrary{calc} \usetikzlibrary{shapes.multipart} @@ -59,16 +60,20 @@ \tikzset{/spells/note/.initial={}} \tikzset{/spells/ref/.initial={}} \tikzset{/spells/tempo/.initial={1 a}} +\tikzset{/spells/tempostr/.initial={}} \tikzset{/spells/level/.initial={Must be passed in}} +\tikzset{/spells/levelstr/.initial={}} \tikzset{/spells/name/.initial={Must be passed in}} \tikzset{/spells/scuola/.initial={Must be passed in}} +\tikzset{/spells/source/.initial={Must be passed in}} \tikzset{/spells/durata/.initial={Must be passed in}} \tikzset{/spells/components/.initial={Must be passed in}} +\tikzset{/spells/uses/.initial={Must be passed in}} \tikzset{/spells/descrizione/.initial={Must be passed in}} \tikzset{/spells/target/.initial={Must be passed in}} \tikzset{/spells/range/.initial={Must be passed in}} -\newcommand{\incantesimo}[1]{% +\newcommand{\spellcard}[1]{% %\begin{scope}[every node/.style={draw,ultra thin},/spells/.cd,#1] \begin{scope}[/spells/.cd,#1] \node[carta] (card) {}; @@ -91,7 +96,7 @@ %lato sud est \node [anchor=south east,above angles label] (tempo) at (card.east |- prep.north) - {\textsf{CT: \pgfkeysvalueof{/spells/tempo}}}; + {\pgfkeysvalueof{/spells/tempostr}}; \node [anchor=north east,side label] (ref) at ($(tempo.north east) + (0,3mm)$) {\pgfkeysvalueof{/spells/ref}}; @@ -107,11 +112,11 @@ %sottotitoli -\node [anchor=north east,align=flush right,rectangle,subt label] (scuola) at (type.south west) - {\emph{\pgfkeysvalueof{/spells/scuola}}}; +\node [anchor=north east,align=flush right,rectangle,subt label] (source) at (type.south west) + {\emph{\pgfkeysvalueof{/spells/source}}}; \node [anchor=north west,rectangle split,rectangle split parts=2,rectangle split part align={left,flushright},subt label] - (components) at ($(scuola.south -| card.west) - (0mm,0mm)$) + (components) at ($(source.south -| card.west) - (0mm,0mm)$) {\textsc{\pgfkeysvalueof{/spells/components}}\nodepart{two}{\tiny\pgfkeysvalueof{/spells/specialcomp}}}; @@ -131,8 +136,22 @@ %lato est \node [anchor=north west,side label] (lvl) at ($0.8*(card.east)+0.2*(card.north east)$) - {\textbf{LVL \pgfkeysvalueof{/spells/level}}}; + {\textbf{\pgfkeysvalueof{/spells/levelstr}}}; \end{scope}% } + +\newcommand{\incantesimo}[1]{% +\pgfkeys{/spells/.cd,#1}\spellcard{type=spell, + tempostr={CT: \pgfkeysvalueof{/spells/tempo}}, + source={\pgfkeysvalueof{scuola}}, + levelstr={LVL \pgfkeysvalueof{/spells/level}}, +}} + +\newcommand{\potere}[1]{% +\pgfkeys{/spells/.cd,level={},type=special,#1}\spellcard{ + tempostr={AT: \pgfkeysvalueof{/spells/tempo}}, + components={\pgfkeysvalueof{/spells/uses}}, + levelstr={\ifthenelse{\equal{\pgfkeysvalueof{/spells/level}}{}}{}{EqvLvl~\pgfkeysvalueof{/spells/level}}} +}} -- cgit v1.2.3