| 1 | #ifndef lint |
| 2 | static char *sccsid = "@(#)dr_4.c 2.2 83/12/17"; |
| 3 | #endif |
| 4 | #include "externs.h" |
| 5 | |
| 6 | ungrap(from, to) |
| 7 | register struct ship *from, *to; |
| 8 | { |
| 9 | register k; |
| 10 | char friend; |
| 11 | |
| 12 | if ((k = grappled2(from, to)) == 0) |
| 13 | return; |
| 14 | friend = capship(from)->nationality == capship(to)->nationality; |
| 15 | while (--k >= 0) { |
| 16 | if (friend || die() < 3) { |
| 17 | cleangrapple(from, to, 0); |
| 18 | makesignal(from, "ungrappling %s (%c%c)", to); |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | grap(from, to) |
| 24 | register struct ship *from, *to; |
| 25 | { |
| 26 | if (capship(from)->nationality != capship(to)->nationality && die() > 2) |
| 27 | return; |
| 28 | Write(W_GRAP, from, 0, to->file->index, 0, 0, 0); |
| 29 | Write(W_GRAP, to, 0, from->file->index, 0, 0, 0); |
| 30 | makesignal(from, "grappled with %s (%c%c)", to); |
| 31 | } |