Commit | Line | Data |
---|---|---|
0bcf0267 | 1 | #ifndef lint |
6ca45914 | 2 | static char *sccsid = "@(#)parties.c 2.2 83/12/17"; |
0bcf0267 | 3 | #endif |
b3a57661 | 4 | |
0bcf0267 CL |
5 | #include "externs.h" |
6 | ||
7 | meleeing(from, to) | |
b3a57661 EW |
8 | struct ship *from; |
9 | register struct ship *to; | |
0bcf0267 | 10 | { |
b3a57661 EW |
11 | register struct BP *p = from->file->OBP; |
12 | register struct BP *q = p + NBP; | |
0bcf0267 | 13 | |
b3a57661 EW |
14 | for (; p < q; p++) |
15 | if (p->turnsent && p->toship == to) | |
16 | return 1; | |
17 | return 0; | |
0bcf0267 CL |
18 | } |
19 | ||
b3a57661 EW |
20 | boarding(from, isdefense) |
21 | register struct ship *from; | |
22 | char isdefense; | |
0bcf0267 | 23 | { |
b3a57661 EW |
24 | register struct BP *p = isdefense ? from->file->DBP : from->file->OBP; |
25 | register struct BP *q = p + NBP; | |
0bcf0267 | 26 | |
b3a57661 EW |
27 | for (; p < q; p++) |
28 | if (p->turnsent) | |
29 | return 1; | |
30 | return 0; | |
0bcf0267 CL |
31 | } |
32 | ||
b3a57661 EW |
33 | unboard(ship, to, isdefense) |
34 | register struct ship *ship, *to; | |
35 | register char isdefense; | |
0bcf0267 | 36 | { |
b3a57661 EW |
37 | register struct BP *p = isdefense ? ship->file->DBP : ship->file->OBP; |
38 | register n; | |
0bcf0267 | 39 | |
b3a57661 EW |
40 | for (n = 0; n < NBP; p++, n++) |
41 | if (p->turnsent && (p->toship == to || isdefense || ship == to)) | |
42 | Write(isdefense ? W_DBP : W_OBP, ship, 0, n, 0, 0, 0); | |
0bcf0267 | 43 | } |