diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index a70ea6728181..663ffd786045 100644
a
|
b
|
MystOptionsWidget::MystOptionsWidget(GuiObject *boss, const Common::String &name
|
99 | 99 | _zipModeCheckbox(nullptr), |
100 | 100 | _transitionsCheckbox(nullptr), |
101 | 101 | _mystFlyByCheckbox(nullptr), |
| 102 | _spaceshipFuzzyLogicCheckbox(nullptr), |
102 | 103 | _languagePopUp(nullptr), |
103 | 104 | _dropPageButton(nullptr), |
104 | 105 | _showMapButton(nullptr), |
… |
… |
MystOptionsWidget::MystOptionsWidget(GuiObject *boss, const Common::String &name
|
119 | 120 | _("The Myst fly by movie was not played by the original engine.")); |
120 | 121 | } |
121 | 122 | |
| 123 | if (!isDemo) { |
| 124 | /** |
| 125 | * I18N: |
| 126 | * This Option is for hard-of-hearing. |
| 127 | * It makes it easier to solve the spaceship puzzle. |
| 128 | * Normally game uses strict binary logic here. |
| 129 | * We change it to use fuzzy logic. |
| 130 | * By default the option is off. |
| 131 | */ |
| 132 | _spaceshipFuzzyLogicCheckbox = new GUI::CheckboxWidget(widgetsBoss(), "MystGameOptionsDialog.FuzzyMode", _("~F~uzzy Logic in SpaceShip Active")); |
| 133 | } |
| 134 | |
122 | 135 | if (isInGame()) { |
123 | 136 | MohawkEngine_Myst *vm = static_cast<MohawkEngine_Myst *>(g_engine); |
124 | 137 | assert(vm); |
… |
… |
void MystOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::Stri
|
161 | 174 | .addWidget("ZipMode", "Checkbox") |
162 | 175 | .addWidget("Transistions", "Checkbox") |
163 | 176 | .addWidget("PlayMystFlyBy", "Checkbox") |
| 177 | .addWidget("FuzzyMode", "Checkbox") |
164 | 178 | .addLayout(GUI::ThemeLayout::kLayoutHorizontal) |
165 | 179 | .addPadding(0, 0, 0, 0) |
166 | 180 | .addWidget("LanguageDesc", "OptionsLabel") |
… |
… |
void MystOptionsWidget::load() {
|
193 | 207 | _mystFlyByCheckbox->setState(ConfMan.getBool("playmystflyby", _domain)); |
194 | 208 | } |
195 | 209 | |
| 210 | if (_spaceshipFuzzyLogicCheckbox) { |
| 211 | _spaceshipFuzzyLogicCheckbox->setState(ConfMan.getBool("fuzzy_logic", _domain)); |
| 212 | } |
| 213 | |
196 | 214 | if (_languagePopUp) { |
197 | 215 | Common::Language language = Common::parseLanguage(ConfMan.get("language", _domain)); |
198 | 216 | const MystLanguage *languageDesc = MohawkEngine_Myst::getLanguageDesc(language); |
… |
… |
bool MystOptionsWidget::save() {
|
229 | 247 | ConfMan.setBool("playmystflyby", _mystFlyByCheckbox->getState(), _domain); |
230 | 248 | } |
231 | 249 | |
| 250 | if (_spaceshipFuzzyLogicCheckbox) { |
| 251 | ConfMan.setBool("fuzzy_logic", _spaceshipFuzzyLogicCheckbox->getState(), _domain); |
| 252 | } |
| 253 | |
232 | 254 | if (_languagePopUp) { |
233 | 255 | MohawkEngine_Myst *vm = static_cast<MohawkEngine_Myst *>(g_engine); |
234 | 256 | assert(vm); |
diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h
index 776172b5371b..d479dddf94ed 100644
a
|
b
|
class MystOptionsWidget : public GUI::OptionsContainerWidget {
|
100 | 100 | GUI::CheckboxWidget *_zipModeCheckbox; |
101 | 101 | GUI::CheckboxWidget *_transitionsCheckbox; |
102 | 102 | GUI::CheckboxWidget *_mystFlyByCheckbox; |
| 103 | GUI::CheckboxWidget *_spaceshipFuzzyLogicCheckbox; |
| 104 | |
103 | 105 | GUI::PopUpWidget *_languagePopUp; |
104 | 106 | |
105 | 107 | GUI::ButtonWidget *_dropPageButton; |
diff --git a/engines/mohawk/myst_metaengine.cpp b/engines/mohawk/myst_metaengine.cpp
index 7f400bb308e3..a77b3e857343 100644
a
|
b
|
void Mohawk::MohawkMetaEngine_Myst::registerDefaultSettings() {
|
26 | 26 | ConfMan.registerDefault("playmystflyby", false); |
27 | 27 | ConfMan.registerDefault("zip_mode", false); |
28 | 28 | ConfMan.registerDefault("transition_mode", false); |
| 29 | ConfMan.registerDefault("fuzzy_logic", false); |
29 | 30 | } |
30 | 31 | |
31 | 32 | const Mohawk::MystLanguage *Mohawk::MohawkMetaEngine_Myst::listLanguages() { |
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index de9a375d0c3f..165b84a50d3c 100644
a
|
b
|
|
30 | 30 | #include "mohawk/video.h" |
31 | 31 | #include "mohawk/myst_stacks/myst.h" |
32 | 32 | |
| 33 | #include "common/config-manager.h" |
33 | 34 | #include "common/events.h" |
34 | 35 | #include "common/math.h" |
35 | 36 | #include "common/system.h" |
… |
… |
uint16 Myst::rocketSliderGetSound(uint16 pos) {
|
2292 | 2293 | return (uint16)(9530 + (pos - 216) * 35.0 / 61.0); |
2293 | 2294 | } |
2294 | 2295 | |
| 2296 | uint16 Myst::rocketCheckIfSoundMatches(uint16 sound1, uint16 sound2) { |
| 2297 | debugN("rocketCheckIfSoundMatches: %i %i (diff:% 3i) ", sound1, sound2, sound1 - sound2); |
| 2298 | if (!ConfMan.getBool("fuzzy_logic")) { |
| 2299 | debugN("strict\n"); |
| 2300 | return sound1 == sound2; |
| 2301 | } else { |
| 2302 | debugN("fuzzy\n"); |
| 2303 | return abs(sound1 - sound2) < 5; |
| 2304 | } |
| 2305 | } |
| 2306 | |
2295 | 2307 | void Myst::rocketCheckSolution() { |
2296 | 2308 | _vm->_cursor->hideCursor(); |
2297 | 2309 | |
… |
… |
void Myst::rocketCheckSolution() {
|
2302 | 2314 | _vm->_sound->playEffect(soundId); |
2303 | 2315 | _rocketSlider1->drawConditionalDataToScreen(2); |
2304 | 2316 | _vm->wait(250); |
2305 | | if (soundId != 9558) |
| 2317 | if (!rocketCheckIfSoundMatches(soundId, 9558)) |
2306 | 2318 | solved = false; |
2307 | 2319 | |
2308 | 2320 | soundId = rocketSliderGetSound(_rocketSlider2->_pos.y); |
2309 | 2321 | _vm->_sound->playEffect(soundId); |
2310 | 2322 | _rocketSlider2->drawConditionalDataToScreen(2); |
2311 | 2323 | _vm->wait(250); |
2312 | | if (soundId != 9546) |
| 2324 | if (!rocketCheckIfSoundMatches(soundId, 9546)) |
2313 | 2325 | solved = false; |
2314 | 2326 | |
2315 | 2327 | soundId = rocketSliderGetSound(_rocketSlider3->_pos.y); |
2316 | 2328 | _vm->_sound->playEffect(soundId); |
2317 | 2329 | _rocketSlider3->drawConditionalDataToScreen(2); |
2318 | 2330 | _vm->wait(250); |
2319 | | if (soundId != 9543) |
| 2331 | if (!rocketCheckIfSoundMatches(soundId, 9543)) |
2320 | 2332 | solved = false; |
2321 | 2333 | |
2322 | 2334 | soundId = rocketSliderGetSound(_rocketSlider4->_pos.y); |
2323 | 2335 | _vm->_sound->playEffect(soundId); |
2324 | 2336 | _rocketSlider4->drawConditionalDataToScreen(2); |
2325 | 2337 | _vm->wait(250); |
2326 | | if (soundId != 9553) |
| 2338 | if (!rocketCheckIfSoundMatches(soundId, 9553)) |
2327 | 2339 | solved = false; |
2328 | 2340 | |
2329 | 2341 | soundId = rocketSliderGetSound(_rocketSlider5->_pos.y); |
2330 | 2342 | _vm->_sound->playEffect(soundId); |
2331 | 2343 | _rocketSlider5->drawConditionalDataToScreen(2); |
2332 | 2344 | _vm->wait(250); |
2333 | | if (soundId != 9560) |
| 2345 | if (!rocketCheckIfSoundMatches(soundId, 9560)) |
2334 | 2346 | solved = false; |
2335 | 2347 | |
2336 | 2348 | _vm->_sound->stopEffect(); |
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index 373963037940..8bb89917a275 100644
a
|
b
|
class Myst : public MystScriptParser {
|
312 | 312 | |
313 | 313 | void rocketSliderMove(); |
314 | 314 | uint16 rocketSliderGetSound(uint16 pos); |
| 315 | uint16 rocketCheckIfSoundMatches(uint16 sound1, uint16 sound2); |
315 | 316 | void rocketCheckSolution(); |
316 | 317 | |
317 | 318 | void libraryBookPageTurnLeft(); |