1 /*
2     GL-117
3     Copyright 2001, 2002 Thomas A. Drexl aka heptargon
4 
5     This file is part of GL-117.
6 
7     GL-117 is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11 
12     GL-117 is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License
18     along with GL-117; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 */
21 
22 /* This file handles all pilots data. */
23 
24 #ifndef IS_PILOTS_H
25 #define IS_PILOTS_H
26 
27 #define SAVEVERSION "GL117_S1"
28 
29 const int maxpilotdata = 100;
30 
31 #define PILOT_PRIMETIME 0
32 #define PILOT_HEPTARGON 1
33 #define PILOT_LARA 2
34 #define PILOT_SHARK 3
35 #define PILOT_BOSS 4
36 #define PILOT_DRDOOM 5
37 #define PILOT_SHADOW 6
38 #define PILOT_MATRIX 7
39 #define PILOT_FIREBIRD 8
40 #define PILOT_THUNDER 9
41 
42 class TeamPilot
43 {
44   public:
45   int ranking; // 0=lowest ranking
46   char name [100]; // pilot nickname
47   char fullname [100]; // pilot full name
48   int intelligence; // intelligence, knowledge on piloting and manoevers
49   int precision; // precision, reaction
50   int aggressivity; // stay close behind the enemy, more firing tolerance
51   int fighterkills; // number of fighter kills for the pilot ranking
52   TeamPilot (int ranking, char *name, int intelligence, int precision, int aggressivity, int fighterkills);
53   void flyMission (int averagekills);
54   char *getRank ();
55   char *getShortRank ();
56   char *getName ();
57   char *getShortName ();
58   void load (FILE *in);
59   void save (FILE *out);
60 };
61 
62 class Pilot
63 {
64   public:
65   char name [16];
66   int mission_state [maxpilotdata]; // success/failure
67   int mission_time [maxpilotdata]; // time spent on the mission
68   int mission_fighterkills [maxpilotdata];
69   int mission_shipkills [maxpilotdata];
70   int mission_tankkills [maxpilotdata];
71   int mission_otherkills [maxpilotdata];
72   int mission_shield [maxpilotdata]; // shield left
73   int mission_points [maxpilotdata]; // extra points for hitting a target
74   int mission_score [maxpilotdata]; // overall score (calculated)
75   int ranking; // current ranking (calculated due to all scores)
76   TeamPilot **tp; // team pilots
77 
78   void load ();
79   void save ();
80   char *getRank ();
81   char *getShortRank ();
82   Pilot (char *name);
83   ~Pilot ();
84 };
85 
86 const int maxpilots = 5;
87 
88 class PilotList
89 {
90   public:
91   int aktpilots, aktpilot;
92   Pilot *pilot [maxpilots];
93 
94   void load (char *fname);
95   void save (char *fname);
96   PilotList (char *fname);
97   ~PilotList ();
98   void rm ();
99   void add (char *name);
100 };
101 
102 #endif
103