BSD 4_3_Tahoe release
[unix-history] / usr / src / games / trek / destruct.c
index fad5711..4b07495 100644 (file)
@@ -1,6 +1,23 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)destruct.c 4.1     (Berkeley)      %G%";
-#endif not lint
+static char sccsid[] = "@(#)destruct.c 5.4 (Berkeley) 6/18/88";
+#endif /* not lint */
 
 # include      "trek.h"
 
 
 # include      "trek.h"
 
@@ -28,11 +45,11 @@ destruct()
 {
        char            checkpass[15];
        register int    i, j;
 {
        char            checkpass[15];
        register int    i, j;
-       float           zap;
+       double          zap;
 
        if (damaged(COMPUTER))
                return (out(COMPUTER));
 
        if (damaged(COMPUTER))
                return (out(COMPUTER));
-       printf("\n\a --- WORKING ---\a\n");
+       printf("\n\07 --- WORKING ---\07\n");
        sleep(3);
        /* output the count 10 9 8 7 6 */
        for (i = 10; i > 5; i--)
        sleep(3);
        /* output the count 10 9 8 7 6 */
        for (i = 10; i > 5; i--)
@@ -63,13 +80,13 @@ destruct()
        Game.killed = 1;
        /* let's see what we can blow up!!!! */
        zap = 20.0 * Ship.energy;
        Game.killed = 1;
        /* let's see what we can blow up!!!! */
        zap = 20.0 * Ship.energy;
-       Game.deaths =+ Ship.crew;
+       Game.deaths += Ship.crew;
        for (i = 0; i < Etc.nkling; )
        {
                if (Etc.klingon[i].power * Etc.klingon[i].dist <= zap)
                        killk(Etc.klingon[i].x, Etc.klingon[i].y);
                else
        for (i = 0; i < Etc.nkling; )
        {
                if (Etc.klingon[i].power * Etc.klingon[i].dist <= zap)
                        killk(Etc.klingon[i].x, Etc.klingon[i].y);
                else
-                       i =+ 1;
+                       i++;
        }
        /* if we didn't kill the last Klingon (detected by killk), */
        /* then we lose.... */
        }
        /* if we didn't kill the last Klingon (detected by killk), */
        /* then we lose.... */