X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/f12b51f99bbe8bb6ad7eca12b047ba9b46836ee6..52ae241ee1f8584a23f94b47c59eb897b8c761a2:/trek/nova.c diff --git a/trek/nova.c b/trek/nova.c index 7c5a8767..eb24a284 100644 --- a/trek/nova.c +++ b/trek/nova.c @@ -1,4 +1,4 @@ -/* $NetBSD: nova.c,v 1.6 2003/08/07 09:37:53 agc Exp $ */ +/* $NetBSD: nova.c,v 1.8 2009/05/24 21:44:56 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)nova.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: nova.c,v 1.6 2003/08/07 09:37:53 agc Exp $"); +__RCSID("$NetBSD: nova.c,v 1.8 2009/05/24 21:44:56 dholland Exp $"); #endif #endif /* not lint */ @@ -56,16 +56,14 @@ __RCSID("$NetBSD: nova.c,v 1.6 2003/08/07 09:37:53 agc Exp $"); */ void -nova(x, y) -int x, y; +nova(int x, int y) { int i, j; int se; if (Sect[x][y] != STAR || Quad[Ship.quadx][Ship.quady].stars < 0) return; - if (ranf(100) < 15) - { + if (ranf(100) < 15) { printf("Spock: Star at %d,%d failed to nova.\n", x, y); return; } @@ -75,26 +73,22 @@ int x, y; } printf("Spock: Star at %d,%d gone nova\n", x, y); - if (ranf(4) != 0) + if (ranf(4) != 0) { Sect[x][y] = EMPTY; - else - { + } else { Sect[x][y] = HOLE; Quad[Ship.quadx][Ship.quady].holes += 1; } Quad[Ship.quadx][Ship.quady].stars -= 1; Game.kills += 1; - for (i = x - 1; i <= x + 1; i++) - { + for (i = x - 1; i <= x + 1; i++) { if (i < 0 || i >= NSECTS) continue; - for (j = y - 1; j <= y + 1; j++) - { + for (j = y - 1; j <= y + 1; j++) { if (j < 0 || j >= NSECTS) continue; se = Sect[i][j]; - switch (se) - { + switch (se) { case EMPTY: case HOLE: