1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 */ 17 18 #ifndef lint 19 static char sccsid[] = "@(#)dumpssradio.c 5.3 (Berkeley) 06/18/88"; 20 #endif /* not lint */ 21 22 # include "trek.h" 23 24 /** 25 ** output hidden distress calls 26 **/ 27 28 dumpssradio() 29 { 30 register struct event *e; 31 register int j; 32 register int chkrest; 33 34 chkrest = 0; 35 for (j = 0; j < MAXEVENTS; j++) 36 { 37 e = &Event[j]; 38 /* if it is not hidden, then just ignore it */ 39 if ((e->evcode & E_HIDDEN) == 0) 40 continue; 41 if (e->evcode & E_GHOST) 42 { 43 unschedule(e); 44 printf("Starsystem %s in quadrant %d,%d is no longer distressed\n", 45 systemname(e), e->x, e->y); 46 continue; 47 } 48 49 switch (e->evcode) 50 { 51 52 case E_KDESB: 53 printf("Starbase in quadrant %d,%d is under attack\n", 54 e->x, e->y); 55 chkrest++; 56 break; 57 58 case E_ENSLV: 59 case E_REPRO: 60 printf("Starsystem %s in quadrant %d,%d is distressed\n", 61 systemname(e), e->x, e->y); 62 chkrest++; 63 break; 64 65 } 66 } 67 68 return (chkrest); 69 } 70