* Copyright (c) 1980 Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)srscan.c 5.4 (Berkeley) %G%";
** SHORT RANGE SENSOR SCAN
** A short range scan is taken of the current quadrant. If the
** flag 'f' is one, it is an "auto srscan", which is not done
** unless in 'fast' mode. It does a status report and a srscan.
** If 'f' is -1, you get a status report only. If it is zero,
** you get a srscan and an optional status report. The status
** report is taken if you enter "srscan yes"; for all srscans
** thereafter you get a status report with your srscan until
** you type "srscan no". It defaults to on.
** The current quadrant is filled in on the computer chart.
extern struct cvntab Skitab
[];
extern struct cvntab Lentab
[];
if (f
>= 0 && check_out(SRSCAN
))
Etc
.statreport
= getynpar("status report");
statinfo
= Etc
.statreport
;
printf("\nShort range sensor scan\n");
q
= &Quad
[Ship
.quadx
][Ship
.quady
];
q
->scanned
= q
->klings
* 100 + q
->bases
* 10 + q
->stars
;
for (i
= 0; i
< NSECTS
; i
++)
for (i
= 0; i
< NSECTS
; i
++)
for (j
= 0; j
< NSECTS
; j
++)
printf("%c ", Sect
[i
][j
]);
printf("stardate %.2f", Now
.date
);
printf("condition %s", Color
[Ship
.cond
]);
printf("position %d,%d/%d,%d",Ship
.quadx
, Ship
.quady
, Ship
.sectx
, Ship
.secty
);
printf("warp factor %.1f", Ship
.warp
);
printf("total energy %d", Ship
.energy
);
printf("torpedoes %d", Ship
.torped
);
percent
= 100.0 * Ship
.shield
/ Param
.shield
;
printf("shields %s, %d%%", s
, percent
);
printf("Klingons left %d", Now
.klings
);
printf("time left %.2f", Now
.time
);
printf("damaged, reserves = %.2f", Ship
.reserves
);
printf("current crew %d\n", Ship
.crew
);
printf("brig space %d\n", Ship
.brigfree
);
printf("Klingon power %d\n", Param
.klingpwr
);
p
= &Lentab
[Game
.length
- 1];
printf("Length, Skill %s%s, ", p
->abrev
, p
->full
);
p
= &Skitab
[Game
.skill
- 1];
printf("%s%s\n", p
->abrev
, p
->full
);
for (i
= 0; i
< NSECTS
; i
++)
if (q
->qsystemname
& Q_DISTRESSED
)
printf("Starsystem %s\n", systemname(q
));