annotate ranklist.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: ranklist.c,v 1.1.1.1 1997/12/06 05:41:30 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 * ranklist.c
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 * Kevin P. Smith 12/5/88
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #include "copyright2.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 #include <stdio.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include "struct.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #include "data.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 #include "proto.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 /* Prototypes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 static void print_ranks_paradise P((void));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 ranklist()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 register int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 char buf[80];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 W_ClearWindow(rankw);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 if (!paradise) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 (void) strcpy(buf, " Rank Hours Defense Ratings DI");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 W_WriteText(rankw, 1, 1, textColor, buf, strlen(buf), W_BoldFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 for (i = 0; i < NUMRANKS; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 sprintf(buf, "%-11.11s %5.0f %8.2f %8.2f %7.2f",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 ranks[i].name,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 ranks[i].hours,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 ranks[i].defense,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 ranks[i].ratings,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 ranks[i].ratings * ranks[i].hours);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 if (mystats->st_rank == i) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 W_WriteText(rankw, 1, i + 2, W_Cyan, buf, strlen(buf), W_BoldFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 W_WriteText(rankw, 1, i + 2, textColor, buf, strlen(buf),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48 strcpy(buf, "To achieve a rank, you need a high enough defense, and");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 W_WriteText(rankw, 1, i + 3, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 strcpy(buf, "either enough hours, and bombing + planet + offense ratings");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 W_WriteText(rankw, 1, i + 4, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 strcpy(buf, "above shown ratings, or too few hours, and a DI rating above");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 W_WriteText(rankw, 1, i + 5, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 strcpy(buf, "the shown DI rating.");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 W_WriteText(rankw, 1, i + 6, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 } else { /* else we are in a paradise server */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 print_ranks_paradise();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 print_ranks_paradise()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 register int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 char buf[80];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 W_ResizeText(rankw, 65, nranks2 + 8);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 (void) strcpy(buf, " Rank genocides DI battle strategy special ships");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 W_WriteText(rankw, 1, 1, textColor, buf, strlen(buf), W_BoldFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 for (i = 0; i < nranks2; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 sprintf(buf, "%-11.11s %5d %8.2f %8.2f %8.2f %7.2f",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 ranks2[i].name,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 ranks2[i].genocides,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 ranks2[i].di,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 ranks2[i].battle,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 ranks2[i].strategy,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 ranks2[i].specship);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 if (mystats->st_rank == i) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 W_WriteText(rankw, 1, i + 2, W_Cyan, buf, strlen(buf), W_BoldFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 W_WriteText(rankw, 1, i + 2, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 strcpy(buf, "To achieve a rank, you need a high enough number of");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 W_WriteText(rankw, 1, i + 3, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 strcpy(buf, "genocides, a high enough DI, a high enough battle");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 W_WriteText(rankw, 1, i + 4, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 strcpy(buf, "rating, a high enough strategy rating, and a high");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92 W_WriteText(rankw, 1, i + 5, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 strcpy(buf, "enough special ship rating");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 W_WriteText(rankw, 1, i + 6, textColor, buf, strlen(buf), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95 }