1 /* $Id: mission.h,v 1.21 2004-10-23 19:39:35 schaffner Exp $ */
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.
17 * Header for mission.h
26 #define MAX_MISSIONS 300
27 #define MAX_LEVELS_PER_MISSION 30
28 #define MAX_SECRET_LEVELS_PER_MISSION 6
29 #define MISSION_NAME_LEN 25
31 #define D1_MISSION_FILENAME "descent"
32 #define D1_MISSION_NAME "Descent: First Strike"
33 #define D1_MISSION_HOGSIZE 6856701 // v1.4 - 1.5
34 #define D1_10_MISSION_HOGSIZE 7261423 // v1.0
35 #define D1_MAC_MISSION_HOGSIZE 7456179
36 #define D1_OEM_MISSION_NAME "Destination Saturn"
37 #define D1_OEM_MISSION_HOGSIZE 4492107 // v1.4a
38 #define D1_OEM_10_MISSION_HOGSIZE 4494862 // v1.0
39 #define D1_SHAREWARE_MISSION_NAME "Descent Demo"
40 #define D1_SHAREWARE_MISSION_HOGSIZE 2339773 // v1.4
41 #define D1_SHAREWARE_10_MISSION_HOGSIZE 2365676 // v1.0 - 1.2
42 #define D1_MAC_SHARE_MISSION_HOGSIZE 3370339
44 #define SHAREWARE_MISSION_FILENAME "d2demo"
45 #define SHAREWARE_MISSION_NAME "Descent 2 Demo"
46 #define SHAREWARE_MISSION_HOGSIZE 2292566 // v1.0 (d2demo.hog)
47 #define MAC_SHARE_MISSION_HOGSIZE 4292746
49 #define OEM_MISSION_FILENAME "d2"
50 #define OEM_MISSION_NAME "D2 Destination:Quartzon"
51 #define OEM_MISSION_HOGSIZE 6132957 // v1.1
53 #define FULL_MISSION_FILENAME "d2"
54 #define FULL_MISSION_HOGSIZE 7595079 // v1.1 - 1.2
55 #define FULL_10_MISSION_HOGSIZE 7107354 // v1.0
56 #define MAC_FULL_MISSION_HOGSIZE 7110007 // v1.1 - 1.2
60 char filename[9]; // path and filename without extension
61 char mission_name[MISSION_NAME_LEN+1];
62 ubyte anarchy_only_flag; // if true, mission is anarchy only
63 ubyte location; // see defines below
64 ubyte descent_version; // descent 1 or descent 2?
67 //values that describe where a mission is located
69 #define ML_MISSIONDIR 1
72 //where the missions go
74 #define MISSION_DIR "missions/"
76 #define MISSION_DIR "./"
79 extern mle Mission_list[MAX_MISSIONS];
81 extern int Current_mission_num, Builtin_mission_num;
82 extern char *Current_mission_filename,*Current_mission_longname;
83 extern char Builtin_mission_filename[9];
84 extern int Builtin_mission_hogsize;
86 #define is_SHAREWARE (Builtin_mission_hogsize == SHAREWARE_MISSION_HOGSIZE)
87 #define is_MAC_SHARE (Builtin_mission_hogsize == MAC_SHARE_MISSION_HOGSIZE)
88 #define is_D2_OEM (Builtin_mission_hogsize == OEM_MISSION_HOGSIZE)
90 #define PLAYING_BUILTIN_MISSION (Current_mission_num == Builtin_mission_num)
91 #define EMULATING_D1 (Mission_list[Current_mission_num].descent_version == 1)
92 #define ANARCHY_ONLY_MISSION (Mission_list[Current_mission_num].anarchy_only_flag == 1)
94 //arrays of name of the level files
95 extern char Level_names[MAX_LEVELS_PER_MISSION][FILENAME_LEN];
96 extern char Secret_level_names[MAX_SECRET_LEVELS_PER_MISSION][FILENAME_LEN];
98 //fills in the global list of missions. Returns the number of missions
99 //in the list. If anarchy_mode is set, then also add anarchy-only missions.
100 //if there is only one mission, this function will call load_mission on it.
101 int build_mission_list(int anarchy_mode);
103 //loads the named mission if exists.
104 //Returns true if mission loaded ok, else false.
105 int load_mission_by_name(char *mission_name);
107 //Handles creating and selecting from the mission list.
108 //Returns 1 if a mission was loaded.
109 int select_mission(int anarchy_mode, char *message);