summaryrefslogtreecommitdiff
path: root/games/trek/nova.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
commited884b9fa4509c09f0f7ab71efe57a4e83a2e055 (patch)
treeef9d859a0754785b42ea5cacb27aff54b5000315 /games/trek/nova.c
parentf4fc9566a4d35c0cc2bf8c7f1136287d8eec8c44 (diff)
tags, formatting, ANSI-fication, prototypes, de-typos, and the occasional
initialization, removal of unused variable, or other minor fix. Most changes are from or inspired by NetBSD.
Diffstat (limited to 'games/trek/nova.c')
-rw-r--r--games/trek/nova.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/games/trek/nova.c b/games/trek/nova.c
index 7c02a70eb4b..1def930561e 100644
--- a/games/trek/nova.c
+++ b/games/trek/nova.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: nova.c,v 1.2 1998/08/19 07:41:51 pjanzen Exp $ */
/* $NetBSD: nova.c,v 1.3 1995/04/22 10:59:14 cgd Exp $ */
/*
@@ -37,11 +38,12 @@
#if 0
static char sccsid[] = "@(#)nova.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: nova.c,v 1.3 1995/04/22 10:59:14 cgd Exp $";
+static char rcsid[] = "$OpenBSD: nova.c,v 1.2 1998/08/19 07:41:51 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "trek.h"
+#include <stdio.h>
+#include "trek.h"
/*
** CAUSE A NOVA TO OCCUR
@@ -57,8 +59,9 @@ static char rcsid[] = "$NetBSD: nova.c,v 1.3 1995/04/22 10:59:14 cgd Exp $";
** If the zap is too much, it gets destroyed.
*/
+void
nova(x, y)
-int x, y;
+ int x, y;
{
register int i, j;
register int se;
@@ -71,7 +74,10 @@ int x, y;
return;
}
if (ranf(100) < 5)
- return (snova(x, y));
+ {
+ snova(x, y);
+ return;
+ }
printf("Spock: Star at %d,%d gone nova\n", x, y);
if (ranf(4) != 0)
@@ -120,6 +126,7 @@ int x, y;
case QUEENE:
se = 2000;
if (Ship.shldup)
+ {
if (Ship.shield >= se)
{
Ship.shield -= se;
@@ -130,6 +137,7 @@ int x, y;
se -= Ship.shield;
Ship.shield = 0;
}
+ }
Ship.energy -= se;
if (Ship.energy <= 0)
lose(L_SUICID);
@@ -143,5 +151,4 @@ int x, y;
}
}
}
- return;
}