summaryrefslogtreecommitdiff
path: root/incantesimi/incantesimi.cmd.tex
blob: ef785e93d72463b95eb9d67d89b9781d73fdcaff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
\documentclass[a4paper,10pt,landscape]{article}
\usepackage[empty,cm]{fullpage}
\usepackage[latin1]{inputenc}
\usepackage[italian,english]{babel}
\usepackage[OT1]{fontenc}
\usepackage{pgfkeys}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.multipart}
 
%%%% fullpage
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\footskip}{0pt}
\setlength{\textwidth}{\paperwidth}
\setlength{\oddsidemargin}{-2.68cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{1.1\paperheight}
\setlength{\topmargin}{0pt}
\addtolength{\topmargin}{-2.68cm}
\addtolength{\oddsidemargin}{0.45cm} % per centrare le etichette
\addtolength{\evensidemargin}{0.45cm} % per centrare le etichette
%%%%
\setlength{\parindent}{0pt}
 
%%%%
\newlength{\cardtextwidth}
\setlength{\cardtextwidth}{4.33cm}
 
%\fontseries{c}\fontshape{sc}
 
\tikzstyle{carta}=[rectangle,minimum width=4.8cm,minimum height=7cm,outer sep=0,use as bounding box
%  ,ultra thin,draw %uncomment to show card boxes!
]
 
\tikzstyle{title label}=[rectangle,text=blue!80!green!75!black,minimum height=2\baselineskip,font={\small},inner sep=1mm,text width=4.6cm,align=flush center]
 
\tikzstyle{side label}=[rectangle,text=green!25!black,minimum height=3mm,font=\tiny,inner sep=0.5mm,rotate=270]
 
\tikzstyle{subt label}=[text=magenta!25!black,font=\scriptsize,inner xsep=2pt,inner ysep=0.2em,text width=\cardtextwidth]
 
\tikzstyle{descr label}=[rectangle,text=red!50!black,font={\sffamily\footnotesize},inner xsep=2pt,inner ysep=1mm,text width=\cardtextwidth,align=justify]
 
\tikzstyle{trg label}=[rectangle,text=red!70!blue!90!yellow,font={\sffamily\footnotesize},inner xsep=2pt,inner ysep=1mm,align=#1]
 
\tikzstyle{above angles label}=[text=blue!50!black,font=\scriptsize,minimum height=\baselineskip,align=justify]
 
\tikzstyle{angles label}=[rectangle split,rectangle split parts=2,rectangle split part align=left,text=blue!50!black,font=\tiny,align=justify]
 
\tikzstyle{prep label}=[rectangle split,rectangle split parts=2,rectangle split part align=left,draw,ultra thin,minimum width=0.333*4.8cm,text=yellow!10!black,inner xsep=0.1em,inner ysep=0.293em,font={\it\tiny}]%inner ysep is set to have 7mm overall heigh
 
%%%%
 
\pgfkeys{/spells/.is family}
\tikzset{/spells/type/.initial=spell}
\tikzset{/spells/st/.initial=None}
\tikzset{/spells/sr/.initial=No}
\tikzset{/spells/specialcomp/.initial={}}
\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{\spellcard}[1]{%
%\begin{scope}[every node/.style={draw,ultra thin},/spells/.cd,#1]
\begin{scope}[/spells/.cd,#1]
\node[carta] (card) {};
 
% titolo
\node [anchor=north,title label] (name) at (card.north)
      {\usefont{OT1}{ptm}{bx}{sc}\pgfkeysvalueof{/spells/name}};
 
%angolo nord est
\node [anchor=north west,side label] (type) at ($(card.east |- name.south) - (0mm,0.0mm)$)
      {\textsl{\pgfkeysvalueof{/spells/type}}};
 
%lato sud
\node [anchor=south,prep label] (prep) at (card.south)
      {Prep:\nodepart{two}Used:};
 
%lato sud ovest
\node [anchor=south west,above angles label] (durata) at (card.west |- prep.north)
      {\textsf{Duration: \pgfkeysvalueof{/spells/durata}}};
 
%lato sud est
\node [anchor=south east,above angles label] (tempo) at (card.east |- prep.north)
      {\pgfkeysvalueof{/spells/tempostr}};
 
\node [anchor=north east,side label] (ref) at ($(tempo.north east) + (0,3mm)$)
      {\pgfkeysvalueof{/spells/ref}};
 
 
%angolo sud ovest
\node [anchor=south west,angles label] (sr) at (card.south west)
      {\textsc{SR:}\nodepart{two}\textsc{\pgfkeysvalueof{/spells/sr}}};
 
%angolo sud est
\node [anchor=south east,angles label] (st) at (card.south east)
      {\textsc{ST:}\nodepart{two}\textsc{\pgfkeysvalueof{/spells/st}}};
 
 
%sottotitoli
\node [anchor=north east,align=flush right,rectangle,subt label] (source) at (type.south west)
      {\emph{\pgfkeysvalueof{/spells/source}}};
 
\node [anchor=north west,subt label,align=left]
      (components) at ($(source.south -| card.west) - (0mm,0mm)$)
      {\textsc{\pgfkeysvalueof{/spells/components}}};
\node [anchor=north west,subt label,align=flush right]
      (specialcomp) at (components.south west)
      {\tiny\pgfkeysvalueof{/spells/specialcomp}};
 
 
%centro
\node [anchor=west,descr label] (description) at ($0.70*(card.west)+0.3*(card.south west)$)
      {\pgfkeysvalueof{/spells/descrizione}};
 
\node [anchor=north,descr label] (notes) at (description.south)
      {\tiny\fontseries{e}\pgfkeysvalueof{/spells/note}};
 
% sopra il centro
\node [anchor=south west,trg label=flush left] (target) at ($(description.north west) + (0,1mm)$)
      {{\tiny{}Target/Effect/Area:}\\{\slshape\pgfkeysvalueof{/spells/target}}};
 
\node [anchor=south east,trg label=flush right] (range) at (target.north -| type.south)
      {{\tiny{}Range:} \textnormal{\itshape\pgfkeysvalueof{/spells/range}}};
 
%lato est
\node [anchor=north west,side label] (lvl) at ($0.8*(card.east)+0.2*(card.north east)$)
      {\textbf{\pgfkeysvalueof{/spells/levelstr}}};
 
 
\end{scope}%
}
 
\newcommand{\incantesimo}[1]{%
\pgfkeys{/spells/.cd,#1}\spellcard{type=spell,
  tempostr={CT: \pgfkeysvalueof{/spells/tempo}},
  source={\pgfkeysvalueof{/spells/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}}}
}}