+/* $NetBSD: kill.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: @(#)kill.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: kill.c,v 1.2 1993/08/01 18:50:24 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)kill.c 8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: kill.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"
/*
** KILL KILL KILL !!!
** and the game is won if that was the last klingon.
*/
+void
killk(ix, iy)
int ix, iy;
{
- register int i, j;
+ int i;
printf(" *** Klingon at %d,%d destroyed ***\n", ix, iy);
/* purge him from the list */
Etc.nkling -= 1;
for (; i < Etc.nkling; i++)
- bmove(&Etc.klingon[i+1], &Etc.klingon[i], sizeof Etc.klingon[i]);
+ Etc.klingon[i] = Etc.klingon[i+1];
break;
}
** handle a starbase's death
*/
+void
killb(qx, qy)
int qx, qy;
{
- register struct quad *q;
- register struct xy *b;
+ struct quad *q;
+ struct xy *b;
q = &Quad[qx][qy];
if (q->bases <= 0)
return;
- if (!damaged(SSRADIO))
+ if (!damaged(SSRADIO)) {
/* then update starchart */
if (q->scanned < 1000)
q->scanned -= 10;
else
if (q->scanned > 1000)
q->scanned = -1;
+ }
q->bases = 0;
Now.bases -= 1;
for (b = Now.base; ; b++)
if (qx == b->x && qy == b->y)
break;
- bmove(&Now.base[Now.bases], b, sizeof *b);
+ *b = Now.base[Now.bases];
if (qx == Ship.quadx && qy == Ship.quady)
{
Sect[Etc.starbase.x][Etc.starbase.y] = EMPTY;
if (Ship.cond == DOCKED)
- undock();
+ undock(0);
printf("Starbase at %d,%d destroyed\n", Etc.starbase.x, Etc.starbase.y);
}
else
** kill an inhabited starsystem
**/
+void
kills(x, y, f)
int x, y; /* quad coords if f == 0, else sector coords */
int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */
{
- register struct quad *q;
- register struct event *e;
- register char *name;
- char *systemname();
+ struct quad *q;
+ struct event *e;
+ char *name;
if (f)
{
** "kill" a distress call
**/
+void
killd(x, y, f)
int x, y; /* quadrant coordinates */
int f; /* set if user is to be informed */
{
- register struct event *e;
- register int i;
- register struct quad *q;
+ struct event *e;
+ int i;
+ struct quad *q;
q = &Quad[x][y];
for (i = 0; i < MAXEVENTS; i++)