1 | /*
2 | ** $Log: po_mastrpt.c,v $
3 | ** Revision 1.7 2004/07/09 03:32:23 nzmb
4 | ** Missing #include of functions.h.
5 | **
6 | ** Revision 1.6 2004/07/08 22:20:47 millis
7 | ** Bug 91: small changes to improve status handling and show only
8 | ** real player information to master
9 | **
10 | ** Revision 1.5 2004/05/22 08:51:47 millis
11 | ** Bug 297: Add Intimate Diplomacy
12 | **
13 | ** Revision 1.3 2003/05/02 22:16:57 millis
14 | ** Remove moves from non-players (stops Chaos games with lots of junk lines)
15 | **
16 | ** Revision 1.2 2003/01/14 13:56:46 millis
17 | ** Updated with ustv merged changed
18 | **
19 | ** Revision 1.1.2.1 2003/01/13 16:04:56 millis
20 | ** ustv latest versions
21 | **
22 | ** Revision 1.1 1998/02/28 17:49:42 david
23 | ** Initial revision
24 | **
25 | ** Revision 1.2 1997/03/12 21:33:31 davidn
26 | ** Fix to ensure judge does not try to send 4Gb of spaces to the gm
27 | ** when there is a power with more than 10 letters in its name.
28 | **
29 | ** Revision 1.1 1996/10/20 12:29:45 rpaar
30 | ** Morrolan v9.0
31 | **
32 | */
33 |
34 | /********************************************************************/
35 | /* Code for Players' status in Master signon */
36 | /* */
37 | /* Written by Sean Starkey, starkey@netcom - December 16, 1993 */
38 | /********************************************************************/
39 |
40 | #include <stdio.h>
41 | #include <string.h>
42 | #include "dip.h"
43 | #include "variant.h"
44 | #include "functions.h"
45 |
46 | void mast_rpt(int current_power, int line_up)
47 | {
48 | int cnt, tmp;
49 |
50 | if (current_power == dipent.has_natives)
51 | return; /* Don't show moves pending from natives */
52 |
53 | if (FindPower(current_power) >= dipent.n)
54 | return; /* Don't show moves pending from non-players */
55 |
56 | fprintf(rfp, "%s:", powers[current_power]);
57 | if (line_up) {
58 | for (cnt = strlen(powers[current_power]); cnt < LPOWER + 1; cnt++) {
59 | fprintf(rfp, " ");
60 | };
61 | };
62 | for (cnt = 0; cnt < MAXPLAYERS; cnt++) {
63 | tmp = 0;
64 | if (dipent.players[cnt].power == current_power) {
65 | if (dipent.players[cnt].controlling_power == 0 ||
66 | dipent.players[cnt].controlling_power >= WILD_PLAYER) {
67 | if ((dipent.players[cnt].status & SF_MOVE) &&
68 | !(dipent.players[cnt].status & SF_PART)) {
69 | fprintf(rfp, " Move Required");
70 | tmp = 1;
71 | };
72 | if ((dipent.players[cnt].status & SF_MOVE) &&
73 | (dipent.players[cnt].status & SF_PART)) {
74 | if (tmp)
75 | fprintf(rfp, ",");
76 | fprintf(rfp, " Move Submitted");
77 | tmp = 1;
78 | };
79 | if (~dipent.players[cnt].status & SF_MOVE) {
80 | if (tmp)
81 | fprintf(rfp, ",");
82 | fprintf(rfp, " No Move Required");
83 | tmp = 1;
84 | };
85 | if ((dipent.players[cnt].status & SF_PART) &&
86 | !(dipent.players[cnt].status & SF_MOVED)) {
87 | if (tmp)
88 | fprintf(rfp, ",");
89 | fprintf(rfp, " Error Flag");
90 | tmp = 1;
91 | };
92 | if (dipent.players[cnt].status & SF_CD) {
93 | if (tmp)
94 | fprintf(rfp, ",");
95 | tmp = 1;
96 | fprintf(rfp, " CD");
97 | };
98 | if (dipent.players[cnt].status & SF_ABAND) {
99 | if (tmp)
100 | fprintf(rfp, ",");
101 | tmp = 1;
102 | fprintf(rfp, " Abandoned");
103 | };
104 | if (dipent.players[cnt].status & SF_WAIT) {
105 | if (tmp)
106 | fprintf(rfp, ",");
107 | tmp = 1;
108 | fprintf(rfp, " WAIT");
109 | };
110 | fprintf(rfp, ".");
111 | } else {
112 | fprintf(rfp, " controlled by %s.", powers[dipent.players[RealPlayerIndex(cnt)].power]);
113 | }
114 | };
115 | };
116 | fprintf(rfp, "\n");
117 | }