annotate planetlist.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: planetlist.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 * planetlist.c
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 #include "copyright.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 #include <stdio.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 #include <string.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include "struct.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #include "data.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include "proto.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 /* Prototypes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 static void planet_list_paradise P((void));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 static void planet_list_normal P((void));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 static void print_planet P((W_Window wind, int line, struct planet * j));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 static char *teamname[5] = {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 "IND",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 "FED",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 "ROM",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 "KLI",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 "ORI"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 ** Open a window which contains all the planets and their current
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 ** statistics. Players will not know about planets that their team
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 ** has not orbited.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 planetlist()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 W_ClearWindow(planetw);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 if (!paradise) { /* if not a paradise server then */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 planet_list_normal();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 } else { /* else must be a paradise server */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 planet_list_paradise();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 /*This function provides the planet list for a normal server. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 planet_list_normal()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 int k = 0; /* for row number */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 int i; /* looping var */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 struct planet *j; /* to point to a planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 char buf[100]; /* to sprintf into */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 char buf1[40];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 W_Window wind;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 wind = planetw;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 for (i = 0, j = &planets[i]; i < nplanets; i++, j++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 if (i == 0 || i == nplanets / 2) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 if (i != 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 wind = planetw2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 sprintf(buf, "Planet name Own Armies Resources Info");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 W_WriteText(wind, 2, 1, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 k = 2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 sprintf(buf1, "%-16s ", j->pl_name);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 if (j->pl_info & idx_to_mask(me->p_teami)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 sprintf(buf, "%3s %3d %s%s%s %s ",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 teamname[mask_to_idx(j->pl_owner) + 1],
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 j->pl_armies,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 (j->pl_flags & PLREPAIR ? "REPR " : " "),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 (j->pl_flags & PLFUEL ? "FUEL " : " "),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 (j->pl_flags & PLAGRI ? "AGRI " : " "),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 team_bit_string(j->pl_info));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 W_WriteText(wind, 2, k, planetColor(j), buf1, strlen(buf1),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 planetFont(j));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 W_WriteText(wind, 24, k++, planetColor(j), buf, strlen(buf),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 planetFont(j));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 /* end of have info */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 else { /* else no info on planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 W_WriteText(wind, 2, k++, planetColor(j), buf1, strlen(buf1),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 planetFont(j));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 } /* end of for loop */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97 /*This function provides the planet list for a paradise server version 2.0 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 planet_list_paradise()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102 typedef struct planet *plptr;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104 int k = 0; /* for row number */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 int i, team_pnum; /* looping var */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 plptr j; /* to point to a planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107 char buf[100]; /* to sprintf into */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 W_Window wind;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 extern int number_of_teams;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110 plptr **team_p;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111 int *team_pcount;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 wind = planetw;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 /* this malloc stuff will handle any number of teams/races */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 /* team's planet counters */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118 team_pcount = (int *) malloc((number_of_teams + 1) * sizeof(int));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 for (i = 0; i < number_of_teams + 1; i++)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 team_pcount[i] = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 if (mapSort) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 /* make some memory */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124 team_p = (plptr **) malloc((number_of_teams + 1) * sizeof(struct planet *));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 for (i = 0; i < (number_of_teams + 1); i++)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 team_p[i] = (plptr *) malloc(nplanets * sizeof(struct planet *));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 /* loop thru and put proper team planeter point on each planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129 for (i = 0, j = &planets[i]; i < nplanets; i++, j++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130 k = mask_to_idx(j->pl_owner) + 1; /* which team gets planet */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131 team_p[k][team_pcount[k]] = j;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 team_pcount[k]++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 /* go thru each teams planet list and display */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136 for (i = 0, k = 0; i < (number_of_teams + 1); i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 for (team_pnum = 0; team_pnum < team_pcount[i]; team_pnum++, k++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 j = team_p[i][team_pnum];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 /* (nplanets+13)/2 is the height of window; from newwin.c */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 if (k == 0 || k >= ((nplanets + 13) / 2)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 if (k != 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 wind = planetw2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 sprintf(buf, "Planet name sctr own armies RESOURCES SURFC ATMOS VISIT TIME");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145 W_WriteText(wind, 2, 1, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146 k = 2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 print_planet(wind, k, j);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 } /* end of 2nd for */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 if (team_pcount[i] > 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 k++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152 } /* end of 1st for */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 for (i = 0; i < (number_of_teams + 1); i++)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 free(team_p[i]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 free(team_p);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 } else { /* do the original alpa only sort planet list */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 for (i = 0, j = &planets[i]; i < nplanets; i++, j++, k++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 if (i == 0 || i == nplanets / 2) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 sprintf(buf, "Planet name sctr own armies RESOURCES SURFC ATMOS VISIT TIME");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164 if (i != 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 wind = planetw2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 W_WriteText(wind, 2, 1, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 k = 2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170 team_pcount[mask_to_idx(j->pl_owner) + 1]++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 print_planet(wind, k, j);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 k++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176 for (i = 0; i < (number_of_teams + 1); i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 W_Color cur_color;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179 cur_color = shipCol[i];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180 sprintf(buf, "%s: ", teamname[i]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181 W_WriteText(wind, i * 7 + 2, k, cur_color, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 sprintf(buf, " %.2i", team_pcount[i]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 W_WriteText(wind, i * 7 + 2, k + 1, cur_color, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 free(team_pcount);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188 } /* end of planet_list_paradise */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 /****************************** print_planet() ************************/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 print_planet(wind, line, j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 W_Window wind;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195 int line;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 struct planet *j;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198 char buf[100]; /* to sprintf into */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 sprintf(buf, "%-16s %d-%d", j->pl_name, (j->pl_x / GRIDSIZE) + 1,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 (j->pl_y / GRIDSIZE) + 1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 W_WriteText(wind, 2, line, textColor, buf, strlen(buf),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 if (j->pl_info & idx_to_mask(me->p_teami)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 if (PL_TYPE(*j) == PLSTAR) { /* if planet actually a star */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 W_WriteText(wind, 24, line, textColor, "---S T A R---", 13,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208 W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 } else if (PL_TYPE(*j) == PLWHOLE) { /* if wormhole... */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 W_WriteText(wind, 24, line, textColor, "---W O R M H O L E---", 21,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211 W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 } else { /* else planet not a star */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 char *s = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 switch (j->pl_flags & PLATMASK) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 case PLPOISON:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217 s = "TOXC";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219 case PLATYPE3:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 s = "TNTD";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222 case PLATYPE2:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223 s = "THIN";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 case PLATYPE1:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226 s = "STND";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229 sprintf(buf, "%3s %3d %c%c%c%c %c%c%c %4s",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 teamname[mask_to_idx(j->pl_owner) + 1],
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231 j->pl_armies,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 (j->pl_flags & PLREPAIR ? 'R' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 (j->pl_flags & PLFUEL ? 'F' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 (j->pl_flags & PLAGRI ? 'A' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 (j->pl_flags & PLSHIPYARD ? 'S' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 (j->pl_flags & PLDILYTH ? 'D' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237 (j->pl_flags & PLMETAL ? 'M' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 (j->pl_flags & PLARABLE ? 'A' : ' '),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
239 s);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
240
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
241 W_WriteText(wind, 24, line, planetColor(j), buf, strlen(buf),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
242 planetFont(j));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
243
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
244 sprintf(buf, "%4s %3ld",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
245 team_bit_string(j->pl_info),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
246 ((idx_to_mask(me->p_teami) == j->pl_owner) ? 0 : (status2->clock - j->pl_timestamp)));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
247
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
248 W_WriteText(wind, 64, line, planetColor(j), buf, strlen(buf),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
249 planetFont(j));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
250 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
251 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
252 sprintf(buf, "--- No info; Scout me ---");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
253 W_WriteText(wind, 24, line, textColor, buf, strlen(buf),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
254 W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
255 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
256 } /* end of print_planet */