ScummVM
timer_mr.cpp
Go to the documentation of this file.
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
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.
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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "kyra/engine/kyra_mr.h"
24 #include "kyra/engine/timer.h"
25 
26 #include "common/system.h"
27 
28 namespace Kyra {
29 
30 #define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_MR>(this, &KyraEngine_MR::x)
31 
34  for (int i = 1; i <= 3; ++i)
37  for (int i = 5; i <= 11; ++i)
39  for (int i = 12; i <= 13; ++i)
41 }
42 
44  if (_shownMessage)
45  _restoreCommandLine = true;
46 }
47 
52  _sceneScriptState.regs[3] = 0;
55 
56  while (_emc->isValid(&_sceneScriptState))
58 }
59 
61  _timer->setCountdown(4, 5400);
62  saveGameStateIntern(999, "Autosave", 0);
63  _screen->hideMouse();
64  _timer->disable(4);
65  runAnimationScript("FLEADTH1.EMC", 0, 0, 1, 1);
66  runAnimationScript("FLEADTH2.EMC", 0, 0, 1, 0);
68  delay(60, true);
69  const char *str1 = (const char *)getTableEntry(_cCodeFile, 130);
70  const char *str2 = (const char *)getTableEntry(_cCodeFile, 131);
71  if (str1 && str2) {
72  badConscienceChat(str1, 204, 130);
73  badConscienceChat(str2, 204, 131);
74  }
75  delay(60, true);
77  runAnimationScript("FLEADTH3.EMC", 0, 0, 0, 1);
78  _deathHandler = 9;
79  _screen->showMouse();
80 }
81 
83  if (speed < 5)
84  speed = 3;
85  else
86  speed = 5;
87 
88  _mainCharacter.walkspeed = speed;
89 }
90 
92  if (secs == -1)
93  secs = 32000;
94  _timer->setCountdown(0, secs*60);
95 }
96 
99 }
100 
101 } // End of namespace Kyra
Character _mainCharacter
Definition: kyra_v2.h:330
uint32 _nextIdleAnim
Definition: kyra_mr.h:177
EMCState _sceneScriptState
Definition: kyra_v2.h:192
Screen_MR * _screen
Definition: kyra_mr.h:82
bool start(EMCState *script, int function)
Definition: script.cpp:155
void setWalkspeed(uint8)
Definition: timer_mr.cpp:82
void timerFleaDeath(int arg)
Definition: timer_mr.cpp:60
EMCData _sceneScriptData
Definition: kyra_v2.h:191
void disable(uint8 id)
Definition: timer.cpp:238
void setCountdown(uint8 id, int32 countdown)
Definition: timer.cpp:143
unsigned char uint8
Definition: cdtypes.h:28
void runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload)
bool isValid(EMCState *script)
Definition: script.cpp:175
EMCInterpreter * _emc
Definition: kyra_v1.h:269
void timerRestoreCommandLine(int arg)
Definition: timer_mr.cpp:43
TimerManager * _timer
Definition: kyra_v1.h:268
OSystem * _system
Definition: engine.h:59
virtual uint32 getMillis(bool skipRecord=false)=0
Get the number of milliseconds since the program was started.
void hideMouse()
Definition: screen.cpp:3029
const char * _shownMessage
Definition: kyra_mr.h:242
void badConscienceChat(const char *str, int vocHigh, int vocLow)
Definition: text_mr.cpp:366
uint getRandomNumberRng(uint min, uint max)
Generates a random unsigned integer in the interval [min, max].
Definition: random.cpp:58
void showMouse()
Definition: screen.cpp:3034
void setCommandLineRestoreTimer(int secs)
Definition: timer_mr.cpp:91
#define TimerV3(x)
Definition: timer_mr.cpp:30
void timerRunSceneScript7(int arg)
Definition: timer_mr.cpp:48
Common::Error saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumbnail)
Definition: saveload_mr.cpp:33
This is the namespace of the Kyra engine.
Definition: chargen.cpp:37
void delay(uint32 time, bool update=false, bool isMainLoop=false)
Definition: kyra_v2.cpp:149
void setNextIdleAnimTimer()
Definition: timer_mr.cpp:97
bool run(EMCState *script)
Definition: script.cpp:181
void addTimer(uint8 id, TimerFunc *func, int countdown, bool enabled)
Definition: timer.cpp:90
uint8 * getTableEntry(uint8 *buffer, int id)
Definition: kyra_mr.cpp:1246
bool _restoreCommandLine
Definition: kyra_mr.h:243
uint8 * _cCodeFile
Definition: kyra_mr.h:269
Common::RandomSource _rnd
Definition: kyra_v1.h:205
void init(EMCState *scriptState, const EMCData *data)
Definition: script.cpp:147
int16 regs[30]
Definition: script.h:58