Lines Matching refs:pp
67 PLAY *pp;
71 pp = &Player[Play];
73 if (pp->hand[i] != -1)
87 if (haspicked(pp)) {
88 if (pp->hand[Card_no] == C_INIT)
94 if (is_safety(pp->hand[Card_no])) {
99 Discard = pp->hand[Card_no];
100 pp->hand[Card_no] = C_INIT;
110 goodplay = playcard(pp);
116 else if (haspicked(pp))
119 pp->hand[0] = *--Topcard;
128 pp->safety[*Topcard-S_CONV] = S_IN_HAND;
130 if (pp->hand[1] == C_INIT && Topcard > Deck) {
132 pp->hand[1] = *--Topcard;
139 pp->new_battle = FALSE;
140 pp->new_speed = FALSE;
152 if (Order && Movetype != M_DRAW && goodplay && pp == &Player[PLAYER])
153 sort(pp->hand);
156 if (pp->hand[i] == C_INIT) {
157 for (j = 0; pp->hand[j] == C_INIT; j++)
162 pp->hand[i] = pp->hand[j];
163 pp->hand[j] = C_INIT;
179 PLAY *pp, *op;
182 for (pp = Player; pp < &Player[2]; pp++) {
183 op = (pp == &Player[COMP] ? &Player[PLAYER] : &Player[COMP]);
185 card = pp->hand[i];
186 if (is_safety(card) || canplay(pp, op, card)) {
191 fprintf(outf, "canplay(pp, op, card) = %d\n", canplay(pp, op, card));
207 playcard(PLAY *pp)
215 switch (pp->hand[Card_no]) {
217 if (!haspicked(pp))
225 card = pp->hand[Card_no];
233 if (pp->nummiles[C_200] == 2)
237 if (pp->speed == C_LIMIT)
241 if (pp->mileage + Value[card] > End)
245 if (!pp->can_go)
247 pp->nummiles[card]++;
249 pp->total += v;
250 pp->hand_tot += v;
251 if ((pp->mileage += v) == End)
256 if (pp->battle != opposite(card))
258 pp->battle = card;
259 if (pp->safety[S_RIGHT_WAY] == S_PLAYED)
260 pp->can_go = TRUE;
264 if (pp->battle != C_INIT && pp->battle != C_STOP
265 && !is_repair(pp->battle))
267 C_name[pp->battle]);
268 pp->battle = C_GO;
269 pp->can_go = TRUE;
273 if (pp->speed != C_LIMIT)
275 pp->speed = C_END_LIMIT;
280 pp = &Player[other(Play)];
281 if (!pp->can_go)
283 else if (pp->safety[safety(card) - S_CONV] == S_PLAYED)
286 pp->battle = card;
287 pp->new_battle = TRUE;
288 pp->can_go = FALSE;
289 pp = &Player[Play];
293 pp = &Player[other(Play)];
294 if (pp->speed == C_LIMIT)
296 if (pp->safety[S_RIGHT_WAY] == S_PLAYED)
298 pp->speed = C_LIMIT;
299 pp->new_speed = TRUE;
300 pp = &Player[Play];
305 if (pp->battle == opposite(card)
306 || (card == C_RIGHT_WAY && pp->speed == C_LIMIT)) {
307 if (!(card == C_RIGHT_WAY && !is_repair(pp->battle))) {
308 pp->battle = C_GO;
309 pp->can_go = TRUE;
311 if (card == C_RIGHT_WAY && pp->speed == C_LIMIT)
312 pp->speed = C_INIT;
313 if (pp->new_battle
314 || (pp->new_speed && card == C_RIGHT_WAY)) {
315 pp->coups[card - S_CONV] = TRUE;
316 pp->total += SC_COUP;
317 pp->hand_tot += SC_COUP;
318 pp->coupscore += SC_COUP;
324 else if (pp->hand[0] == C_INIT && Topcard > Deck)
326 pp->safety[card - S_CONV] = S_PLAYED;
327 pp->total += SC_SAFETY;
328 pp->hand_tot += SC_SAFETY;
329 if ((pp->safescore += SC_SAFETY) == NUM_SAFE * SC_SAFETY) {
330 pp->total += SC_ALL_SAFE;
331 pp->hand_tot += SC_ALL_SAFE;
334 if (pp->speed == C_LIMIT)
335 pp->speed = C_INIT;
336 if (pp->battle == C_STOP || pp->battle == C_INIT) {
337 pp->can_go = TRUE;
338 pp->battle = C_INIT;
340 if (!pp->can_go && is_repair(pp->battle))
341 pp->can_go = TRUE;
351 if (pp == &Player[PLAYER])
353 pp->hand[Card_no] = C_INIT;
493 haspicked(const PLAY *pp)
499 switch (pp->hand[Card_no]) {
508 return (pp->hand[card] != C_INIT);