1 /*
2  * quest.h - quest scene
3  * Copyright (C) 2010  Alexandre Martins <alemartf(at)gmail(dot)com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef _QUESTSCENE_H
21 #define _QUESTSCENE_H
22 
23 /*
24    There is only one quest running at a time.
25 
26    This is actually a "mock" scene that just
27    dispatches the player to the correct levels.
28    How does it know the correct levels? By
29    looking at the quest_t* structure, of course.
30 
31    quest_t* contains all the data relevant to
32    a quest (including name, author and list of
33    levels), but it does nothing for itself.
34    (see ../core/quest.h)
35 */
36 
37 #include "../core/quest.h"
38 
39 /* public scene functions */
40 /* call quest_run() before pushing this scene into the stack! */
41 void quest_init();
42 void quest_update();
43 void quest_render();
44 void quest_release();
45 
46 /* specific methods */
47 void quest_run(quest_t *qst, int standalone_quest); /* executes the given quest */
48 void quest_setlevel(int lev); /* jumps to the given level (0..n-1) */
49 void quest_abort(); /* aborts the current quest */
50 const char *quest_getname(); /* returns the name of the current quest */
51 
52 /* quest values */
53 typedef enum questvalue_t {
54     QUESTVALUE_TOTALTIME,   /* total quest time, in seconds */
55     QUESTVALUE_BIGRINGS,    /* how many big rings has the player got so far? */
56     QUESTVALUE_GLASSES      /* how many magic glasses has the player got so far? */
57 } questvalue_t;
58 
59 void quest_setvalue(questvalue_t key, float value);
60 float quest_getvalue(questvalue_t key);
61 
62 #endif
63