\ProvidesPackage{custom}

% This package (custom.sty) is read in by game.cls and, therefore, is
% used by all game documents.  It's where the Production Czar should make
% any global customizations, including some particular ones that it comes
% set up for.  Remember to document what you do....



\newdef\gamename{Happy Fun Game}
\newdef\gamedate{IAP, 1900}



% \usecharacterformat defines the format of \newchar in characters.tex;
% \useplayerformat defines the format of \player in players.tex.
% The Template supplies them as
%
%% \usecharacterformat{
%%        {last; first; middle; prefix; suffix}
%%        {number; desc; ghost}
%%        {clump/unlisted; position}
%%        {ma/10; md/8; hp/6; mdelta/1}
%% }
%%
%% \useplayerformat{
%%        {gender; player}
%%        {email; address; phone; dontcall/midnight--10am}
%% }
%
% but you can change these if you want to add, subtract, or move fields.
%
% So, what does this do?  Having read html/charinfo.html you have a good
% idea already, but we'll go over it again.  This uses Lists/characters.tex
% and Lists/players.tex to define characters; each is a control sequence,
% e.g. Indiana Jones might be \Cjones, with some associated data.
% The \usecharacterformat information defines what information is
% supplied by \newchar (in characters.tex).  Since ``last'' (last name)
% is the first thing in the first pair of braces in \usecharacter format
% above, \Cjones{last} will turn into whatever's in that place when
% characters.tex says \newchar\Cjones{...}, e.g. ``Jones.''  Similarly,
% \useplayerformat defines what information is supplied by \player in
% players.tex (which can only supply information for \newchar'd macros).
% If \newchar is called on \Cjones, but \player isn't, all player
% info for \Cjones will be blank (and you'll get a warning latex'ing things).
%
% So here you're defining the base info fields; below you'll do combinations.
% Note that using these keeps cross-references between sheets, other sheets, 
% memory packets, etc automatically consistent.
%
% The fields given above are used by the playerlist, badges, etc to do
% their stuff.  If you want to add, say, appearance cards, you might toss in
% a line {appearone; appeartwo} and put first- and second-level appearance
% card descs in them, extracting with \Cjones{appearone} etc.
%
% You can have any number of ``outer'' fields (the ones in {}s), and each
% of those can have any number of ``inner'' fields (delimited by semicolons);
% you are by no means limited to 9 as in tex macro definitions.  Go nuts.
%
% Of course, any changes you make to \use(whichever)format should damn well
% be reflected in the comments in characters.tex or players.tex, and
% in html/charinfo.html!  And of course you should immediately make whatever 
% changes are necessary to current \newchar or \player declarations --- adding
% fields, deleting fields, moving fields....  Placing your new fields cleverly
% can avoid the need for most of the work here.
%
% What about those ``ma/10'' and other ``foo/bar'' entries?
% Those say that the field is ``foo'' and the default value is ``bar''
% if it's left blank --- e.g. ma defaults to 10; dontcall defaults
% to midnight--10am.  Any defaults you set you should document in
% Lists/characters.tex or players.tex, of course.  Defaults can't have 
% slash or semicolon characters in them, but they don't have to be letters.
% The ``clump'' field is used by the playerlist (see the comments in
% LaTeX/Central/playerlist.tex); ``unlisted'' is a good default since
% it tells the playerlist not to worry that the character doesn't show up.
%
% Try to keep the fields in a good order for optionality --- that is, since 
% in a \newchar and \player you can leave fields off the tail, you want the
% often-punted ones last, since if a never-punted field is last, you'll
% be forced to include all the ones on the way.  That's why the name
% is done as ``last; first; middle; prefix; suffix'' so that you can
% give ``last; first'' and everything is fine; if we'd done it as
% ``prefix; first; middle; last; suffix'' then you'd always have to
% supply a prefix, which is annoying, and furthermore if you want
% a last name you'd have to supply a middle name too, also annoying.
% You get the idea here.
%
% The meanings of specific data fields are not discussed here;
% see characters.tex and players.tex comments.
%
% Data field names must be letters only (no spaces, no punctuation).
% Case matters, so we advise you to always use lowercase.
%
% DON'T HAVE A BUNCH OF LONG FIELD NAMES, ESPECIALLY IF YOU HAVE A LOT
% OF CHARACTERS. This can cause you to overflow one of TeX's memory pools
% and be in much pain; see the external issues docs (pointer in intro.html).


\usecharacterformat{
	{last; first; middle; prefix; suffix}
	{number; desc; ghost}
	{clump/unlisted; position}
	{ma/10; md/8; hp/6; mdelta/1}
}

\useplayerformat{
	{gender; player}
	{email; address; phone; dontcall/midnight--10am}
}


% Some of those fields are, presumably, stats, which should be listed
% as such on charsheets and made into statcards.  You define these like
%
%% \usestats{
%%	{ma}{MA}{Martial Attack}
%%	{md}{MD}{Martial Defense}
%%	{mdelta}{M$\Delta$}{Martial Delta}
%%	{hp}{HP}{Hit Points}
%% }
%
% The first column is the name of the field; the second is the ``short name''
% (listed on both charsheet and statcard); the third is the ``long name''
% (listed on charsheet only).
%
% The black magic part of this file will use this to prepare for statcards
% and for \saystats (defined in character.sty) to work.  They'll be
% given in whatever order you set in \usestats.
%
% You may very well want to set defaults; this is done in \usecharformat
% and \useplayerformat above, for which see the comments there.
%
% With nine or fewer stats, stat cards will usually manage to be
% single-column; more go two-column.  About eighteen will fit that
% way without the card having to stretch.  If you've got more than
% that, or if you want to tweak the stat cards, look at
% LaTeX/Styles/stats.sty, mostly the top stuff.

\usestats{
	{ma}{MA}{Martial Attack}
	{md}{MD}{Martial Defense}
	{mdelta}{M$\Delta$}{Martial Delta}
	{hp}{HP}{Hit Points}
}


% While, as html/charinfo.html tells you, you can say things like
% \Cbond{prefix first middle last suffix} to get Bond's full name,
% this and some other combos appear often enough that it's nice
% to be able to say \Cbond{char} and get the same effect.  Here's
% where you set those, with \usecombos, whose basic format is
%
%% \usecombos{
%%	{default}{char}
%%	{char}{prefix first middle last suffix}
%%	{map}{char (player)}
%% }
%
% Whenever the first thing appears in the argument to a \Ccharacter,
% it is turned into the second thing; this is recursive, so
% \Cbond{map} --> \Cbond{char (player)} -->
% \Cbond{prefix first middle last suffix (player)} -->
% ``Dr. Indiana Fitzgerald Brown III, PhD (Jeremy Brown).''
% Should be fairly easy.  ANY CHANGES YOU MAKE HERE SHOULD BE
% DOCUMENTED IN html/charinfo.html.
%
% ``default'' is a special combo; while you could call \Cbond{default},
% its use is that it's what you get if you call \Cbond{} --- that is,
% don't supply any info request argument.  \Cbond{} --> \Cbond{default} --> ...
% The Template originally sets it to ``char'', which will turn into the
% full name; if you change this, DOCUMENT IT IN html/charinfo.html AND TELL
% YOUR TEAM.
%
% Some of the black magic that implements all this makes sure that spaces
% almost always DTRT, but if you find yourself defining combos that cause
% spurious spaces sometimes, you'll want to experiment with putting
% \ignorespaces (zot spaces after it) and/or \unskip (zot spaces before it)
% at stragetic places in the combo, e.g. {mycombo}{foo bar\unskip baz}.
% This should rarely be necessary.
%
% Like base fields, combo names must be letters only --- no spaces/punctuation.

\usecombos{
	{default}{char} % 'default' better be defined usefully
	{char}{prefix first middle last suffix}
	{map}{char (player)}
        {formal}{\testnonzero{last}\ifnonzero last\else first\fi}
        {informal}{\testnonzero{first}\ifnonzero first\else last\fi}
}

% BTW, 'formal' and 'informal' use \testnonzero and \ifnonzero there to do
% their ``be the last/first name if the first/last name isn't there'' magic.
% You couldn't use \testinfo{last} here, because the 'last' would expand
% before '\testinfo' did.  \testnonzero checks if its argument is zero width,
% and sets up for \ifnonzero to come out true or false appropriately.  So
% first 'last' and 'first' are expanded, and then \testnonzero operates
% on the result, such that it DTRT.  You don't actually need to understand
% any of that, but I thought I'd explain it since I use it there.  You might
% find it useful if you define similar conditional combos.


% Assuming that you kept the ``gender'' entry that the default \useformat has,
% you can define ``pronoun combos'' here that use it.  The format is
%
%% \newpronoun{he}{she}{it}{they}{They}
%
% That is, {male form}{female form}{neuter}{combo name}{uppercase combo name}.
% Then \Cbond{they} --> ``he'' or ``she'' or ``it'' or ``he/she''
% and  \Cbond{They} --> ``He'' or ``She'' or ``It'' or ``He/She''.
% (Yes, you only give lowercase of the expansions, but you have to give
% both lower and uppercase of the combo name --- annoying but I couldn't
% get around it.)
% The inverted form will be created automatically --- that is,
% @they for ``she'' or ``he'' or ``it'' or ``she/he'' etc (gender-swapped).
% As usual, any changes you make should be DOCUMENTED in html/charinfo.html.
% And the combo names are letters only, no spaces, no punctuation (incl @).
%
% Actually, you can use \newpronoun anywhere in the Template --- i.e. the
% ones you do here are global, but if GMs want a gender-dependent phrase 
% just for one sheet, they can use \newpronoun there to make it work 
% without you having to add every such thing here.  See charinfo.html.

\newpronoun{he}{she}{it}{they}{They}
\newpronoun{him}{her}{it}{them}{Them}
\newpronoun{his}{her}{its}{their}{Their}
\newpronoun{his}{hers}{its}{theirs}{Theirs}
\newpronoun{himself}{herself}{itself}{theirself}{Theirself}
\newpronoun{husband}{wife}{mate}{spouse}{Spouse}
\newpronoun{son}{daughter}{offspring}{child}{Child}
\newpronoun{brother}{sister}{sibling}{sibling}{Sibling}
\newpronoun{boy}{girl}{kid}{kid}{Kid}
\newpronoun{father}{mother}{parent}{parent}{Parent}
\newpronoun{uncle}{aunt}{parentsibling}{parentsib}{Parentsib}
\newpronoun{nephew}{niece}{siblingchild}{sibchild}{Sibchild}
\newpronoun{king}{queen}{monarch}{monarch}{Monarch}
\newpronoun{prince}{princess}{heir}{heir}{Heir}
\newpronoun{man}{woman}{person}{person}{Person}
\newpronoun{men}{women}{people}{people}{People}
\newpronoun{male}{female}{neuter}{sex}{Sex}


% Another pair of macros that you as Production Czar might find useful for
% tricks in style files (badges and playerlist use it) is \eachcharaction
% and \eachchar.  You define \eachcharaction as a macro that takes exactly
% one argument; when you call \eachchar, it will call \eachcharaction with
% each \newchar'd character macro in characters.tex order.  Use \renewcommand
% to define \eachcharaction, not \newcommand, since it's initialized.
% Example:
%% \renewcommand\eachcharaction[1]{\string#1 (#1{char}) has desc #1{desc}}
%% \eachchar
% will do 
%% \string\Cjones (\Cjones{char}) has desc \Cjones{desc}
%% \string\Cfred (\Cfred{char}) has desc \Cfred{desc}
% etc, producing the literal text
%% \Cjones (Dr. Indiana Fitzgerald Jones III, PhD) has desc tall and suave
%% \Cfred (Fred ``Flakey'' Flintstone) has desc A cheerful caveman
% With slightly nicer formatting, you've just made a two-line .tex file
% that summarizes all character descriptions for you automagically.


% If you're using the Random Numbers script as per html/numbers-*.html, and if
% you're furthermore using the automatic-assignment functionality it
% allows, then here's where list what things you're doing that for.
% It looks like
%
%%  \usenumbers{
%%	{itemnum}
%%	{badgenum}
%%	etc...
%% }
%
% This causes \itemnum{unique id}{properties} and \badgenum{unique id}{props}
% to be defined.  It also causes game.cls to look for the files
% itemnum-assigned.tex and badgenum-assigned.tex.  If it can find them
% in your TEXINPUTS tree (ie somewhere under LaTeX; by default they're
% placed in LaTeX/Numbers), it reads them in to see which itemnums and
% badgenums you've defined.  If it can't find them, that's ok, the numbers
% are just all unassigned.  Occurrences of \itemnum{id}{whatever} will now
% be evaluated by latex to the number assigned to that id; if none is assigned
% it will evaluated to UNASSIGNED.
%
% If you're not using random number assignment, just leave \usenumbers
% with a blank definition.
%

\usenumbers{
%	{nothing being used yet}
}



% Feel free to put other things here if it's appropriate to have them
% defined globally --- if only sheets will use them, put them in sheets.sty,
% if only character sheets, character.sty, etc.  DOCUMENT WHAT YOU DO
% here and in html/macro-glossary.html and/or html/charinfo.html
% for your fellow GMs!
