3 * Daniel Nelson - 8/24/0
5 * Copyright (C) 2000 Daniel Nelson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
33 #define LB_INACTIVE (1 << 0)
34 #define LB_LOW_ALERT (1 << 1)
35 #define LB_HIGH_ALERT (1 << 2)
36 #define LB_FADE_LOW_TO_INACTIVE (1 << 3)
37 #define LB_FADE_HIGH_TO_INACTIVE (1 << 4)
38 #define LB_FADE_RESET_HIGH (1 << 5)
40 /* static */ class LoseBar
{
42 static void initialize ( );
43 static void gameStart ( );
45 static void timeStep ( );
47 static inline void highAlertReset ( )
49 * Called by Creep when the high alert timer is reset.
52 assert(state
== LB_HIGH_ALERT
);
54 fade_timer
= DC_LOSEBAR_FADE_TIME
;
55 state
= LB_FADE_RESET_HIGH
;
60 static int fade_timer
;
63 static inline void enterLowToInactiveFade ( )
65 fade_timer
= DC_LOSEBAR_FADE_TIME
;
66 state
= LB_FADE_LOW_TO_INACTIVE
;
69 static inline void enterHighToInactiveFade ( )
71 fade_timer
= DC_LOSEBAR_FADE_TIME
;
72 state
= LB_FADE_HIGH_TO_INACTIVE
;