diff options
author | uruk | 2014-06-18 23:34:26 +0200 |
---|---|---|
committer | uruk | 2014-06-18 23:34:26 +0200 |
commit | 7a549f2693222743dd76697534664fdc498a456c (patch) | |
tree | b9b4b6220c8ba46c970d3ec601065a4826e73d15 /engines | |
parent | ea5697d5a0ff66c7e93db4e53c881980df0a5971 (diff) | |
download | scummvm-rg350-7a549f2693222743dd76697534664fdc498a456c.tar.gz scummvm-rg350-7a549f2693222743dd76697534664fdc498a456c.tar.bz2 scummvm-rg350-7a549f2693222743dd76697534664fdc498a456c.zip |
CGE2: Implement offUse().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2.h | 2 | ||||
-rw-r--r-- | engines/cge2/cge2_main.cpp | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index bc4a16c33f..e743d7b819 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -80,6 +80,8 @@ class Map; #define kExitOkText 40 #define kCrackedText 44 +#define kOffUseCount 130 +#define kOffUseText 131 enum CallbackType { kNullCB = 0, kQGame, kXScene, kSoundSetVolume diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index b17f48dacd..c27b16073c 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -1018,7 +1018,24 @@ void CGE2Engine::optionTouch(int opt, uint16 mask) { } void CGE2Engine::offUse() { - warning("STUB: CGE2Engine::offUse()"); + int seq = 0; + int offUseCount = atoi(_text->getText(kOffUseCount)); + + // This fixes the issue of empty speech bubbles in the original. + // Now we only let this cycle pass if it randoms a valid value for getText(). + int txt = 0; + do { + txt = kOffUseText + _sex * offUseCount + newRandom(offUseCount); + } while (_text->getText(txt) == nullptr); + + Hero *h = _heroTab[_sex]->_ptr; + h->park(); + _commandHandler->addCommand(kCmdWait, -1, -1, h); + _commandHandler->addCommand(kCmdSeq, -1, seq, h); + if (!_sayVox) + _commandHandler->addCommand(kCmdSound, -1, 6 + _sex, h); + _commandHandler->addCommand(kCmdWait, -1, -1, h); + _commandHandler->addCommand(kCmdSay, -1, txt, h); } Sprite *CGE2Engine::spriteAt(V2D pos) { |