ASYLUM: Use the actor constants in more places

This commit is contained in:
Cameron Cawley 2024-06-11 15:15:14 +01:00 committed by Alexander Panov
parent 7517aa58b9
commit 3e4640a7ed
4 changed files with 46 additions and 43 deletions

View File

@ -2246,7 +2246,7 @@ void Actor::updateStatusEnabledProcessStatus(int16 testX, int16 testY, uint32 co
void Actor::updateStatusBored() {
if (_index == getSharedData()->getPlayerIndex()
&& getWorld()->chapter != kChapter9
&& getWorld()->actorType == 0
&& getWorld()->actorType == kActorMax
&& _frameIndex == 0
&& checkBoredStatus()) {
if (!getSpeech()->getSoundResourceId() || !getSound()->isPlaying(getSpeech()->getSoundResourceId()))

View File

@ -63,7 +63,7 @@ WorldStats::WorldStats(AsylumEngine *engine) : _vm(engine) {
memset(&graphicResourceIds, kResourceNone, sizeof(graphicResourceIds));
sceneTitleGraphicResourceId = kResourceNone;
sceneTitlePaletteResourceId = kResourceNone;
actorType = 0;
actorType = kActorMax;
memset(&soundResourceIds, kResourceNone, sizeof(soundResourceIds));
numAmbientSounds = 0;

View File

@ -51,7 +51,10 @@ const int moviesCd[49] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
const int chapterIndexes[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 4, 4, 8, 9, 0, 0};
/** Default Actor Indices by Scene */
const int actorType[16] = {0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 1, 1, 3, 0, 0, 0};
const ActorIndexes actorType[16] = {kActorMax, kActorMax, kActorMax, kActorMax,
kActorSarah, kActorMax, kActorCyclops, kActorMax,
kActorAztec, kActorMax, kActorSarah, kActorSarah,
kActorAztec, kActorMax, kActorMax, kActorMax};
/** Speech indexes */
const uint speechIndex[20] = {17, 22, 27, 37, 45, 12, 16, 19, 25, 29, 14, 18, 23, 29, 35, 6, 9, 13, 19, 27};

View File

@ -1878,13 +1878,13 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = GET_INDEX();
break;
case 1:
case 2:
case 3:
case kActorSarah:
case kActorCyclops:
case kActorAztec:
index = 1;
break;
}
@ -1895,13 +1895,13 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 3 - GET_INDEX();
break;
case 1:
case 2:
case 3:
case kActorSarah:
case kActorCyclops:
case kActorAztec:
index = 2;
break;
}
@ -1912,13 +1912,13 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 2;
break;
case 1:
case 2:
case 3:
case kActorSarah:
case kActorCyclops:
case kActorAztec:
index = 4;
break;
}
@ -1929,13 +1929,13 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 5;
break;
case 1:
case 2:
case 3:
case kActorSarah:
case kActorCyclops:
case kActorAztec:
index = 3;
break;
}
@ -1946,13 +1946,13 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 6;
break;
case 1:
case 2:
case 3:
case kActorSarah:
case kActorCyclops:
case kActorAztec:
index = 4;
break;
}
@ -1963,12 +1963,12 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 7;
break;
case 1:
case 2:
case kActorSarah:
case kActorCyclops:
index = 5;
break;
}
@ -1979,12 +1979,12 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 8;
break;
case 1:
case 2:
case kActorSarah:
case kActorCyclops:
index = 6;
break;
}
@ -1995,12 +1995,12 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 9;
break;
case 1:
case 2:
case kActorSarah:
case kActorCyclops:
index = 7;
break;
}
@ -2011,12 +2011,12 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 10;
break;
case 1:
case 2:
case kActorSarah:
case kActorCyclops:
index = 8;
break;
}
@ -2027,12 +2027,12 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 11;
break;
case 1:
case 2:
case kActorSarah:
case kActorCyclops:
index = 9;
break;
}
@ -2043,12 +2043,12 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 13 - GET_INDEX();
break;
case 1:
case 2:
case kActorSarah:
case kActorCyclops:
index = 10;
break;
}
@ -2059,11 +2059,11 @@ bool Scene::speak(Common::KeyCode code) {
default:
break;
case 0:
case kActorMax:
index = 15 - GET_INDEX();
break;
case 2:
case kActorCyclops:
index = 12 - GET_INDEX();
break;
}