%%%%%
%%
%% This file sets up the Mem, MemFold, and MemEnvelope datatypes, and
%% creates possible macros for each.
%%
%% The Mem datatype isn't really used directly; it's there so the
%% other datatypes can inherit and share its code.
%%
%%%%%

\DECLARESUBTYPE{Mem}{Element}
\PRESETS{Mem}{
  %% \MYname is the trigger
  \F\MYtext	%%  text
  }


%%%%%
%% MemFold and MemEnvelope are both subtypes of Mem.  MemFold is for
%% fold-n-staple style mempackets, MemEnvelope is for stuff-n-seal
%% style mempackets.  If you want a mempacket to contain interesting
%% contents, like sheets, abilities, and other mempackets, use a
%% MemEnvelope.
\DECLARESUBTYPE{MemFold}{Mem}
\DECLARESUBTYPE{MemEnvelope}{Mem}


%%%%%
%% MemCover and MemPage are for the cover and pages of mempacket
%% booklets, which resemble research notebooks.  These are good
%% substitutes for large piles of MemFolds, and can be useful for
%% things like amnesiac characters.
%%
%% Like MemFolds, MemPages shouldn't directly own any other elements
%% as contents.  Use MemEnvelope instead.
%%
%% MemPages are usually assigned to a MemCover (via \MYmems), with the
%% MemCover representing the entire booklet and assigned to a
%% character.
%%
%% A MemCover is not a mempacket in and of itself; its name is not its
%% trigger and its text is not a memory.
\DECLARESUBTYPE{MemCover}{Mem}
\PRESETS{MemCover}{
  \sd\MYtext	{Each page is a memory/event packet with a separate
		trigger.}
  }

\DECLARESUBTYPE{MemPage}{Mem}


%%%%%
%% \memfold{<trigger>}{<text>}
%% \memenvelope{<trigger>}{<text>}
%% \memcover{<name>}{<pages>}
%% \mempage{<trigger>}{<text>}
%% \startmembook{<name>} <pages> \endmembook
%%
%% These are wrappers around \INSTANCE, useful as 1-shots.
%% \startmembook...\endmembook is a simple wrapper around \memcover
%% that may have better syntax for use within character sheets (inside
%% a \starttag{mems}...\endtag block).
\newinstance{MemFold}{\memfold[2]}{
  \s\MYname{#1}\s\MYtext{#2}}
\newinstance{MemEnvelope}{\memenvelope[2]}{
  \s\MYname{#1}\s\MYtext{#2}}
\newinstance{MemCover}{\memcover[2]}{
  \s\MYname{#1}\s\MYmems{#2}}
\newinstance{MemPage}{\mempage[2]}{
  \s\MYname{#1}\s\MYtext{#2}}

\long\def\startmembook#1#2\endmembook{\memcover{#1}{#2}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NEW{MemFold}{\mTest}{
  \s\MYname	{Test Trigger}
  \s\MYtext	{This is a Test of a fold-n-staple memory packet}
  }

\NEW{MemEnvelope}{\mEnvTest}{
  \s\MYname	{Test Trigger}
  \s\MYtext	{This is a Test of a stuff-n-seal memory packet}
  }

\NEW{MemEnvelope}{\mAmazing}{
  \s\MYname	{if you see something amazing}
  \s\MYtext	{Wow!  That was amazing!  Hey, you seem to be able to
		do amazing things, too.  See the enclosed greensheet
		and ability.}
  \s\MYabils	{\aTest{}}
  \s\MYgreens	{\gTest{}}
  }

\NEW{MemCover}{\mBookTest}{
  \s\MYname	{Book of Memory Packets}
  \s\MYmems	{\mPageOne{}\mPageTwo{}}
  }

\NEW{MemPage}{\mPageOne}{
  \s\MYname	{Test Trigger One}
  \s\MYtext	{This is a Test of a mempacket book}
  }

\NEW{MemPage}{\mPageTwo}{
  \s\MYname	{Test Trigger Two}
  \s\MYtext	{This is a Test of a mempacket book}
  }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NEW{MemEnvelope}{\mSoulMachine}{
  \s\MYname     {If you see item \#\iSoulMachine{\MYnumber}}
  \s\MYtext     {You recognize that device! Read the included
                 greensheet now}
  \s\MYgreens {\gSoulMachine{}}
}

\NEW{MemEnvelope}{\mSilverDagger}{
  \s\MYname     {If you perform a {\bf killing blow} or {\bf wound}
                    attack with this dagger}
  \s\MYtext     {The dagger melts, hissing, as it touches the victim's
                blood. Destroy the dagger's item card now.}
}

\NEW{MemFold}{\mNagios}{
  \s\MYname     {Open at game start}
  \s\MYtext     {Your PDA starts beeping. Crap, Nagios reports two of
                the base mainframes are down, but the piece of shit
                can't tell you which.}
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
