some more blockalarm()s
[unix-history] / usr / src / games / sail / dr_4.c
CommitLineData
a3715b77 1#ifndef lint
6ca45914 2static char *sccsid = "@(#)dr_4.c 2.2 83/12/17";
a3715b77
CL
3#endif
4#include "externs.h"
5
b3a57661
EW
6ungrap(from, to)
7register struct ship *from, *to;
a3715b77 8{
b3a57661 9 register k;
6ca45914 10 char friend;
a3715b77 11
6ca45914
EW
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);
b3a57661 18 makesignal(from, "ungrappling %s (%c%c)", to);
a3715b77
CL
19 }
20 }
21}
22
23grap(from, to)
b3a57661 24register struct ship *from, *to;
a3715b77 25{
6ca45914 26 if (capship(from)->nationality != capship(to)->nationality && die() > 2)
b3a57661 27 return;
6ca45914
EW
28 Write(W_GRAP, from, 0, to->file->index, 0, 0, 0);
29 Write(W_GRAP, to, 0, from->file->index, 0, 0, 0);
b3a57661 30 makesignal(from, "grappled with %s (%c%c)", to);
a3715b77 31}