comparison ranklist.c @ 3:5a977ccbc7a9 default tip

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