diff options
author | Filippos Karapetis | 2008-06-03 18:17:56 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-06-03 18:17:56 +0000 |
commit | e3a8074a6d93b8ef590c9761f2a8d7aba8b06e0b (patch) | |
tree | 654bc08951eb3943edc2595c0e3779a3471a7977 /engines | |
parent | 3be34f071fc56275d37f9467dcf72389c1711474 (diff) | |
download | scummvm-rg350-e3a8074a6d93b8ef590c9761f2a8d7aba8b06e0b.tar.gz scummvm-rg350-e3a8074a6d93b8ef590c9761f2a8d7aba8b06e0b.tar.bz2 scummvm-rg350-e3a8074a6d93b8ef590c9761f2a8d7aba8b06e0b.zip |
Rewrote some more room logic
svn-id: r32518
Diffstat (limited to 'engines')
-rw-r--r-- | engines/drascula/drascula.h | 2 | ||||
-rw-r--r-- | engines/drascula/rooms.cpp | 83 | ||||
-rw-r--r-- | engines/drascula/staticdata.h | 50 |
3 files changed, 72 insertions, 63 deletions
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index ba43c9895c..4649dd5ada 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -105,7 +105,7 @@ enum IgorTalkerTypes { struct DrasculaGameDescription; struct RoomTalkAction { - int num; + int chapter; int action; int objectID; int speechID; diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index 6a8c87f8b6..a294895162 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -32,8 +32,8 @@ bool DrasculaEngine::roomParse(RoomTalkAction* roomActions, int fl) { bool didAction = false; for (int i = 0; i < ARRAYSIZE(roomActions); i++) { - if (roomActions[i].num == currentChapter || - roomActions[i].num == -1) { + if (roomActions[i].chapter == currentChapter || + roomActions[i].chapter == -1) { if (roomActions[i].action == pickedObject || roomActions[i].action == kVerbDefault) { if (roomActions[i].objectID == fl || @@ -317,11 +317,10 @@ void DrasculaEngine::room_14(int fl) { } void DrasculaEngine::room_15(int fl) { - if (pickedObject == kVerbTalk && fl == 188) - talk(333); - else if (pickedObject == kVerbLook && fl == 188) - talk(334); - else if (pickedObject == 19 && fl == 188 && flags[27] == 0) + if (roomParse(room15Actions, fl)) + return; + + if (pickedObject == 19 && fl == 188 && flags[27] == 0) talk(335); else if (pickedObject == 19 && fl == 188 && flags[27] == 1) { talk(336); @@ -347,27 +346,18 @@ void DrasculaEngine::room_15(int fl) { flags[27] = 1; if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1) flags[38] = 1; - } else if (pickedObject == kVerbLook && fl == 205) - talk(172); - else if (pickedObject == kVerbLook && fl == 206) - talk(173); - else if (pickedObject == kVerbMove && fl == 206) - talk(174); - else if (pickedObject == kVerbOpen && fl == 206) - talk(174); - else + } else hasAnswer = 0; } void DrasculaEngine::room_16(int fl) { - if (pickedObject == kVerbTalk && fl == 163) - talk(6); - else if (pickedObject == kVerbOpen && fl == 163) + if (roomParse(room16Actions, fl)) + return; + + if (pickedObject == kVerbOpen && fl == 163) openDoor(17, 0); else if (pickedObject == kVerbClose && fl == 163) closeDoor(17, 0); - else if (pickedObject == kVerbLook && fl == 183) - talk(340); else if (pickedObject == kVerbTalk && fl == 183) { talk(341); pause(10); @@ -386,23 +376,13 @@ void DrasculaEngine::room_16(int fl) { } } else if (pickedObject == kVerbClose && fl == 183) closeDoor(19, NO_DOOR); - else if (pickedObject == kVerbLook && fl == 185) - talk(37); - else if (pickedObject == kVerbPick && fl == 185) - talk(7); - else if (pickedObject == kVerbMove && fl == 185) - talk(7); - else if (pickedObject == kVerbTalk && fl == 185) - talk(38); else if (pickedObject == kVerbLook && fl == 187) { talk(343); trackProtagonist = 3; updateRoom(); updateScreen(); talk(344); - } else if (pickedObject == kVerbTalk && fl == 187) - talk(345); - else + } else hasAnswer = 0; } @@ -431,12 +411,13 @@ void DrasculaEngine::room_17(int fl) { } void DrasculaEngine::room_18(int fl) { + if (roomParse(room18Actions, fl)) + return; + if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 0) animation_24_2(); else if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 1) talk(109); - else if (pickedObject == kVerbLook && fl == 181) - talk(348); else if (pickedObject == kVerbPick && fl == 182) { copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); updateRefresh_pre(); @@ -447,8 +428,6 @@ void DrasculaEngine::room_18(int fl) { pickObject(12); visible[2] = 0; flags[28] = 1; - } else if (pickedObject == kVerbLook && fl == 182) { - talk(154); } else if (fl == 55 && flags[38] == 0 && flags[33] == 0) { if (pickedObject == 8 || pickedObject == 13 || pickedObject == 15 || pickedObject == 16 || pickedObject == 17) @@ -579,6 +558,9 @@ void DrasculaEngine::room_24(int fl) { } void DrasculaEngine::room_26(int fl) { + if (roomParse(room26Actions, fl)) + return; + if (pickedObject == kVerbOpen && fl == 107 && flags[30] == 0) openDoor(2, 0); else if (pickedObject == kVerbOpen && fl == 107 && flags[30] == 1) @@ -613,22 +595,6 @@ void DrasculaEngine::room_26(int fl) { gotoObject(153, 180); } else if (pickedObject == kVerbTalk && fl == 51) animation_1_4(); - else if (pickedObject == kVerbOpen && fl == 167) - talk(467); - else if (pickedObject == kVerbLook && fl == 164) - talk(470); - else if (pickedObject == kVerbOpen && fl == 164) - talk(471); - else if (pickedObject == kVerbLook && fl == 163) - talk(472); - else if (pickedObject == kVerbPick && fl == 163) - talk(473); - else if (pickedObject == kVerbLook && fl == 165) - talk(474); - else if (pickedObject == kVerbLook && fl == 168) - talk(476); - else if (pickedObject == kVerbPick && fl == 168) - talk(477); else hasAnswer = 0; } @@ -655,20 +621,13 @@ void DrasculaEngine::room_27(int fl) { } void DrasculaEngine::room_29(int fl) { + if (roomParse(room29Actions, fl)) + return; + if (pickedObject == kVerbOpen && fl == 114) openDoor(4, 1); else if (pickedObject == kVerbClose && fl == 114) closeDoor(4, 1); - else if (pickedObject == kVerbLook && fl == 152) - talk(463); - else if (pickedObject == kVerbOpen && fl == 152) - talk(464); - else if (pickedObject == kVerbLook && fl == 153) - talk(465); - else if (pickedObject == kVerbPick && fl == 154) - talk(466); - else if (pickedObject == kVerbOpen && fl == 156) - talk(467); else hasAnswer = 0; } diff --git a/engines/drascula/staticdata.h b/engines/drascula/staticdata.h index acd9e308c6..03fe4c6f61 100644 --- a/engines/drascula/staticdata.h +++ b/engines/drascula/staticdata.h @@ -290,6 +290,56 @@ RoomTalkAction room14Actions[] = { { -1, kVerbLook, 204, 171 } }; +RoomTalkAction room15Actions[] = { + // num action object speech + { -1, kVerbTalk, 188, 333 }, + { -1, kVerbLook, 188, 334 }, + // ---------------------------------- + { -1, kVerbLook, 205, 172 }, + // ---------------------------------- + { -1, kVerbLook, 206, 173 }, + { -1, kVerbMove, 206, 174 }, + { -1, kVerbOpen, 206, 174 } +}; + +RoomTalkAction room16Actions[] = { + // num action object speech + { -1, kVerbTalk, 163, 6 }, + { -1, kVerbLook, 183, 340 }, + { -1, kVerbLook, 185, 37 }, + { -1, kVerbPick, 185, 7 }, + { -1, kVerbMove, 185, 7 }, + { -1, kVerbTalk, 185, 38 }, + { -1, kVerbTalk, 187, 345 } +}; + +RoomTalkAction room18Actions[] = { + // num action object speech + { -1, kVerbLook, 181, 348 }, + { -1, kVerbLook, 182, 154 } +}; + +RoomTalkAction room26Actions[] = { + // num action object speech + { -1, kVerbOpen, 167, 467 }, + { -1, kVerbLook, 164, 470 }, + { -1, kVerbOpen, 164, 471 }, + { -1, kVerbLook, 163, 472 }, + { -1, kVerbPick, 163, 473 }, + { -1, kVerbLook, 165, 474 }, + { -1, kVerbLook, 168, 476 }, + { -1, kVerbPick, 168, 477 } +}; + +RoomTalkAction room29Actions[] = { + // num action object speech + { -1, kVerbLook, 152, 463 }, + { -1, kVerbOpen, 152, 464 }, + { -1, kVerbLook, 153, 465 }, + { -1, kVerbPick, 154, 466 }, + { -1, kVerbOpen, 156, 467 } +}; + const char *_text[][501] = { { // 0 |