Reexpress the motion words in adventure.yaml.
[open-adventure.git] / cheat.c
1 #define DEFINE_GLOBALS_FROM_INCLUDES
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <stdbool.h>
5 #include <time.h>
6 #include "advent.h"
7 #include "database.h"
8 #include "linenoise/linenoise.h"
9 #include "newdb.h"
10
11 struct game_t game;
12
13 long LNLENG, LNPOSN;
14 char rawbuf[LINESIZE], INLINE[LINESIZE + 1];
15
16 long FIND;
17 long INVENT;
18 long SAY;
19 long LOCK;
20 long THROW;
21
22 FILE  *logfp = NULL, *rfp = NULL;
23 bool oldstyle = false;
24 bool editline = true;
25 bool prompt = true;
26
27 int main(int argc, char *argv[])
28 {
29     FILE *fp = NULL;
30
31     game.lcg_a = 1093;
32     game.lcg_c = 221587;
33     game.lcg_m = 1048576;
34     srand(time(NULL));
35     long seedval = (long)rand();
36     set_seed(seedval);
37
38     /*  Initialize game variables */
39     initialise();
40
41     game.zzword = rndvoc(3, 0);
42     game.newloc = LOC_START;
43     game.loc = LOC_START;
44     game.limit = GAMELIMIT;
45     game.numdie = -1000;
46     game.saved = 1;
47     
48     fp = fopen("cheat_numdie.adv", WRITE_MODE);
49     if (fp == NULL)
50     {
51         printf("Can't open file. Exiting.\n");
52         exit(0);
53     }        
54
55     savefile(fp);
56     printf("cheat: tests/cheat_numdie.adv created.\n");
57     return 0;
58 }