Commit | Line | Data |
---|---|---|
b5f0675e | 1 | /* |
9dceaff0 KB |
2 | * Copyright (c) 1983, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
c0ca48ec | 4 | * |
b2e7427f | 5 | * %sccs.include.redist.c% |
b5f0675e EW |
6 | */ |
7 | ||
a3715b77 | 8 | #ifndef lint |
9dceaff0 | 9 | static char sccsid[] = "@(#)dr_4.c 8.1 (Berkeley) %G%"; |
c0ca48ec | 10 | #endif /* not lint */ |
b5f0675e | 11 | |
a3715b77 CL |
12 | #include "externs.h" |
13 | ||
b3a57661 EW |
14 | ungrap(from, to) |
15 | register struct ship *from, *to; | |
a3715b77 | 16 | { |
b3a57661 | 17 | register k; |
6ca45914 | 18 | char friend; |
a3715b77 | 19 | |
6ca45914 EW |
20 | if ((k = grappled2(from, to)) == 0) |
21 | return; | |
22 | friend = capship(from)->nationality == capship(to)->nationality; | |
23 | while (--k >= 0) { | |
24 | if (friend || die() < 3) { | |
25 | cleangrapple(from, to, 0); | |
b3a57661 | 26 | makesignal(from, "ungrappling %s (%c%c)", to); |
a3715b77 CL |
27 | } |
28 | } | |
29 | } | |
30 | ||
31 | grap(from, to) | |
b3a57661 | 32 | register struct ship *from, *to; |
a3715b77 | 33 | { |
6ca45914 | 34 | if (capship(from)->nationality != capship(to)->nationality && die() > 2) |
b3a57661 | 35 | return; |
6ca45914 EW |
36 | Write(W_GRAP, from, 0, to->file->index, 0, 0, 0); |
37 | Write(W_GRAP, to, 0, from->file->index, 0, 0, 0); | |
b3a57661 | 38 | makesignal(from, "grappled with %s (%c%c)", to); |
a3715b77 | 39 | } |