Commit | Line | Data |
---|---|---|
a3715b77 CL |
1 | #ifndef lint |
2 | static char *sccsid = "@(#)dr_4.c 1.1 83/03/17"; | |
3 | #endif | |
4 | #include "externs.h" | |
5 | ||
6 | ungrap(from,to) | |
7 | int from, to; | |
8 | { | |
9 | int k; | |
10 | ||
11 | if(grapple(from, to)){ | |
12 | for (k = 0; k < 10; k++){ | |
13 | if (scene[game].ship[from].file -> grapples[k].turnfoul && to == scene[game].ship[from].file -> grapples[k].toship && (die() < 3 || scene[game].ship[from].nationality == scene[game].ship[to].nationality)){ | |
14 | cleangrapple(from, to, k); | |
15 | makesignal("ungrappling %s (%c%c)", to, from); | |
16 | } | |
17 | } | |
18 | } | |
19 | } | |
20 | ||
21 | grap(from, to) | |
22 | int from,to; | |
23 | { | |
24 | int number, captured, l; | |
25 | ||
26 | if ((captured = scene[game].ship[to].file -> captured) < 0) | |
27 | captured = to; | |
28 | number = die() < 3; | |
29 | if (!number && scene[game].ship[from].nationality == scene[game].ship[captured].nationality) | |
30 | number = 1; | |
31 | if (number){ | |
32 | for (l=0; l < 10 && scene[game].ship[from].file -> grapples[l].turnfoul; l++); | |
33 | if (l < 10){ | |
34 | Write(FILES + from, 0, 124 + l*4, turn); | |
35 | Write(FILES + from, 0, 124 + l*4 + 2, to); | |
36 | } | |
37 | for (l=0; l < 10 && scene[game].ship[to].file -> grapples[l].turnfoul; l++); | |
38 | if (l < 10){ | |
39 | Write(FILES + to, 0, 124 + l*4, turn); | |
40 | Write(FILES + to, 0, 124 + l*4 + 2, from); | |
41 | } | |
42 | makesignal("grappled with %s (%c%c)", to, from); | |
43 | } | |
44 | } | |
45 | ||
46 |