summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wargame/source/chit/battle.dtx
blob: 5057d620a59cce40339b7fcc6d942983a2dcc645 (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
% \iffalse
% <*chit>
% --------------------------------------------------------------------
% \fi
% \subsubsection{Battle markers}
%
% Takes 1 arguments - the identifier.
% 
% Define \spec{every battle marker} to change the style. 
% 
%    \begin{macrocode}
\tikzset{%
  battle marker/.pic={
    \node[shape=circle,
    font=\sffamily\bfseries,
    inner sep=0pt,
    minimum size=5mm,
    draw=black,
    fill=yellow!85!black,
    every battle marker/.try] at (-.3,.3) {%
      \ifnum#1>0\relax #1\fi%
    };
  },
  battle marker/.style={
    chit={full={battle marker=#1},frame={draw=none}}},
}
%    \end{macrocode}
%
% Takes two arguments - the odds and the fill colour.  The latter is
% useful to differentiate the severity of an attack.
%
% Define \spec{every odds marker} to change the style. 
%
%    \begin{macrocode}
\tikzset{%
  pics/odds marker/.style args={#1,#2}{
    code={
      \node[shape=circle,
      font=\sffamily\bfseries\large,
      inner sep=0pt,
      minimum size=8mm,
      draw=black,
      fill=#2,
      every odds marker/.try] at (.2,-.2) {#1};
    }
  },
  odds marker/.style args={#1,#2}{
    chit={full={odds marker={#1,#2}},frame={draw=none}}},
}
%    \end{macrocode}
%
% Takes two arguments - the result and the fill colour.  The latter is
% useful to differentiate the severity of an attack.
%
% Define \spec{every result marker} to change the style. 
%
%    \begin{macrocode}
\tikzset{
  pics/result marker/.style args={#1,#2}{
    code={
      \message{^^JResults marker #1 (#2)}
      \node[shape=circle,
      font=\sffamily\bfseries\large,
      inner sep=0pt,
      minimum size=8mm,
      draw=black,
      fill=#2,
      every result marker/.try] at (0,0) {#1};}},
  result marker/.style args={#1,#2}{
    chit={full={result marker={#1,#2}},frame={draw=none}}}
}
%    \end{macrocode}
%
% \iffalse
% </chit>
% --------------------------------------------------------------------
% \fi