\ProvidesPackage{badges}

% You shouldn't need to touch this file at all, unless you really want to 
% frob with how badges look.  Even then you probably won't have to frob it
% much to get what you want; the spacing tends to rearrange itself nicely.
%
% Badges don't have the I'M NOT HERE on the *back* of the Here side
% because it's convenient for dead people to be able to rip the
% Here side off and leave it to be their body while keeping the
% I'M NOT HERE side to wear.  Instead they mirror, like item cards,
% so that upside-down bodies are still recognizable.
%
% If the ``ghost'' charinfo field hasn't been left blank, the character
% is ``ghostly'' --- GM, Observer, etc --- so the whole badge will
% be reverse video (white-on-black).


\RequirePackage[mirror,.5cm]{cards}

\pagestyle{empty}

% should fit in badge holders!
\newlength\badgewidth  \badgewidth=3.1in
\newlength\badgeheight \badgeheight=2in

\def\head@line{Identity Badge \hfil\hfil\hfil Not Transferable}

\newfont\reallybig{ptmr scaled 3300}

\parindent 0pt                    % don't indent paragraphs
\centering                        % keep everything centered
\lineskip 0pt \lineskiplimit 10in % no interline glue ever

% For what we do here it actually seems to be easier / more straightforward
% to toss in some color-frobbing postscript than to use the color package cmds.
% (Plus this way we can stick to level one postscript and maybe have the
% Guild printers be happier with it.)
%
\newcommand\ps@gray[2]{\special{ps: gsave #1 setgray}#2\special{ps: grestore}}
\newcommand\graybox[3]{%
  \leavevmode
  \setbox\z@=\hbox{\ps@gray{#1}{#3}}%
  \ps@gray{#2}{\rlap{\vrule\@height\ht\z@\@depth\dp\z@\@width\wd\z@}}%
  \box\z@\relax
}
% ghosts/GMs/etc (and Not Here) are reverse video, white on very-dark-grey
\newcommand\@ReverseVideoBox{\graybox{1}{.333}} % third arg will follow


% when \name is called, we'll make a badge for \me
\renewcommand\doname{%
  \testinfo\me{ghost}%
  \ifinfo\let\@FaceSide\@ReverseVideoBox \else\let\@FaceSide\hbox \fi
  % cards.sty will frame the badge for us
  \makecard{%
    \vbox{\hsize=\badgewidth
      \@ReverseVideoBox{%
        \rotatebox[origin=c]{180}{%
          \vbox to \badgeheight{%
            \smallskip
            \head@line\break\vfil
            \hbox{\reallybig I'M NOT HERE}\break\vfil
            \gamename\break\smallskip
          }% end \vbox to \badgeheight
        }% end \rotatebox
      }% end \@ReverseVideoBox
      \break
      \@FaceSide{%
        \vbox to \badgeheight{%
          \smallskip
          \head@line \break\vfil
          {\Huge \me{char}}\break\vfil      % character name
          {\huge \me{player}}\break\vfil    % player name
          {\LARGE \me{number}}\break\vfil   % number
          {\LARGE \me{desc}}\break\vfil     % description
          \gamename\break\smallskip
        }% end \vbox to \badgeheight
      }% end \@FaceSide
    }% end \vbox
  }% end \makecard
}% end \renewcommand\doname
