/* 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 parse_player_command_now(); } _G(player).command_ready = false; } else if (player_said("GATE") && _G(flags)[V172] == 10025) { player_hotspot_walk_override(280, 296, 2); } else if (player_said("GEAR") && player_said_any("WINCH", "LEVER", "LEVER ") && _G(flags)[V175]) { player_hotspot_walk_override(546, 284, 9); } else if (player_said("TAKE", "DOG COLLAR ") || player_said("FISH", "TIRE")) { player_hotspot_walk_override(248, 298, 1); } else if (player_said_any("CHAIN ", "CHAIN ")) { player_walk_to(340, 300); } else if (player_said("GEAR", "DISC")) { _val4 = 4007; player_hotspot_walk_override(44, 310, -1, 5); _G(player).command_ready = false; } else if (player_said("GEAR", "DISC ")) { _val4 = 4007; player_hotspot_walk_override(460, 346, -1, 5); _G(player).command_ready = false; } else if (player_said("LOOK AT") && player_said_any("JAIL CELL", "JAIL CELL ") && _G(flags)[V174] == 4004) { if (!_flag1) { parseJail(); _G(kernel).call_daemon_every_loop = true; if (player_said("LOOK AT", "JAIL CELL")) player_hotspot_walk_override(173, 302, 10); } _G(player).command_ready = false; } else { if (_G(flags)[V174] == 4002) { if (_G(player).walk_x >= 180 && _G(player).walk_x <= 309 && _G(player).walk_y >= 271 && _G(player).walk_y <= 280) player_walk_to(_G(player).walk_x, 281); if (_G(player).walk_x >= 350 && _G(player).walk_x <= 409 && _G(player).walk_y >= 263 && _G(player).walk_y <= 283) player_walk_to(_G(player).walk_x, 284); } if (_G(flags)[V174] == 4004) { if (_G(player).walk_x >= 336 && _G(player).walk_x <= 388 && _G(player).walk_y >= 272 && _G(player).walk_y <= 291) player_walk_to(_G(player).walk_x, 292); if (_G(player).walk_x >= 378 && _G(player).walk_x <= 409 && _G(player).walk_y >= 259 && _G(player).walk_y <= 291) player_walk_to(_G(player).walk_x, 292); } if (player_said("FORCE FIELD")) { player_set_facing_hotspot(); } else if (!_G(flags)[V175]) { _hotspot = hotspot_which(_G(player).click_x, _G(player).click_y); assert(_hotspot); if (_hotspot->feet_y == 0x7fff) { term_message("click_y: %d taboo_area_y (click_x)", _G(player).click_x, tabooAreaY(_G(player).click_x)); } else { term_message("feet_y: %d taboo_area_y (feet_x): %d", _hotspot->feet_y, tabooAreaY(_hotspot->feet_x)); } if (_hotspot->feet_x > _hotspot->feet_y || (_hotspot->feet_y == 0x7fff && tabooAreaY(_G(player).click_x) > _G(player).click_y)) player_walk_to(_hotspot->feet_x, tabooAreaY(_hotspot->feet_x) + 1); } } } void Room406::parser() { _G(kernel).trigger_mode = KT_DAEMON; if (_G(walker).wilbur_said(SAID) || _G(walker).wilbur_match(MATCH)) _G(player).command_ready = false; } void Room406::loadSeries() { if (_G(flags)[V172] == 10025) { series_load("406dg02"); series_load("406dg02s"); } if (_G(flags)[V172] == 10023 || _G(flags)[V172] == 10024) { if (_dogShould == 49) { series_load("406dg06"); series_load("406dg06s"); } if (_dogShould == 50) { series_load("406dg07"); series_load("406dg07s"); } series_load("406dg11"); series_load("406dg11s"); series_load("406dg15"); series_load("406dg15s"); } } void Room406::setHotspots1() { hotspot_set_active("PEGLEG", false); hotspot_set_active("PEGLEG ", false); hotspot_set_active("PEGLEG ", false); hotspot_set_active("DOG COLLAR ", false); hotspot_set_active("DOG COLLAR ", false); hotspot_set_active("DOG COLLAR ", false); hotspot_set_active("DOG COLLAR ", false); switch (_G(flags)[V172]) { case 10023: hotspot_set_active("PEGLEG", true); hotspot_set_active("DOG COLLAR ", true); break; case 10024: hotspot_set_active("PEGLEG ", true); hotspot_set_active("DOG COLLAR ", true); break; case 10025: if (!_G(flags)[V173]) { hotspot_set_active("PEGLEG ", true); if (_G(flags)[V171] == 4000) hotspot_set_active("DOG COLLAR ", true); } hotspot_set_active("HOLE", false); break; case 10026: if (_G(flags)[V171] == 4001) hotspot_set_active("DOG COLLAR ", true); default: break; } } void Room406::setHotspots2() { if (_G(flags)[V175]) { hotspot_set_active("GATE", false); hotspot_set_active("LOCK", false); hotspot_set_active("CHAIN", false); hotspot_set_active("RAZOR WIRE ", false); hotspot_set_active("YARD ", true); } else { hotspot_set_active("GATE", true); hotspot_set_active("LOCK", true); hotspot_set_active("CHAIN", true); hotspot_set_active("RAZOR WIRE ", true); hotspot_set_active("YARD ", false); } } void Room406::setHotspots3() { hotspot_set_active("HOOK ", false); hotspot_set_active("HOOK ", false); hotspot_set_active("HOOK ", false); hotspot_set_active("HOOK ", false); hotspot_set_active("CHAIN ", false); hotspot_set_active("CHAIN ", false); hotspot_set_active("CHAIN ", false); hotspot_set_active("CHAIN ", false); hotspot_set_active("LEVER", false); hotspot_set_active("LEVER ", false); switch (_G(flags)[V174]) { case 4000: hotspot_set_active("HOOK ", true); hotspot_set_active("CHAIN ", true); hotspot_set_active("LEVER", true); break; case 4001: hotspot_set_active("HOOK ", true); hotspot_set_active("CHAIN ", true); hotspot_set_active("LEVER ", true); break; case 4002: hotspot_set_active("HOOK ", true); hotspot_set_active("CHAIN ", true); hotspot_set_active("LEVER ", true); break; case 4003: hotspot_set_active("CHAIN ", true); hotspot_set_active("LEVER ", true); break; case 4004: hotspot_set_active("HOOK ", true); hotspot_set_active("CHAIN ", true); hotspot_set_active("LEVER", true); break; default: break; } } void Room406::setHotspots4() { hotspot_set_active("JAIL CELL ", false); hotspot_set_active("RUBBLE", false); hotspot_set_active("BARRED WINDOW ", false); hotspot_set_active("HOOK ", false); if (_G(flags)[V174] == 4004) { hotspot_set_active("JAIL CELL ", true); hotspot_set_active("RUBBLE", true); hotspot_set_active("BARRED WINDOW ", false); hotspot_set_active("BARRED WINDOW ", true); hotspot_set_active("HOOK ", true); } } void Room406::setupFish() { hotspot_set_active("FISH ", false); hotspot_set_active("FISH ", false); if (_G(flags)[V173]) { _fish = series_show("406fish", 0x4fd); hotspot_set_active("FISH ", true); } if (_G(flags)[V172] == 10025) hotspot_set_active("FISH ", true); } void Room406::setupTt() { if (_tt) terminateMachineAndNull(_tt); if (_tire) series_unload(_tire); switch (_G(flags)[V174]) { case 4000: _tire = series_load("406tt"); _tt = series_show("406tt", 0x600); break; case 4001: _tire = series_load("406tt02"); _tt = series_show("406tt02", 0x600); break; case 4002: _tire = series_load("406tt03"); _tt = series_show("406tt03", 0x600); break; case 4004: _tire = series_load("406tt05"); _tt = series_show("406tt05", 0x600); break; default: break; } setHotspots3(); } void Room406::setNoWalk() { if (_G(flags)[V174] == 4002) { _walk1 = intr_add_no_walk_rect(180, 271, 309, 280, 179, 281); _walk2 = intr_add_no_walk_rect(350, 263, 409, 283, 349, 284); } if (_G(flags)[V174] == 4004) { _walk3 = intr_add_no_walk_rect(336, 272, 388, 291, 335, 292); _walk4 = intr_add_no_walk_rect(378, 259, 409, 291, 377, 292); } } void Room406::parseJail() { if (player_said("LOOK AT") && player_said_any("JAIL CELL", "JAIL CELL ")) _flag1 = true; if (_flag1) { player_update_info(); if (_G(player_info).x < 183 && _G(player_info).y < 312 && player_commands_allowed()) disable_player_commands_and_fade_init(4003); } } int Room406::tabooAreaY(int x) const { return ((double)x * -0.1050583 + -240.21069) * -1.0; } void Room406::playRandom(int trigger) { digi_unload(_randomDigi); if (!digi_play_state(2)) { _randomDigi = Common::String::format("406g001%c", 'a' + imath_ranged_rand(0, 18)); digi_preload(_randomDigi); digi_play(_randomDigi.c_str(), 2, 125, trigger); } } void Room406::triggerPreparser() { _G(player).waiting_for_walk = true; _G(player).ready_to_walk = true; _G(player).need_to_walk = true; _G(player).command_ready = true; _G(kernel).trigger = -1; _G(kernel).trigger_mode = KT_PREPARSE; _G(player).walker_trigger = -1; pre_parser(); if (_G(player).command_ready) { g_engine->_activeSection->pre_parser(); if (_G(player).command_ready) g_engine->global_pre_parser(); } } } // namespace Rooms } // namespace Burger } // namespace M4