|
|
1.1 root 1: # include "trek.h"
2:
3: /**
4: ** short range sensor scan
5: **/
6:
7: srscan()
8: {
9: scansys(0);
10: }
11:
12: status()
13: {
14: scansys(-1);
15: }
16:
17: scansys(f)
18: int f;
19: {
20: register int i, j;
21: register int statinfo;
22: QUAD *q;
23: static int savestat;
24:
25: if (Damage[SRSCAN] && f >= 0) {
26: if (!f)
27: printf("S.R. scanners out");
28: if(Status.cond==DOCKED) {
29: printf("; using Starbase scanners.\n");
30: } else {
31: printf("\n");
32: return;
33: }
34: }
35: if (f)
36: statinfo = 1;
37: else
38: {
39: if (lineended()==0)
40: savestat = getynpar("Status report");
41: statinfo = savestat;
42: }
43: if (f > 0)
44: savestat = 1;
45: if (f >= 0)
46: {
47: q = &Quad[Quadx][Quady];
48: q->scanned = q->qkling * 100 + q->bases * 10 + q->stars;
49: printf(" ");
50: for (i = 0; i < NSECTS; i++)
51: {
52: printf("%d ", i);
53: }
54: printf("\tS.R. sensor scan for quadrant %d,%d\n", Quadx, Quady);
55: }
56:
57: for (i=0; i<NSECTS && mkfault==0; i++)
58: {
59: if (f >= 0)
60: {
61: printf("%d ", i);
62: for (j = 0; j < NSECTS; j++)
63: printf("%c ", Sect[i][j]);
64: printf("%d", i);
65: if (statinfo)
66: printf(" ");
67: }
68: if (statinfo)
69: getinfo(i);
70: else printf("\n");
71: }
72: if (f < 0)
73: {
74: printf("current crew %d\n", Status.crew);
75: printf("brig space %d\n", Status.brigfree);
76: return;
77: }
78: printf(" ");
79: for (i = 0; i < NSECTS; i++)
80: printf("%d ", i);
81: if (q->systemname&Q_DISTRESS)
82: printf("\tDistressed starsystem %s",
83: Systemname[Event[q->systemname&Q_STARNAME].evdata]);
84: else
85: if (q->systemname&Q_GHOST)
86: printf("\tGhost starsystem %s",
87: Systemname[q->systemname&Q_STARNAME]);
88: else if(q->systemname)
89: printf("\tStarsystem %s", Systemname[q->systemname]);
90: printf("\n");
91: }
92:
93: effshld()
94: {
95: return(100.0 * Status.shield / Initial.shield);
96: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.