1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
|
/* 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 <http://www.gnu.org/licenses/ },.
*
*/
#include "m4/riddle/rooms/section9/room996.h"
#include "m4/graphics/gr_series.h"
#include "m4/riddle/vars.h"
namespace M4 {
namespace Riddle {
namespace Rooms {
Room996::Room996() : Room() {
for (int i = 0; i < 13; ++i)
_flagArray[i] = 0;
}
void Room996::preload() {
_G(player).walker_in_this_scene = false;
}
void Room996::init() {
digi_preload("950_s56", -1);
interface_hide();
series_show("996mark", 0, 16, -1, -1, 0, 100, 0, 0);
_flag = 1;
if (_G(flags)[V290]) {
_roomStates_loop0 = series_show("996 Charcoal Page", 256, 16, -1, -1, 0, 100, 0, 0);
digi_preload("205r13a", -1);
digi_play("205r13a", 1, 255, -1, 205);
hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", false);
hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
} else {
if (player_been_here(205)) {
_roomStates_loop0 = series_show("996 RIPPED OUT PAGE", 256, 16, -1, -1, 0, 100, 0, 0);
hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", false);
hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
} else {
if (_G(flags)[V280]) {
_roomStates_tt = series_show("996 Peru Pictograph Snake", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V148]) {
_roomStates_field4 = series_show("996 Peru Pictograph Condor", 256, 16, -1, -1, 0, 100, 0, 0);
} else {
_roomStates_field4 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -13, -87);
}
if (_G(flags)[V156]) {
_roomStates_pu = series_show("996 Peru Pictos Solved Spider", 256, 16, -1, -1, 0, 100, 0, 0);
} else {
_roomStates_field8 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, 0, 0);
}
if (_G(flags)[V283]) {
_roomStates_untie = series_show("996 Peru Pictograph Monkey", 256, 16, -1, -1, 0, 100, 0, 0);
} else {
_roomStates_untie = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -21, 71);
}
}
hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
}
}
for (int i = 1; i < 12; ++i)
_flagArray[i] = 0;
if (_G(flags)[kEasterIslandCartoon])
_flagArray[1] = 1;
if (_G(flags)[kChinshiCartoon])
_flagArray[1] = 2;
if (_G(flags)[kTabletsCartoon])
_flagArray[1] = 3;
if (_G(flags)[kEpitaphCartoon])
_flagArray[1] = 5;
if (_G(flags)[kGraveyardCartoon])
_flagArray[1] = 4;
if (_G(flags)[kCastleCartoon])
_flagArray[1] = 6;
if (_G(flags)[kMocaMocheCartoon])
_flagArray[1] = 7;
if (_G(flags)[kTempleCartoon])
_flagArray[1] = 8;
if (_G(flags)[kEmeraldCartoon])
_flagArray[1] = 9;
_flagArray[12] = 1;
_moveValue = 0;
}
void Room996::pre_parser() {
if (player_said("forward", nullptr, nullptr) && (_flagArray[12] != 3)) {
digi_play("950_s56", 1, 255, -1, 950);
++_flagArray[12];
}
if (player_said("back", nullptr, nullptr) && (_flagArray[12] != 3)) {
digi_play("950_s56", 1, 255, -1, 950);
--_flagArray[12];
}
if (player_said("forward", nullptr, nullptr) && (_flagArray[12] == 3) && (_flagArray[1] == 0)) {
++_flagArray[12];
}
if (player_said("forward", nullptr, nullptr) && (_flagArray[12] == 4) && (_G(flags)[V047] == 0)) {
++_flagArray[12];
}
if (player_said("back", nullptr, nullptr) && (_flagArray[12] == 4) && (_G(flags)[V047] == 0)) {
--_flagArray[12];
}
if (player_said("back", nullptr, nullptr) && (_flagArray[12] == 3) && (_flagArray[1] == 0)) {
--_flagArray[12];
}
_flagArray[12] = CLIP(_flagArray[12], (int32)1, (int32)5);
_G(player).need_to_walk = false;
_G(player).ready_to_walk = true;
_G(player).waiting_for_walk = false;
}
void Room996::parser() {
if (player_said("--", nullptr, nullptr)) {
_G(player).command_ready = false;
return;
}
if (player_said("exit", nullptr, nullptr) && (_G(kernel).trigger >= -1)) {
if (_G(kernel).trigger == -1) {
player_set_commands_allowed(false);
disable_player_commands_and_fade_init(1);
_G(player).command_ready = false;
return;
}
if (_G(kernel).trigger == 1) {
interface_show();
restoreAutosave();
_G(player).command_ready = false;
return;
}
}
switch (_flagArray[12]) {
case 1:
if (_G(kernel).trigger == -1) {
hotspot_set_active(_G(currentSceneDef).hotspots, "FORWARD", true);
hotspot_set_active(_G(currentSceneDef).hotspots, "BACK", false);
terminateMachine(_roomStates_ripTalker);
terminateMachine(_roomStates_field18);
terminateMachine(_roomStates_ripTalking);
terminateMachine(_roomStates_ripTalk);
terminateMachine(_roomStates_field24);
kernel_timing_trigger(10, 1, nullptr);
} else if (_G(kernel).trigger == 1 && _G(flags)[V280] != 0) {
_roomStates_tt = series_show("996 Peru Pictograph Snake", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V148])
_roomStates_field4 = series_show("996 Peru Pictograph Condor", 256, 16, -1, -1, 0, 100, 0, 0);
else
_roomStates_field4 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -13, -87);
if (_G(flags)[V156])
_roomStates_pu = series_show("996 Peru Pictos Solved Spider", 256, 16, -1, -1, 0, 100, 0, 0);
else
_roomStates_field8 = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V283])
_roomStates_untie = series_show("996 Peru Pictograph Monkey", 256, 16, -1, -1, 0, 100, 0, 0);
else
_roomStates_untie = series_show("996 Peru Pictograph Spider", 256, 16, -1, -1, 0, 100, -21, 71);
}
break;
case 2:
if (_G(kernel).trigger == -1) {
if (_flagArray[_moveValue] != 0 || _G(flags)[V047] || _G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", true);
else
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
hotspot_set_active(_G(currentSceneDef).hotspots, "back", true);
terminateMachine(_roomStates_tt);
terminateMachine(_roomStates_field4);
terminateMachine(_roomStates_pu);
terminateMachine(_roomStates_field8);
terminateMachine(_roomStates_untie);
terminateMachine(_roomStates_loop1);
terminateMachine(_roomStates_loop2);
terminateMachine(_roomStates_loop3);
terminateMachine(_roomStates_loop4);
terminateMachine(_roomStates_loop5);
terminateMachine(_roomStates_loop6);
terminateMachine(_roomStates_loop7);
terminateMachine(_roomStates_ear2);
terminateMachine(_roomStates_field4C);
kernel_timing_trigger(10, 1, nullptr);
} else if (_G(kernel).trigger == 1) {
if (_G(flags)[V285])
_roomStates_ripTalker = series_show("996 TITLE JOURNAL TYPE", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V286])
_roomStates_field18 = series_show("996 sikkamese text alone", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V287])
_roomStates_ripTalking = series_show("996 PERU SCRIPT", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V288]) {
if (player_been_here(615))
_roomStates_ripTalk = series_show("996 EASTER ISLAND SCRIPT", 256, 16, -1, -1, 0, 100, 0, 0);
else
_roomStates_ripTalk = series_show("996 East Isl. w/o #s", 256, 16, -1, -1, 0, 100, 0, 0);
}
if (_G(flags)[V289])
_roomStates_field24 = series_show("996 KEY TO TOMB SCRIPT", 256, 16, -1, -1, 0, 100, 0, 0);
}
break;
case 3:
if (_G(kernel).trigger == -1) {
if (player_said("forward", nullptr, nullptr)) {
digi_play("950_s56", 1, 255, -1, 950);
++_moveValue;
} else if (player_said("back", nullptr, nullptr)) {
digi_play("950_s56", 1, 255, -1, 950);
--_moveValue;
}
if (_moveValue == 0) {
_flagArray[12] = 2;
digi_play("950_s56", 1, 255, -1, 950);
} else if (_flagArray[_moveValue] == 0) {
if (_G(flags)[V047])
_flagArray[12] = 4;
else if (_G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
_flagArray[12] = 5;
}
if (_flagArray[_moveValue] != 0 || _G(flags)[V047] || _G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", true);
else
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
if (_flagArray[12] == 4) {
if (_G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", true);
else
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
}
if (_flagArray[12] == 5)
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
terminateMachine(_roomStates_ripTalker);
terminateMachine(_roomStates_field18);
terminateMachine(_roomStates_ripTalking);
terminateMachine(_roomStates_ripTalk);
terminateMachine(_roomStates_field24);
terminateMachine(_roomStates_loop1);
terminateMachine(_roomStates_loop2);
terminateMachine(_roomStates_loop3);
terminateMachine(_roomStates_loop4);
terminateMachine(_roomStates_loop5);
terminateMachine(_roomStates_loop6);
terminateMachine(_roomStates_loop7);
terminateMachine(_roomStates_ear2);
terminateMachine(_roomStates_field4C);
kernel_timing_trigger(10, 1, nullptr);
} else if (_G(kernel).trigger == 1) {
switch (_flagArray[_moveValue]) {
case 1:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 0, 100, 0, 0);
break;
case 2:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 1, 100, 0, 0);
break;
case 3:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 2, 100, 0, 0);
break;
case 4:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 3, 100, 0, 0);
break;
case 5:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 4, 100, 0, 0);
break;
case 6:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 5, 100, 0, 0);
break;
case 7:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 6, 100, 0, 0);
break;
case 8:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 7, 100, 0, 0);
break;
case 9:
_roomStates_loop1 = series_show("996car", 256, 16, -1, -1, 8, 100, 0, 0);
break;
default:
break;
}
}
break;
case 4:
if (_G(kernel).trigger == -1) {
if (_G(flags)[V196] || _G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", true);
else
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
terminateMachine(_roomStates_ripTalker);
terminateMachine(_roomStates_field18);
terminateMachine(_roomStates_ripTalking);
terminateMachine(_roomStates_ripTalk);
terminateMachine(_roomStates_field24);
terminateMachine(_roomStates_loop1);
terminateMachine(_roomStates_loop3);
terminateMachine(_roomStates_loop4);
terminateMachine(_roomStates_loop5);
terminateMachine(_roomStates_loop6);
terminateMachine(_roomStates_loop7);
terminateMachine(_roomStates_ear2);
terminateMachine(_roomStates_field4C);
kernel_timing_trigger(10, 1, nullptr);
} else if (_G(kernel).trigger == 1) {
_check201Fl = _G(flags)[V201] != 0;
_check207Fl = _G(flags)[V207] != 0;
_check208Fl = _G(flags)[V208] != 0;
_check209Fl = _G(flags)[V209] != 0;
if (!_check201Fl && !_check207Fl && !_check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ136", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && !_check207Fl && !_check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ122", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && _check207Fl && !_check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ123", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && !_check207Fl && !_check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ124", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && !_check207Fl && _check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ125", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && _check207Fl && !_check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ126", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && !_check207Fl && _check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ127", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && !_check207Fl && !_check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ128", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && _check207Fl && !_check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ129", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && _check207Fl && _check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ130", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && !_check207Fl && _check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ131", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && _check207Fl && _check208Fl && !_check209Fl) {
_roomStates_loop2 = series_show("PING OBJ132", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && !_check207Fl && _check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ133", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && _check207Fl && !_check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ134", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (!_check201Fl && _check207Fl && _check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING OBJ135", 256, 16, -1, -1, 0, 100, 206, 67);
} else if (_check201Fl && _check207Fl && _check208Fl && _check209Fl) {
_roomStates_loop2 = series_show("PING TWELVETREES' MAP", 256, 16, -1, -1, 0, 100, 206, 67);
}
}
break;
case 5:
if (_G(kernel).trigger == -1) {
terminateMachine(_roomStates_ripTalker);
terminateMachine(_roomStates_field18);
terminateMachine(_roomStates_ripTalking);
terminateMachine(_roomStates_ripTalk);
terminateMachine(_roomStates_field24);
terminateMachine(_roomStates_loop2);
hotspot_set_active(_G(currentSceneDef).hotspots, "forward", false);
kernel_timing_trigger(10, 1, nullptr);
} else if (_G(kernel).trigger == 1) {
_roomStates_loop3 = series_show("996 EA Glyph title", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V201] || _G(flags)[V207] || _G(flags)[V208] || _G(flags)[V209])
_roomStates_loop5 = series_show("996 EA Glyph Quarry title", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V196])
_roomStates_loop4 = series_show("996 EA Glyph Fallen head", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V201])
_roomStates_loop7 = series_show("996 EA Glyph Sharks Tooth", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V207])
_roomStates_loop6 = series_show("996 EA Glyph Scallop Shell", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V208])
_roomStates_ear2 = series_show("996 EA Glyph Starfish", 256, 16, -1, -1, 0, 100, 0, 0);
if (_G(flags)[V209])
_roomStates_field4C = series_show("996 EA Glyph SeaHorse", 256, 16, -1, -1, 0, 100, 0, 0);
}
break;
default:
break;
}
_G(player).command_ready = false;
}
void Room996::daemon() {
if (_G(kernel).trigger == 1)
player_set_commands_allowed(true);
}
} // namespace Rooms
} // namespace Riddle
} // namespace M4
|