annotate struct.h @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* $Id: struct.h,v 1.1.1.1 1997/12/06 05:41:31 darius Exp $ */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 * struct.h for the client of an xtrek socket protocol.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 * Most of the unneeded stuff in the structures has been thrown away.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #ifndef struct_h_
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10 #define struct_h_
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include "copyright.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #include "packets.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 #ifdef HOCKEY
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 /* hockey struct [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 struct hockeyLine {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20 int vertical; /* vertical or horizontal flag */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 W_Color color;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 int pos, end1, end2; /* x or y constant and two endpoints */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 #endif /*HOCKEY*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 /* ratings struct [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 struct ratings {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 float r_offrat; /* offense rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 float r_planetrat; /* planets rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 float r_bombrat; /* bombing rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 float r_defrat; /* defense rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 float r_resrat; /* resource rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 float r_dooshrat; /* doosh rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 float r_stratrat; /* strategy rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 float r_batrat; /* battle rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 float r_sbrat; /* sb rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 float r_wbrat; /* wb rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 float r_jsrat; /* js rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 int r_jsplanets; /* js planets */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 int r_resources; /* total resources bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 int r_armies; /* total armies bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 int r_planets; /* total planets taken */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 int r_dooshes; /* total armies dooshed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 float r_specrat; /* special ship rating */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 float r_di; /* damage inflicted */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 float r_ratio; /* ratio, kills/losses */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 int r_kills; /* kills */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48 int r_losses; /* losses */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 float r_ratings; /* total ratings */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 float r_killsPerHour; /* kills/hour */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 float r_lossesPerHour; /* losses/hour */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 float r_maxkills; /* max kills */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 int r_genocides; /* number of genocides */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 /* messageWindow structure [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 struct messageWin {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 W_Window window;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 int flags;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 struct messageNode *head, *curHead;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 /* stuff yanked from COW-lite for rc_distress [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 struct distress {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 unsigned char sender;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 unsigned char dam, shld, arms, wtmp, etmp, fuelp, sts;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 unsigned char wtmpflag, etempflag, cloakflag, distype, macroflag;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 unsigned char close_pl, close_en, tclose_pl, tclose_en, pre_app, i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 unsigned char close_j, close_fr, tclose_j, tclose_fr;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 unsigned char cclist[6]; /* allow us some day to cc a message up to 5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 people */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 /* sending this to the server allows the server to do the cc action */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 /* otherwise it would have to be the client ... less BW this way */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 char preappend[80]; /* text which we pre or append */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 enum dist_type {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 /* help me do series */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 take = 1, ogg, bomb, space_control,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 save_planet,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 base_ogg,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 help3, help4,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 /* doing series */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 escorting, ogging, bombing, controlling,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 asw,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 asbomb,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 doing3, doing4,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 /* other info series */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 free_beer, /* ie. player x is totally hosed now */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92 no_gas, /* ie. player x has no gas */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 crippled, /* ie. player x is way hurt but may have gas */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 pickup, /* player x picked up armies */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95 pop, /* there was a pop somewhere */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96 carrying, /* I am carrying */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97 other1, other2,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 /* just a generic distress call */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 generic
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103 /* The General distress has format:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 byte1: 00yzzzzz
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 where zzzzz is dist_type, and y is 1 if this is a more complicated macro
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107 and not just a simple distress (a simple distress will ONLY send ship
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 info like shields, armies, status, location, etc.). I guess y=1 can be for !
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 future expansion.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111 byte2: 1fff ffff - f = percentage fuel remaining (0-100)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112 byte3: 1ddd dddd - % damage
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 byte4: 1sss ssss - % shields remaining
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114 byte5: 1eee eeee - % etemp
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 byte6: 1www wwww - % wtemp
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116 byte7: 100a aaaa - armies carried
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 byte8: (lsb of me->p_status) & 0x80
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118 byte9: 1ppp pppp - planet closest to me
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 byte10: 1eee eeee - enemy closest to me
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 byte11: 1ppp pppp - planet closest to target
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121 byte12: 1eee eeee - enemy closest to target
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 byte13: 1ttt tttt - tclose_j
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 byte14: 1jjj jjjj - close_j
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124 byte15: 1fff ffff - tclose_fr
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 byte16: 1ccc cccc - close_fr
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 byte17+: cc list (each player to cc this message to is 11pp ppp)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127 cc list is terminated by 0x80 (pre-pend) or 0100 0000 (append) )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 byte18++: the text to pre or append .. depending on termination above.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129 text is null terminated and the last thing in this distress
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 struct macro_list {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133 int type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134 char key;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 char who;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136 char *string;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 struct dmacro_list {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 unsigned char c;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 char *name;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 char *macro;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 /* end rc_distress stuff [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146 struct status {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 unsigned char tourn; /* Tournament mode? */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 /* These stats only updated during tournament mode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 unsigned int armsbomb, planets, kills, losses, time;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 /* Use long for this, so it never wraps */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 unsigned long timeprod;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 struct status2 { /* paradise status struct */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 int active; /* for interfacing with people who */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 unsigned int wait, count; /* want to get into the game */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 unsigned int number, request, answer;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158 unsigned char tourn; /* Tournament mode? */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 unsigned long dooshes; /* total number of armies dooshed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 unsigned long armsbomb; /* all t-mode armies bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161 unsigned long resbomb; /* resources bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 unsigned long planets; /* all t-mode planets taken */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163 unsigned long kills; /* all t-mode kills made */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164 unsigned long losses; /* all t-mode losses */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 unsigned long genocides; /* number of genocides */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 unsigned long sbkills; /* total kills in SB's */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 unsigned long sblosses; /* total losses in Sb's */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 unsigned long sbtime; /* total time in SB's */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 unsigned long wbkills; /* kills in warbases */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170 unsigned long wblosses; /* losses in warbases */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 unsigned long wbtime; /* total time played in wb's */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172 unsigned long jsplanets; /* total planets taken by jump ships */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173 unsigned long jstime; /* total time in a jump ship */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174 unsigned long time; /* t-mode time */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 unsigned long timeprod; /* t-mode ship ticks--sort of like */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176 /* manhours in t-mode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 int gameup; /* is game up */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178 unsigned long clock; /* clock for planet info timestamp */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 #ifdef METASERVER
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 /* metaserver window struct */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184 struct servers {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185 char address[LINE];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 int port;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187 int time;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188 int players;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189 int status;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190 int RSA_client;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 char typeflag;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192 char hilited;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 #endif /* METASERVER */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 /* MOTD structures */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 struct piclist {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198 int page;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199 W_Icon thepic;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 int x, y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 int width, height;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 struct piclist *next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204 struct page {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 struct list *text;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 struct page *next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 struct page *prev;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208 int first;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 int page;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 #define PFREE 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 #define POUTFIT 1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214 #define PALIVE 2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 #define PEXPLODE 3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 #define PDEAD 4
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217 #define PTQUEUE 5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 #define POBSERVE 6
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 #define PFSHIELD (1<< 0) /* shields are raised */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 #define PFREPAIR (1<< 1) /* player in repair mode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222 #define PFBOMB (1<< 2) /* player is bombing */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223 #define PFORBIT (1<< 3) /* player is orbiting */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224 #define PFCLOAK (1<< 4) /* player is cloaked */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 #define PFWEP (1<< 5) /* player is weapon temped */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226 #define PFENG (1<< 6) /* player is engine temped */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 #define PFROBOT (1<< 7) /* player is a robot */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228 #define PFBEAMUP (1<< 8) /* player is beaming up */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229 #define PFBEAMDOWN (1<< 9) /* player is beaming down */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 #define PFSELFDEST (1<<10) /* player is self destructing */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231 #define PFGREEN (1<<11) /* player at green alert */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 #define PFYELLOW (1<<12) /* player is at yellow alert */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 #define PFRED (1<<13) /* player is at red alert */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 #define PFPLOCK (1<<14) /* Locked on a player */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 #define PFPLLOCK (1<<15) /* Locked on a planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 #define PFCOPILOT (1<<16) /* Allow copilots */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237 #define PFWAR (1<<17) /* computer reprogramming for war */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 #define PFPRACTR (1<<18) /* practice type robot (no kills) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
239 #define PFDOCK (1<<19) /* true if docked to a starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
240 #define PFREFIT (1<<20) /* true if about to refit */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
241 #define PFREFITTING (1<<21) /* true if currently refitting */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
242 #define PFTRACT (1<<22) /* tractor beam activated */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
243 #define PFPRESS (1<<23) /* pressor beam activated */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
244 #define PFDOCKOK (1<<24) /* docking permission */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
245 #define PFSEEN (1<<25) /* seen by enemy on galactic map? */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
246 #define PFWARPPREP (1<<26) /* in warp prep [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
247 #define PFWARP (1<<27) /* ship warping */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
248 #define PFAFTER (1<<28) /* after burners on */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
249 #define PFWPSUSPENDED (1<<29) /* warp prep suspended [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
250 #define PFSNAKE (1<<30) /* it's a space snake */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
251 #define PFBIRD (1<<31) /* it's a space bird */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
252
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
253 enum why_dead {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
254 KNOREASON, KQUIT, KTORP, KPHASER, KPLANET,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
255 KSHIP, KDAEMON, KWINNER, KGHOST, KGENOCIDE,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
256 KPROVIDENCE, KPLASMA, KTOURNEND, KOVER, KTOURNSTART,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
257 KBADBIN, KMISSILE, KASTEROID
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
258 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
259
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
260 #define DEFAULT -1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
261 #define SCOUT 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
262 #define DESTROYER 1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
263 #define CRUISER 2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
264 #define BATTLESHIP 3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
265 #define ASSAULT 4
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
266 #define STARBASE 5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
267 #define ATT 6
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
268 #define GALAXY 6 /* galaxy ships now supported - they look
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
269 extremely similar to flagships :) [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
270 #define JUMPSHIP 7
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
271 #define FLAGSHIP 8
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
272 #define WARBASE 9
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
273 #define LIGHTCRUISER 10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
274 #define CARRIER 11
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
275 #define UTILITY 12
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
276 #define PATROL 13
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
277 #define PUCK 14
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
278 /*#define NUM_TYPES 14*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
279
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
280 struct shiplist {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
281 struct ship *ship;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
282 struct shiplist *prev, *next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
283 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
284
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
285 struct ship {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
286 int s_phaserrange;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
287 int s_maxspeed;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
288 int s_maxfuel;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
289 int s_maxshield;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
290 int s_maxdamage;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
291 int s_maxegntemp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
292 int s_maxwpntemp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
293 short s_maxarmies;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
294 short s_type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
295 int s_torpspeed;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
296 char s_letter;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
297 /* char s_name[16]; */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
298 char s_desig[2];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
299 short s_bitmap;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
300 unsigned char s_keymap[256];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
301 unsigned char s_buttonmap[12];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
302 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
303
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
304 struct ship_shape {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
305 int nviews;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
306 W_Icon *bmap;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
307 W_Icon shield;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
308 int width, height;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
309 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
310
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
311 struct stats {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
312 double st_maxkills; /* max kills ever */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
313 int st_kills; /* how many kills */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
314 int st_losses; /* times killed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
315 int st_armsbomb; /* armies bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
316 int st_planets; /* planets conquered */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
317 int st_ticks; /* Ticks I've been in game */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
318 int st_tkills; /* Kills in tournament play */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
319 int st_tlosses; /* Losses in tournament play */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
320 int st_tarmsbomb; /* Tournament armies bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
321 int st_tplanets; /* Tournament planets conquered */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
322 int st_tticks; /* Tournament ticks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
323 /* SB stats are entirely separate */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
324 int st_sbkills; /* Kills as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
325 int st_sblosses; /* Losses as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
326 int st_sbticks; /* Time as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
327 double st_sbmaxkills; /* Max kills as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
328 long st_lastlogin; /* Last time this player was played */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
329 int st_flags; /* Misc option flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
330 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
331 unsigned char st_keymap[256]; /* keymap for this player */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
332 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
333 int st_rank; /* Ranking of the player */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
334 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
335
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
336
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
337 struct stats2 { /* paradise stats */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
338 int st_genocides; /* number of genocides participated in */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
339 float st_tmaxkills; /* max kills ever */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
340 float st_di; /* total destruction inflicted for all time */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
341 int st_tkills; /* Kills in tournament play */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
342 int st_tlosses; /* Losses in tournament play */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
343 int st_tarmsbomb; /* Tournament armies bombed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
344 int st_tresbomb; /* resources bombed off */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
345 int st_tdooshes; /* armies killed while being carried */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
346 int st_tplanets; /* Tournament planets conquered */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
347 int st_tticks; /* Tournament ticks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
348 /* SB/WB/JS stats are entirely separate */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
349 int st_sbkills; /* Kills as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
350 int st_sblosses; /* Losses as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
351 int st_sbticks; /* Time as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
352 float st_sbmaxkills; /* Max kills as starbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
353 int st_wbkills; /* Kills as warbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
354 int st_wblosses; /* Losses as warbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
355 int st_wbticks; /* Time as warbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
356 float st_wbmaxkills; /* Max kills as warbase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
357 int st_jsplanets; /* planets assisted with in JS */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
358 int st_jsticks; /* ticks played as a JS */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
359 long st_lastlogin; /* Last time this player was played */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
360 int st_flags; /* Misc option flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
361 unsigned char st_keymap[256]; /* keymap for this player */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
362 int st_rank; /* Ranking of the player */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
363 int st_royal; /* royaly, specialty, rank */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
364 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
365
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
366 #define ST_NOBITMAPS (1<<0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
367 #define ST_KEEPPEACE (1<<3)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
368
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
369 struct player {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
370 int p_no;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
371 int p_updates; /* Number of updates ship has survived */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
372 int p_status; /* Player status */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
373 unsigned int p_flags; /* Player flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
374 char p_name[16];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
375 char p_login[16];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
376 char p_monitor[16]; /* Monitor being played on */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
377 char p_mapchars[2]; /* Cache for map window image */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
378 struct ship *p_ship; /* Personal ship statistics */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
379 int p_x;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
380 int p_y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
381 unsigned char p_dir; /* Real direction */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
382 unsigned char p_desdir; /* desired direction */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
383 int p_subdir; /* fraction direction change */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
384 int p_speed; /* Real speed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
385 short p_desspeed; /* Desired speed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
386 int p_subspeed; /* Fractional speed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
387 short p_teami; /* Team I'm on */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
388 int p_damage; /* Current damage */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
389 int p_subdamage; /* Fractional damage repair */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
390 int p_shield; /* Current shield power */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
391 int p_subshield; /* Fractional shield recharge */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
392 short p_cloakphase; /* Drawing stage of cloaking
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
393 engage/disengage. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
394 short p_ntorp; /* Number of torps flying */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
395 short p_ndrone; /* Number of drones .. why was this missing? */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
396 short p_totmissiles; /* number of total missiles [Bill Dyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
397 short p_nplasmatorp; /* Number of plasma torps active */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
398 char p_hostile; /* Who my torps will hurt */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
399 char p_swar; /* Who am I at sticky war with */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
400 float p_kills; /* Enemies killed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
401 short p_planet; /* Planet orbiting or locked onto */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
402 short p_playerl; /* Player locked onto */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
403 #ifdef ARMY_SLIDER
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
404 int p_armies; /* XXX: for stats */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
405 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
406 short p_armies;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
407 #endif /* ARMY_SLIDER */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
408 int p_fuel;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
409 short p_explode; /* Keeps track of final explosion */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
410 int p_etemp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
411 short p_etime;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
412 int p_wtemp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
413 short p_wtime;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
414 short p_whydead; /* Tells you why you died */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
415 short p_whodead; /* Tells you who killed you */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
416 struct stats p_stats; /* player statistics */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
417 struct stats2 p_stats2; /* Paradise stats */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
418 short p_genoplanets; /* planets taken since last genocide */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
419 short p_genoarmsbomb; /* armies bombed since last genocide */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
420 short p_planets; /* planets taken this game */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
421 short p_armsbomb; /* armies bombed this game */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
422 int p_docked; /* If starbase, # docked to, else pno base
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
423 host */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
424 int p_port[4]; /* If starbase, pno of ship docked to that
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
425 port, else p_port[0] = port # docked to on
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
426 host. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
427 short p_tractor; /* What player is in tractor lock */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
428 int p_pos; /* My position in the player file */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
429 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
430
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
431 struct statentry {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
432 char name[16], password[16];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
433 struct stats stats;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
434 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
435
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
436 /* Torpedo states */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
437
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
438 #define TFREE 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
439 #define TMOVE 1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
440 #define TEXPLODE 2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
441 #define TDET 3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
442 #define TOFF 4
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
443 #define TSTRAIGHT 5 /* Non-wobbling torp */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
444
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
445 struct torp {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
446 int t_no;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
447 int t_status; /* State information */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
448 int t_owner;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
449 int t_x;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
450 int t_y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
451 unsigned char t_dir; /* direction */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
452 short t_turns; /* rate of change of direction if tracking */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
453 int t_damage; /* damage for direct hit */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
454 int t_speed; /* Moving speed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
455 int t_fuse; /* Life left in current state */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
456 char t_war; /* enemies */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
457 char t_team; /* launching team */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
458 char t_whodet; /* who detonated... */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
459 char frame; /* frame of animation [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
460 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
461
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
462 struct thingy {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
463 int t_no;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
464 int t_shape; /* State information */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
465 int t_owner;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
466 int t_x;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
467 int t_y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
468 unsigned char t_dir; /* direction */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
469 int t_speed; /* Moving speed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
470 int t_fuse; /* Life left in current state */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
471 char t_war; /* enemies */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
472 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
473
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
474 /* Plasma Torpedo states */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
475
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
476 #define PTFREE 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
477 #define PTMOVE 1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
478 #define PTEXPLODE 2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
479 #define PTDET 3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
480
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
481 struct plasmatorp {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
482 int pt_no;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
483 int pt_status; /* State information */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
484 int pt_owner;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
485 int pt_x;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
486 int pt_y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
487 unsigned char pt_dir; /* direction */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
488 short pt_turns; /* ticks turned per cycle */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
489 int pt_damage; /* damage for direct hit */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
490 int pt_speed; /* Moving speed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
491 int pt_fuse; /* Life left in current state */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
492 char pt_war; /* enemies */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
493 char pt_team; /* launching team */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
494 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
495
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
496 #define PHFREE 0x00
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
497 #define PHHIT 0x01 /* When it hits a person */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
498 #define PHMISS 0x02
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
499 #define PHHIT2 0x04 /* When it hits a photon */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
500 #ifdef CHECK_DROPPED
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
501 #define PHGHOST 0x80 /* fuse has exceeded longest received so far */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
502 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
503 struct phaser {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
504 int ph_status; /* What it's up to */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
505 unsigned char ph_dir; /* direction */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
506 int ph_target; /* Who's being hit (for drawing) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
507 int ph_x, ph_y; /* For when it hits a torp */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
508 int ph_fuse; /* Life left for drawing */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
509 int ph_damage; /* Damage inflicted on victim */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
510 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
511
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
512 /* An important note concerning planets: The game assumes that
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
513 the planets are in a 'known' order. Ten planets per team,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
514 the first being the home planet.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
515 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
516
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
517 /* defines for the pl_flags field of planet struct */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
518
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
519 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
520 pl_flags is an int of 32 bits:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
521
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
522 bits 16 and 23 currently define the type of the planet. The
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
523 interpretation of the other bits is dependent upon the planet
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
524 type.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
525
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
526 Here is the interpretation for a planet
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
527 bits 0..3 unknown
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
528 bits 4..6 planetary facilities (REPAIR,FUEL,AGRI)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
529 bit 7 redraw (archaic, recyclable?)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
530 bits 8..11 old flags (archaic, recyclable?)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
531 bits 12..15 paradise planetary facilities
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
532 (REPAIR,FUEL,AGRI,SHIPY)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
533 bit 16 cosmic object type (also bit 23)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
534 bits 17,18 planet atmosphere type
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
535 bits 19..21 planetary surface properties
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
536 (DILYTH,METAL,ARABLE)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
537 bit 22 paradise planet flag (why?)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
538 bit 23 cosmic object type (also bit 16)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
539 bits 24..31 currently unallocated (8 bits to play with)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
540
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
541 Asteroids are NYI but here is a draft standard:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
542 bits 12,15 facilities
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
543 (REPAIR,FUEL,SHIPY)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
544 bit 20 surface properties
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
545 (DILYTH,METAL)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
546 other bits currently unallocated
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
547
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
548 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
549
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
550 /* facilities, bits 4..6 and 12..15
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
551 valid for planets and asteroids */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
552 #define PLREPAIR ((1<<12) | (1<<4)) /* planet can repair ships */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
553 #define PLFUEL ((1<<13) | (1<<5)) /* planet has fuel depot */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
554 #define PLAGRI ((1<<14) | (1<<6)) /* agricultural thingies built here */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
555 #define PLSHIPYARD ((1<<15)) /* planet has a shipyard on it */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
556 #define PLORESMASK (0x7<<4) /* mask for original resource flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
557 #define PLRESSHIFT 12 /* bit to shift right by for resources */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
558 #define PLRESMASK (0xF<<PLRESSHIFT) /* to mask off all but resource bits */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
559
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
560 #define PLREDRAW (1<<7) /* Player close for redraw */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
561
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
562 #define PLHOME (1<< 8) /* These 4 flags no longer are */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
563 #define PLCOUP (1<< 9) /* used in the server */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
564 #define PLCHEAP (1<<10)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
565 #define PLCORE (1<<11)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
566
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
567 /* cosmic object types, bits 16 and 23, and 24 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
568 #define PLPLANET 0 /* object is a planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
569 #define PLSTAR (1<<16) /* object is a star */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
570 #define PLAST (1<<23) /* object is an asteroid NYI */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
571 #define PLNEB ((1<<16)|(1<<23)) /* object is a nebula NYI */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
572 #define PLBHOLE (1<<24) /* object is a black hole NYI */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
573 #define PLPULSAR ((1<<16)|(1<<24)) /* object is a pulsar NYI */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
574 #define PLUK1 ((1<<23)|(1<<24)) /* future expansion */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
575 #define PLWHOLE ((1<<16)|(1<<23)|(1<<24)) /* object is a wormhole */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
576 #define PLTYPEMASK ((1<<16)|(1<<23)|(1<<24)) /* mask to extract object
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
577 type */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
578 #define PL_TYPE(p) ( (p).pl_flags & PLTYPEMASK )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
579
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
580 /* Atmosphere Types, bits 17 and 18.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
581 Valid for planets.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
582 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
583 #define PLATSHIFT 17 /* number of right bit shifts for atmos bits */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
584 #define PLPOISON (0<<PLATSHIFT) /* poison atmosphere, no army growth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
585 #define PLATYPE3 (1<<PLATSHIFT) /* slightly toxic, very slow army
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
586 growth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
587 #define PLATYPE2 (2<<PLATSHIFT) /* thin atmosphere, slow army growth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
588 #define PLATYPE1 (3<<PLATSHIFT) /* normal human atmosphere, normal
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
589 growth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
590 #define PLATMASK (0x3<<PLATSHIFT) /* to mask off everything but atmos
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
591 bits */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
592
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
593 /* Surface Properties, bits 19..21
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
594 Valid for planets and asteroids.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
595 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
596 #define PLBARREN 0 /* rocky barren surface */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
597 #define PLSURSHIFT 19 /* number of bit shift to surface */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
598 #define PLDILYTH (1<<(PLSURSHIFT+0)) /* dilythium deposits on the planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
599 #define PLMETAL (1<<(PLSURSHIFT+1)) /* metal deposits on the planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
600 #define PLARABLE (1<<(PLSURSHIFT+2)) /* planet has farmland */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
601 #define PLSURMASK (0x7<<PLSURSHIFT) /* number of surface combinations */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
602
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
603
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
604 #define PLPARADISE (1<<22) /* Paradise server flag set to 1 for P server */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
605
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
606
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
607 struct planet {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
608 int pl_no;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
609 int pl_flags; /* State information */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
610 int pl_owner;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
611 int pl_x;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
612 int pl_y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
613 char pl_name[16];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
614 int pl_namelen; /* Cuts back on strlen's */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
615 int pl_armies;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
616 int pl_info; /* Teams which have info on planets */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
617 int pl_deadtime; /* Time before planet will support life */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
618 int pl_couptime; /* Time before coup may take place */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
619 int pl_timestamp; /* time the info was taken */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
620 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
621
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
622 struct t_unit {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
623 /* int alt1;*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
624 /* int alt2;*/ /* Terrain types. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
625 char types;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
626 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
627
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
628 /* Terrain types */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
629 #define T_EMPTY_SPACE 0x00
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
630 #define T_ASTEROIDS 0x01
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
631 #define T_NEBULA 0x02
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
632 #define T_RADIATION 0x04
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
633 #define T_EXPANSN1 0x08
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
634 #define T_EXPANSN2 0x10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
635 #define T_EXPANSN3 0x20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
636 #define T_EXPANSN4 0x40
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
637 #define T_EXPANSN5 0x80
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
638
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
639 struct _clearzone {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
640 int x, y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
641 int width, height;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
642 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
643
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
644 #ifndef SHORT_PACKETS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
645 #define MVALID 0x01
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
646 #define MINDIV 0x02
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
647 #define MTEAM 0x04
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
648 #define MALL 0x08
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
649 #define MGOD 0x10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
650 #define MCAST 0x18 /* not an offial packet type. only */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
651 /* used in smessage to stay orthogonal */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
652 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
653 #define MVALID 0x01
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
654 #define MGOD 0x10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
655 #define MMOO 0x12
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
656
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
657 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
658 #define MTOOLS 0x14
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
659 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
660
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
661 /* order flags by importance (0x100 - 0x400) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
662 /* restructuring of message flags to squeeze them all into 1 byte - jmn */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
663 /* hopefully quasi-back-compatible:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
664 MVALID, MINDIV, MTEAM, MALL, MGOD use up 5 bits. this leaves us 3 bits.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
665 since the server only checks for those flags when deciding message
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
666 related things and since each of the above cases only has 1 flag on at
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
667 a time we can overlap the meanings of the flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
668
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
669 #define MINDIV 0x02
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
670 /* these go with MINDIV flag */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
671 #ifdef STDBG
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
672 #define MDBG 0x20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
673 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
674 #define MCONFIG 0x40 /* config messages from server */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
675 #define MDIST 0x60 /* flag distress messages - client thing
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
676 really but stick it in here for
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
677 consistency */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
678 #define MCAST 0x18 /* not an offial packet type. only */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
679 /* used in smessage.c to stay orthogonal */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
680
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
681 #define MTEAM 0x04
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
682 /* these go with MTEAM flag */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
683 #define MTAKE 0x20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
684 #define MDEST 0x40
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
685 #define MBOMB 0x60
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
686 #define MCOUP1 0x80
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
687 #define MCOUP2 0xA0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
688 #define MDISTR 0xC0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
689
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
690 #define MALL 0x08
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
691 /* these go with MALL flag */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
692 #define MGENO 0x20 /* MGENO is not used in INL server but
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
693 belongs here */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
694 #define MCONQ 0x20 /* not enought bits to distinguish
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
695 MCONQ/MGENO :-( */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
696 #define MKILLA 0x40
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
697 #define MKILLP 0x60
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
698 #define MKILL 0x80
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
699 #define MLEAVE 0xA0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
700 #define MJOIN 0xC0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
701 #define MGHOST 0xE0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
702 /* MMASK not used in INL server */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
703
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
704 /* to flag multi-line macros */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
705 #define MMACRO 0x80
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
706
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
707 #define MWHOMSK 0x1f /* mask with this to find who msg to */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
708 #define MWHATMSK 0xe0 /* mask with this to find what message about */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
709
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
710 /* old flags...
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
711 #define MVALID 0x01
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
712 #define MINDIV 0x02
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
713 #define MTEAM 0x04
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
714 #define MALL 0x08
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
715 #define MGOD 0x10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
716
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
717 #define MGENO 0x100 order these by importance (0x100 - 0x400)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
718 #define MCONQ 0x110
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
719 #define MTAKE 0x120
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
720 #define MDEST 0x130
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
721 #define MKILLA 0x200
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
722 #define MBOMB 0x210
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
723 #define MKILLP 0x220
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
724 #define MKILL 0x230
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
725 #define MLEAVE 0x300
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
726 #define MJOIN 0x310
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
727 #define MGHOST 0x320
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
728 #define MCOUP1 0x330
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
729 #define MCOUP2 0x340 end of old flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
730 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
731
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
732 struct message {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
733 int m_no;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
734 int m_flags;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
735 int m_time;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
736 int m_recpt;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
737 char m_data[80];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
738 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
739
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
740 /* message control structure */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
741
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
742 struct mctl {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
743 int mc_current;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
744 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
745
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
746 /* This is a structure used for objects returned by mouse pointing */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
747
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
748 #define PLANETTYPE 0x1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
749 #define PLAYERTYPE 0x2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
750
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
751 struct obtype {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
752 int o_type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
753 int o_num;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
754 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
755
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
756 struct id {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
757 char *name;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
758 int team;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
759 int number;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
760 int type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
761 char mapstring[4];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
762 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
763
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
764 struct rank {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
765 float hours, ratings, defense;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
766 char *name;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
767 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
768
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
769 struct rank2 { /* Paradise ranks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
770 int genocides; /* minimum number of genocides */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
771 float di; /* minimum destruction inflicted */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
772 float battle; /* minimum battle ratings */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
773 float strategy; /* minimum strategy ratings */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
774 float specship; /* minimum total ratings in a specialty */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
775 /* ship SB + WB + JS */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
776 char *name; /* name of this rank */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
777 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
778
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
779
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
780 struct royalty { /* Paradise royalty ranks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
781 char *name; /* name of rank */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
782 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
783
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
784 struct plupdate {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
785
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
786 int plu_update;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
787 int plu_x, plu_y;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
788 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
789
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
790 #ifdef MACROS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
791 #define MACSINGLE 1
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
792 #define MACRCD 2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
793 #define MACMULTI 4
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
794 struct macro {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
795 char flags; /* WAS isSingleMacro; now, uses above flags */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
796 INT8 to; /* if to team, rom, etc put here or -1 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
797 char specialto; /* player nearest mouse, etc here */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
798 struct macro *next; /* for multi-line macros, points to a struct
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
799 *distress if MACRCD flag set. -JR */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
800 char *string; /* string to be sent, % escapes intact */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
801 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
802 #endif /* MACROS */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
803
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
804 struct stringlist {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
805 char *string;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
806 char *value;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
807 struct stringlist *next, *prev;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
808 int searched;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
809 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
810 #endif