Annotation of 43BSD/games/sail/dr_4.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1983 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  */
                      6: 
                      7: #ifndef lint
                      8: static char sccsid[] = "@(#)dr_4.c     5.1 (Berkeley) 5/29/85";
                      9: #endif not lint
                     10: 
                     11: #include "externs.h"
                     12: 
                     13: ungrap(from, to)
                     14: register struct ship *from, *to;
                     15: {
                     16:        register k;
                     17:        char friend;
                     18: 
                     19:        if ((k = grappled2(from, to)) == 0)
                     20:                return;
                     21:        friend = capship(from)->nationality == capship(to)->nationality;
                     22:        while (--k >= 0) {
                     23:                if (friend || die() < 3) {
                     24:                        cleangrapple(from, to, 0);
                     25:                        makesignal(from, "ungrappling %s (%c%c)", to);
                     26:                }
                     27:        }
                     28: }
                     29: 
                     30: grap(from, to)
                     31: register struct ship *from, *to;
                     32: {
                     33:        if (capship(from)->nationality != capship(to)->nationality && die() > 2)
                     34:                return;
                     35:        Write(W_GRAP, from, 0, to->file->index, 0, 0, 0);
                     36:        Write(W_GRAP, to, 0, from->file->index, 0, 0, 0);
                     37:        makesignal(from, "grappled with %s (%c%c)", to);
                     38: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.