Commit | Line | Data |
---|---|---|
bb0cfa24 | 1 | /* |
4c3ad851 KB |
2 | * Copyright (c) 1980, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
e9fb6bea | 4 | * |
b2e7427f | 5 | * %sccs.include.redist.c% |
bb0cfa24 DF |
6 | */ |
7 | ||
e18cde4b | 8 | #ifndef lint |
4c3ad851 | 9 | static char sccsid[] = "@(#)rest.c 8.1 (Berkeley) %G%"; |
e9fb6bea | 10 | #endif /* not lint */ |
e18cde4b KM |
11 | |
12 | # include "trek.h" | |
13 | # include "getpar.h" | |
14 | ||
15 | /* | |
16 | ** REST FOR REPAIRS | |
17 | ** | |
18 | ** You sit around and wait for repairs to happen. Actually, you | |
19 | ** sit around and wait for anything to happen. I do want to point | |
20 | ** out however, that Klingons are not as patient as you are, and | |
21 | ** they tend to attack you while you are resting. | |
22 | ** | |
23 | ** You can never rest through a long range tractor beam. | |
24 | ** | |
25 | ** In events() you will be given an opportunity to cancel the | |
26 | ** rest period if anything momentous happens. | |
27 | */ | |
28 | ||
29 | rest() | |
30 | { | |
06d69904 | 31 | double t; |
e18cde4b KM |
32 | register int percent; |
33 | ||
34 | /* get the time to rest */ | |
35 | t = getfltpar("How long"); | |
36 | if (t <= 0.0) | |
37 | return; | |
38 | percent = 100 * t / Now.time + 0.5; | |
39 | if (percent >= 70) | |
40 | { | |
41 | printf("Spock: That would take %d%% of our remaining time.\n", | |
42 | percent); | |
43 | if (!getynpar("Are you really certain that is wise")) | |
44 | return; | |
45 | } | |
46 | Move.time = t; | |
47 | ||
48 | /* boundary condition is the LRTB */ | |
49 | t = Now.eventptr[E_LRTB]->date - Now.date; | |
50 | if (Ship.cond != DOCKED && Move.time > t) | |
51 | Move.time = t + 0.0001; | |
52 | Move.free = 0; | |
53 | Move.resting = 1; | |
54 | } |