| 1 |
\documentclass{article} |
| 2 |
|
| 3 |
\usepackage{wargame} |
| 4 |
\usetikzlibrary{decorations.markings} |
| 5 |
\usetikzlibrary{shadows.blur} |
| 6 |
\title{A test of \textsf{wargame}} |
| 7 |
\author{} |
| 8 |
\date{} |
| 9 |
\input{testmap} |
| 10 |
\input{testchits} |
| 11 |
\begin{document} |
| 12 |
\maketitle |
| 13 |
%\chitdbglvl=6 |
| 14 |
%\wargamedbglvl=5 |
| 15 |
\natoappdbglvl=1 |
| 16 |
|
| 17 |
\section{A board} |
| 18 |
|
| 19 |
\begin{tikzpicture} |
| 20 |
\begin{scope}[every hex/.style={/hex/label=auto}, |
| 21 |
hex/board frame/.style={fill=Tan}] |
| 22 |
\boardframe[0.5](c=0,r=0)(c=3,r=3) |
| 23 |
\boardpath(c=0,r=0)(c=3,r=3) |
| 24 |
\draw[fill=white,very thick] \hexboardpath; |
| 25 |
\boardclip(c=0,r=0)(c=3,r=3){fill=white} |
| 26 |
\testmap{} |
| 27 |
\end{scope} |
| 28 |
\end{tikzpicture} |
| 29 |
|
| 30 |
\section{Some chits} |
| 31 |
|
| 32 |
\begin{tikzpicture}[every chit node/.style={blur shadow={shadow blur steps=5}}] |
| 33 |
\fill[red!50] (1,-1) rectangle (3,1); |
| 34 |
\firstchit(0,0)% |
| 35 |
%\secondchit(2,0)% |
| 36 |
\fourthchit(2,0)% |
| 37 |
\thirdchit(4,0)% |
| 38 |
\turnchit(6,0)% |
| 39 |
% \chitdbglvl=4 |
| 40 |
\chit[my chit](0,-2) |
| 41 |
\chit[my chit,color=white,fill=red,right={chit/identifier=1}](2,-2) |
| 42 |
% \chitdbglvl=0 |
| 43 |
\chit[fort](4,-2) |
| 44 |
\node[chit={my chit},/chit/left={[font=\noexpand\rmfamily]chit/identifier={foo}},draw] at (6,-2) {}; |
| 45 |
% |
| 46 |
\end{tikzpicture} |
| 47 |
|
| 48 |
\section{Chits on a board} |
| 49 |
\begin{tikzpicture}[every chit/.style={chit drop}] |
| 50 |
\chitdbglvl=5 |
| 51 |
\begin{scope}[every hex/.style={/hex/label=auto},transform shape] |
| 52 |
\boardframe[0.5](c=0,r=0)(c=3,r=3) |
| 53 |
\boardclip(c=0,r=0)(c=3,r=3){fill=white} |
| 54 |
\testmap{} |
| 55 |
\firstchit[no chit drop](hex cs:c=2,r=2) |
| 56 |
%\secondchit(hex cs:c=3,r=0) |
| 57 |
\thirdchit(hex cs:c=0,r=3) |
| 58 |
|
| 59 |
\stackchits(hex cs:c=0,r=1)(.3,.3){ |
| 60 |
\noexpand\firstchit, |
| 61 |
\noexpand\secondchit%/\noexpand\eliminatechit |
| 62 |
} |
| 63 |
|
| 64 |
\begin{scope}[m/.style={hex/long move=green}] |
| 65 |
\path[m] (hex cs:c=3,r=0) -- (hex cs:c=3,r=1)--(hex cs:c=3,r=2); |
| 66 |
\end{scope} |
| 67 |
\begin{scope}[a/.style={hex/attack}] |
| 68 |
\path[a] (hex cs:c=1,r=0) -- (hex cs:c=1,r=1); |
| 69 |
\end{scope} |
| 70 |
\end{scope} |
| 71 |
\turnchit(7,3) |
| 72 |
\end{tikzpicture} |
| 73 |
|
| 74 |
\section{NATO App6(C) symbols} |
| 75 |
|
| 76 |
\begin{tikzpicture} |
| 77 |
\natoapp[faction=friendly,frame={faction},command=land,main=infantry](0,0) |
| 78 |
% |
| 79 |
\natoapp[faction=friendly, |
| 80 |
frame={faction}, |
| 81 |
main={infantry,engineer}, |
| 82 |
lower=mountain, |
| 83 |
color=red](2,0) |
| 84 |
% |
| 85 |
\natoapp[faction=unknown, |
| 86 |
command=sea surface, |
| 87 |
main={diving=military},color=blue](4,0) |
| 88 |
% |
| 89 |
\natoapp[faction=unknown, |
| 90 |
command=space, |
| 91 |
main={[fill]satellite}, |
| 92 |
color=green](6,0) |
| 93 |
% |
| 94 |
\natoapp[ |
| 95 |
faction=none, |
| 96 |
command=base, |
| 97 |
echelon=army, |
| 98 |
main={text=M}, |
| 99 |
top={text=T}, |
| 100 |
bottom={text=B}, |
| 101 |
left={text=L}, |
| 102 |
right={text=R}, |
| 103 |
below={text=V}](8,0) |
| 104 |
% |
| 105 |
\natoapp[faction=hostile, |
| 106 |
frame={faction}, |
| 107 |
command=land, |
| 108 |
echelon=company, |
| 109 |
main=rifle](10,0) |
| 110 |
\begin{scope}[scale=.5] |
| 111 |
\natoapp[faction=hostile, |
| 112 |
command=land, |
| 113 |
echelon=platoon, |
| 114 |
main={rifle}](24,0) |
| 115 |
\end{scope} |
| 116 |
|
| 117 |
\natoapp[faction=friendly,frame={faction}, |
| 118 |
command=land,main=infantry,decoy](0,-2) |
| 119 |
|
| 120 |
\natoapp[faction=friendly,frame={faction}, |
| 121 |
command=land,main=infantry,decoy,scale line widths,line |
| 122 |
width=1pt](2,-2) |
| 123 |
|
| 124 |
\begin{scope}[scale=.5] |
| 125 |
\natoapp[faction=friendly,frame={faction}, |
| 126 |
command=land,main=infantry,decoy,scale line widths,line |
| 127 |
width=1pt](8,-4) |
| 128 |
\end{scope} |
| 129 |
\end{tikzpicture} |
| 130 |
|
| 131 |
\section{Rotations} |
| 132 |
|
| 133 |
%\chitdbglvl=5 |
| 134 |
%\natoappdbglvl=11 |
| 135 |
\begin{tikzpicture} |
| 136 |
\begin{scope}[rotate=45,transform shape] |
| 137 |
\message{^^J======= Chit rotated 45} |
| 138 |
\chit[symbol={[faction=friendly,command=land,echelon=division, |
| 139 |
main=anti tank anti armour]}](0,0) |
| 140 |
|
| 141 |
\message{^^J======= NATO App6(D) rotated 45} |
| 142 |
\natoapp[faction=friendly,command=land,echelon=division, |
| 143 |
main=anti tank anti armour](0,2) |
| 144 |
|
| 145 |
\message{^^J======= NATO App6(D) rotated 45} |
| 146 |
\natoapp[faction=friendly,command=land,echelon=division, |
| 147 |
main=air defence](0,4) |
| 148 |
\end{scope} |
| 149 |
|
| 150 |
\begin{scope}[shift={(4,0)}] |
| 151 |
\message{^^J==== Normal chit} |
| 152 |
\chit[symbol={[faction=friendly,command=land,echelon=division, |
| 153 |
main=anti tank anti armour]}](0,0) |
| 154 |
|
| 155 |
\message{^^J==== Normal NATO App6(D)} |
| 156 |
\natoapp[faction=friendly,command=land,echelon=division, |
| 157 |
main=anti tank anti armour](0,2) |
| 158 |
|
| 159 |
\message{^^J==== Normal NATO App6(D)} |
| 160 |
\natoapp[faction=friendly,command=land,echelon=division, |
| 161 |
main=air defence](0,4) |
| 162 |
|
| 163 |
\end{scope} |
| 164 |
\end{tikzpicture} |
| 165 |
|
| 166 |
\begin{tikzpicture} |
| 167 |
\begin{scope}[] |
| 168 |
\node[draw,chit={symbol={faction=friendly,command=land,main=infantry}}] |
| 169 |
(A) {}; |
| 170 |
\foreach \a in {north,west,south,east}{% |
| 171 |
\draw[fill=red] (A.\a) circle(.1);} |
| 172 |
\draw[thick,green] circle(.2); |
| 173 |
\end{scope} |
| 174 |
\end{tikzpicture} |
| 175 |
\end{document} |