/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see (g_engine)->handleTestDone(); break; case kCHANGE_WILBUR_ANIMATION: switch (_G(wilbur_should)) { case 1: if (!strcmp(conv_sound_to_play(), "53p0101")) { _G(wilbur_should) = 3; conv_resume_curr(); kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION); } else { _G(wilbur_should) = 2; digi_play(conv_sound_to_play(), 1, 255, kCHANGE_WILBUR_ANIMATION); _general1 = series_play("207wi01", 0x400, 4, -1, 6, -1); } break; case 2: terminateMachineAndNull(_general1); _G(wilbur_should) = 3; conv_resume_curr(); kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION); break; case 3: _G(wilbur_should) = getWilburShould(); series_show("207wi01", 0x400, 0, kCHANGE_WILBUR_ANIMATION, 30, 0); break; case 4: _G(wilbur_should) = getWilburShould(); series_play("207wi01", 0x400, 1, kCHANGE_WILBUR_ANIMATION, 6, 0, 100, 0, 0, 0, 2); break; default: break; } break; default: _G(kernel).continue_handling_trigger = true; break; } } void Room207::parser() { _G(kernel).trigger_mode = KT_DAEMON; if (player_said(_conv1)) { handleConv(); _G(player).command_ready = false; } } void Room207::handleConv() { const char *sound = conv_sound_to_play(); const int who = conv_whos_talking(); const int node = conv_current_node(); const int entry = conv_current_entry(); if (sound) { if (who == 1) { _G(wilbur_should) = 1; if (player_said("conv56") && node == 4) _astralShould = 8; if (node == 0 && entry == 1) pal_fade_init(_G(kernel).first_fade, 255, 100, 30, -1); } else if (player_said("conv51") && node == 8) { _astralShould = 13; } else { _astralShould = 1; } } } int Room207::getAstralShould() const { const int rand = imath_ranged_rand(1, 24); switch (_astralMode) { case 15: switch (rand) { case 1: return 8; case 2: return 11; case 3: return 12; default: return 10; } break; case 16: switch (rand) { case 1: return 10; case 2: case 3: return 9; case 4: return 12; default: return 8; } break; case 17: switch (rand) { case 1: return 8; case 2: return 10; default: return 12; } break; default: return _astralShould; } } int Room207::getWilburShould() const { const int rand = imath_ranged_rand(1, 8); return (rand == 1) ? 4 : 3; } } // namespace Rooms } // namespace Burger } // namespace M4