| 1 | /* |
| 2 | * PROPRIETARY INFORMATION. This software is proprietary to POWDER |
| 3 | * Development, and is not to be reproduced, transmitted, or disclosed |
| 4 | * in any way without written permission. |
| 5 | * |
| 6 | * Produced by: Jeff Lait |
| 7 | * |
| 8 | * POWDER Development |
| 9 | * |
| 10 | * NAME: speed.h ( POWDER Library, C++ ) |
| 11 | * |
| 12 | * COMMENTS: |
| 13 | * This controls the speed system of POWDER. |
| 14 | * The speed system is intentionaly simplistic. More complicated |
| 15 | * systems are attempts to kludge a continuous process on an essentially |
| 16 | * turn oriented game. |
| 17 | * Hopefully this decision does not become too regretable. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __speed_h__ |
| 21 | #define __speed_h__ |
| 22 | |
| 23 | class SRAMSTREAM; |
| 24 | |
| 25 | // |
| 26 | // These are the possible phases we can be in each turn. |
| 27 | // MOBs get actions every phase, but may want to skip their move |
| 28 | // or their heartbeat depending on the phase. |
| 29 | enum PHASE_NAMES |
| 30 | { |
| 31 | PHASE_NORMAL, // heartbeats, everyone gets action. |
| 32 | PHASE_SLOW, // heartbeats. Slowed people get no action. |
| 33 | PHASE_FAST, // no heart, fast get action |
| 34 | PHASE_QUICK, // no heart, quick get action. |
| 35 | NUM_PHASES |
| 36 | }; |
| 37 | |
| 38 | // One time speed initialization. |
| 39 | void speed_init(); |
| 40 | |
| 41 | // Returns the current phase. |
| 42 | PHASE_NAMES speed_getphase(); |
| 43 | |
| 44 | // Returns true if we are in a heartbeat phase. |
| 45 | bool speed_isheartbeatphase(); |
| 46 | |
| 47 | // Returns true if we are on this modulus of the heartbeat |
| 48 | bool speed_matchheartbeat(int modulus); |
| 49 | |
| 50 | // Increments the global time |
| 51 | void speed_ticktime(); |
| 52 | |
| 53 | // Resets the time to 0 for a new game. |
| 54 | void speed_reset(); |
| 55 | |
| 56 | // Get the current time value. |
| 57 | int speed_gettime(); |
| 58 | |
| 59 | // Save the speed related information. |
| 60 | void speed_save(SRAMSTREAM &os); |
| 61 | |
| 62 | // And load |
| 63 | void speed_load(SRAMSTREAM &is); |
| 64 | |
| 65 | #endif |