mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-13 21:20:58 +00:00
AVALANCHE: Implement Dialogs::displayQuestion(), repair setSeed() and getRandomNumber() calls.
This commit is contained in:
parent
bfb28c7a39
commit
8408fa46c7
@ -51,7 +51,9 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
|
||||
_console = new AvalancheConsole(this);
|
||||
|
||||
_rnd = new Common::RandomSource("avalanche");
|
||||
_rnd->setSeed(42);
|
||||
TimeDate time;
|
||||
_system->getTimeAndDate(time);
|
||||
_rnd->setSeed(time.tm_sec + time.tm_min + time.tm_hour);
|
||||
|
||||
// Needed because of Lucerna::load_also()
|
||||
for (int i = 0; i < 31; i++) {
|
||||
|
@ -1526,7 +1526,7 @@ void AvalancheEngine::newGame() {
|
||||
_her = kPeoplePardon;
|
||||
_it = Parser::kPardon;
|
||||
_lastPerson = kPeoplePardon; // = Pardon?
|
||||
_passwordNum = _rnd->getRandomNumber(30) + 1; //Random(30) + 1;
|
||||
_passwordNum = _rnd->getRandomNumber(29) + 1; //Random(30) + 1;
|
||||
_userMovesAvvy = false;
|
||||
_doingSpriteRun = false;
|
||||
_avvyInBed = true;
|
||||
|
@ -66,8 +66,8 @@ void Closing::exitGame() {
|
||||
_vm->_sound->stopSound();
|
||||
|
||||
getScreen(kScreenNagScreen);
|
||||
byte nounId = _vm->_rnd->getRandomNumber(12);
|
||||
byte verbId = _vm->_rnd->getRandomNumber(12);
|
||||
byte nounId = _vm->_rnd->getRandomNumber(11);
|
||||
byte verbId = _vm->_rnd->getRandomNumber(11);
|
||||
Common::String result = nouns[nounId] + " will " + verbs[verbId] + " you";
|
||||
putIn(result, 1628);
|
||||
showScreen(); // No halt- it's already set up.
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "common/textconsole.h"
|
||||
#include "common/file.h"
|
||||
#include "common/random.h"
|
||||
|
||||
namespace Avalanche {
|
||||
|
||||
@ -765,7 +766,17 @@ void Dialogs::displayText(Common::String text) { // TODO: REPLACE BUFFER WITH A
|
||||
|
||||
bool Dialogs::displayQuestion(Common::String question) {
|
||||
displayText(question + kControlNewLine + kControlQuestion);
|
||||
warning("STUB: Dialogs::displayQuestion()");
|
||||
|
||||
if (_scReturn && (_vm->_rnd->getRandomNumber(1) == 0)) { // Half-and-half chance.
|
||||
Common::String tmpStr = Common::String::format("...Positive about that?%cI%c%c%c", kControlRegister, kControlIcon, kControlNewLine, kControlQuestion);
|
||||
displayText(tmpStr); // Be annoying!
|
||||
if (_scReturn && (_vm->_rnd->getRandomNumber(3) == 3)) { // Another 25% chance
|
||||
// \? are used to avoid that ??! is parsed as a trigraph
|
||||
tmpStr = Common::String::format("%c100%% certain\?\?!%c%c%c%c", kControlInsertSpaces, kControlInsertSpaces, kControlIcon, kControlNewLine, kControlQuestion);
|
||||
displayText(tmpStr); // Be very annoying!
|
||||
}
|
||||
}
|
||||
|
||||
return _scReturn;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user