]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/nova.c
sweep of errx/warnx, remove unnecessary trailing \n
[bsdgames-darwin.git] / trek / nova.c
index cd6a73c746a478e5ebbf278f11250a06737bfd5c..82164a6a94789866209242e9fbdf6e6d241ce2ee 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: nova.c,v 1.5 1998/08/30 09:19:40 veego Exp $   */
+
 /*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-/*static char sccsid[] = "from: @(#)nova.c     5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: nova.c,v 1.2 1993/08/01 18:50:15 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)nova.c     8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: nova.c,v 1.5 1998/08/30 09:19:40 veego Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
+#include <stdio.h>
+#include "trek.h"
 
 /*
 **  CAUSE A NOVA TO OCCUR
@@ -52,11 +59,12 @@ static char rcsid[] = "$Id: nova.c,v 1.2 1993/08/01 18:50:15 mycroft Exp $";
 **     If the zap is too much, it gets destroyed.
 */
 
+void
 nova(x, y)
 int    x, y;
 {
-       register int            i, j;
-       register int            se;
+       int     i, j;
+       int     se;
 
        if (Sect[x][y] != STAR || Quad[Ship.quadx][Ship.quady].stars < 0)
                return;
@@ -65,8 +73,10 @@ int  x, y;
                printf("Spock: Star at %d,%d failed to nova.\n", x, y);
                return;
        }
-       if (ranf(100) < 5)
-               return (snova(x, y));
+       if (ranf(100) < 5) {
+               snova(x, y);
+               return;
+       }
        printf("Spock: Star at %d,%d gone nova\n", x, y);
 
        if (ranf(4) != 0)
@@ -114,17 +124,15 @@ int       x, y;
                          case ENTERPRISE:
                          case QUEENE:
                                se = 2000;
-                               if (Ship.shldup)
-                                       if (Ship.shield >= se)
-                                       {
+                               if (Ship.shldup) {
+                                       if (Ship.shield >= se) {
                                                Ship.shield -= se;
                                                se = 0;
-                                       }
-                                       else
-                                       {
+                                       } else {
                                                se -= Ship.shield;
                                                Ship.shield = 0;
                                        }
+                               }
                                Ship.energy -= se;
                                if (Ship.energy <= 0)
                                        lose(L_SUICID);