\ProvidesPackage{magica}[2023/07/06 Magica]

\usepackage{amssymb}
\usepackage{xparse}
\usepackage{milsymb}
\usetikzlibrary{
	calc,
	positioning,
	shapes.misc, % Rounded rectangles, etc.
	shapes.multipart, % Multi-line nodes
	arrows.meta,
	decorations.markings,
	% Mapping
	decorations.text,
}
\tikzset{
	Char/.style={
		draw,rounded corners=3pt,line width=0.5mm,
		minimum size=10pt,
		fill=#1
	},
	Char/.default={white}, % civilian colour
	MilSymb land/magica/demon/.pic={
		\node [fill=MilSymb@fill, \MilSymb@line,
				star, star points=5, star point height=6px, draw=black, scale=0.6, rotate=180] {};
	},
	/MilSymb/.cd,
		main/demon/.style={/MilSymb/.cd, SymbC=land/magica/demon},
}


\colorlet{TomoeM}{Dandelion}
\colorlet{SakuraY}{Rhodamine}
\colorlet{AkemiH}{Black}
\colorlet{ShizukiR}{LimeGreen}
\colorlet{Sayaka}{CornflowerBlue}

\NewDocumentCommand\Magica{ o d() g}{
	\node[Char=#1] (char) at (#2) {};
	\IfNoValueTF{#3}{}{ \node[right=5pt] at (char) {#3}; }
}
\NewDocumentCommand\Civilian{ d() g}{
	\node[Char] (char) at (#1) {};
	\IfNoValueTF{#2}{}{ \node[right=5pt] at (char) {#2}; }
}
\NewDocumentCommand\Demon{ o d() }{
	\node[Char=red!50, \IfNoValueTF{#1}{}{#1}] (char) at (#2) {};
}
\NewDocumentCommand\Annotate{ d() g }{
	\coordinate (charAnnotate) at (#1);
	\draw[thin,gray] (char) -- (char |- charAnnotate);
	\draw[thin,gray] (char |- charAnnotate) -- (charAnnotate)
		node[midway,above,scale=0.7] {#2};
}

% Environment objects
\colorlet{pavement}{gray!90!yellow!20}
\tikzset{
	material railing/.style={
		black!80, line width=2mm,
	},
	material wall/.style={
		black!30, line width=2mm,
	},
	material laser/.style={
		red!80, line width=3px,
	},
	material bullet/.style={
		orange!80, line width=3px, dashed
	},
	Magica object turbine/.pic={
		\node[draw=black,star,star points=3,star point height=10pt,scale=1.5,fill=white]
			(magica/turbine) {};
		\draw (magica/turbine) circle (23pt);
	},
	Magica object solarpanel/.pic={
		\filldraw[Blue!80,draw=black] (-0.5,-1) rectangle (0.5,1);
		\draw[thin,step=0.5] (-0.5,-1) grid (0.5,1);
	},
}

% Map drawing
\tikzset{
	dot/.style={circle,draw,inner sep=1.5,fill=#1},
	dot/.default=black,
	largedot/.style={circle,draw,inner sep=4},
}
