forked from jogordo/DnD_Archive
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.0 KiB
81 lines
2.0 KiB
\documentclass{article}
|
|
|
|
\usepackage{syntax}
|
|
|
|
\begin{document}
|
|
|
|
DungeonConf is a small language used to construct dungeons. The following features are included:
|
|
\begin{enumerate}
|
|
\item Dungeon dimensions and procgen method
|
|
\item What clusters of monsters appear and where
|
|
\item Traps
|
|
\item Locations (named tiles)
|
|
\end{enumerate}
|
|
|
|
\noindent The grammar is as follows:
|
|
|
|
\begin{grammar}
|
|
<dungeon> ::= <dungeon\_header> <body>
|
|
|
|
<dungeon\_header> ::= NAME `\{' <onl> <property\_list> <onl> `\}'
|
|
|
|
<onl> ::= `\\n'
|
|
\alt
|
|
|
|
<property\_list> ::= <property> `\\n' <property\_list>
|
|
\alt <property>
|
|
|
|
<property> ::= NAME `=' <value>
|
|
|
|
<value> ::= NAME
|
|
\alt NUM
|
|
\alt DICE
|
|
\alt COLOR /* used to specify a location on the generated map. \#000000 for random location. */
|
|
|
|
<body> ::= <content\_list>
|
|
\alt
|
|
|
|
<content\_list> ::= <content> `\\n' <content\_list>
|
|
\alt <content>
|
|
|
|
<content> ::= <monsters>
|
|
\alt <traps>
|
|
\alt <location>
|
|
|
|
<monsters> ::= `Monsters' `\{' <onl> <property\_list> <onl> `\}'
|
|
|
|
<traps> ::= `Trap' `\{' <onl> <property\_list> <onl> `\}'
|
|
|
|
<location> ::= `Location' `\{' <onl> <property\_list> <onl> `\}'
|
|
\end{grammar}
|
|
|
|
Though many language constructs are similar syntactically, the semantics are distinct.
|
|
|
|
The following are valid properties for each property\_list:
|
|
\begin{enumerate}
|
|
\item dungeon\_header
|
|
\begin{enumerate}
|
|
\item Width : $Int$
|
|
\item Height : $Int$
|
|
\item Procgen : $String \in \{Cave, Rooms\}$
|
|
\item Description : $String$
|
|
\end{enumerate}
|
|
\item monsters
|
|
\begin{enumerate}
|
|
\item Name : $String$
|
|
\item Number : $Dice$
|
|
\item Sprite : $String$
|
|
\item Size : $Int$
|
|
\item Color : $Color$
|
|
\end{enumerate}
|
|
\item location
|
|
\begin{enumerate}
|
|
\item Name : $String$
|
|
\item Width : $Int$
|
|
\item Height: $Int$
|
|
\item Sprite : $String$
|
|
\item Color : $Color$
|
|
\end{enumerate}
|
|
\end{enumerate}
|
|
|
|
\end{document}
|