xref: /csrg-svn/games/trek/dumpssradio.c (revision 60857)
121277Sdist /*
2*60857Sbostic  * Copyright (c) 1980, 1993
3*60857Sbostic  *	The Regents of the University of California.  All rights reserved.
434205Sbostic  *
542605Sbostic  * %sccs.include.redist.c%
621277Sdist  */
721277Sdist 
811671Smckusick #ifndef lint
9*60857Sbostic static char sccsid[] = "@(#)dumpssradio.c	8.1 (Berkeley) 05/31/93";
1034205Sbostic #endif /* not lint */
1111671Smckusick 
1211671Smckusick # include	"trek.h"
1311671Smckusick 
1411671Smckusick /**
1511671Smckusick  **	output hidden distress calls
1611671Smckusick  **/
1711671Smckusick 
dumpssradio()1811671Smckusick dumpssradio()
1911671Smckusick {
2011671Smckusick 	register struct event	*e;
2111671Smckusick 	register int		j;
2211671Smckusick 	register int		chkrest;
2311671Smckusick 
2411671Smckusick 	chkrest = 0;
2511671Smckusick 	for (j = 0; j < MAXEVENTS; j++)
2611671Smckusick 	{
2711671Smckusick 		e = &Event[j];
2811671Smckusick 		/* if it is not hidden, then just ignore it */
2911671Smckusick 		if ((e->evcode & E_HIDDEN) == 0)
3011671Smckusick 			continue;
3111671Smckusick 		if (e->evcode & E_GHOST)
3211671Smckusick 		{
3311671Smckusick 			unschedule(e);
3411671Smckusick 			printf("Starsystem %s in quadrant %d,%d is no longer distressed\n",
3511671Smckusick 				systemname(e), e->x, e->y);
3611671Smckusick 			continue;
3711671Smckusick 		}
3811671Smckusick 
3911671Smckusick 		switch (e->evcode)
4011671Smckusick 		{
4111671Smckusick 
4211671Smckusick 		  case E_KDESB:
4311671Smckusick 			printf("Starbase in quadrant %d,%d is under attack\n",
4411671Smckusick 				e->x, e->y);
4511671Smckusick 			chkrest++;
4611671Smckusick 			break;
4711671Smckusick 
4811671Smckusick 		  case E_ENSLV:
4911671Smckusick 		  case E_REPRO:
5011671Smckusick 			printf("Starsystem %s in quadrant %d,%d is distressed\n",
5111671Smckusick 				systemname(e), e->x, e->y);
5211671Smckusick 			chkrest++;
5311671Smckusick 			break;
5411671Smckusick 
5511671Smckusick 		}
5611671Smckusick 	}
5711671Smckusick 
5811671Smckusick 	return (chkrest);
5911671Smckusick }
60