diff options
author | Peter Kohaut | 2019-02-10 19:45:50 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-02-10 19:47:22 +0100 |
commit | dbfc657a2c305946483e60d8bd68bb40575fb3a4 (patch) | |
tree | ab8289a1aa270209913106d8562a667ee015ffb4 /engines | |
parent | 55e23a190991543d808691943be7b149f8d32632 (diff) | |
download | scummvm-rg350-dbfc657a2c305946483e60d8bd68bb40575fb3a4.tar.gz scummvm-rg350-dbfc657a2c305946483e60d8bd68bb40575fb3a4.tar.bz2 scummvm-rg350-dbfc657a2c305946483e60d8bd68bb40575fb3a4.zip |
BLADERUNNER: Added sitcom mode
Available via ScummVM game options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/bladerunner/actor.cpp | 37 | ||||
-rw-r--r-- | engines/bladerunner/actor.h | 4 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 8 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.h | 1 | ||||
-rw-r--r-- | engines/bladerunner/detection.cpp | 18 | ||||
-rw-r--r-- | engines/bladerunner/detection_tables.h | 14 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 16 |
7 files changed, 79 insertions, 19 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index 59af72d87c..ef89bb876c 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -140,6 +140,39 @@ void Actor::setup(int actorId) { _movementTrack->flush(); _actorSpeed = Vector3(); + + switch (_id) { + case kActorMcCoy: + _sitcomRatio = 50; + break; + + case kActorGordo: + _sitcomRatio = 0; + break; + + case kActorGuzza: + case kActorChew: + case kActorVoiceOver: + _sitcomRatio = 75; + break; + + case kActorCrazylegs: + case kActorBulletBob: + case kActorRunciter: + case kActorZuben: + case kActorLeon: + _sitcomRatio = 90; + break; + + case kActorGrigorian: + case kActorMoraji: + _sitcomRatio = 100; + break; + + default: + _sitcomRatio = 33; + break; + } } void Actor::changeAnimationMode(int animationMode, bool force) { @@ -969,6 +1002,10 @@ bool Actor::getFlagDamageAnimIfMoving() const { return _damageAnimIfMoving; } +int Actor::getSitcomRatio() const { + return _sitcomRatio; +} + void Actor::retire(bool retired, int width, int height, int retiredByActorId) { _isRetired = retired; _retiredWidth = MAX(width, 0); diff --git a/engines/bladerunner/actor.h b/engines/bladerunner/actor.h index 492db6dd5f..62c7a284aa 100644 --- a/engines/bladerunner/actor.h +++ b/engines/bladerunner/actor.h @@ -115,6 +115,8 @@ private: Vector3 _actorSpeed; + int _sitcomRatio; + public: Actor(BladeRunnerEngine *_vm, int actorId); ~Actor(); @@ -227,6 +229,8 @@ public: void setFlagDamageAnimIfMoving(bool value); bool getFlagDamageAnimIfMoving() const; + int getSitcomRatio() const; + void retire(bool isRetired, int width, int height, int retiredByActorId); void combatModeOn(int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int attackRatio, int damage, int range, bool unstoppable); diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index bad251a333..48cc6179e9 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -99,9 +99,11 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des _windowIsActive = true; _gameIsRunning = true; - _vqaIsPlaying = false; + _vqaIsPlaying = false; _vqaStopIsRequested = false; + _subtitlesEnabled = false; + _sitcomMode = true; _playerLosesControlCounter = 0; @@ -411,6 +413,8 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { // get value from the ScummVM configuration manager _subtitlesEnabled = ConfMan.getBool("subtitles"); + _sitcomMode = ConfMan.getBool("sitcom"); + _items = new Items(this); _audioMixer = new AudioMixer(this); @@ -1720,7 +1724,7 @@ Common::SeekableReadStream *BladeRunnerEngine::getResourceStream(const Common::S } // debug("getResource: Searching archive %s for %s.", _archives[i].getName().c_str(), name.c_str()); - + Common::SeekableReadStream *stream = _archives[i].createReadStreamForMember(name); if (stream) { return stream; diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h index 7f7883a410..1122e21eff 100644 --- a/engines/bladerunner/bladerunner.h +++ b/engines/bladerunner/bladerunner.h @@ -194,6 +194,7 @@ public: bool _vqaIsPlaying; bool _vqaStopIsRequested; bool _subtitlesEnabled; // tracks the state of whether subtitles are enabled or disabled from ScummVM GUI option or KIA checkbox (the states are synched) + bool _sitcomMode; int _walkSoundId; int _walkSoundVolume; diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp index 4d61396955..d6ecf74105 100644 --- a/engines/bladerunner/detection.cpp +++ b/engines/bladerunner/detection.cpp @@ -29,6 +29,7 @@ #include "common/system.h" #include "common/savefile.h" #include "common/serializer.h" +#include "common/translation.h" #include "engines/advancedDetector.h" @@ -39,6 +40,20 @@ static const PlainGameDescriptor bladeRunnerGames[] = { {0, 0} }; +static const ADExtraGuiOptionsMap optionsList[] = { + { + GAMEOPTION_SITCOM, + { + _s("Sitcom mode"), + _s("Game will add laughter after actor's line or narration"), + "sitcom", + false + } + }, + + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + } // End of namespace BladeRunner class BladeRunnerMetaEngine : public AdvancedMetaEngine { @@ -59,7 +74,8 @@ BladeRunnerMetaEngine::BladeRunnerMetaEngine() : AdvancedMetaEngine( BladeRunner::gameDescriptions, sizeof(BladeRunner::gameDescriptions[0]), - BladeRunner::bladeRunnerGames) {} + BladeRunner::bladeRunnerGames, + BladeRunner::optionsList) {} const char *BladeRunnerMetaEngine::getName() const { diff --git a/engines/bladerunner/detection_tables.h b/engines/bladerunner/detection_tables.h index 5d1a851598..12e9d68118 100644 --- a/engines/bladerunner/detection_tables.h +++ b/engines/bladerunner/detection_tables.h @@ -25,6 +25,8 @@ #include "engines/advancedDetector.h" +#define GAMEOPTION_SITCOM GUIO_GAMEOPTIONS1 + namespace BladeRunner { static const ADGameDescription gameDescriptions[] = { @@ -36,7 +38,7 @@ static const ADGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformWindows, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GAMEOPTION_SITCOM) }, // BladeRunner (German) @@ -47,7 +49,7 @@ static const ADGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformWindows, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GAMEOPTION_SITCOM) }, // BladeRunner (French) - Bug #9722 @@ -58,7 +60,7 @@ static const ADGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformWindows, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GAMEOPTION_SITCOM) }, // BladeRunner (Italian) @@ -69,7 +71,7 @@ static const ADGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformWindows, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GAMEOPTION_SITCOM) }, // BladeRunner (Russian) @@ -80,7 +82,7 @@ static const ADGameDescription gameDescriptions[] = { Common::RU_RUS, Common::kPlatformWindows, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GAMEOPTION_SITCOM) }, // BladeRunner (Spanish) @@ -91,7 +93,7 @@ static const ADGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformWindows, ADGF_NO_FLAGS, - GUIO0() + GUIO1(GAMEOPTION_SITCOM) }, AD_TABLE_END_MARKER diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 502344bf6f..4c205d5d4c 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -329,16 +329,12 @@ void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause, actor->changeAnimationMode(kAnimationModeIdle, false); } - //TODO: sitcom - //if (_vm->isSitcom) - //{ - // int rnd = _vm->random(1, 100); - // if (rnd <= actor::get_unknown3(actor)) - // { - // int soundId = _vm->random(319, 327); - // _vm->_audioPlayer->play(soundId, 40, 0, 0, 50); - // } - //} + if (_vm->_sitcomMode) { + int rnd = Random_Query(1, 100); + if (rnd <= actor->getSitcomRatio()) { + Sound_Play(Random_Query(319, 327), 40, 0, 0, 50); + } + } if(pause > 0.0f && !_vm->_speechSkipped) { Delay(pause * 1000); } |