Commit | Line | Data |
---|---|---|
bb0cfa24 DF |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | */ | |
6 | ||
6ce8f7c1 | 7 | #ifndef lint |
bb0cfa24 | 8 | static char sccsid[] = "@(#)setwarp.c 5.1 (Berkeley) %G%"; |
6ce8f7c1 KM |
9 | #endif not lint |
10 | ||
11 | # include "trek.h" | |
12 | # include "getpar.h" | |
13 | ||
14 | /* | |
15 | ** SET WARP FACTOR | |
16 | ** | |
17 | ** The warp factor is set for future move commands. It is | |
18 | ** checked for consistancy. | |
19 | */ | |
20 | ||
21 | setwarp() | |
22 | { | |
06d69904 | 23 | double warpfac; |
6ce8f7c1 KM |
24 | |
25 | warpfac = getfltpar("Warp factor"); | |
26 | if (warpfac < 0.0) | |
27 | return; | |
28 | if (warpfac < 1.0) | |
29 | return (printf("Minimum warp speed is 1.0\n")); | |
30 | if (warpfac > 10.0) | |
31 | return (printf("Maximum speed is warp 10.0\n")); | |
32 | if (warpfac > 6.0) | |
33 | printf("Damage to warp engines may occur above warp 6.0\n"); | |
34 | Ship.warp = warpfac; | |
35 | Ship.warp2 = Ship.warp * warpfac; | |
36 | Ship.warp3 = Ship.warp2 * warpfac; | |
37 | } |