TITANIC: Change Bomb to use speech sound type

This commit is contained in:
Paul Gilbert 2017-06-25 08:00:55 -04:00
parent e127ddada1
commit f16505b128
3 changed files with 24 additions and 10 deletions

View File

@ -158,7 +158,7 @@ bool CBomb::StatusChangeMsg(CStatusChangeMsg *msg) {
break;
}
_soundHandle = queueSound(name, _soundHandle, _volume);
_soundHandle = queueSound(name, _soundHandle, _volume, Audio::Mixer::kSpeechSoundType);
}
return true;
@ -174,7 +174,6 @@ bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_active) {
stopSound(_soundHandle);
//stopSound(_unusedHandle);
if (_numCorrectWheels < CORRECT_WHEELS) {
_tappedCtr = MIN(_tappedCtr + 1, 23);
@ -201,7 +200,7 @@ bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
break;
}
_soundHandle = queueSound(name, _soundHandle, _volume);
_soundHandle = queueSound(name, _soundHandle, _volume, Audio::Mixer::kSpeechSoundType);
_countdown = 999;
}
} else {
@ -258,7 +257,7 @@ bool CBomb::ActMsg(CActMsg *msg) {
break;
}
_soundHandle = queueSound(name, _soundHandle, _volume);
_soundHandle = queueSound(name, _soundHandle, _volume, Audio::Mixer::kSpeechSoundType);
_countdown = 999;
}
@ -267,7 +266,8 @@ bool CBomb::ActMsg(CActMsg *msg) {
bool CBomb::TurnOn(CTurnOn *msg) {
if (!_active) {
_soundHandle = playSound("z#389.wav", _volume);
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound("z#389.wav", prox);
_active = true;
// WORKAROUND: Only reset the code wheels back to 'O' value
@ -295,8 +295,9 @@ bool CBomb::TurnOn(CTurnOn *msg) {
bool CBomb::TimerMsg(CTimerMsg *msg) {
if (msg->_action == "Disarmed") {
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
stopSound(_soundHandle);
playSound("z#364.wav", _volume);
playSound("z#364.wav", prox);
CActMsg actMsg1("Disarm Bomb");
actMsg1.execute("EndExplodeShip");
@ -330,8 +331,9 @@ bool CBomb::TimerMsg(CTimerMsg *msg) {
if (_countdown >= 100) {
// Play "x hundred and" or just "x hundred"
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
CString hName = remainder ? HUNDREDS_AND_WAVS[hundreds] : HUNDREDS_WAVS[hundreds];
_soundHandle = playSound(hName, _volume);
_soundHandle = playSound(hName, prox);
}
CString ctrName = COUNTDOWN_WAVS[remainder];
@ -342,9 +344,10 @@ bool CBomb::TimerMsg(CTimerMsg *msg) {
// Play the sub-hundred portion of the countdown amount
if (_soundHandle > 0) {
_soundHandle = queueSound(ctrName, _soundHandle, _volume);
_soundHandle = queueSound(ctrName, _soundHandle, _volume, 0, false, Audio::Mixer::kSpeechSoundType);
} else {
_soundHandle = playSound(ctrName, _volume);
CProximity prox(Audio::Mixer::kSpeechSoundType, _volume);
_soundHandle = playSound(ctrName, prox);
}
// Reduce countdown and schedule another timer
@ -352,7 +355,7 @@ bool CBomb::TimerMsg(CTimerMsg *msg) {
addTimer(0, 1000, 0);
}
} else {
// Bomb speech currently active, so schedule the method'
// Bomb speech currently active, so schedule the method
// to re-trigger after 100ms to check if speech is finished
addTimer(0, 100, 0);
}

View File

@ -35,4 +35,14 @@ CProximity::CProximity() : _channelVolume(100), _balance(0),
_soundDuration(0), _soundType(Audio::Mixer::kPlainSoundType) {
}
CProximity::CProximity(Audio::Mixer::SoundType soundType, int volume) :
_soundType(soundType), _channelVolume(volume),
_balance(0), _priorSoundHandle(-1), _frequencyMultiplier(0.0),
_frequencyAdjust(1.875), _repeated(false), _channelMode(10),
_positioningMode(POSMODE_NONE), _azimuth(0.0), _range(0.5), _elevation(0),
_posX(0.0), _posY(0.0), _posZ(0.0), _hasVelocity(false), _velocityX(0),
_velocityY(0), _velocityZ(0), _disposeAfterUse(DisposeAfterUse::NO),
_endTalkerFn(nullptr), _talker(nullptr), _soundDuration(0) {
}
} // End of namespace Titanic

View File

@ -61,6 +61,7 @@ public:
Audio::Mixer::SoundType _soundType;
public:
CProximity();
CProximity(Audio::Mixer::SoundType soundType, int volume = 100);
};
} // End of namespace Titanic