aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/drascula/animation.cpp39
-rw-r--r--engines/drascula/converse.cpp121
-rw-r--r--engines/drascula/drascula.h2
-rw-r--r--engines/drascula/rooms.cpp46
4 files changed, 113 insertions, 95 deletions
diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index af94ed79c6..79aadf3a7a 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -1100,22 +1100,29 @@ void DrasculaEngine::animation_27_2() {
void DrasculaEngine::animation_29_2() {
if (flags[33] == 0) {
- talk_vonBraun(32, kVonBraunNormal);
- talk(398);
- talk_vonBraun(33, kVonBraunNormal);
- talk(399);
- talk_vonBraun(34, kVonBraunNormal);
- talk_vonBraun(35, kVonBraunNormal);
- talk(400);
- talk_vonBraun(36, kVonBraunNormal);
- talk_vonBraun(37, kVonBraunNormal);
- talk(386);
- talk_vonBraun(38, kVonBraunNormal);
- talk_vonBraun(39, kVonBraunNormal);
- talk(401);
- talk_vonBraun(40, kVonBraunNormal);
- talk_vonBraun(41, kVonBraunNormal);
- flags[33] = 1;
+ // TODO: eventually move this to drascula.dat, along with any other
+ // sequences
+ TalkSequenceCommand anim29_2Seq[] = {
+ // Chapter, sequence, command type, action
+ { -1, -1, kTalkerVBNormal, 32 },
+ { -1, -1, kTalkerGeneral, 398 },
+ { -1, -1, kTalkerVBNormal, 33 },
+ { -1, -1, kTalkerGeneral, 399 },
+ { -1, -1, kTalkerVBNormal, 34 },
+ { -1, -1, kTalkerVBNormal, 35 },
+ { -1, -1, kTalkerGeneral, 400 },
+ { -1, -1, kTalkerVBNormal, 36 },
+ { -1, -1, kTalkerVBNormal, 37 },
+ { -1, -1, kTalkerGeneral, 386 },
+ { -1, -1, kTalkerVBNormal, 38 },
+ { -1, -1, kTalkerVBNormal, 39 },
+ { -1, -1, kTalkerGeneral, 401 },
+ { -1, -1, kTalkerVBNormal, 40 },
+ { -1, -1, kTalkerVBNormal, 41 },
+ { -1, -1, kSetFlag, 1 }
+ };
+
+ playTalkSequence(anim29_2Seq, ARRAYSIZE(anim29_2Seq));
} else
talk_vonBraun(43, kVonBraunNormal);
diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp
index dee5868142..14a0c90fd6 100644
--- a/engines/drascula/converse.cpp
+++ b/engines/drascula/converse.cpp
@@ -35,68 +35,75 @@ void DrasculaEngine::checkTalkSequence(int sequence) {
_talkSequences[i].sequence == sequence) {
seen = true;
- // do action
- switch (_talkSequences[i].commandType) {
- case kPause:
- pause(_talkSequences[i].action);
- break;
- case kSetFlag:
- flags[_talkSequences[i].action] = 1;
- break;
- case kClearFlag:
- flags[_talkSequences[i].action] = 0;
- break;
- case kPickObject:
- pickObject(_talkSequences[i].action);
- break;
- case kAddObject:
- addObject(_talkSequences[i].action);
- break;
- case kBreakOut:
- breakOut = 1;
- break;
- case kTalkerGeneral:
- talk(_talkSequences[i].action);
- break;
- case kTalkerDrunk:
- talk_drunk(_talkSequences[i].action);
- break;
- case kTalkerPianist:
- talk_pianist(_talkSequences[i].action);
- break;
- case kTalkerBJ:
- talk_bj(_talkSequences[i].action);
- break;
- case kTalkerVBNormal:
- talk_vonBraun(_talkSequences[i].action, kVonBraunNormal);
- break;
- case kTalkerVBDoor:
- talk_vonBraun(_talkSequences[i].action, kVonBraunDoor);
- break;
- case kTalkerIgorSeated:
- talk_igor(_talkSequences[i].action, kIgorSeated);
- break;
- case kTalkerWerewolf:
- talk_werewolf(_talkSequences[i].action);
- break;
- case kTalkerMus:
- talk_mus(_talkSequences[i].action);
- break;
- case kTalkerDrascula:
- talk_drascula(_talkSequences[i].action, 1);
- break;
- case kTalkerBartender:
- talk_bartender(_talkSequences[i].action, 1);
- break;
- default:
- error("checkTalkSequence: Unknown command");
- }
-
+ doTalkSequenceCommand(_talkSequences[i]);
} else if (seen) // Stop searching down the list
break;
}
}
+void DrasculaEngine::playTalkSequence(TalkSequenceCommand *seq, int size) {
+ for (int i = 0; i < size; i++)
+ doTalkSequenceCommand(seq[i]);
+}
+
+void DrasculaEngine::doTalkSequenceCommand(TalkSequenceCommand cmd) {
+ switch (cmd.commandType) {
+ case kPause:
+ pause(cmd.action);
+ break;
+ case kSetFlag:
+ flags[cmd.action] = 1;
+ break;
+ case kClearFlag:
+ flags[cmd.action] = 0;
+ break;
+ case kPickObject:
+ pickObject(cmd.action);
+ break;
+ case kAddObject:
+ addObject(cmd.action);
+ break;
+ case kBreakOut:
+ breakOut = 1;
+ break;
+ case kTalkerGeneral:
+ talk(cmd.action);
+ break;
+ case kTalkerDrunk:
+ talk_drunk(cmd.action);
+ break;
+ case kTalkerPianist:
+ talk_pianist(cmd.action);
+ break;
+ case kTalkerBJ:
+ talk_bj(cmd.action);
+ break;
+ case kTalkerVBNormal:
+ talk_vonBraun(cmd.action, kVonBraunNormal);
+ break;
+ case kTalkerVBDoor:
+ talk_vonBraun(cmd.action, kVonBraunDoor);
+ break;
+ case kTalkerIgorSeated:
+ talk_igor(cmd.action, kIgorSeated);
+ break;
+ case kTalkerWerewolf:
+ talk_werewolf(cmd.action);
+ break;
+ case kTalkerMus:
+ talk_mus(cmd.action);
+ break;
+ case kTalkerDrascula:
+ talk_drascula(cmd.action, 1);
+ break;
+ case kTalkerBartender:
+ talk_bartender(cmd.action, 1);
+ break;
+ default:
+ error("doTalkSequenceCommand: Unknown command");
+ }
+}
+
void DrasculaEngine::cleanupString(char *string) {
uint len = strlen(string);
for (uint h = 0; h < len; h++)
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 0c52656786..dffa323068 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -543,6 +543,8 @@ public:
bool roomParse(int, int);
void cleanupString(char *string);
void checkTalkSequence(int sequence);
+ void doTalkSequenceCommand(TalkSequenceCommand cmd);
+ void playTalkSequence(TalkSequenceCommand *seq, int size);
void converse(int);
void print_abc_opc(const char *, int, int);
void response(int);
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index fe1e65120e..a35b8b9f66 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -1524,13 +1524,7 @@ bool DrasculaEngine::checkAction(int fl) {
talk(495);
} else
hasAnswer = 0;
- } else if (currentChapter == 5) {
- if (pickedObject == kVerbLook && fl == 9) {
- talk(482);
- talk(483);
- } else
- hasAnswer = 0;
- } else if (currentChapter == 6) {
+ } else if (currentChapter == 5 || currentChapter == 6) {
if (pickedObject == kVerbLook && fl == 9) {
talk(482);
talk(483);
@@ -1854,21 +1848,29 @@ void DrasculaEngine::enterRoom(int roomIndex) {
flags[7] = 1;
updateRoom();
updateScreen();
- talk(228);
- talk_werewolf(1);
- talk_werewolf(2);
- pause(23);
- talk(229);
- talk_werewolf(3);
- talk_werewolf(4);
- talk(230);
- talk_werewolf(5);
- talk(231);
- talk_werewolf(6);
- talk_werewolf(7);
- pause(33);
- talk(232);
- talk_werewolf(8);
+
+ // TODO: eventually move this to drascula.dat, along with any other
+ // sequences
+ TalkSequenceCommand room45Seq[] = {
+ // Chapter, sequence, command type, action
+ { -1, -1, kTalkerGeneral, 228 },
+ { -1, -1, kTalkerWerewolf, 1 },
+ { -1, -1, kTalkerWerewolf, 2 },
+ { -1, -1, kPause, 23 },
+ { -1, -1, kTalkerGeneral, 229 },
+ { -1, -1, kTalkerWerewolf, 3 },
+ { -1, -1, kTalkerWerewolf, 4 },
+ { -1, -1, kTalkerGeneral, 230 },
+ { -1, -1, kTalkerWerewolf, 5 },
+ { -1, -1, kTalkerGeneral, 231 },
+ { -1, -1, kTalkerWerewolf, 6 },
+ { -1, -1, kTalkerWerewolf, 7 },
+ { -1, -1, kPause, 33 },
+ { -1, -1, kTalkerGeneral, 232 },
+ { -1, -1, kTalkerWerewolf, 8 },
+ };
+
+ playTalkSequence(room45Seq, ARRAYSIZE(room45Seq));
}
}