-#include "main.h"
-
-#include "misc.h"
-
-long ABB[186], ATAB[331], ATLOC[186],
- DLOC[7], FIXED[101],
- KTAB[331], *LINES, LINK[201], LNLENG, LNPOSN,
- PARMS[26], PLACE[101], PTEXT[101], RTEXT[278],
- TABSIZ = 330;
-signed char INLINE[LINESIZE+1], MAP1[129], MAP2[129];
-
-long ACTVERB[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
- BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CHLOC, CHLOC2,
- CLAM, CLSMAX = 12, CLSSES,
- COINS, COND[186], CONDS, CTEXT[13], CVAL[13], DALTLC,
- DOOR, DPRSSN, DRAGON, DWARF, EGGS,
- EMRALD, ENTER, ENTRNC, FIND, FISSUR, FIXD[101], FOOD,
- GRATE, HINT, HINTED[21], HINTLC[21], HINTS[21][5], HNTMAX,
- HNTSIZ = 20, I, INVENT, IGO, J, JADE, K, K2, KEY[186], KEYS, KK,
- KNIFE, KQ, L, LAMP, LINSIZ = 12500, LINUSE, LL,
- LOC, LOCK, LOCSIZ = 185, LOCSND[186], LOOK, LTEXT[186],
- MAGZIN, MAXDIE, MAXTRS, MESH = 123456789,
- MESSAG, MIRROR, MXSCOR, NUGGET, NUL, OBJ, OBJSND[101],
- OBJTXT[101], ODLOC[7], OGRE, OIL, OYSTER,
- PEARL, PILLOW, PLAC[101], PLANT, PLANT2, PROP[101], PYRAM,
- RESER, ROD, ROD2, RTXSIZ = 277, RUBY, RUG, SAPPH, SAY,
- SCORE, SECT, SIGN, SNAKE, STEPS, STEXT[186], STICK,
- STREAM, TABNDX, THROW, TK[21], TRAVEL[886], TRIDNT,
- TRNSIZ = 5, TRNVAL[6], TRNVLS, TROLL, TROLL2, TRVS,
- TRVSIZ = 885, TTEXT[6], URN, V1, V2, VASE, VEND, VERB,
- VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X;
-struct game_t game = {.blklin = true};
+#include <signal.h>
+#include <time.h>
+#include "advent.h"
+#include "database.h"
+
+struct game_t game;
+
+long LNLENG, LNPOSN, PARMS[MAXPARMS+1];
+char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[129], MAP2[129];
+
+long AMBER, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
+ BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
+ CLAM, COINS, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
+ EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
+ GRATE, HINT, I, INVENT, J, JADE, K, KEYS,
+ KNIFE, L, LAMP, LOCK, LOOK, MAGZIN,
+ MESSAG, MIRROR, NUGGET, NUL, OGRE, OIL, OYSTER,
+ PEARL, PILLOW, PLANT, PLANT2, PYRAM, RESER, ROD, ROD2,
+ RUBY, RUG, SAPPH, SAY, SECT, SIGN, SNAKE, SPK,
+ STEPS, STREAM, THROW, TRIDNT, TROLL, TROLL2,
+ URN, VASE, VEND,
+ VOLCAN, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X;