Permalink
Browse files

BLADERUNNER: Added sitcom mode

Available via ScummVM game options
  • Loading branch information...
peterkohaut committed Feb 10, 2019
1 parent 55e23a1 commit dbfc657a2c305946483e60d8bd68bb40575fb3a4
@@ -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);
@@ -115,6 +115,8 @@ class Actor {

Vector3 _actorSpeed;

int _sitcomRatio;

public:
Actor(BladeRunnerEngine *_vm, int actorId);
~Actor();
@@ -227,6 +229,8 @@ class Actor {
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);
@@ -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;
@@ -194,6 +194,7 @@ class BladeRunnerEngine : public Engine {
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;
@@ -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 {
@@ -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
@@ -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);
}

0 comments on commit dbfc657

Please sign in to comment.