]> icculus.org git repositories - btb/d2x.git/blob - main/mission.h
rewrote endlevel stuff to reread exit model info every time
[btb/d2x.git] / main / mission.h
1 /* $Id: mission.h,v 1.11 2003-03-14 09:17:08 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Header for mission.h
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  15:59:22  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:31:35  john
24  * New version 2.0, which has no anonymous unions, builds with
25  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
26  *
27  * Revision 1.6  1995/01/30  12:55:41  matt
28  * Added vars to point to mission names
29  *
30  * Revision 1.5  1995/01/22  18:57:21  matt
31  * Made player highest level work with missions
32  *
33  * Revision 1.4  1995/01/22  14:13:21  matt
34  * Added flag in mission list for anarchy-only missions
35  *
36  * Revision 1.3  1995/01/21  23:13:12  matt
37  * Made high scores with (not work, really) with loaded missions
38  * Don't give player high score when quit game
39  *
40  * Revision 1.2  1995/01/20  22:47:53  matt
41  * Mission system implemented, though imcompletely
42  *
43  * Revision 1.1  1995/01/20  13:42:26  matt
44  * Initial revision
45  *
46  *
47  */
48
49 #ifndef _MISSION_H
50 #define _MISSION_H
51
52 #include <pstypes.h>
53
54 #define MAX_MISSIONS                    300
55 #define MAX_LEVELS_PER_MISSION          30
56 #define MAX_SECRET_LEVELS_PER_MISSION   6
57 #define MISSION_NAME_LEN                25
58
59 #define D1_MISSION_FILENAME             "descent"
60 #define D1_MISSION_NAME                 "Descent: First Strike"
61 #define D1_MISSION_HOGSIZE              6856701
62 #define D1_10_MISSION_HOGSIZE           7261423
63 #define D1_MAC_MISSION_HOGSIZE          7456179
64 #define D1_OEM_MISSION_NAME             "Destination Saturn"
65 #define D1_OEM_MISSION_HOGSIZE          4492107
66 #define D1_SHAREWARE_MISSION_NAME       "Descent Demo"
67 #define D1_SHAREWARE_MISSION_HOGSIZE    2339773
68 #define D1_SHAREWARE_10_MISSION_HOGSIZE 2365676
69 #define D1_MAC_SHARE_MISSION_HOGSIZE    3370339
70
71 #define SHAREWARE_MISSION_FILENAME  "d2demo"
72 #define SHAREWARE_MISSION_NAME      "Descent 2 Demo"
73 #define SHAREWARE_MISSION_HOGSIZE   2292566
74 #define MAC_SHARE_MISSION_HOGSIZE   4292746
75
76 #define OEM_MISSION_FILENAME        "d2"
77 #define OEM_MISSION_NAME            "D2 Destination:Quartzon"
78 #define OEM_MISSION_HOGSIZE         6132957
79
80 #define FULL_MISSION_FILENAME       "d2"
81 #define FULL_MISSION_HOGSIZE        7595079
82 #define MAC_FULL_MISSION_HOGSIZE    7110007
83
84 //mission list entry
85 typedef struct mle {
86         char    filename[9];                // path and filename without extension
87         char    mission_name[MISSION_NAME_LEN+1];
88         ubyte   anarchy_only_flag;          // if true, mission is anarchy only
89         ubyte   location;                   // see defines below
90         ubyte   descent_version;            // descent 1 or descent 2?
91 } mle;
92
93 //values that describe where a mission is located
94 #define ML_CURDIR       0
95 #define ML_MISSIONDIR   1
96 #define ML_CDROM        2
97
98 //where the missions go
99 #ifndef EDITOR
100 #define MISSION_DIR "missions/"
101 #else
102 #define MISSION_DIR "./"
103 #endif
104
105 extern mle Mission_list[MAX_MISSIONS];
106
107 extern int Current_mission_num, Builtin_mission_num;
108 extern char *Current_mission_filename,*Current_mission_longname;
109 extern char Builtin_mission_filename[9];
110 extern int Builtin_mission_hogsize;
111
112 //arrays of name of the level files
113 extern char Level_names[MAX_LEVELS_PER_MISSION][FILENAME_LEN];
114 extern char Secret_level_names[MAX_SECRET_LEVELS_PER_MISSION][FILENAME_LEN];
115
116 //fills in the global list of missions.  Returns the number of missions
117 //in the list.  If anarchy_mode set, don't include non-anarchy levels.
118 //if there is only one mission, this function will call load_mission on it.
119 int build_mission_list(int anarchy_mode);
120
121 //loads the specfied mission from the mission list.  build_mission_list()
122 //must have been called.  If build_mission_list() returns 0, this function
123 //does not need to be called.  Returns true if mission loaded ok, else false.
124 int load_mission(int mission_num);
125
126 //loads the named mission if exists.
127 //Returns true if mission loaded ok, else false.
128 int load_mission_by_name(char *mission_name);
129
130 #endif