diff --git a/docs.tex b/docs.tex index 8d1bc46f0a48f375154f99c4b2a2b887c6e39477..21e1806ac1d9b71109a346131e2ebd99f387e0bb 100644 --- a/docs.tex +++ b/docs.tex @@ -122,6 +122,17 @@ Then we have \verb"\begin{exampletext}" for example: \end{boxtext} +\subsubsection{Showing Dice} + +You can show dice with \verb"\dicef{7}", which shows up as `\dicef{7}'. +And you can list dice, with results, with the `\texttt{dlist}' environment. + +\begin{dlist} + \item Badger + \item Fox + \item Gazebo +\end{dlist} + \subsection{Magic} \subsubsection{Magical Items} diff --git a/layout.sty b/layout.sty index d6c6929a3ec29eb9c3b692560cb1894838d93ffc..6c878377989b477d0e5d0e6f3092d8899c9b6cc0 100644 --- a/layout.sty +++ b/layout.sty @@ -322,6 +322,24 @@ bookmarks=true]% \label{#2} } +\newcommand\dicef[1]{% + \setcounter{track}{#1}% + \ifnum\value{track}>0% + \whileboolexpr{% + test {\ifnumcomp{\value{track}}{>}{6}}% + }{% + \addtocounter{track}{-5}% + \epsdice{5}% + }% + \epsdice{\value{track}} + \else% + \arabic{track}% + \fi% +} + +\newenvironment{dlist}% + {\begin{list}{\Large\dicef{\value{list}}}{\usecounter{list}}}% + {\end{list}}% \newcounter{blingNo} \setcounter{blingNo}{0}