annotate getship.c @ 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: getship.c,v 1.1.1.1 1997/12/06 05:41:29 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 * getship.c for client of socket protocol.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 * This file has been mangled so it only sets the ship characteristics needed.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 #include "copyright.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10 #include <stdio.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 #ifdef __STDC__
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include <stdlib.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include <sys/types.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 #include "struct.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 #include "data.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 #include "proto.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 /* Prototypes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 static void getship_default P((struct ship * shipp, int s_type));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 init_shiptypes()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 struct shiplist *temp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 /* start at -1, the default shiptype */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 for (i = -1; i < nshiptypes; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 temp = (struct shiplist *) malloc(sizeof(struct shiplist));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 temp->ship = (struct ship *) malloc(sizeof(struct ship));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 getship_default(temp->ship, i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 temp->next = shiptypes;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 if (temp->next)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 temp->next->prev = temp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 temp->prev = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 shiptypes = temp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 init_galaxy_class()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 hack to allow galaxy class ships. By the time the client knows it's
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48 connected to a paradise server, the defaults must already have been
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 run. [BDyess]
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 struct shiplist *temp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 for (temp = shiptypes; temp->ship->s_type != GALAXY; temp = temp->next)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 /* null body */ ;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 getship_default(temp->ship, GALAXY);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 /* slurp_ship_bitmaps(); */ /* don't destroy downloaded bitmaps */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 init_puck()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 /* ditto above init_galaxy_class(), but this time for hockey and puck.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 [BDyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 struct shiplist *temp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 temp = shiptypes;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 while(temp->next) temp = temp->next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 temp->next = (struct shiplist*)malloc(sizeof(struct shiplist));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 temp = temp->next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 temp->ship = (struct ship*)malloc(sizeof(struct ship));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 getship_default(temp->ship, PUCK);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 temp->next = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 slurp_ship_bitmaps();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 #endif /*0*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 /* now returns a pointer to where the ship data is located. This way
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 if the data is later changed by the server everybody gets updated.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 Plus as a bonus it's more efficient :) [Bill Dyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 struct ship *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 getship(s_type)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 int s_type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 struct shiplist *temp, *new;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 temp = shiptypes;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 while (temp) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95 if (temp->ship->s_type == s_type) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96 /* bcopy(temp->ship, shipp, sizeof(struct ship)); */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97 return temp->ship;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 temp = temp->next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102 ok, that shiptype is unheard of. Assume a new shiptype, and get the
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103 values for CA. Also add the ship to the list so if it gets updated by
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104 the server later everyone stays happy. [Bill Dyess]
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 printf("Error: getship of unknown ship type %d, using CA defaults\n", s_type);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107 temp = shiptypes;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 while (temp) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 if (temp->ship->s_type == DEFAULT) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110 printf("Adding ship type %d\n", s_type);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111 /* bcopy(temp->ship, shipp, sizeof(struct ship)); */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112 /* now add the new ship to the list */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 new = (struct shiplist *) malloc(sizeof(struct shiplist));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114 new->ship = (struct ship *) malloc(sizeof(struct ship));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 new->next = shiptypes;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116 new->prev = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 if (shiptypes)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118 shiptypes->prev = new;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 shiptypes = new;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 bcopy(temp->ship, new->ship, sizeof(struct ship));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121 new->ship->s_type = s_type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 return new->ship;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124 temp = temp->next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 return temp->ship;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130 /* fill in ship characteristics */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133 getship_default(shipp, s_type)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134 struct ship *shipp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 int s_type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 switch (s_type) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138 case SCOUT:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 case PUCK:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 shipp->s_torpspeed = 16;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 shipp->s_phaserrange = 4500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 shipp->s_maxspeed = 12;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 shipp->s_maxfuel = 5000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 shipp->s_maxarmies = 2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145 shipp->s_maxshield = 75;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146 shipp->s_maxdamage = 75;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 if(s_type == PUCK) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 shipp->s_type = PUCK;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 shipp->s_letter = 'k';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152 shipp->s_desig[0] = 'P';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153 shipp->s_desig[1] = 'U';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 shipp->s_bitmap = PUCK;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 shipp->s_type = SCOUT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 shipp->s_letter = 's';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158 shipp->s_desig[0] = 'S';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 shipp->s_desig[1] = 'C';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 shipp->s_bitmap = SCOUT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163 case DESTROYER:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164 shipp->s_type = DESTROYER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 shipp->s_torpspeed = 14;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 shipp->s_phaserrange = 5100;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 shipp->s_maxspeed = 10;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 shipp->s_maxfuel = 7000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 shipp->s_maxarmies = 5;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170 shipp->s_maxshield = 85;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 shipp->s_maxdamage = 85;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174 shipp->s_letter = 'd';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 shipp->s_desig[0] = 'D';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176 shipp->s_desig[1] = 'D';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 shipp->s_bitmap = DESTROYER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180 case DEFAULT:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181 case CRUISER:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 shipp->s_type = s_type;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 shipp->s_torpspeed = 12;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184 shipp->s_phaserrange = 6000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185 shipp->s_maxspeed = 9;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 shipp->s_maxfuel = 10000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187 shipp->s_maxarmies = 10;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188 shipp->s_maxshield = 100;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189 shipp->s_maxdamage = 100;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192 shipp->s_letter = 'c';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 shipp->s_desig[0] = 'C';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 shipp->s_desig[1] = 'A';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195 shipp->s_bitmap = CRUISER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 case BATTLESHIP:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198 shipp->s_type = BATTLESHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199 shipp->s_torpspeed = 12;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 shipp->s_phaserrange = 6300;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 shipp->s_maxspeed = 8;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 shipp->s_maxfuel = 14000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 shipp->s_maxarmies = 6;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204 shipp->s_maxshield = 130;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 shipp->s_maxdamage = 130;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208 shipp->s_letter = 'b';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 shipp->s_desig[0] = 'B';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 shipp->s_desig[1] = 'B';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211 shipp->s_bitmap = BATTLESHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 case ASSAULT:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214 shipp->s_type = ASSAULT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 shipp->s_torpspeed = 16;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 shipp->s_phaserrange = 4800;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217 shipp->s_maxspeed = 8;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 shipp->s_maxfuel = 6000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219 shipp->s_maxarmies = 20;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 shipp->s_maxshield = 80;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 shipp->s_maxdamage = 200;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223 shipp->s_maxegntemp = 1200;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224 shipp->s_letter = 'a';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 shipp->s_desig[0] = 'A';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226 shipp->s_desig[1] = 'S';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 shipp->s_bitmap = ASSAULT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229 case STARBASE:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 shipp->s_type = STARBASE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231 shipp->s_torpspeed = 14;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 shipp->s_phaserrange = 7200;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 shipp->s_maxspeed = 2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 shipp->s_maxfuel = 60000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 shipp->s_maxarmies = 25;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 shipp->s_maxshield = 500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237 shipp->s_maxdamage = 600;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 shipp->s_maxwpntemp = 1300;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
239 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
240 shipp->s_letter = 'o';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
241 shipp->s_desig[0] = 'S';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
242 shipp->s_desig[1] = 'B';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
243 shipp->s_bitmap = STARBASE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
244 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
245 case ATT: /* or GALAXY */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
246 if (paradise) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
247 shipp->s_type = ATT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
248 shipp->s_torpspeed = 20;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
249 shipp->s_phaserrange = 6000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
250 shipp->s_maxspeed = 90;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
251 shipp->s_maxfuel = 60000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
252 shipp->s_maxarmies = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
253 shipp->s_maxshield = 30000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
254 shipp->s_maxdamage = 30000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
255 shipp->s_maxwpntemp = 10000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
256 shipp->s_maxegntemp = 10000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
257 shipp->s_letter = 'X';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
258 shipp->s_desig[0] = 'A';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
259 shipp->s_desig[1] = 'T';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
260 shipp->s_bitmap = ATT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
261 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
262 shipp->s_type = GALAXY;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
263 shipp->s_torpspeed = 13;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
264 shipp->s_phaserrange = 6000; /* this is a guess */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
265 shipp->s_maxspeed = 9;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
266 shipp->s_maxfuel = 12000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
267 shipp->s_maxarmies = 12;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
268 shipp->s_maxshield = 140;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
269 shipp->s_maxdamage = 120;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
270 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
271 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
272 shipp->s_letter = 'g';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
273 shipp->s_desig[0] = 'G';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
274 shipp->s_desig[1] = 'A';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
275 shipp->s_bitmap = FLAGSHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
276 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
277 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
278 case FLAGSHIP:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
279 shipp->s_type = FLAGSHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
280 shipp->s_torpspeed = 14;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
281 shipp->s_phaserrange = 5750;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
282 shipp->s_maxspeed = 9;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
283 shipp->s_maxfuel = 14500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
284 shipp->s_maxarmies = 8;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
285 shipp->s_maxshield = 115;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
286 shipp->s_maxdamage = 115;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
287 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
288 shipp->s_maxegntemp = 1500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
289 shipp->s_letter = 'f';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
290 shipp->s_desig[0] = 'F';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
291 shipp->s_desig[1] = 'L';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
292 shipp->s_bitmap = FLAGSHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
293 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
294 case JUMPSHIP:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
295 shipp->s_type = JUMPSHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
296 shipp->s_torpspeed = 18;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
297 shipp->s_phaserrange = 3000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
298 shipp->s_maxspeed = 20;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
299 shipp->s_maxfuel = 50000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
300 shipp->s_maxarmies = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
301 shipp->s_maxshield = 5;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
302 shipp->s_maxdamage = 60;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
303 shipp->s_maxwpntemp = 1300;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
304 shipp->s_maxegntemp = 5000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
305 shipp->s_letter = 'j';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
306 shipp->s_desig[0] = 'J';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
307 shipp->s_desig[1] = 'S';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
308 shipp->s_bitmap = JUMPSHIP;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
309 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
310 case WARBASE:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
311 shipp->s_type = WARBASE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
312 shipp->s_torpspeed = 15;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
313 shipp->s_phaserrange = 6000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
314 shipp->s_maxspeed = 3;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
315 shipp->s_maxfuel = 50000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
316 shipp->s_maxarmies = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
317 shipp->s_maxshield = 150;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
318 shipp->s_maxdamage = 500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
319 shipp->s_maxwpntemp = 1500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
320 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
321 shipp->s_letter = 'w';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
322 shipp->s_desig[0] = 'W';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
323 shipp->s_desig[1] = 'B';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
324 shipp->s_bitmap = WARBASE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
325 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
326
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
327 case LIGHTCRUISER:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
328 shipp->s_type = LIGHTCRUISER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
329 shipp->s_torpspeed = 13;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
330 shipp->s_phaserrange = 6000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
331 shipp->s_maxspeed = 10;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
332 shipp->s_maxfuel = 9000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
333 shipp->s_maxarmies = 4;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
334 shipp->s_maxshield = 95;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
335 shipp->s_maxdamage = 90;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
336 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
337 shipp->s_maxegntemp = 1500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
338 shipp->s_letter = 'l';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
339 shipp->s_desig[0] = 'C';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
340 shipp->s_desig[1] = 'L';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
341 shipp->s_bitmap = LIGHTCRUISER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
342 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
343
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
344 case CARRIER:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
345 shipp->s_type = CARRIER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
346 shipp->s_torpspeed = 10;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
347 shipp->s_phaserrange = 4500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
348 shipp->s_maxspeed = 10;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
349 shipp->s_maxfuel = 15000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
350 shipp->s_maxarmies = 3;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
351 shipp->s_maxshield = 100;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
352 shipp->s_maxdamage = 150;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
353 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
354 shipp->s_maxegntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
355 shipp->s_letter = 'v';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
356 shipp->s_desig[0] = 'C';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
357 shipp->s_desig[1] = 'V';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
358 shipp->s_bitmap = CARRIER;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
359 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
360 case UTILITY:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
361 shipp->s_type = UTILITY;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
362 shipp->s_torpspeed = 16;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
363 shipp->s_phaserrange = 5000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
364 shipp->s_maxspeed = 7;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
365 shipp->s_maxfuel = 12000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
366 shipp->s_maxarmies = 12;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
367 shipp->s_maxshield = 110;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
368 shipp->s_maxdamage = 180;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
369 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
370 shipp->s_maxegntemp = 1800;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
371 shipp->s_letter = 'u';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
372 shipp->s_desig[0] = 'U';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
373 shipp->s_desig[1] = 'T';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
374 shipp->s_bitmap = UTILITY;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
375 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
376
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
377 case PATROL:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
378 shipp->s_type = PATROL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
379 shipp->s_torpspeed = 15;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
380 shipp->s_phaserrange = 5000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
381 shipp->s_maxspeed = 11;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
382 shipp->s_maxfuel = 4000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
383 shipp->s_maxarmies = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
384 shipp->s_maxshield = 50;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
385 shipp->s_maxdamage = 40;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
386 shipp->s_maxwpntemp = 1000;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
387 shipp->s_maxegntemp = 1500;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
388 shipp->s_letter = 'p';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
389 shipp->s_desig[0] = 'P';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
390 shipp->s_desig[1] = 'T';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
391 shipp->s_bitmap = PATROL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
392 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
393 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
394 buildShipKeymap(shipp);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
395 }