ScummVM API documentation
timer.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
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.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
24  * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
25  */
26 
27 /* Original name: TIMEOUT The scheduling unit. */
28 
29 #ifndef AVALANCHE_TIMER_H
30 #define AVALANCHE_TIMER_H
31 
32 namespace Avalanche {
33 class AvalancheEngine;
34 
35 class Timer {
36 public:
37  // Reason runs between 1 and 28.
38  enum Reason {
39  kReasonDrawbridgeFalls = 2,
40  kReasonAvariciusTalks = 3,
41  kReasonGoToToilet = 4,
42  kReasonExplosion = 5,
43  kReasonBrummieStairs = 6,
44  kReasonCardiffsurvey = 7,
45  kReasonCwytalotInHerts = 8,
46  kReasonGettingTiedUp = 9,
47  kReasonHangingAround = 10, // Tied to the tree in Nottingham.
48  kReasonJacquesWakingUp = 11,
49  kReasonNaughtyDuke = 12,
50  kReasonJumping = 13,
51  kReasonSequencer = 14,
52  kReasonCrapulusSaysSpludwickOut = 15,
53  kReasonDawndelay = 16,
54  kReasonDrinks = 17,
55  kReasonDuLustieTalks = 18,
56  kReasonFallingDownOubliette = 19,
57  kReasonMeetingAvaroid = 20,
58  kReasonRisingUpOubliette = 21,
59  kReasonRobinHoodAndGeida = 22,
60  kReasonSittingDown = 23,
61  kReasonGhostRoomPhew = 1,
62  kReasonArkataShouts = 24,
63  kReasonWinning = 25,
64  kReasonFallingOver = 26,
65  kReasonSpludwickWalk = 27,
66  kReasonGeidaSings = 28
67  };
68 
69  // Proc runs between 1 and 41.
70  enum Proc {
71  kProcOpenDrawbridge = 3,
72  kProcAvariciusTalks = 4,
73  kProcUrinate = 5,
74  kProcToilet = 6,
75  kProcBang = 7,
76  kProcBang2 = 8,
77  kProcStairs = 9,
78  kProcCardiffSurvey = 10,
79  kProcCardiffReturn = 11,
80  kProcCwytalotInHerts = 12,
81  kProcGetTiedUp = 13,
82  kProcGetTiedUp2 = 1,
83  kProcHangAround = 14,
84  kProcHangAround2 = 15,
85  kProcAfterTheShootemup = 32,
86  kProcJacquesWakesUp = 16,
87  kProcNaughtyDuke = 17,
88  kProcNaughtyDuke2 = 18,
89  kProcNaughtyDuke3 = 38,
90  kProcJump = 19,
91  kProcSequence = 20,
92  kProcCrapulusSpludOut = 21,
93  kProcDawnDelay = 22,
94  kProcBuyDrinks = 23,
95  kProcBuyWine = 24,
96  kProcCallsGuards = 25,
97  kProcGreetsMonk = 26,
98  kProcFallDownOubliette = 27,
99  kProcMeetAvaroid = 28,
100  kProcRiseUpOubliette = 29,
101  kProcRobinHoodAndGeida = 2,
102  kProcRobinHoodAndGeidaTalk = 30,
103  kProcAvalotReturns = 31,
104  kProcAvvySitDown = 33, // In Nottingham.
105  kProcGhostRoomPhew = 34,
106  kProcArkataShouts = 35,
107  kProcWinning = 36,
108  kProcAvalotFalls = 37,
109  kProcSpludwickGoesToCauldron = 39,
110  kProcSpludwickLeavesCauldron = 40,
111  kProcGiveLuteToGeida = 41
112  };
113 
114  struct TimerType {
115  int32 _timeLeft;
116  byte _action;
117  byte _reason;
118  };
119 
120  TimerType _times[7];
121 
122  Timer(AvalancheEngine *vm);
123 
124  void resetVariables();
125  void addTimer(int32 duration, byte action, byte reason);
126  void updateTimer();
127  void loseTimer(byte which);
128 
129  // Procedures to do things at the end of amounts of time:
130  void openDrawbridge();
131  void avariciusTalks();
132  void urinate();
133  void toilet();
134  void bang();
135  void bang2();
136  void stairs();
137  void cardiffSurvey();
138  void cardiffReturn();
139  void cwytalotInHerts();
140  void getTiedUp();
141  void getTiedUp2();
142  void hangAround();
143  void hangAround2();
144  void afterTheShootemup();
145  void jacquesWakesUp();
146  void naughtyDuke();
147  void naughtyDuke2();
148  void naughtyDuke3();
149  void jump();
150  void crapulusSaysSpludOut();
151  void buyDrinks();
152  void buyWine();
153  void callsGuards();
154  void greetsMonk();
155  void fallDownOubliette();
156  void meetAvaroid();
157  void riseUpOubliette();
158  void robinHoodAndGeida();
159  void robinHoodAndGeidaTalk();
160  void avalotReturns();
161  void avvySitDown();
162  void ghostRoomPhew();
163  void arkataShouts();
164  void winning();
165  void avalotFalls();
166  void spludwickGoesToCauldron();
167  void spludwickLeavesCauldron();
168  void giveLuteToGeida();
169 
170 private:
171  AvalancheEngine *_vm;
172  byte _shootEmUpScore;
173 };
174 
175 } // End of namespace Avalanche.
176 
177 #endif // AVALANCHE_TIMER_H
Definition: animation.h:32
Definition: avalanche.h:74
Definition: timer.h:114
Definition: timer.h:35