diff options
author | uruk | 2013-08-12 13:28:28 +0200 |
---|---|---|
committer | uruk | 2013-08-12 13:28:28 +0200 |
commit | caed4470f12db61f0bc11c813186a9066527a94d (patch) | |
tree | de5c3e941dae806c13b131eac219054fed2e1d39 /engines | |
parent | d8798e978a695a1b6ebd853bd05790d11c5fe4f9 (diff) | |
download | scummvm-rg350-caed4470f12db61f0bc11c813186a9066527a94d.tar.gz scummvm-rg350-caed4470f12db61f0bc11c813186a9066527a94d.tar.bz2 scummvm-rg350-caed4470f12db61f0bc11c813186a9066527a94d.zip |
AVALANCHE: Implement Acci::personshere(), Visa::talkto(), make control-constants in Scrolls public.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/acci2.cpp | 45 | ||||
-rw-r--r-- | engines/avalanche/scrolls2.h | 48 | ||||
-rw-r--r-- | engines/avalanche/visa2.cpp | 127 |
3 files changed, 179 insertions, 41 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 3b9448aad5..437752ba6b 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -606,9 +606,17 @@ void Acci::examobj() { /* Examine a standard object-thing */ warning("STUB: Acci::examobj()"); } -bool Acci::personshere() { /* Person equivalent of "holding" */ - warning("STUB: Acci::personshere()"); - return true; +bool Acci::personshere() { // Person equivalent of "holding". + if ((person == pardon) || (person == 0) || (_vm->_gyro->whereis[person] == _vm->_gyro->dna.room)) + return true; + else { + if (person < 175) + _vm->_scrolls->display(Common::String('H') + _vm->_scrolls->kControlToBuffer); + else + _vm->_scrolls->display(Common::String("Sh") + _vm->_scrolls->kControlToBuffer); + _vm->_scrolls->display("e isn't around at the moment."); + return false; + } } void Acci::exampers() { @@ -1178,30 +1186,31 @@ void Acci::do_that() { break; case vb_talk: if (person == pardon) { - if (_vm->_gyro->subjnumber == 99) /* They typed "say passuint16". */ - _vm->_scrolls->display("Yes, but what \6is\22 the passuint16?"); - /* - else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) { - Delete(thats, 1, 1); - move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1])); - verb = chr(subjnumber); + if (_vm->_gyro->subjnumber == 99) /* They typed "say password". */ + _vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?"); + else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 449)) { + thats.deleteChar(0); + + for (byte i = 0; i < 10; i++) + realwords[i] = realwords[i + 1]; + //move(realwords[2], realwords[1], sizeof(realwords) - sizeof(realwords[1])); + + verb = _vm->_gyro->subjnumber; do_that(); return; } else { person = _vm->_gyro->subjnumber; - subjnumber = 0; - if (set::of(pardon, '\0', eos).has(person)) + _vm->_gyro->subjnumber = 0; + if ((person == 0) || (person == pardon)) _vm->_scrolls->display("Talk to whom?"); else if (personshere()) - talkto(ord(person)); + _vm->_visa->talkto(person); } - */ - else if (person == pardon) - _vm->_scrolls->display("Talk to whom?"); - } else if (personshere()) + } else if (person == pardon) + _vm->_scrolls->display("Talk to whom?"); + else if (personshere()) _vm->_visa->talkto(person); break; - case vb_give: if (holding()) { if (person == pardon) diff --git a/engines/avalanche/scrolls2.h b/engines/avalanche/scrolls2.h index 8af3402d96..b90f280ae7 100644 --- a/engines/avalanche/scrolls2.h +++ b/engines/avalanche/scrolls2.h @@ -41,6 +41,27 @@ typedef void (Scrolls::*func2)(); class Scrolls { public: + // Constants to replace the command characters from Pascal. + // For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers + + static const char kControlSpeechBubble = 2; // ^B + static const char kControlCenter = 3; // ^C + static const char kControlToBuffer = 4; // ^D + static const char kControlItalic = 6; // ^F + static const char kControlBell = 7; // ^G + static const char kControlBackspace = 8; // ^H + static const char kControlInsertSpaces = 9; // ^I + static const char kControlLeftJustified = 12; // ^L + static const char kControlNewLine = 13; // ^M + static const char kControlParagraph = 16; // ^P + static const char kControlQuestion = 17; // ^Q + static const char kControlRoman = 18; // ^R + static const char kControlRegister = 19; // ^S + static const char kControlNegative = 21; // ^U + static const char kControlIcon = 22; // ^V + + + bool aboutscroll; /* Is this the about box? */ @@ -71,6 +92,8 @@ public: void musical_scroll(); + fontType ch[2]; + private: AvalancheEngine *_vm; @@ -81,29 +104,8 @@ private: - // Constants to replace the command characters from Pascal. - // For more information, see: https://github.com/urukgit/avalot/wiki/Scrolldrivers - - static const char kControlSpeechBubble = 2; // ^B - static const char kControlCenter = 3; // ^C - static const char kControlToBuffer = 4; // ^D - static const char kControlItalic = 6; // ^F - static const char kControlBell = 7; // ^G - static const char kControlBackspace = 8; // ^H - static const char kControlInsertSpaces = 9; // ^I - static const char kControlLeftJustified = 12; // ^L - static const char kControlNewLine = 13; // ^M - static const char kControlParagraph = 16; // ^P - static const char kControlQuestion = 17; // ^Q - static const char kControlRoman = 18; // ^R - static const char kControlRegister = 19; // ^S - static const char kControlNegative = 21; // ^U - static const char kControlIcon = 22; // ^V - - - int16 dix, diy; - fontType ch[2]; + byte cfont; // Current font int16 dodgex, dodgey; @@ -111,6 +113,8 @@ private: byte use_icon; + + void easteregg(); void say(int16 x, int16 y, Common::String z); diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index 135ab216c6..72e49344bc 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -164,7 +164,132 @@ void Visa::talkto(byte whom) { byte fv; bool no_matches; - warning("STUB: Visa::talkto()"); + if (_vm->_acci->person == _vm->_acci->pardon) { + _vm->_acci->person = _vm->_gyro->subjnumber; + _vm->_gyro->subjnumber = 0; + } + + if (_vm->_gyro->subjnumber == 0) + switch (whom) { + case _vm->_gyro->pspludwick: + + if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion])) { + dixi('q', 68); + _vm->_gyro->dna.obj[_vm->_gyro->potion] = true; + _vm->_lucerna->objectlist(); + _vm->_lucerna->points(3); + return; + } else { + if (_vm->_gyro->dna.talked_to_crapulus) + // Spludwick - what does he need? + // 0 - let it through to use normal routine. + switch (_vm->_gyro->dna.given2spludwick) { + case 1: // Falltrough is intended. + case 2:{ + _vm->_scrolls->display(Common::String("Can you get me ") + _vm->_gyro->get_better(_vm->_gyro->spludwick_order[_vm->_gyro->dna.given2spludwick]) + ", please?" + _vm->_scrolls->kControlRegister + '2' + _vm->_scrolls->kControlSpeechBubble); + return; + } + break; + case 3: { + dixi('q', 30); // Need any help with the game? + return; + } + break; + } + else { + dixi('q', 42); // Haven't talked to Crapulus. Go and talk to him. + return; + } + } + break; + + case _vm->_gyro->pibythneth: + if (_vm->_gyro->dna.givenbadgetoiby) { + dixi('q', 33); // Thanks a lot! + return; // And leave the proc. + } + break; // Or... just continue, 'cos he hasn't got it. + case _vm->_gyro->pdogfood: + if (_vm->_gyro->dna.wonnim) { // We've won the game. + dixi('q', 6); // "I'm Not Playing!" + return; // Zap back. + } else + _vm->_gyro->dna.asked_dogfood_about_nim = true; + break; + case _vm->_gyro->payles: + if (!_vm->_gyro->dna.ayles_is_awake) { + dixi('q', 43); // He's fast asleep! + return; + } else if (!_vm->_gyro->dna.given_pen_to_ayles) { + dixi('q', 44); // Can you get me a pen, Avvy? + return; + } + break; + + case _vm->_gyro->pjacques: { + dixi('q', 43); + return; + } + case _vm->_gyro->pgeida: + if (_vm->_gyro->dna.geida_given_potion) + _vm->_gyro->dna.geida_follows = true; + else { + dixi('u', 17); + return; + } + break; + case _vm->_gyro->pspurge: + if (~ _vm->_gyro->dna.sitting_in_pub) { + dixi('q', 71); // Try going over and sitting down. + return; + } else { + if (_vm->_gyro->dna.spurge_talk < 5) + _vm->_gyro->dna.spurge_talk++; + if (_vm->_gyro->dna.spurge_talk > 1) { // no. 1 falls through + dixi('q', 70 + _vm->_gyro->dna.spurge_talk); + return; + } + } + break; + } + // On a subject. Is there any reason to block it? + else if ((whom == _vm->_gyro->payles) && (!_vm->_gyro->dna.ayles_is_awake)) { + dixi('q', 43); // He's fast asleep! + return; + } + + if (whom > 149) + whom -= 149; + + no_matches = true; + for (fv = 0; fv <= _vm->_trip->numtr; fv++) + if (_vm->_trip->tr[fv].a.accinum == whom) { + _vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + (fv + 49) + _vm->_scrolls->kControlToBuffer); + no_matches = false; + break; + } + + if (no_matches) + _vm->_scrolls->display(Common::String(_vm->_scrolls->kControlRegister) + _vm->_scrolls->kControlRegister + _vm->_scrolls->kControlToBuffer); + + speech(whom, _vm->_gyro->subjnumber); + + if (!went_ok) + dixi('n', whom); // File not found! + + if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only + _vm->_gyro->dna.obj[_vm->_gyro->badge] = true; + _vm->_lucerna->objectlist(); + dixi('q', 1); // Circular from Cardiff. + _vm->_gyro->dna.talked_to_crapulus = true; + + _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = 177; // Crapulus walks off. + + _vm->_trip->tr[1].vanishifstill = true; + _vm->_trip->tr[1].walkto(3); // Walks away. + + _vm->_lucerna->points(2); + } } } // End of namespace Avalanche. |