1 #pragma once
2 
3 //********************************************************************************************
4 //*
5 //*    This file is part of Egoboo.
6 //*
7 //*    Egoboo is free software: you can redistribute it and/or modify it
8 //*    under the terms of the GNU General Public License as published by
9 //*    the Free Software Foundation, either version 3 of the License, or
10 //*    (at your option) any later version.
11 //*
12 //*    Egoboo is distributed in the hope that it will be useful, but
13 //*    WITHOUT ANY WARRANTY; without even the implied warranty of
14 //*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 //*    General Public License for more details.
16 //*
17 //*    You should have received a copy of the GNU General Public License
18 //*    along with Egoboo.  If not, see <http://www.gnu.org/licenses/>.
19 //*
20 //********************************************************************************************
21 
22 #include "egoboo_typedef.h"
23 #include "IDSZ_map.h"
24 
25 #if defined(__cplusplus)
26 extern "C"
27 {
28 #endif
29 
30 //--------------------------------------------------------------------------------------------
31 // Module constants
32 //--------------------------------------------------------------------------------------------
33 
34 #define RANKSIZE 12
35 #define SUMMARYLINES 8
36 #define SUMMARYSIZE  80
37 #define MAX_MODULE           100                     ///< Number of modules
38 
39 //--------------------------------------------------------------------------------------------
40 //--------------------------------------------------------------------------------------------
41 
42 /// All the possible filters for modules
43     enum e_module_filter
44     {
45         FILTER_OFF,                     ///< Display all modules
46         FILTER_MAIN,                    ///< Only main quest modules
47         FILTER_SIDE,                    ///< Only alternate sidequest modules
48         FILTER_TOWN,                    ///< Only display Town modules
49         FILTER_FUN,                     ///< Only fun modules (bumpercars!)
50 
51         FILTER_STARTER,                 ///< An extra filter for the starter modules
52 
53         // aliases
54         FILTER_NORMAL_BEGIN = FILTER_OFF,
55         FILTER_NORMAL_END   = FILTER_FUN
56     };
57     typedef enum e_module_filter module_filter_t;
58 
59 //--------------------------------------------------------------------------------------------
60 //--------------------------------------------------------------------------------------------
61 
62 /// The internal representation of the *.mod file
63     struct s_mod_file
64     {
65         // data from menu.txt
66         char    rank[RANKSIZE];               ///< Number of stars
67         STRING  longname;                     ///< Module names
68         STRING  reference;                    ///< the module reference string
69         Uint8   importamount;                 ///< # of import characters
70         bool_t  allowexport;                  ///< Export characters?
71         Uint8   minplayers;                   ///< Number of players
72         Uint8   maxplayers;
73         bool_t  monstersonly;                           ///< Only allow monsters
74         Uint8   respawnvalid;                           ///< Allow respawn
75         Uint8   rtscontrol;                             ///< !! keep this in the file, even though it is not used in the game !!
76         int     numlines;                               ///< Lines in summary
77         char    summary[SUMMARYLINES][SUMMARYSIZE];     ///< Quest description
78 
79         IDSZ_node_t     unlockquest;                    ///< the quest required to unlock this module
80         module_filter_t moduletype;                     ///< Main quest, town, sidequest or whatever
81         bool_t          beaten;                         ///< The module has been marked with the [BEAT] eapansion
82     };
83     typedef struct s_mod_file mod_file_t;
84 
85 //--------------------------------------------------------------------------------------------
86 //--------------------------------------------------------------------------------------------
87     int    module_has_idsz_vfs( const char *szModName, IDSZ idsz, size_t buffer_len, char * buffer );
88     void   module_add_idsz_vfs( const char *szModName, IDSZ idsz, size_t buffer_len, const char * buffer );
89 
90     mod_file_t * module_load_info_vfs( const char * szLoadName, mod_file_t * pmod );
91 
92 //--------------------------------------------------------------------------------------------
93 //--------------------------------------------------------------------------------------------
94 
95 #if defined(__cplusplus)
96 }
97 #endif
98 
99 //--------------------------------------------------------------------------------------------
100 //--------------------------------------------------------------------------------------------
101 
102 #define _module_file_h