ASYLUM: HiveControl puzzle: add completion checks

This commit is contained in:
Alexander 2011-08-08 00:23:40 +00:00 committed by Eugene Sandulenko
parent be21e4e028
commit 1fc9a8a837
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -237,9 +237,17 @@ bool PuzzleHiveControl::mouseLeftDown(const AsylumEvent &) {
getSound()->playSound(getWorld()->graphicResourceIds[83], false, Config.sfxVolume - 10);
++_frameIndexes[kElementSwirlRim];
error("[PuzzleHiveControl::mouseLeftDown] Not implemented");
//if (_frameIndexes[kElementSwirlRim] == 12)
// ...
// Check for puzzle completion
if (_frameIndexes[kElementSwirlRim] == 12) {
getSound()->stop(getWorld()->graphicResourceIds[73]);
getSound()->stop(getWorld()->graphicResourceIds[74]);
getScreen()->clear();
getScreen()->setupTransTables(3, getWorld()->cellShadeMask1, getWorld()->cellShadeMask2, getWorld()->cellShadeMask3);
getScreen()->selectTransTable(1);
_vm->switchEventHandler(getScene());
}
}
}
break;
@ -252,8 +260,18 @@ bool PuzzleHiveControl::mouseLeftDown(const AsylumEvent &) {
if (_glyphFlags[1][_leverPosition]) {
getSound()->playSound(getWorld()->graphicResourceIds[83], false, Config.sfxVolume - 10);
++_frameIndexes[kElementSwirlRim];
//if (_frameIndexes[kElementSwirlRim] == 12)
// ...
// Check for puzzle completion
if (_frameIndexes[kElementSwirlRim] == 12) {
getSound()->stop(getWorld()->graphicResourceIds[73]);
getSound()->stop(getWorld()->graphicResourceIds[74]);
getScreen()->clear();
getScreen()->setupTransTables(3, getWorld()->cellShadeMask1, getWorld()->cellShadeMask2, getWorld()->cellShadeMask3);
getScreen()->selectTransTable(1);
_vm->switchEventHandler(getScene());
}
}
}
break;
@ -408,8 +426,7 @@ void PuzzleHiveControl::updateScreen() {
_frameIndexes[kElementWingLeft1 + 2*i] = (_frameIndexes[kElementWingLeft1 + 2*i] + 1) % GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[kElementWingLeft1 + 2*i]);
if (_frameIndexes[kElementWingRight1 + 2*i] != GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[kElementWingRight1 + 2*i]) - 1)
_frameIndexes[kElementWingRight1 + 2*i] = (_frameIndexes[kElementWingRight1 + 2*i] + 1) % GraphicResource::getFrameCount(_vm, getWorld()->graphicResourceIds[kElementWingRight1 + 2*i]);
}
else {
} else {
if (_frameIndexes[kElementWingLeft1 + 2*i] > 0) {
--_frameIndexes[kElementWingLeft1 + 2*i];
if (_resetFlag && _frameIndexes[kElementWingLeft1 + 2*i] == 0 && !reseted) {