xref: /original-bsd/games/trek/setwarp.c (revision 7a8f01dc)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)setwarp.c	5.4 (Berkeley) 06/01/90";
10 #endif /* not lint */
11 
12 # include	"trek.h"
13 # include	"getpar.h"
14 
15 /*
16 **  SET WARP FACTOR
17 **
18 **	The warp factor is set for future move commands.  It is
19 **	checked for consistancy.
20 */
21 
22 setwarp()
23 {
24 	double	warpfac;
25 
26 	warpfac = getfltpar("Warp factor");
27 	if (warpfac < 0.0)
28 		return;
29 	if (warpfac < 1.0)
30 		return (printf("Minimum warp speed is 1.0\n"));
31 	if (warpfac > 10.0)
32 		return (printf("Maximum speed is warp 10.0\n"));
33 	if (warpfac > 6.0)
34 		printf("Damage to warp engines may occur above warp 6.0\n");
35 	Ship.warp = warpfac;
36 	Ship.warp2 = Ship.warp * warpfac;
37 	Ship.warp3 = Ship.warp2 * warpfac;
38 }
39