aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/bladerunner/bladerunner.cpp16
-rw-r--r--engines/bladerunner/bladerunner.h4
-rw-r--r--engines/bladerunner/chapters.cpp13
-rw-r--r--engines/bladerunner/game_constants.h164
-rw-r--r--engines/bladerunner/items.cpp3
-rw-r--r--engines/bladerunner/script/ai/leon.cpp162
-rw-r--r--engines/bladerunner/script/ai/maggie.cpp353
-rw-r--r--engines/bladerunner/script/ai/mccoy.cpp1004
-rw-r--r--engines/bladerunner/script/ai/officer_leary.cpp642
-rw-r--r--engines/bladerunner/script/ai/runciter.cpp377
-rw-r--r--engines/bladerunner/script/ai_script.h34
-rw-r--r--engines/bladerunner/script/scene/ar02.cpp8
-rw-r--r--engines/bladerunner/script/scene/bb03.cpp2
-rw-r--r--engines/bladerunner/script/scene/bb11.cpp2
-rw-r--r--engines/bladerunner/script/scene/ct01.cpp4
-rw-r--r--engines/bladerunner/script/scene/ct04.cpp4
-rw-r--r--engines/bladerunner/script/scene/ct06.cpp4
-rw-r--r--engines/bladerunner/script/scene/ct09.cpp4
-rw-r--r--engines/bladerunner/script/scene/ct11.cpp4
-rw-r--r--engines/bladerunner/script/scene/ct12.cpp18
-rw-r--r--engines/bladerunner/script/scene/dr01.cpp4
-rw-r--r--engines/bladerunner/script/scene/dr02.cpp2
-rw-r--r--engines/bladerunner/script/scene/dr03.cpp2
-rw-r--r--engines/bladerunner/script/scene/dr06.cpp2
-rw-r--r--engines/bladerunner/script/scene/hc03.cpp6
-rw-r--r--engines/bladerunner/script/scene/hf01.cpp4
-rw-r--r--engines/bladerunner/script/scene/hf05.cpp10
-rw-r--r--engines/bladerunner/script/scene/hf06.cpp4
-rw-r--r--engines/bladerunner/script/scene/ma01.cpp72
-rw-r--r--engines/bladerunner/script/scene/ma02.cpp65
-rw-r--r--engines/bladerunner/script/scene/ma04.cpp181
-rw-r--r--engines/bladerunner/script/scene/ma05.cpp40
-rw-r--r--engines/bladerunner/script/scene/ma06.cpp27
-rw-r--r--engines/bladerunner/script/scene/ma07.cpp8
-rw-r--r--engines/bladerunner/script/scene/nr01.cpp4
-rw-r--r--engines/bladerunner/script/scene/nr07.cpp2
-rw-r--r--engines/bladerunner/script/scene/ps01.cpp2
-rw-r--r--engines/bladerunner/script/scene/ps02.cpp2
-rw-r--r--engines/bladerunner/script/scene/ps03.cpp4
-rw-r--r--engines/bladerunner/script/scene/ps04.cpp18
-rw-r--r--engines/bladerunner/script/scene/ps05.cpp18
-rw-r--r--engines/bladerunner/script/scene/ps07.cpp2
-rw-r--r--engines/bladerunner/script/scene/ps14.cpp4
-rw-r--r--engines/bladerunner/script/scene/ps15.cpp2
-rw-r--r--engines/bladerunner/script/scene/rc01.cpp147
-rw-r--r--engines/bladerunner/script/scene/rc02.cpp35
-rw-r--r--engines/bladerunner/script/scene/rc03.cpp24
-rw-r--r--engines/bladerunner/script/scene/rc04.cpp6
-rw-r--r--engines/bladerunner/script/scene/rc51.cpp57
-rw-r--r--engines/bladerunner/script/scene/tb02.cpp16
-rw-r--r--engines/bladerunner/script/scene/tb03.cpp4
-rw-r--r--engines/bladerunner/script/scene/tb07.cpp6
-rw-r--r--engines/bladerunner/script/scene/ug02.cpp4
-rw-r--r--engines/bladerunner/script/scene/ug03.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug04.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug06.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug07.cpp6
-rw-r--r--engines/bladerunner/script/scene/ug09.cpp4
-rw-r--r--engines/bladerunner/script/scene/ug10.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug13.cpp6
-rw-r--r--engines/bladerunner/script/scene/ug14.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug17.cpp2
-rw-r--r--engines/bladerunner/script/scene/ug18.cpp4
-rw-r--r--engines/bladerunner/script/scene_script.h25
-rw-r--r--engines/bladerunner/script/script.cpp12
-rw-r--r--engines/bladerunner/script/script.h4
-rw-r--r--engines/bladerunner/ui/elevator.cpp8
-rw-r--r--engines/bladerunner/ui/kia.cpp2
68 files changed, 1974 insertions, 1715 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 8435e751fa..5f565d972c 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -109,25 +109,25 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des
switch (desc->language) {
case Common::EN_ANY:
- this->_languageCode = "E";
+ _languageCode = "E";
break;
case Common::DE_DEU:
- this->_languageCode = "G";
+ _languageCode = "G";
break;
case Common::FR_FRA:
- this->_languageCode = "F";
+ _languageCode = "F";
break;
case Common::IT_ITA:
- this->_languageCode = "I";
+ _languageCode = "I";
break;
case Common::RU_RUS:
- this->_languageCode = "R";
+ _languageCode = "R";
break;
case Common::ES_ESP:
- this->_languageCode = "S";
+ _languageCode = "S";
break;
default:
- this->_languageCode = "E";
+ _languageCode = "E";
}
_screenEffects = nullptr;
@@ -996,7 +996,7 @@ void BladeRunnerEngine::actorsUpdate() {
int setId = _scene->getSetId();
//TODO: original game updates every non-visible characters by updating only one character in one frame
- if (setId != 89 || _gameVars[1] != 4 || _gameFlags->query(670) != 1 || !_aiScripts->isInsideScript()) {
+ if (setId != kSetUG18 || _gameVars[kVariableChapter] != 4 || !_gameFlags->query(670) || !_aiScripts->isInsideScript()) {
for (int i = 0; i < actorCount; i++) {
Actor *actor = _actors[i];
if (actor->getSetId() == setId) {
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 2257df6319..07e52de345 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -90,7 +90,11 @@ class ZBuffer;
class BladeRunnerEngine : public Engine {
public:
+#if BLADERUNNER_DEBUG_GAME
+ static const int kArchiveCount = 100;
+#else
static const int kArchiveCount = 10;
+#endif
static const int kActorCount = 100;
static const int kActorVoiceOver = kActorCount - 1;
diff --git a/engines/bladerunner/chapters.cpp b/engines/bladerunner/chapters.cpp
index a573ffffa3..e7404c3c97 100644
--- a/engines/bladerunner/chapters.cpp
+++ b/engines/bladerunner/chapters.cpp
@@ -41,6 +41,19 @@ bool Chapters::enterChapter(int chapter) {
if (!_vm->openArchive(Common::String::format("OUTTAKE%d.MIX", id)))
return false;
+#if BLADERUNNER_DEBUG_GAME
+ _vm->openArchive("OUTTAKE1.MIX");
+ _vm->openArchive("OUTTAKE2.MIX");
+ _vm->openArchive("OUTTAKE3.MIX");
+ _vm->openArchive("OUTTAKE4.MIX");
+ _vm->openArchive("VQA1.MIX");
+ _vm->openArchive("VQA2.MIX");
+ _vm->openArchive("VQA3.MIX");
+ _vm->openArchive("1.TLK");
+ _vm->openArchive("2.TLK");
+ _vm->openArchive("3.TLK");
+#endif
+
_chapter = chapter;
_hasOpenResources = true;
return true;
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index c74adf0b1e..30b28de714 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -441,6 +441,7 @@ enum SpinnerDestinations {
enum Flags {
kFlagRC02Discovered = 1,
kFlagGotOfficersStatement = 3,
+ kFlagRC02FirstLeave = 4,
kFlagRC01toRC02 = 8,
kFlagRC02toRC01 = 9,
kFlagIntroPlayed = 24,
@@ -450,6 +451,8 @@ enum Flags {
kFlagMA04ToMA02 = 36,
kFlagMA01toMA06 = 37,
kFlagMA06toMA01 = 38,
+ kFlagZubenRetired = 40,
+ kFlagZubenSpared = 41,
kFlagIzoIsReplicant = 44,
kFlagGordoIsReplicant = 45,
kFlagLucyIsReplicant = 46,
@@ -457,10 +460,18 @@ enum Flags {
kFlagSadikIsReplicant = 48,
kFlagMA07toMA06 = 57,
kFlagMA06toMA07 = 58,
+ kFlagChapter1Ended = 61,
kFlagMA04toMA05 = 62,
kFlagMA05toMA04 = 63,
kFlagRC03toRC01 = 114,
kFlagRC01toRC03 = 115,
+ kFlagRC02LucyDeskAvailable = 141,
+ kFlagChapter1Ending = 146,
+ kFlagChopstickWrapperTaken = 147,
+ kFlagCandyTaken = 148,
+ kFlagDogTaken = 149,
+ kFlagGuzzaTalkZubenRetired = 159,
+ kFlagGuzzaTalkZubenEscaped = 160,
kFlagChromeDebrisTaken = 163,
kFlagRC01PoliceDone = 186,
kFlagShellCasingsTaken = 190,
@@ -477,13 +488,25 @@ enum Flags {
kFlagDirectorsCut = 378,
KFlagMcCoyAndOfficerLearyTalking = 392,
KFlagMcCoyAndOfficerLearyArtMetaphor = 397,
+ kFlagMaggieIsHurt = 461,
kFlagKIAPrivacyAddon = 487,
- kFlagKIAPrivacyAddonIntro = 599
+ kFlagKIAPrivacyAddonIntro = 599,
+ kFlagMcCoySleeping = 647,
+ kFlagPhoneMessageFromClovis = 649,
+ kFlagPhoneMessageFromLucy = 650,
+ kFlagChapter2Intro = 678,
+ kFlagRC51Discovered = 709,
+ kFlagMA04WatchedTV = 711,
+ kFlagZubenBountyPaid = 723
};
enum Variables {
+ kVariableChapter = 1,
+ kVariableChinyen = 2,
kVariableWalkLoopActor = 37,
- kVariableWalkLoopRun = 38
+ kVariableWalkLoopRun = 38,
+ kVariableAffectionTowards = 45, // 0 none, 1 steele, 2 dektora, 3 lucy
+ kVariableNextTvNews = 52
};
enum Outtakes {
@@ -547,7 +570,7 @@ enum SceneLoopMode {
kSceneLoopModeSpinner = 3
};
-enum kScenes {
+enum Scenes {
kSceneAR01 = 0,
kSceneAR02 = 1,
kSceneBB01 = 2,
@@ -596,12 +619,12 @@ enum kScenes {
kSceneKP05 = 45,
kSceneKP06 = 46,
kSceneKP07 = 47,
- kSceneMA01 = 48,
- kSceneMA02 = 49,
- kSceneMA04 = 50,
- kSceneMA05 = 51,
- kSceneMA06 = 52,
- kSceneMA07 = 53,
+ kSceneMA01 = 48, // McCoy's Apartment - Roof
+ kSceneMA02 = 49, // McCoy's Apartment - Living room
+ kSceneMA04 = 50, // McCoy's Apartment - Sleeping room
+ kSceneMA05 = 51, // McCoy's Apartment - Balcony
+ kSceneMA06 = 52, // McCoy's Apartment - Elevator
+ kSceneMA07 = 53, // McCoy's Apartment - Ground floor
kSceneNR01 = 54,
kSceneNR02 = 55,
kSceneNR03 = 56,
@@ -613,10 +636,10 @@ enum kScenes {
kSceneNR09 = 62,
kSceneNR10 = 63,
kSceneNR11 = 64,
- kScenePS01 = 65,
- kScenePS02 = 66,
+ kScenePS01 = 65, // Police Station - Roof
+ kScenePS02 = 66, // Police Station - Elevator
kScenePS03 = 67,
- kScenePS04 = 68,
+ kScenePS04 = 68, // Police Station - Guzza's Office
kScenePS05 = 69,
kScenePS06 = 70,
kScenePS07 = 71,
@@ -626,8 +649,8 @@ enum kScenes {
kScenePS12 = 75,
kScenePS13 = 76,
kScenePS14 = 77,
- kSceneRC01 = 78,
- kSceneRC02 = 79,
+ kSceneRC01 = 78, // Runciter - Outside
+ kSceneRC02 = 79, // Runciter - Inside
kSceneRC03 = 80,
kSceneRC04 = 81,
kSceneTB02 = 82,
@@ -655,23 +678,132 @@ enum kScenes {
kSceneBB51 = 104,
kSceneCT51 = 105,
kSceneHC04 = 106,
- kSceneRC51 = 107,
+ kSceneRC51 = 107, // Runciter - Lucy's desk
kSceneTB07 = 108,
kScenePS15 = 119,
kSceneBB12 = 120
};
enum Sets {
- kSetRunciterInterior = 16
+ kSetAR01_AR02 = 0,
+ kSetBB02_BB04_BB06_BB51 = 1,
+ kSetBB06_BB07 = 2, //BB06
+ kSetBB07 = 3,
+ kSetCT01_CT12 = 4,
+ kSetCT03_CT04 = 5,
+ kSetCT08_CT51_UG12 = 6, //UG12
+ kSetDR01_DR02_DR04 = 7,
+ kSetHC01_HC02_HC03_HC04 = 8,
+ kSetKP05_KP06 = 9,
+ kSetMA02_MA04 = 10, //MA04
+ kSetNR02 = 11,
+ kSetNR04 = 12,
+ kSetNR05_NR08 = 13,
+ kSetPS10_PS11_PS12_PS13 = 14,
+ kSetPS05 = 15,
+ kSetRC02_RC51 = 16,
+ kSetTB02_TB03 = 17,
+ kSetTB07 = 18,
+ kSetUG16 = 19,
+ kSetBB01 = 20,
+ kSetBB03 = 21,
+ kSetBB05 = 22,
+ kSetBB08 = 23,
+ kSetBB09 = 24,
+ kSetBB10 = 25,
+ kSetBB11 = 26,
+ kSetCT02 = 27,
+ kSetCT05 = 28,
+ kSetCT06 = 29,
+ kSetCT09 = 31,
+ kSetCT10 = 32,
+ kSetCT11 = 33,
+ kSetDR03 = 34,
+ kSetDR05 = 35,
+ kSetDR06 = 36,
+ kSetHF01 = 37,
+ kSetHF02 = 38,
+ kSetHF03 = 39,
+ kSetHF04 = 40,
+ kSetHF05 = 41,
+ kSetHF06 = 42,
+ kSetHF07 = 43,
+ kSetKP01 = 44,
+ kSetKP02 = 45,
+ kSetKP03 = 46,
+ kSetKP04 = 47,
+ kSetKP07 = 48,
+ kSetMA01 = 49,
+ kSetMA04 = 50,
+ kSetMA05 = 51,
+ kSetMA06 = 52,
+ kSetMA07 = 53,
+ kSetNR01 = 54,
+ kSetNR03 = 55,
+ kSetNR06 = 56,
+ kSetNR07 = 57,
+ kSetNR09 = 58,
+ kSetNR10 = 59,
+ kSetNR11 = 60,
+ kSetPS01 = 61,
+ kSetPS02 = 62,
+ kSetPS03 = 63,
+ kSetPS04 = 64,
+ kSetPS06 = 65,
+ kSetPS07 = 66,
+ kSetPS09 = 67,
+ kSetPS14 = 68,
+ kSetRC01 = 69,
+ kSetRC03 = 70,
+ kSetRC04 = 71,
+ kSetTB05 = 72,
+ kSetTB06 = 73,
+ kSetUG01 = 74,
+ kSetUG02 = 75,
+ kSetUG03 = 76,
+ kSetUG04 = 77,
+ kSetUG05 = 78,
+ kSetUG06 = 79,
+ kSetUG07 = 80,
+ kSetUG08 = 81,
+ kSetUG09 = 82,
+ kSetUG10 = 83,
+ kSetUG12 = 84,
+ kSetUG13 = 85,
+ kSetUG14 = 86,
+ kSetUG15 = 87,
+ kSetUG17 = 88,
+ kSetUG18 = 89,
+ kSetUG19 = 90,
+ kSetFreeSlotA = 91,
+ kSetFreeSlotB = 92,
+ kSetFreeSlotC = 93,
+ kSetFreeSlotD = 94,
+ kSetFreeSlotE = 95,
+ kSetFreeSlotF = 96,
+ kSetFreeSlotG = 97,
+ kSetFreeSlotH = 98,
+ kSetFreeSlotI = 99,
+ kSetFreeSlotJ = 100,
+ kSetPS15 = 101,
+ kSetBB12 = 102
};
enum GameItems {
kItemChromeDebris = 66,
+ kItemCandy = 79,
+ kItemChopstickWrapper = 82,
+ kItemToyDog = 98,
kItemShellCasingA = 100,
kItemShellCasingB = 101,
kItemShellCasingC = 102
};
+enum Elevators {
+ kElevatorMA = 1,
+ kElevatorPS = 2
+};
+
} // End of namespace BladeRunner
#endif
diff --git a/engines/bladerunner/items.cpp b/engines/bladerunner/items.cpp
index a5298ca8de..e85366e3f6 100644
--- a/engines/bladerunner/items.cpp
+++ b/engines/bladerunner/items.cpp
@@ -22,6 +22,7 @@
#include "bladerunner/items.h"
+#include "bladerunner/game_constants.h"
#include "bladerunner/scene.h"
#include "bladerunner/scene_objects.h"
#include "bladerunner/zbuffer.h"
@@ -58,7 +59,7 @@ void Items::tick() {
if (_items[i]->_setId != setId) {
continue;
}
- bool set14NotTarget = setId == 14 && !_items[i]->isTargetable();
+ bool set14NotTarget = setId == kSetPS10_PS11_PS12_PS13 && !_items[i]->isTargetable();
Common::Rect screenRect;
if (_items[i]->tick(&screenRect, set14NotTarget)) {
_vm->_zbuffer->mark(screenRect);
diff --git a/engines/bladerunner/script/ai/leon.cpp b/engines/bladerunner/script/ai/leon.cpp
index f1f619f382..9d82464708 100644
--- a/engines/bladerunner/script/ai/leon.cpp
+++ b/engines/bladerunner/script/ai/leon.cpp
@@ -29,10 +29,10 @@ void AIScriptLeon::Initialize() {
var_45EDA4_y = 0.0f;
var_45EDA8_x = 0.0f;
var_45EDAC = 0;
- var_462AF0 = 0;
- var_462AF4 = 0;
- var_45EDB4_animation_frame = 0;
- var_45EDB0_animation_state = 0;
+ _animationStateNext = 0;
+ _animationNext = 0;
+ _animationFrame = 0;
+ _animationState = 0;
}
bool AIScriptLeon::Update() {
@@ -237,27 +237,27 @@ bool AIScriptLeon::GoalChanged(int currentGoalNumber, int newGoalNumber) {
bool AIScriptLeon::UpdateAnimation(int *animation, int *frame) {
- switch (var_45EDB0_animation_state) {
+ switch (_animationState) {
case 10:
*animation = 856;
- if (var_45EDB4_animation_frame++ == 7) {
+ if (_animationFrame++ == 7) {
Actor_Change_Animation_Mode(kActorMcCoy, 48);
Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
}
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
*animation = 847;
- var_45EDB4_animation_frame = 0;
+ _animationFrame = 0;
Actor_Change_Animation_Mode(kActorLeon, 0);
}
break;
case 9:
*animation = 849;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(849) - 1) {
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(849) - 1) {
Actor_Change_Animation_Mode(kActorLeon, 0);
*animation = 847;
- var_45EDB4_animation_frame = 0;
- var_45EDB0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
if (Actor_Query_Goal_Number(kActorLeon) == 2) {
Actor_Set_Goal_Number(kActorLeon, 3);
}
@@ -265,94 +265,94 @@ bool AIScriptLeon::UpdateAnimation(int *animation, int *frame) {
break;
case 8:
*animation = 854;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(854) - 1) {
- var_45EDB4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(854) - 1) {
+ _animationFrame = 0;
}
break;
case 7:
*animation = 855;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(855) - 1) {
- var_45EDB4_animation_frame = 0;
- var_45EDB0_animation_state = 6;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(855) - 1) {
+ _animationFrame = 0;
+ _animationState = 6;
*animation = 854;
}
break;
case 6:
- if (var_45EDB4_animation_frame == 0 && var_45EDAC != 0) {
+ if (_animationFrame == 0 && var_45EDAC != 0) {
Actor_Change_Animation_Mode(kActorLeon, 72);
*animation = 848;
} else {
*animation = 854;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(854) - 1) {
- var_45EDB4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(854) - 1) {
+ _animationFrame = 0;
}
}
break;
case 5:
*animation = 853;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(853) - 1) {
- var_45EDB4_animation_frame = 0;
- var_45EDB0_animation_state = 2;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(853) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
*animation = 850;
}
break;
case 4:
*animation = 852;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(852) - 1) {
- var_45EDB4_animation_frame = 0;
- var_45EDB0_animation_state = 2;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(852) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
*animation = 850;
}
break;
case 3:
*animation = 851;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(851) - 1) {
- var_45EDB4_animation_frame = 0;
- var_45EDB0_animation_state = 2;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(851) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
*animation = 850;
}
break;
case 2:
- if (!var_45EDB4_animation_frame && var_45EDAC) {
+ if (!_animationFrame && var_45EDAC) {
*animation = 847;
- var_45EDB0_animation_state = 0;
+ _animationState = 0;
} else {
*animation = 850;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(850) - 1) {
- var_45EDB4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(850) - 1) {
+ _animationFrame = 0;
}
}
break;
case 1:
*animation = 846;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(846) - 1) {
- var_45EDB4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(846) - 1) {
+ _animationFrame = 0;
}
break;
case 0:
*animation = 847;
- var_45EDB4_animation_frame++;
- if (var_45EDB4_animation_frame > Slice_Animation_Query_Number_Of_Frames(847) - 1) {
- var_45EDB4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(847) - 1) {
+ _animationFrame = 0;
}
break;
}
- *frame = var_45EDB4_animation_frame;
+ *frame = _animationFrame;
return true;
}
bool AIScriptLeon::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
- switch (var_45EDB0_animation_state) {
+ switch (_animationState) {
case 2:
case 3:
case 4:
@@ -365,75 +365,75 @@ bool AIScriptLeon::ChangeAnimationMode(int mode) {
Actor_Change_Animation_Mode(kActorLeon, 72);
break;
default:
- var_45EDB0_animation_state = 0;
- var_45EDB4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
break;
}
break;
case 1:
- var_45EDB0_animation_state = 1;
- var_45EDB4_animation_frame = 0;
+ _animationState = 1;
+ _animationFrame = 0;
break;
case 3:
- var_45EDB0_animation_state = 2;
- var_45EDB4_animation_frame = 0;
+ _animationState = 2;
+ _animationFrame = 0;
var_45EDAC = 0;
break;
case 6:
- var_45EDB0_animation_state = 10;
- var_45EDB4_animation_frame = 0;
+ _animationState = 10;
+ _animationFrame = 0;
break;
case 12:
- var_45EDB0_animation_state = 3;
- var_45EDB4_animation_frame = 0;
+ _animationState = 3;
+ _animationFrame = 0;
var_45EDAC = 0;
break;
case 13:
- var_45EDB0_animation_state = 4;
- var_45EDB4_animation_frame = 0;
+ _animationState = 4;
+ _animationFrame = 0;
var_45EDAC = 0;
break;
case 14:
- var_45EDB0_animation_state = 5;
- var_45EDB4_animation_frame = 0;
+ _animationState = 5;
+ _animationFrame = 0;
var_45EDAC = 0;
break;
case 15:
- var_45EDB0_animation_state = 6;
- var_45EDB4_animation_frame = 0;
+ _animationState = 6;
+ _animationFrame = 0;
var_45EDAC = 0;
break;
case 16:
- var_45EDB0_animation_state = 7;
- var_45EDB4_animation_frame = 0;
+ _animationState = 7;
+ _animationFrame = 0;
var_45EDAC = 0;
break;
case 26:
- var_45EDB0_animation_state = 9;
- var_45EDB4_animation_frame = 0;
+ _animationState = 9;
+ _animationFrame = 0;
break;
case 72:
- if (var_45EDB0_animation_state != 8) {
- var_45EDB0_animation_state = 8;
- var_45EDB4_animation_frame = 0;
+ if (_animationState != 8) {
+ _animationState = 8;
+ _animationFrame = 0;
}
break;
}
return true;
}
-void AIScriptLeon::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
- *animationState = var_45EDB0_animation_state;
- *animationFrame = var_45EDB4_animation_frame;
- *a3 = var_462AF0;
- *a4 = var_462AF4;
+void AIScriptLeon::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
}
-void AIScriptLeon::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
- var_45EDB0_animation_state = animationState;
- var_45EDB4_animation_frame = animationFrame;
- var_462AF0 = a3;
- var_462AF4 = a4;
+void AIScriptLeon::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
}
bool AIScriptLeon::ReachedMovementTrackWaypoint(int waypointId) {
diff --git a/engines/bladerunner/script/ai/maggie.cpp b/engines/bladerunner/script/ai/maggie.cpp
index 50e5013dab..3fd213f1de 100644
--- a/engines/bladerunner/script/ai/maggie.cpp
+++ b/engines/bladerunner/script/ai/maggie.cpp
@@ -25,10 +25,31 @@
namespace BladeRunner {
+enum kMaggieStates {
+ kMaggieStateIdle = 0,
+ kMaggieStateWalking = 1,
+ kMaggieStateJumping = 2,
+ kMaggieStateHappyA = 3,
+ kMaggieStateHappyB = 4,
+ kMaggieStateLayingDown = 5,
+ kMaggieStateLayingIdle = 6,
+ kMaggieStateStandingUp = 7,
+ kMaggieStateGoingToSleep = 8,
+ kMaggieStateSleeping = 9,
+ kMaggieStateWakingUp = 10,
+ kMaggieStateHurtIdle = 11,
+ kMaggieStateHurtWalk = 12,
+ kMaggieStateHurtJumping = 13,
+ kMaggieStateExploding = 14,
+ kMaggieStateDeadExploded = 15,
+ kMaggieStateDead = 16
+};
+
void AIScriptMaggie::Initialize() {
- var_45F3F0_animation_state = 0;
- var_45F3F4_animation_frame = 0;
- var_462B30 = 0;
+ _animationState = kMaggieStateIdle;
+ _animationFrame = 0;
+ _animationStateNext = 0;
+ _animationNext = 0;
var_45F3F8 = 0;
var_45F3FC = 0;
var_45F400 = 0;
@@ -39,8 +60,8 @@ void AIScriptMaggie::Initialize() {
bool AIScriptMaggie::Update() {
int goal = Actor_Query_Goal_Number(kActorMaggie);
- if (Actor_Query_Which_Set_In(kActorMaggie) == 10 && Global_Variable_Query(1) == 4) {
- Actor_Put_In_Set(kActorMaggie, 97);
+ if (Actor_Query_Which_Set_In(kActorMaggie) == kSetMA02_MA04 && Global_Variable_Query(kVariableChapter) == 4) {
+ Actor_Put_In_Set(kActorMaggie, kSetFreeSlotG);
Actor_Set_At_Waypoint(kActorMaggie, 39, 0);
}
if (goal == 414) {
@@ -48,9 +69,9 @@ bool AIScriptMaggie::Update() {
} else if (goal == 413 && Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorMaggie) < 60) {
Actor_Set_Goal_Number(kActorMaggie, 415);
}
- if (Global_Variable_Query(1) == 5) {
+ if (Global_Variable_Query(kVariableChapter) == 5) {
if (Actor_Query_Goal_Number(kActorMaggie) < 400) {
- Actor_Set_Goal_Number(66, 400);
+ Actor_Set_Goal_Number(kActorMaggie, 400);
}
return true;
}
@@ -113,7 +134,7 @@ void AIScriptMaggie::ReceivedClue(int clueId, int fromActorId) {
}
void AIScriptMaggie::ClickedByPlayer() {
- if (!Game_Flag_Query(653) && Global_Variable_Query(1) == 5) {
+ if (!Game_Flag_Query(653) && Global_Variable_Query(kVariableChapter) == 5) {
if (Actor_Query_Goal_Number(kActorMaggie) == 413) {
Actor_Set_Targetable(kActorMaggie, true);
AI_Movement_Track_Flush(kActorMaggie);
@@ -122,7 +143,7 @@ void AIScriptMaggie::ClickedByPlayer() {
}
return; // true
}
- if (var_45F3F0_animation_state == 1 || var_45F3F0_animation_state == 12 || var_45F3F0_animation_state == 16) {
+ if (_animationState == kMaggieStateDead) {
return; // false
}
@@ -159,7 +180,7 @@ void AIScriptMaggie::ClickedByPlayer() {
return; // true
}
if (goal == 10) {
- Actor_Change_Animation_Mode(kActorMaggie, 0);
+ Actor_Change_Animation_Mode(kActorMaggie, kAnimationModeIdle);
return; // true
}
if (goal == 11) {
@@ -177,7 +198,7 @@ void AIScriptMaggie::OtherAgentEnteredThisScene(int otherActorId) {
}
void AIScriptMaggie::OtherAgentExitedThisScene(int otherActorId) {
- if (otherActorId == kActorMcCoy && Actor_Query_Which_Set_In(kActorMaggie) == 10 && Global_Variable_Query(1) < 4) {
+ if (otherActorId == kActorMcCoy && Actor_Query_Which_Set_In(kActorMaggie) == kSetMA02_MA04 && Global_Variable_Query(kVariableChapter) < 4) {
AI_Movement_Track_Flush(kActorMaggie);
Actor_Set_Goal_Number(kActorMaggie, 0);
}
@@ -209,13 +230,13 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
switch (newGoalNumber) {
case 11:
Actor_Change_Animation_Mode(kActorMaggie, 55);
- var_45F3F0_animation_state = 9;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateSleeping;
+ _animationFrame = 0;
return true;
case 10:
Actor_Change_Animation_Mode(kActorMaggie, 54);
- var_45F3F0_animation_state = 6;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateLayingIdle;
+ _animationFrame = 0;
AI_Countdown_Timer_Reset(kActorMaggie, 0);
AI_Countdown_Timer_Start(kActorMaggie, 0, Random_Query(2, 9));
return true;
@@ -225,7 +246,7 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Change_Animation_Mode(kActorMaggie, 54);
} else {
AI_Movement_Track_Flush(kActorMaggie);
- if (Actor_Query_Which_Set_In(kActorMaggie) == 10) {
+ if (Actor_Query_Which_Set_In(kActorMaggie) == kSetMA02_MA04) {
AI_Movement_Track_Append(kActorMaggie, sub_44B260(), 486);
}
AI_Movement_Track_Repeat(kActorMaggie);
@@ -238,7 +259,7 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case 7:
AI_Countdown_Timer_Reset(kActorMaggie, 0);
AI_Movement_Track_Flush(kActorMaggie);
- Loop_Actor_Walk_To_Actor(kActorMaggie, kActorMcCoy, 30, 0, false);
+ Loop_Actor_Walk_To_Actor(kActorMaggie, kActorMcCoy, 30, false, false);
Actor_Face_Actor(kActorMaggie, kActorMcCoy, true);
Actor_Change_Animation_Mode(kActorMaggie, 56);
Actor_Set_Goal_Number(kActorMaggie, 8);
@@ -246,22 +267,22 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case 3:
Player_Loses_Control();
AI_Movement_Track_Flush(kActorMaggie);
- Loop_Actor_Walk_To_Actor(kActorMaggie, kActorMcCoy, 48, 0, false);
- Actor_Face_Actor(0, kActorMaggie, true);
- Actor_Face_Actor(kActorMaggie, 0, false);
+ Loop_Actor_Walk_To_Actor(kActorMaggie, kActorMcCoy, 48, false, false);
+ Actor_Face_Actor(kActorMcCoy, kActorMaggie, true);
+ Actor_Face_Actor(kActorMaggie, kActorMcCoy, false);
Actor_Says(kActorMcCoy, 2400, 52);
Actor_Set_Goal_Number(kActorMaggie, 8);
Player_Gains_Control();
return true;
case 1:
- Actor_Put_In_Set(kActorMaggie, 10);
+ Actor_Put_In_Set(kActorMaggie, kSetMA02_MA04);
Actor_Set_At_Waypoint(kActorMaggie, sub_44B260(), 512);
AI_Movement_Track_Flush(kActorMaggie);
AI_Movement_Track_Append(kActorMaggie, 264, 0);
AI_Movement_Track_Repeat(kActorMaggie);
return true;
case 0:
- Actor_Put_In_Set(kActorMaggie, 10);
+ Actor_Put_In_Set(kActorMaggie, kSetMA02_MA04);
Actor_Set_At_Waypoint(kActorMaggie, 265, 780);
return true;
case 415:
@@ -270,7 +291,7 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Sound_Play(494, 50, 0, 0, 100);
Actor_Set_Goal_Number(kActorMaggie, 599);
Actor_Change_Animation_Mode(kActorMaggie, 51);
- if (Actor_Query_Inch_Distance_From_Actor(0, kActorMaggie) < 144) {
+ if (Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorMaggie) < 144) {
Player_Loses_Control();
Actor_Change_Animation_Mode(kActorMcCoy, 48);
Actor_Retired_Here(kActorMcCoy, 6, 6, 1, -1);
@@ -301,7 +322,7 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
break;
case 412:
Scene_Exits_Disable();
- Loop_Actor_Walk_To_XYZ(kActorMaggie, -734.0, 0.0, -432.0, 0, 0, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMaggie, -734.0, 0.0, -432.0, 0, false, false, 0);
Actor_Face_Actor(kActorMaggie, kActorMcCoy, true);
Actor_Change_Animation_Mode(kActorMaggie, 56);
Actor_Face_Actor(kActorMcCoy, kActorMaggie, true);
@@ -310,10 +331,10 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
break;
case 411:
AI_Movement_Track_Flush(kActorMaggie);
- Game_Flag_Set(461);
- Actor_Put_In_Set(kActorMaggie, 9);
+ Game_Flag_Set(kFlagMaggieIsHurt);
+ Actor_Put_In_Set(kActorMaggie, kSetKP05_KP06);
Actor_Set_At_XYZ(kActorMaggie, -672.0, 0.0, -428.0, 653);
- Actor_Change_Animation_Mode(kActorMaggie, 0);
+ Actor_Change_Animation_Mode(kActorMaggie, kAnimationModeIdle);
break;
case 400:
Actor_Set_Goal_Number(kActorMaggie, 410);
@@ -324,62 +345,62 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) {
bool AIScriptMaggie::UpdateAnimation(int *animation, int *frame) {
int goal;
- switch (var_45F3F0_animation_state) {
- case 16:
+ switch (_animationState) {
+ case kMaggieStateDead:
*animation = 871;
- var_45F3F4_animation_frame = 0;
+ _animationFrame = 0;
break;
- case 15:
+ case kMaggieStateDeadExploded:
*animation = 874;
- var_45F3F4_animation_frame = Slice_Animation_Query_Number_Of_Frames(874) - 1;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(874) - 1;
break;
- case 14:
+ case kMaggieStateExploding:
*animation = 874;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(874) - 1) {
- var_45F3F0_animation_state = 15;
- var_45F3F4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
- Actor_Put_In_Set(kActorMaggie, 99);
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(874) - 1) {
+ _animationState = kMaggieStateDeadExploded;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
+ Actor_Put_In_Set(kActorMaggie, kSetFreeSlotI);
Actor_Set_At_Waypoint(kActorMaggie, 41, 0);
}
break;
- case 13:
+ case kMaggieStateHurtJumping:
*animation = 873;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(873)) {
- var_45F3F0_animation_state = 11;
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(873)) {
+ _animationState = kMaggieStateHurtIdle;
+ _animationFrame = 0;
*animation = 875;
Actor_Set_Goal_Number(kActorMaggie, 414);
}
break;
- case 12:
+ case kMaggieStateHurtWalk:
*animation = 872;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(872)) {
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(872)) {
+ _animationFrame = 0;
}
break;
- case 11:
+ case kMaggieStateHurtIdle:
*animation = 875;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(875)) {
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(875)) {
+ _animationFrame = 0;
}
break;
- case 10:
+ case kMaggieStateWakingUp:
*animation = 876;
- var_45F3F4_animation_frame--;
- if (var_45F3F4_animation_frame > 0) {
+ _animationFrame--;
+ if (_animationFrame > 0) {
break;
}
- var_45F3F0_animation_state = 6;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateLayingIdle;
+ _animationFrame = 0;
*animation = 867;
goal = Actor_Query_Goal_Number(66);
if (goal == 3) {
- var_45F3F0_animation_state = 7;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateStandingUp;
+ _animationFrame = 0;
*animation = 868;
} else if (goal == 7) {
Actor_Set_Goal_Number(kActorMaggie, 10);
@@ -388,25 +409,25 @@ bool AIScriptMaggie::UpdateAnimation(int *animation, int *frame) {
Actor_Set_Goal_Number(kActorMaggie, 10);
}
break;
- case 9:
+ case kMaggieStateSleeping:
*animation = 876;
- var_45F3F4_animation_frame = Slice_Animation_Query_Number_Of_Frames(876) - 1;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(876) - 1;
break;
- case 8:
+ case kMaggieStateGoingToSleep:
*animation = 876;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(876) - 1) {
- var_45F3F0_animation_state = 9;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(876) - 1) {
+ _animationState = kMaggieStateSleeping;
Actor_Set_Goal_Number(kActorMaggie, 11);
}
break;
- case 7:
+ case kMaggieStateStandingUp:
*animation = 868;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(868)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(868)) {
*animation = 864;
- var_45F3F0_animation_state = 0;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateIdle;
+ _animationFrame = 0;
if (Actor_Query_Goal_Number(kActorMaggie) == 10) {
Actor_Set_Goal_Number(kActorMaggie, 8);
} else if (Actor_Query_Goal_Number(kActorMaggie) == 7) {
@@ -415,118 +436,118 @@ bool AIScriptMaggie::UpdateAnimation(int *animation, int *frame) {
}
}
break;
- case 6:
+ case kMaggieStateLayingIdle:
*animation = 867;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(867)) {
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(867)) {
+ _animationFrame = 0;
}
break;
- case 5:
+ case kMaggieStateLayingDown:
*animation = 866;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(866)) {
- var_45F3F0_animation_state = 6;
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(866)) {
+ _animationState = kMaggieStateLayingIdle;
+ _animationFrame = 0;
*animation = 867;
if (Actor_Query_Goal_Number(kActorMaggie) == 9) {
Actor_Set_Goal_Number(kActorMaggie, 10);
}
}
break;
- case 4:
+ case kMaggieStateHappyB:
*animation = 865;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(865)) {
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(865)) {
+ _animationFrame = 0;
var_45F3F8--;
if (var_45F3F8 <= 0) {
- Actor_Change_Animation_Mode(kActorMaggie, 0);
+ Actor_Change_Animation_Mode(kActorMaggie, kAnimationModeIdle);
*animation = 864;
}
}
break;
- case 3:
+ case kMaggieStateHappyA:
*animation = 870;
- if (var_45F3F4_animation_frame == 1) {
+ if (_animationFrame == 1) {
Sound_Play(Random_Query(263, 264), 50, 0, 0, 50);
}
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
var_45F3FC--;
- if (var_45F3FC <= 0 ) {
- Actor_Change_Animation_Mode(kActorMaggie, 0);
+ if (var_45F3FC <= 0) {
+ Actor_Change_Animation_Mode(kActorMaggie, kAnimationModeIdle);
*animation = 864;
- var_45F3F0_animation_state = 0;
+ _animationState = kMaggieStateIdle;
}
- var_45F3F4_animation_frame = 0;
+ _animationFrame = 0;
}
break;
- case 2:
+ case kMaggieStateJumping:
*animation = 869;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(869)) {
- Actor_Change_Animation_Mode(kActorMaggie, 0);
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(869)) {
+ Actor_Change_Animation_Mode(kActorMaggie, kAnimationModeIdle);
*animation = 864;
- var_45F3F0_animation_state = 0;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateIdle;
+ _animationFrame = 0;
}
break;
- case 1:
+ case kMaggieStateWalking:
*animation = 863;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(863)) {
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(863)) {
+ _animationFrame = 0;
}
break;
- case 0:
+ case kMaggieStateIdle:
*animation = 864;
- var_45F3F4_animation_frame++;
- if (var_45F3F4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(864)) {
- var_45F3F4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(864)) {
+ _animationFrame = 0;
}
break;
}
- *frame = var_45F3F4_animation_frame;
+ *frame = _animationFrame;
return true;
}
bool AIScriptMaggie::ChangeAnimationMode(int mode) {
- if (mode == 1) {
- if (Game_Flag_Query(461)) {
- var_45F3F0_animation_state = 12;
- var_45F3F4_animation_frame = 0;
+ if (mode == kAnimationModeWalk) {
+ if (Game_Flag_Query(kFlagMaggieIsHurt)) {
+ _animationState = kMaggieStateHurtWalk;
+ _animationFrame = 0;
} else {
- var_45F3F0_animation_state = 1;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateWalking;
+ _animationFrame = 0;
}
return true;
}
- if (mode == 0) {
- if (Game_Flag_Query(461)) {
- var_45F3F0_animation_state = 11;
- var_45F3F4_animation_frame = 0;
+ if (mode == kAnimationModeIdle) {
+ if (Game_Flag_Query(kFlagMaggieIsHurt)) {
+ _animationState = kMaggieStateHurtIdle;
+ _animationFrame = kMaggieStateIdle;
} else {
- switch (var_45F3F0_animation_state) {
- case 8:
- case 9:
- var_45F3F0_animation_state = 10;
+ switch (_animationState) {
+ case kMaggieStateGoingToSleep:
+ case kMaggieStateSleeping:
+ _animationState = kMaggieStateWakingUp;
break;
- case 6:
- var_45F3F0_animation_state = 7;
- var_45F3F4_animation_frame = 0;
+ case kMaggieStateIdle:
+ _animationState = kMaggieStateStandingUp;
+ _animationFrame = 0;
break;
- case 5:
- var_45F3F0_animation_state = 7;
- var_45F3F4_animation_frame = 0;
+ case kMaggieStateLayingDown:
+ _animationState = kMaggieStateStandingUp;
+ _animationFrame = 0;
break;
- case 2:
- case 7:
- case 10:
+ case kMaggieStateJumping:
+ case kMaggieStateStandingUp:
+ case kMaggieStateWakingUp:
break;
default:
- var_45F3F0_animation_state = 0;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateIdle;
+ _animationFrame = 0;
break;
}
}
@@ -535,73 +556,73 @@ bool AIScriptMaggie::ChangeAnimationMode(int mode) {
switch (mode) {
case 88:
- var_45F3F0_animation_state = 16;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateDead;
+ _animationFrame = 0;
break;
case 57:
- if (var_45F3F0_animation_state != 4) {
- var_45F3F4_animation_frame = 0;
- var_45F3F0_animation_state = 4;
+ if (_animationState != kMaggieStateHappyB) {
+ _animationFrame = 0;
+ _animationState = kMaggieStateHappyB;
}
var_45F3F8 = Random_Query(2, 6);
Sound_Play(276, 50, 0, 0, 50);
break;
case 56:
- if (var_45F3F0_animation_state != 3) {
- var_45F3F4_animation_frame = 0;
- var_45F3F0_animation_state = 3;
+ if (_animationState != 3) {
+ _animationFrame = 0;
+ _animationState = kMaggieStateHappyA;
}
var_45F3FC = Random_Query(2, 6);
break;
case 55:
- if (var_45F3F0_animation_state == 6) {
- var_45F3F0_animation_state = 8;
- var_45F3F4_animation_frame = 0;
+ if (_animationState == kMaggieStateLayingIdle) {
+ _animationState = kMaggieStateGoingToSleep;
+ _animationFrame = 0;
}
break;
case 54:
- if ((unsigned int)var_45F3F0_animation_state <= 9) {
- if (var_45F3F0_animation_state) {
- if (var_45F3F0_animation_state == 9) {
- var_45F3F0_animation_state = 10;
- var_45F3F4_animation_frame = 0;
+ if (_animationState <= kMaggieStateSleeping) {
+ if (_animationState > 0) {
+ if (_animationState == kMaggieStateSleeping) {
+ _animationState = kMaggieStateWakingUp;
+ _animationFrame = 0;
}
} else {
- var_45F3F0_animation_state = 5;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateLayingDown;
+ _animationFrame = 0;
}
}
break;
case 52:
- if (Game_Flag_Query(461)) {
- var_45F3F0_animation_state = 13;
- var_45F3F4_animation_frame = 0;
+ if (Game_Flag_Query(kFlagMaggieIsHurt)) {
+ _animationState = kMaggieStateHurtJumping;
+ _animationFrame = 0;
} else {
- var_45F3F0_animation_state = 2;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateJumping;
+ _animationFrame = 0;
}
break;
case 51:
- var_45F3F0_animation_state = 14;
- var_45F3F4_animation_frame = 0;
+ _animationState = kMaggieStateExploding;
+ _animationFrame = 0;
Sound_Play(272, 50, 0, 0, 50);
break;
}
return true;
}
-void AIScriptMaggie::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
- *animationState = var_45F3F0_animation_state;
- *animationFrame = var_45F3F4_animation_frame;
- *a3 = var_462B30;
- *a4 = var_462B34;
+void AIScriptMaggie::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
}
-void AIScriptMaggie::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
- var_45F3F0_animation_state = animationState;
- var_45F3F4_animation_frame = animationFrame;
- var_462B30 = a3;
- var_462B34 = a4;
+void AIScriptMaggie::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
}
bool AIScriptMaggie::ReachedMovementTrackWaypoint(int waypointId) {
diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp
index 1129ff937d..f84c9a9d52 100644
--- a/engines/bladerunner/script/ai/mccoy.cpp
+++ b/engines/bladerunner/script/ai/mccoy.cpp
@@ -25,8 +25,8 @@
namespace BladeRunner {
void AIScriptMcCoy::Initialize() {
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
dword_45A0D8 = 0;
dword_45A0DC = 30;
dword_45A0E0 = 1;
@@ -153,7 +153,7 @@ void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) {
Global_Variable_Increment(48, 1);
break;
}
- if (Global_Variable_Query(49) > 6 && Global_Variable_Query(1) > 3 && !Actor_Clue_Query(kActorMcCoy, kClueGuzzaFramedMcCoy)) {
+ if (Global_Variable_Query(49) > 6 && Global_Variable_Query(kVariableChapter) > 3 && !Actor_Clue_Query(kActorMcCoy, kClueGuzzaFramedMcCoy)) {
Delay(500);
Actor_Voice_Over(3320, kActorVoiceOver);
switch (clueId) {
@@ -263,8 +263,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return true;
case 100:
Actor_Set_At_Waypoint(kActorMcCoy, 315, 263);
- dword_45A0D0_animation_state = 53;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ _animationState = 53;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
Actor_Set_Invisible(kActorMcCoy, false);
return true;
case 102:
@@ -282,8 +282,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Put_In_Set(kActorMcCoy, 59);
Actor_Set_At_XYZ(kActorMcCoy, 14.0f, 110.84f, -300.0f, 926);
Actor_Change_Animation_Mode(kActorMcCoy, 48);
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 27;
+ _animationFrame = 0;
flt_462714 = 2.84f;
flt_462710 = 110.84f;
off_45A100 = -6.0f;
@@ -300,8 +300,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Player_Set_Combat_Mode_Access(false);
Player_Gains_Control();
Scene_Exits_Disable();
- dword_45A0D0_animation_state = 68;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ _animationState = 68;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
return true;
case 211:
Actor_Face_Heading(kActorMcCoy, 512, false);
@@ -323,8 +323,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
if (Game_Flag_Query(627)) {
Actor_Set_Goal_Number(kActorMcCoy, 212);
} else {
- dword_45A0D0_animation_state = 53;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ _animationState = 53;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
Actor_Set_Invisible(kActorMcCoy, false);
}
return true;
@@ -333,16 +333,16 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Change_Animation_Mode(kActorMcCoy, 0);
return true;
case 301:
- dword_45A0D0_animation_state = 62;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 62;
+ _animationFrame = 0;
return true;
case 302:
- dword_45A0D0_animation_state = 64;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 64;
+ _animationFrame = 0;
return true;
case 303:
- dword_45A0D0_animation_state = 65;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 65;
+ _animationFrame = 0;
return true;
case 350:
Sound_Play(123, 50, 0, 0, 50);
@@ -387,9 +387,9 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
flt_462710 = 48.07f;
off_45A100 = -4.0f;
flt_462714 = -20.0f;
- if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 50;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ if (_animationState != 27 && _animationState != 50) {
+ _animationState = 50;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
}
return true;
case 400:
@@ -422,7 +422,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
}
if (!Game_Flag_Query(653)) {
- Game_Flag_Set(461);
+ Game_Flag_Set(kFlagMaggieIsHurt);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
@@ -439,8 +439,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Music_Stop(3);
Player_Set_Combat_Mode(false);
Actor_Change_Animation_Mode(kActorMcCoy, 0);
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
Game_Flag_Set(465);
Set_Enter(67, kScenePS09);
return true;
@@ -450,29 +450,29 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
int v7, v18, v19, v46;
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 71:
*animation = 52;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(52)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(52)) {
Actor_Change_Animation_Mode(kActorMcCoy, 0);
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
Player_Gains_Control();
}
break;
case 70:
*animation = 51;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(51)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(51)) {
+ _animationFrame = 0;
}
break;
case 69:
*animation = 50;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(50)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(50)) {
Actor_Change_Animation_Mode(kActorMcCoy, 53);
*animation = 51;
}
@@ -480,16 +480,16 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
case 68:
*animation = 18;
v7 = Slice_Animation_Query_Number_Of_Frames(*animation) - 1 - Global_Variable_Query(47);
- if (dword_45A0D4_animation_frame < v7) {
- dword_45A0D4_animation_frame++;
- } else if (dword_45A0D4_animation_frame > v7) {
- dword_45A0D4_animation_frame--;
+ if (_animationFrame < v7) {
+ _animationFrame++;
+ } else if (_animationFrame > v7) {
+ _animationFrame--;
}
- if (dword_45A0D4_animation_frame <= 0) {
+ if (_animationFrame <= 0) {
Actor_Change_Animation_Mode(kActorMcCoy, 0);
*animation = 19;
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
Game_Flag_Reset(627);
Scene_Exits_Enable();
Player_Set_Combat_Mode_Access(true);
@@ -498,12 +498,12 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 67:
*animation = 53;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(53)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(53)) {
Actor_Change_Animation_Mode(kActorMcCoy, 0);
*animation = 19;
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
if (Actor_Query_Goal_Number(kActorMcCoy) == 220) {
Actor_Change_Animation_Mode(kActorMcCoy, 48);
}
@@ -511,56 +511,56 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 66:
*animation = 40;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(40)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(40)) {
Actor_Change_Animation_Mode(kActorMcCoy, 0);
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
}
break;
case 65:
*animation = 45;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(45)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(45)) {
+ _animationFrame = 0;
+ _animationState = 14;
*animation = 0;
Actor_Set_Goal_Number(kActorMcCoy, 0);
}
break;
case 64:
*animation = 44;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(44)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 63;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(44)) {
+ _animationFrame = 0;
+ _animationState = 63;
*animation = 43;
}
break;
case 63:
*animation = 43;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(43)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(43)) {
+ _animationFrame = 0;
}
break;
case 62:
*animation = 42;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(42)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 63;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(42)) {
+ _animationFrame = 0;
+ _animationState = 63;
*animation = 43;
}
break;
case 61:
*animation = 41;
- dword_45A0D4_animation_frame--;
- if (dword_45A0D4_animation_frame <= 0) {
+ _animationFrame--;
+ if (_animationFrame <= 0) {
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
if (Actor_Query_Goal_Number(kActorMcCoy) == 200) {
Actor_Set_Goal_Number(kActorMcCoy, 201);
}
@@ -568,26 +568,26 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 60:
*animation = 41;
- if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(41) - 1) {
- dword_45A0D4_animation_frame++;
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(41) - 1) {
+ _animationFrame++;
}
return true;
case 59:
*animation = 48;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(48)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(48)) {
*animation = 19;
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
dword_45A0DC = 0;
- dword_45A0D0_animation_state = 0;
+ _animationState = 0;
Player_Gains_Control();
Item_Add_To_World(109, 982, 6, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false);
}
break;
case 58:
*animation = 47;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame == 6) {
+ _animationFrame++;
+ if (_animationFrame == 6) {
v18 = Random_Query(0, 2);
v19 = 0;
if (v18 == 0) {
@@ -599,55 +599,55 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
}
Ambient_Sounds_Play_Sound(v19, 39, 0, 0, 99);
}
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { //why -1?
- dword_45A0D4_animation_frame = 0;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { //why -1?
+ _animationFrame = 0;
}
break;
case 57:
*animation = 46;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(46)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(46)) {
+ _animationFrame = 0;
}
if (!Game_Flag_Query(550)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 59;
+ _animationFrame = 0;
+ _animationState = 59;
*animation = 48;
}
break;
case 56:
*animation = 49;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(49)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(49)) {
+ _animationFrame = 0;
if (Actor_Query_Which_Set_In(kActorMcCoy) == 87) {
- dword_45A0D0_animation_state = 27;
+ _animationState = 27;
} else {
*animation = 19;
- dword_45A0D0_animation_state = 0;
+ _animationState = 0;
Actor_Change_Animation_Mode(kActorMcCoy, 0);
}
}
break;
case 55:
*animation = 32;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame == 7) {
+ _animationFrame++;
+ if (_animationFrame == 7) {
Actor_Change_Animation_Mode(kActorMaggie, 52);
}
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
*animation = 19;
- dword_45A0D0_animation_state = 0;
+ _animationState = 0;
}
break;
case 53:
*animation = 18;
- dword_45A0D4_animation_frame--;
- if (dword_45A0D4_animation_frame <= 0) {
+ _animationFrame--;
+ if (_animationFrame <= 0) {
Actor_Change_Animation_Mode(kActorMcCoy, 0);
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
if (Actor_Query_Goal_Number(kActorMcCoy) == 100) {
Actor_Set_Goal_Number(kActorMcCoy, 101);
}
@@ -658,62 +658,62 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 52:
*animation = 31;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(31)) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(31) - 1;
- dword_45A0D0_animation_state = 50;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(31)) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(31) - 1;
+ _animationState = 50;
}
break;
case 51:
*animation = 28;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(28)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(28)) {
Player_Set_Combat_Mode(true);
sub_405800();
Actor_Set_Goal_Number(kActorMcCoy, 0);
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
Player_Gains_Control();
}
break;
case 50:
*animation = 18;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
break;
case 49:
*animation = 34;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(34)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(34)) {
Actor_Set_Goal_Number(kActorMcCoy, 0);
*animation = 19;
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
sub_405660();
}
break;
case 48:
*animation = 33;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(33)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 49;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(33)) {
+ _animationFrame = 0;
+ _animationState = 49;
*animation = 34;
}
break;
case 47:
*animation = 29;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(29)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 48;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(29)) {
+ _animationFrame = 0;
+ _animationState = 48;
*animation = 33;
}
break;
case 46:
Actor_Set_Invisible(kActorMcCoy, false);
*animation = 36;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(36)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(36)) {
*animation = 19;
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
Player_Gains_Control();
sub_405660();
Actor_Face_Heading(kActorMcCoy, (Actor_Query_Facing_1024(kActorMcCoy) + 512) & 1023, false);
@@ -721,20 +721,20 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 45:
*animation = 35;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(35)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(35)) {
Actor_Set_Invisible(kActorMcCoy, true);
*animation = 19;
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
sub_405660();
}
break;
case 44:
*animation = 30;
- if (dword_45A0D4_animation_frame++ == 127) {
+ if (_animationFrame++ == 127) {
Game_Flag_Set(325);
}
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(30)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(30)) {
*animation = 19;
sub_405660();
Actor_Set_At_XYZ(kActorMcCoy, -203.41f, -621.3f, 724.57f, 538);
@@ -743,11 +743,11 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 43:
*animation = 38;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(38) - 1) { //why -1?
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(38) - 1) { //why -1?
+ _animationFrame = 0;
}
- switch (dword_45A0D4_animation_frame) {
+ switch (_animationFrame) {
case 9:
Sound_Left_Footstep_Walk(kActorMcCoy);
break;
@@ -761,11 +761,11 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 42:
*animation = 37;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(37) - 1) { //why -1?
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(37) - 1) { //why -1?
+ _animationFrame = 0;
}
- switch (dword_45A0D4_animation_frame) {
+ switch (_animationFrame) {
case 9:
Sound_Left_Footstep_Walk(kActorMcCoy);
break;
@@ -779,14 +779,14 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 41:
*animation = 7;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(7)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(7)) {
+ _animationFrame = 0;
++off_45A0EC;
}
- if (dword_45A0D4_animation_frame == 9) {
+ if (_animationFrame == 9) {
Sound_Left_Footstep_Walk(kActorMcCoy);
- } else if (dword_45A0D4_animation_frame == 4) {
+ } else if (_animationFrame == 4) {
Sound_Right_Footstep_Walk(kActorMcCoy);
}
if (Game_Flag_Query(359)) {
@@ -795,14 +795,14 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 40:
*animation = 6;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(6)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(6)) {
+ _animationFrame = 0;
++off_45A0EC;
}
- if (dword_45A0D4_animation_frame == 8) {
+ if (_animationFrame == 8) {
Sound_Left_Footstep_Walk(kActorMcCoy);
- } else if (dword_45A0D4_animation_frame == 3) {
+ } else if (_animationFrame == 3) {
Sound_Right_Footstep_Walk(kActorMcCoy);
}
if (Game_Flag_Query(358)) {
@@ -811,14 +811,14 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 39:
*animation = 16;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(16)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(16)) {
+ _animationFrame = 0;
++off_45A0EC;
}
- if (dword_45A0D4_animation_frame == 8) {
+ if (_animationFrame == 8) {
Sound_Left_Footstep_Walk(kActorMcCoy);
- } else if (dword_45A0D4_animation_frame == 3) {
+ } else if (_animationFrame == 3) {
Sound_Right_Footstep_Walk(kActorMcCoy);
}
if (Game_Flag_Query(359)) {
@@ -827,14 +827,14 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 38:
*animation = 15;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(15)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(15)) {
+ _animationFrame = 0;
++off_45A0EC;
}
- if (dword_45A0D4_animation_frame == 9) {
+ if (_animationFrame == 9) {
Sound_Left_Footstep_Walk(kActorMcCoy);
- } else if (dword_45A0D4_animation_frame == 4) {
+ } else if (_animationFrame == 4) {
Sound_Right_Footstep_Walk(kActorMcCoy);
}
if (Game_Flag_Query(358)) {
@@ -842,89 +842,89 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
}
break;
case 37:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(4)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(4)) {
+ _animationFrame = 0;
}
*animation = 4;
- if (dword_45A0D4_animation_frame == 6) {
+ if (_animationFrame == 6) {
Sound_Left_Footstep_Run(kActorMcCoy);
}
- if (dword_45A0D4_animation_frame == 0) {
+ if (_animationFrame == 0) {
Sound_Right_Footstep_Run(kActorMcCoy);
}
break;
case 36:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(3)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(3)) {
+ _animationFrame = 0;
}
*animation = 3;
- if (dword_45A0D4_animation_frame == 15) {
+ if (_animationFrame == 15) {
Sound_Left_Footstep_Walk(kActorMcCoy);
}
- if (dword_45A0D4_animation_frame == 6) {
+ if (_animationFrame == 6) {
Sound_Right_Footstep_Walk(kActorMcCoy);
}
break;
case 32:
- dword_45A0D4_animation_frame = 1;
- dword_45A0D0_animation_state = 30;
+ _animationFrame = 1;
+ _animationState = 30;
*animation = 13;
break;
case 31:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(14)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(14)) {
+ _animationFrame = 0;
}
*animation = 14;
- if (dword_45A0D4_animation_frame == 5) {
+ if (_animationFrame == 5) {
Sound_Left_Footstep_Run(kActorMcCoy);
- } else if (dword_45A0D4_animation_frame == 12) {
+ } else if (_animationFrame == 12) {
Sound_Right_Footstep_Run(kActorMcCoy);
}
break;
case 30:
*animation = 13;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(13)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(13)) {
+ _animationFrame = 0;
}
- if (dword_45A0D4_animation_frame == 2) {
+ if (_animationFrame == 2) {
Sound_Right_Footstep_Walk(kActorMcCoy);
- } else if (dword_45A0D4_animation_frame == 10) {
+ } else if (_animationFrame == 10) {
Sound_Left_Footstep_Walk(kActorMcCoy);
}
break;
case 29:
- v46 = dword_45A0D4_animation_frame + dword_45A0E0;
+ v46 = _animationFrame + dword_45A0E0;
*animation = 18;
- dword_45A0D4_animation_frame = v46;
+ _animationFrame = v46;
if (v46 < 14) {
dword_45A0E0 = 1;
}
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
Actor_Change_Animation_Mode(kActorMcCoy, 48);
*animation = 18;
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ _animationState = 27;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
}
break;
case 28:
*animation = 5;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(5)) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
- dword_45A0D0_animation_state = 50;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(5)) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
+ _animationState = 50;
sub_4054F0();
}
break;
case 27:
*animation = 18;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(18)) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
- dword_45A0D0_animation_state = 50;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(18)) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
+ _animationState = 50;
sub_4054F0();
if (Actor_Query_Goal_Number(kActorMcCoy) == 220) {
Actor_Set_Goal_Number(kActorMcCoy, 221);
@@ -933,62 +933,62 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 26:
*animation = 17;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(17)) {
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
Actor_Change_Animation_Mode(kActorMcCoy, 0);
}
break;
case 25:
*animation = 17;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(17)) {
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
Actor_Change_Animation_Mode(kActorMcCoy, 0);
}
break;
case 24:
*animation = 1;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(1)) {
+ _animationFrame = 0;
+ _animationState = 14;
*animation = 0;
- Actor_Change_Animation_Mode(kActorMcCoy, 4);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatIdle);
}
break;
case 23:
*animation = 1;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(1)) {
+ _animationFrame = 0;
+ _animationState = 14;
*animation = 0;
- Actor_Change_Animation_Mode(kActorMcCoy, 4);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatIdle);
}
break;
case 22:
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 17;
+ _animationFrame = 0;
+ _animationState = 17;
*animation = 12;
break;
case 21:
*animation = 12;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame == 1 && Actor_Query_Goal_Number(kActorMcCoy) == 230 && dword_45A0FC == 1) {
+ _animationFrame++;
+ if (_animationFrame == 1 && Actor_Query_Goal_Number(kActorMcCoy) == 230 && dword_45A0FC == 1) {
dword_45A0F8 = 27;
}
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(12)) {
- dword_45A0D0_animation_state = 17;
- dword_45A0D4_animation_frame = 0;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(12)) {
+ _animationState = 17;
+ _animationFrame = 0;
*animation = 12;
if (Actor_Query_Goal_Number(kActorMcCoy) == 230) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 21;
+ _animationFrame = 0;
+ _animationState = 21;
dword_45A0FC = 1;
*animation = 12;
}
@@ -996,165 +996,165 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;
case 19:
*animation = 11;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= 12) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
+ _animationFrame++;
+ if (_animationFrame >= 12) {
+ _animationFrame = 0;
+ _animationState = 14;
*animation = 0;
}
break;
case 18:
*animation = 10;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(10)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 17;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(10)) {
+ _animationFrame = 0;
+ _animationState = 17;
*animation = 12;
}
break;
case 17:
*animation = 12;
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
// weird, but thats in game code
if (Slice_Animation_Query_Number_Of_Frames(12) <= 0) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 17;
+ _animationFrame = 0;
+ _animationState = 17;
}
break;
case 16:
*animation = 9;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(9)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(9)) {
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
}
break;
case 15:
*animation = 8;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(8)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(8)) {
+ _animationFrame = 0;
+ _animationState = 14;
*animation = 0;
}
break;
case 14:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(0)) {
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(0)) {
+ _animationState = 14;
+ _animationFrame = 0;
}
*animation = 0;
break;
case 13:
*animation = 19;
- if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(19) / 2) {
- dword_45A0D4_animation_frame -= 3;
- if (dword_45A0D4_animation_frame <= 0) {
- dword_45A0D4_animation_frame = 0;
- *animation = dword_46271C;
- dword_45A0D0_animation_state = dword_462718;
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(19) / 2) {
+ _animationFrame -= 3;
+ if (_animationFrame <= 0) {
+ _animationFrame = 0;
+ *animation = _animationNext;
+ _animationState = _animationStateNext;
}
} else {
- dword_45A0D4_animation_frame += 3;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) {
- dword_45A0D4_animation_frame = 0;
- *animation = dword_46271C;
- dword_45A0D0_animation_state = dword_462718;
+ _animationFrame += 3;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(19)) {
+ _animationFrame = 0;
+ *animation = _animationNext;
+ _animationState = _animationStateNext;
}
}
break;
case 12:
*animation = 27;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(27)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 11:
*animation = 26;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(26)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(26)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 10:
*animation = 25;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(25)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(25)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 9:
*animation = 24;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(24)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(24)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 8:
*animation = 23;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(23)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(23)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 7:
*animation = 22;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(22)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(22)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 6:
*animation = 27;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(27)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 5:
*animation = 21;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(21)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(21)) {
+ _animationFrame = 0;
+ _animationState = 3;
*animation = 20;
}
break;
case 3:
case 4:
- if (dword_45A0D4_animation_frame == 0 && !Game_Flag_Query(236)) {
- dword_45A0D4_animation_frame = 1;
- dword_45A0D0_animation_state = dword_45A0F0;
+ if (_animationFrame == 0 && !Game_Flag_Query(236)) {
+ _animationFrame = 1;
+ _animationState = dword_45A0F0;
*animation = dword_45A0F4;
dword_45A0F0 = 4;
dword_45A0F4 = 20;
- } else if (dword_45A0D4_animation_frame <= 4 && Game_Flag_Query(236)) {
+ } else if (_animationFrame <= 4 && Game_Flag_Query(236)) {
Game_Flag_Reset(236);
*animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
+ _animationFrame = 0;
+ _animationState = 0;
} else {
*animation = 20;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(20)) {
- dword_45A0D4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(20)) {
+ _animationFrame = 0;
}
}
break;
@@ -1162,26 +1162,26 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
*animation = 19;
if (dword_45A0D8 < dword_45A0DC) {
//*frame = dword_45A0E8;
- dword_45A0D4_animation_frame += dword_45A0E0;
- if (dword_45A0D4_animation_frame > dword_45A0E8) {
- dword_45A0D4_animation_frame = dword_45A0E8;
+ _animationFrame += dword_45A0E0;
+ if (_animationFrame > dword_45A0E8) {
+ _animationFrame = dword_45A0E8;
dword_45A0E0 = -1;
- } else if (dword_45A0D4_animation_frame < dword_45A0E4) {
- dword_45A0D4_animation_frame = dword_45A0E4;
+ } else if (_animationFrame < dword_45A0E4) {
+ _animationFrame = dword_45A0E4;
dword_45A0E0 = 1;
}
dword_45A0D8++;
} else {
- dword_45A0D4_animation_frame += dword_45A0E0;
+ _animationFrame += dword_45A0E0;
dword_45A0DC = 0;
- if (dword_45A0D4_animation_frame == 18 && Random_Query(0, 2)) {
+ if (_animationFrame == 18 && Random_Query(0, 2)) {
dword_45A0E0 = -1;
dword_45A0D8 = 0;
dword_45A0E4 = 14;
dword_45A0E8 = 18;
dword_45A0DC = Random_Query(0, 30);
}
- if (dword_45A0D4_animation_frame == 26) {
+ if (_animationFrame == 26) {
if (Random_Query(0, 2)) {
dword_45A0E0 = -1;
dword_45A0D8 = 0;
@@ -1190,8 +1190,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
dword_45A0DC = Random_Query(0, 30);
}
}
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) {
- dword_45A0D4_animation_frame = 0;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(19)) {
+ _animationFrame = 0;
if (Random_Query(0, 2)) {
dword_45A0D8 = 0;
dword_45A0E4 = 0;
@@ -1199,13 +1199,13 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
dword_45A0DC = Random_Query(0, 45);
}
}
- if (dword_45A0D4_animation_frame < 0) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(19) - 1;
+ if (_animationFrame < 0) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(19) - 1;
}
}
break;
}
- *frame = dword_45A0D4_animation_frame;
+ *frame = _animationFrame;
return true;
}
@@ -1213,74 +1213,74 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
int v2;
switch (mode) {
case 85:
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 69;
+ _animationFrame = 0;
+ _animationState = 69;
return true;
case 75:
- dword_45A0D0_animation_state = 67;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 67;
+ _animationFrame = 0;
return true;
case 68:
- dword_45A0D0_animation_state = 29;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ _animationState = 29;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
dword_45A0E0 = -1;
return true;
case 65:
case 67:
- dword_45A0D0_animation_state = 43;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 43;
+ _animationFrame = 0;
return true;
case 64:
case 66:
- dword_45A0D0_animation_state = 42;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 42;
+ _animationFrame = 0;
return true;
case 53:
- if (dword_45A0D0_animation_state != 60 && (Player_Query_Current_Set() == 55 || Player_Query_Current_Set() == 13)) {
- dword_45A0D0_animation_state = 60;
- dword_45A0D4_animation_frame = 0;
+ if (_animationState != 60 && (Player_Query_Current_Set() == 55 || Player_Query_Current_Set() == 13)) {
+ _animationState = 60;
+ _animationFrame = 0;
} else {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 70;
+ _animationFrame = 0;
+ _animationState = 70;
}
return true;
case 52:
- dword_45A0D0_animation_state = 55;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 55;
+ _animationFrame = 0;
return true;
case 51:
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 27;
+ _animationFrame = 0;
return true;
case 49:
- dword_45A0D0_animation_state = 28;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 28;
+ _animationFrame = 0;
return true;
case 48:
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 14:
- dword_45A0D0_animation_state = 28;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 28;
+ _animationFrame = 0;
break;
case 13:
- dword_45A0D0_animation_state = 22;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 22;
+ _animationFrame = 0;
return true;
case 10:
- dword_45A0D0_animation_state = 18;
- dword_45A0D4_animation_frame = 8 * (13 - dword_45A0D4_animation_frame) / 13;
+ _animationState = 18;
+ _animationFrame = 8 * (13 - _animationFrame) / 13;
return true;
case 8:
case 9:
case 12:
return true;
case 11:
- dword_45A0D0_animation_state = 18;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 18;
+ _animationFrame = 0;
break;
case 7:
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 14;
+ _animationFrame = 0;
break;
case 0:
case 1:
@@ -1289,76 +1289,76 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
case 4:
case 5:
case 6:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 15;
+ _animationFrame = 0;
break;
default:
- if (dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
+ if (_animationState != 50) {
+ _animationState = 27;
+ _animationFrame = 0;
}
break;
}
return true;
case 47:
- dword_45A0D0_animation_state = 41;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 41;
+ _animationFrame = 0;
return true;
case 46:
- dword_45A0D0_animation_state = 40;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 40;
+ _animationFrame = 0;
return true;
case 45:
- dword_45A0D0_animation_state = 39;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 39;
+ _animationFrame = 0;
return true;
case 44:
- dword_45A0D0_animation_state = 38;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 38;
+ _animationFrame = 0;
return true;
case 42:
- dword_45A0D0_animation_state = 46;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 46;
+ _animationFrame = 0;
Player_Loses_Control();
return true;
case 41:
- dword_45A0D0_animation_state = 45;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 45;
+ _animationFrame = 0;
return true;
case 40:
- dword_45A0D0_animation_state = 44;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 44;
+ _animationFrame = 0;
return true;
case 39:
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 52;
+ _animationFrame = 0;
+ _animationState = 52;
if (Player_Query_Current_Set() == 27) {
- dword_45A0D4_animation_frame = 23;
+ _animationFrame = 23;
}
return true;
case 38:
- dword_45A0D0_animation_state = 47;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 47;
+ _animationFrame = 0;
return true;
case 29:
Player_Loses_Control();
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 71;
+ _animationFrame = 0;
+ _animationState = 71;
return true;
case 23:
- dword_45A0D0_animation_state = 66;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 66;
+ _animationFrame = 0;
return true;
case 22:
if (Random_Query(0, 1)) {
- dword_45A0D0_animation_state = 23;
+ _animationState = 23;
} else {
- dword_45A0D0_animation_state = 24;
+ _animationState = 24;
}
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
return true;
case 21:
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 0:
case 2:
case 3:
@@ -1366,42 +1366,42 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
case 5:
case 6:
case 7:
- dword_45A0D0_animation_state = 28;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 28;
+ _animationFrame = 0;
break;
case 1:
case 8:
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 27;
+ _animationFrame = 0;
break;
default:
if (Random_Query(0, 1)) {
- dword_45A0D0_animation_state = 26;
+ _animationState = 26;
} else {
- dword_45A0D0_animation_state = 25;
+ _animationState = 25;
}
- dword_45A0D4_animation_frame = 0;
+ _animationFrame = 0;
break;
}
return true;
case 20:
v2 = Actor_Query_Which_Set_In(kActorMcCoy);
if (v2 == 27) {
- dword_45A0D0_animation_state = 51;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 51;
+ _animationFrame = 0;
Player_Loses_Control();
Game_Flag_Set(210);
} else if (v2 == 70 || v2 == 87) {
- dword_45A0D0_animation_state = 56;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 56;
+ _animationFrame = 0;
}
return true;
case 19:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 12;
- dword_46271C = 27;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 12;
+ _animationNext = 27;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 12;
@@ -1409,10 +1409,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
return true;
case 18:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 11;
- dword_46271C = 26;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 11;
+ _animationNext = 26;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 11;
@@ -1420,10 +1420,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
return true;
case 17:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 10;
- dword_46271C = 25;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 10;
+ _animationNext = 25;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 10;
@@ -1431,10 +1431,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
return true;
case 16:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 9;
- dword_46271C = 24;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 9;
+ _animationNext = 24;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 9;
@@ -1442,10 +1442,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
return true;
case 15:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 8;
- dword_46271C = 23;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 8;
+ _animationNext = 23;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 8;
@@ -1454,10 +1454,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
return true;
case 11:
case 14:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 7;
- dword_46271C = 22;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 7;
+ _animationNext = 22;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 7;
@@ -1466,10 +1466,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
return true;
case 10:
case 13:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 6;
- dword_46271C = 27;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 6;
+ _animationNext = 27;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 6;
@@ -1478,10 +1478,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
return true;
case 9:
case 12:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 5;
- dword_46271C = 21;
+ if (_animationState < 3 || _animationState > 12) {
+ _animationState = 13;
+ _animationStateNext = 5;
+ _animationNext = 21;
} else {
Game_Flag_Reset(236);
dword_45A0F0 = 5;
@@ -1489,59 +1489,59 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
return true;
case 8:
- if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 37;
- dword_45A0D4_animation_frame = 0;
+ if (_animationState != 27 && _animationState != 50) {
+ _animationState = 37;
+ _animationFrame = 0;
}
return true;
case 7:
- if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 36;
- dword_45A0D4_animation_frame = 0;
+ if (_animationState != 27 && _animationState != 50) {
+ _animationState = 36;
+ _animationFrame = 0;
}
return true;
case 6:
- dword_45A0D0_animation_state = 21;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 21;
+ _animationFrame = 0;
return true;
case 5:
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 1:
case 2:
case 5:
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 14;
+ _animationFrame = 0;
break;
case 0:
case 3:
case 4:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 15;
+ _animationFrame = 0;
break;
default:
- dword_45A0D0_animation_state = 18;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 18;
+ _animationFrame = 0;
break;
}
return true;
case 4:
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 22:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 41;
+ _animationState = 19;
+ _animationFrame = 41;
break;
case 18:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8);
+ _animationState = 19;
+ _animationFrame = 13 * ((8 - _animationFrame) / 8);
break;
case 17:
case 20:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 19;
+ _animationFrame = 0;
break;
case 16:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16;
+ _animationState = 15;
+ _animationFrame = 12 - 12 * _animationFrame / 16;
break;
case 14:
case 15:
@@ -1551,12 +1551,12 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
case 3:
return true;
default:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 15;
+ _animationFrame = 0;
break;
case 13:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 16;
+ _animationFrame = 0;
break;
case 0:
case 1:
@@ -1569,52 +1569,52 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
case 10:
case 11:
case 12:
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
dword_45A0DC = 0;
break;
}
return true;
case 3:
- if (dword_45A0D0_animation_state >= 3 && dword_45A0D0_animation_state <= 12) {
+ if (_animationState >= 3 && _animationState <= 12) {
Game_Flag_Reset(236);
dword_45A0F0 = 4;
dword_45A0F4 = 20;
} else {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 3;
- dword_46271C = 20;
+ _animationState = 13;
+ _animationStateNext = 3;
+ _animationNext = 20;
}
return true;
case 2:
- if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) {
+ if (_animationState == 27 || _animationState == 50) {
return true;
}
if (!Game_Flag_Query(550)) {
- dword_45A0D0_animation_state = 31;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 31;
+ _animationFrame = 0;
return true;
}
- dword_45A0D0_animation_state = 58;
- dword_45A0D4_animation_frame = 4;
+ _animationState = 58;
+ _animationFrame = 4;
return true;
case 1:
- if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) {
+ if (_animationState == 27 || _animationState == 50) {
return true;
}
if (!Game_Flag_Query(550)) {
- dword_45A0D0_animation_state = 32;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 32;
+ _animationFrame = 0;
return true;
}
- dword_45A0D0_animation_state = 58;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 58;
+ _animationFrame = 0;
return true;
case 0:
if (Game_Flag_Query(550)) {
- if (dword_45A0D4_animation_frame > 6) {
- dword_45A0D0_animation_state = 57;
- dword_45A0D4_animation_frame = 0;
+ if (_animationFrame > 6) {
+ _animationState = 57;
+ _animationFrame = 0;
return true;
}
int v3 = Random_Query(0, 2);
@@ -1627,34 +1627,34 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
v4 = 593;
}
Ambient_Sounds_Play_Sound(v4, 39, 0, 0, 99);
- dword_45A0D0_animation_state = 57;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 57;
+ _animationFrame = 0;
return true;
}
- if (dword_45A0D0_animation_state == 60) {
- dword_45A0D0_animation_state = 61;
+ if (_animationState == 60) {
+ _animationState = 61;
return true;
}
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
dword_45A0DC = 0;
return true;
}
return true;
}
-void AIScriptMcCoy::QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) {
- *animationState = dword_45A0D0_animation_state;
- *a2 = dword_45A0D4_animation_frame;
- *a3 = dword_462718;
- *a4 = dword_46271C;
+void AIScriptMcCoy::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
}
-void AIScriptMcCoy::SetAnimationState(int animationState, int a2, int a3, int a4) {
- dword_45A0D0_animation_state = animationState;
- dword_45A0D4_animation_frame = a2;
- dword_462718 = a3;
- dword_46271C = a4;
+void AIScriptMcCoy::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
}
bool AIScriptMcCoy::ReachedMovementTrackWaypoint(int waypointId) {
@@ -1698,7 +1698,7 @@ void AIScriptMcCoy::sub_4054F0() {
void AIScriptMcCoy::sub_405660() {
if (Game_Flag_Query(550)) {
- if (dword_45A0D4_animation_frame <= 6) {
+ if (_animationFrame <= 6) {
int v1 = Random_Query(0, 2);
int v2 = 0;
if (v1 == 0) {
@@ -1710,29 +1710,29 @@ void AIScriptMcCoy::sub_405660() {
}
Ambient_Sounds_Play_Sound(v2, 39, 0, 0, 99);
}
- dword_45A0D0_animation_state = 57;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 57;
+ _animationFrame = 0;
return;
}
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 17:
case 20:
case 21:
case 36:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 16;
+ _animationFrame = 0;
break;
case 16:
case 25:
case 26:
break;
case 15:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 16 - 16 * dword_45A0D4_animation_frame / 12;
+ _animationState = 16;
+ _animationFrame = 16 - 16 * _animationFrame / 12;
break;
case 14:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 16;
+ _animationFrame = 0;
break;
case 3:
case 4:
@@ -1752,41 +1752,41 @@ void AIScriptMcCoy::sub_405660() {
dword_45A0E8 = 3;
break;
case 60:
- dword_45A0D0_animation_state = 61;
+ _animationState = 61;
break;
default:
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
dword_45A0DC = 0;
}
}
void AIScriptMcCoy::sub_405800() {
- switch (dword_45A0D0_animation_state) {
+ switch (_animationState) {
case 36:
case 37:
case 40:
case 41:
case 51:
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 14;
+ _animationFrame = 0;
break;
case 22:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 41;
+ _animationState = 19;
+ _animationFrame = 41;
break;
case 18:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8);
+ _animationState = 19;
+ _animationFrame = 13 * ((8 - _animationFrame) / 8);
break;
case 17:
case 20:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 19;
+ _animationFrame = 0;
break;
case 16:
- dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16;
- dword_45A0D0_animation_state = 15;
+ _animationFrame = 12 - 12 * _animationFrame / 16;
+ _animationState = 15;
break;
case 14:
case 15:
@@ -1794,8 +1794,8 @@ void AIScriptMcCoy::sub_405800() {
case 21:
break;
default:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 15;
+ _animationFrame = 0;
break;
}
}
@@ -1803,19 +1803,19 @@ void AIScriptMcCoy::sub_405800() {
void AIScriptMcCoy::sub_4058B0() {
int v0 = Actor_Query_Which_Set_In(kActorMcCoy);
if (v0 == 27) {
- dword_45A0D0_animation_state = 51;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 51;
+ _animationFrame = 0;
Player_Loses_Control();
Game_Flag_Set(210);
} else if (v0 == 70 || v0 == 87) {
- dword_45A0D0_animation_state = 56;
- dword_45A0D4_animation_frame = 0;
+ _animationState = 56;
+ _animationFrame = 0;
}
}
void AIScriptMcCoy::sub_405920() {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 47;
+ _animationFrame = 0;
+ _animationState = 47;
}
void AIScriptMcCoy::sub_405940(float a1) {
diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp
index da6cdfc7e5..86b3ace09c 100644
--- a/engines/bladerunner/script/ai/officer_leary.cpp
+++ b/engines/bladerunner/script/ai/officer_leary.cpp
@@ -25,12 +25,12 @@
namespace BladeRunner {
void AIScriptOfficerLeary::Initialize() {
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- var_462880 = 0;
+ _animationState = 0;
+ _animationFrame = 0;
+ _animationStateNext = 0;
var_45D5B8 = 0;
var_45D5BC = 0;
- var_462884 = 0;
+ _animationNext = 0;
Actor_Put_In_Set(kActorOfficerLeary, 69);
Actor_Set_At_XYZ(kActorOfficerLeary, -261.80f, 6.00f, 79.58f, 512);
@@ -39,13 +39,13 @@ void AIScriptOfficerLeary::Initialize() {
}
bool AIScriptOfficerLeary::Update() {
- if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(kActorOfficerLeary) < 300) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorOfficerLeary) < 300) {
AI_Movement_Track_Flush(kActorOfficerLeary);
Actor_Set_Goal_Number(kActorOfficerLeary, 300);
- } else if (Global_Variable_Query(1) == 5 && Actor_Query_Goal_Number(kActorOfficerLeary) < 400) {
+ } else if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorOfficerLeary) < 400) {
AI_Movement_Track_Flush(kActorOfficerLeary);
Actor_Set_Goal_Number(kActorOfficerLeary, 400);
- } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(kFlagChromeDebrisTaken) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) {
+ } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(kFlagChromeDebrisTaken) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(kVariableChapter) < 3) {
Game_Flag_Set(kFlagRC01PoliceDone);
Actor_Set_Goal_Number(kActorOfficerLeary, 3);
} else if (Actor_Query_Goal_Number(kActorOfficerLeary) != 1 && Actor_Query_Goal_Number(kActorOfficerLeary) != 2 && Game_Flag_Query(199) == 1) {
@@ -491,324 +491,324 @@ bool AIScriptOfficerLeary::UpdateAnimation(int *animation, int *frame) {
int v57;
int a1;
- switch (var_45D5B0_animation_state) {
+ switch (_animationState) {
case 32:
*animation = 603;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(603)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(603)) {
*animation = 589;
- var_45D5B0_animation_state = 0;
+ _animationState = 0;
var_45D5B8 = 0;
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 31:
*animation = 604;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(604)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(604)) {
*animation = 601;
- var_45D5B0_animation_state = 1;
- var_45D5B4_animation_frame = 0;
+ _animationState = 1;
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 30:
*animation = 587;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(587)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(587)) {
*animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
Actor_Change_Animation_Mode(kActorOfficerLeary, 0);
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 29:
*animation = 586;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(586)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(586)) {
*animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
Actor_Change_Animation_Mode(kActorOfficerLeary, 0);
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 28:
*animation = 576;
- if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(576) - 1) {
- ++var_45D5B4_animation_frame;
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(576) - 1) {
+ ++_animationFrame;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 27:
*animation = 588;
- if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(588) - 1) {
- ++var_45D5B4_animation_frame;
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(588) - 1) {
+ ++_animationFrame;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 26:
*animation = 573;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(573)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(573)) {
+ _animationState = 21;
+ _animationFrame = 0;
*animation = 571;
Actor_Change_Animation_Mode(kActorOfficerLeary, 4);
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 25:
*animation = 572;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(572)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(572)) {
+ _animationState = 21;
+ _animationFrame = 0;
*animation = 571;
Actor_Change_Animation_Mode(kActorOfficerLeary, 4);
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 24:
*animation = 581;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame == 4) {
+ _animationFrame++;
+ if (_animationFrame == 4) {
if (Random_Query(1, 2) == 1) {
Sound_Play_Speech_Line(kActorOfficerLeary, 9010, 75, 0, 99);
} else {
Sound_Play_Speech_Line(kActorOfficerLeary, 9015, 75, 0, 99);
}
}
- if (var_45D5B4_animation_frame == 5) {
+ if (_animationFrame == 5) {
Actor_Combat_AI_Hit_Attempt(kActorOfficerLeary);
}
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(581)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(581)) {
+ _animationState = 21;
+ _animationFrame = 0;
*animation = 571;
Actor_Change_Animation_Mode(kActorOfficerLeary, 4);
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 23:
*animation = 580;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(580)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(580)) {
*animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 22:
*animation = 579;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(579)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(579)) {
+ _animationState = 21;
+ _animationFrame = 0;
*animation = 571;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 21:
*animation = 571;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(571)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(571)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 20:
*animation = 571;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(571) - 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(571) - 1) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 19:
*animation = 600;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(600)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(600)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 18:
*animation = 599;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(599)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(599)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 17:
*animation = 598;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(598)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(598)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 16:
*animation = 597;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(597)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(597)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 15:
*animation = 596;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(596)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(596)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 14:
*animation = 595;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(595)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(595)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 13:
*animation = 594;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(594)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(594)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 12:
*animation = 593;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(593)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(593)) {
+ _animationState = 11;
+ _animationFrame = 0;
*animation = 592;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 11:
- if (var_45D5BC && var_45D5B4_animation_frame <= 2) {
+ if (_animationFrame <= 2) {
var_45D5BC = 0;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
*animation = 589;
var_45D5B8 = Random_Query(0, 1);
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
}
*animation = 592;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(592)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(592)) {
+ _animationFrame = 0;
if (var_45D5BC) {
var_45D5BC = 0;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
*animation = 589;
var_45D5B8 = Random_Query(0, 1);
} else {
- var_45D5B0_animation_state = Random_Query(0, 8) + 11;
+ _animationState = Random_Query(0, 8) + 11;
}
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 10:
*animation = 578;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(578)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(578)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 9:
*animation = 577;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(577)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(577)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 8:
*animation = 575;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(575)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(575)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 7:
*animation = 574;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(574)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(574)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 6:
*animation = 585;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(585)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(585)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 5:
*animation = 584;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(584)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(584)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 4:
*animation = 583;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(583)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(583)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 3:
*animation = 582;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(582)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(582)) {
+ _animationFrame = 0;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 2:
if (Game_Flag_Query(199)) {
*animation = 603;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(603) - 1) {
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(603) - 1) {
Game_Flag_Reset(199);
- var_45D5B4_animation_frame = 0;
- var_45D5B0_animation_state = var_462880;
- *animation = var_462884;
+ _animationFrame = 0;
+ _animationState = _animationStateNext;
+ *animation = _animationNext;
}
} else {
if (var_45D5B8 == 0) {
@@ -820,71 +820,71 @@ bool AIScriptOfficerLeary::UpdateAnimation(int *animation, int *frame) {
if (var_45D5B8 == 2) {
*animation = 591;
}
- if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) {
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) {
a1 = *animation;
- var_45D5B4_animation_frame += 3;
- v57 = var_45D5B4_animation_frame;
+ _animationFrame += 3;
+ v57 = _animationFrame;
if (v57 > Slice_Animation_Query_Number_Of_Frames(a1) - 1) {
- var_45D5B4_animation_frame = 0;
- var_45D5B0_animation_state = var_462880;
- *animation = var_462884;
+ _animationFrame = 0;
+ _animationState = _animationStateNext;
+ *animation = _animationNext;
}
} else {
- var_45D5B4_animation_frame -= 3;
- if (var_45D5B4_animation_frame < 0) {
- var_45D5B4_animation_frame = 0;
- var_45D5B0_animation_state = var_462880;
- *animation = var_462884;
+ _animationFrame -= 3;
+ if (_animationFrame < 0) {
+ _animationFrame = 0;
+ _animationState = _animationStateNext;
+ *animation = _animationNext;
}
}
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 1:
*animation = 601;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(601)) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(601)) {
+ _animationFrame = 0;
}
if (!Game_Flag_Query(199)) {
- var_45D5B0_animation_state = 32;
- var_45D5B4_animation_frame = 0;
+ _animationState = 32;
+ _animationFrame = 0;
*animation = 603;
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
case 0:
if (Game_Flag_Query(199) && !Game_Flag_Query(KFlagMcCoyAndOfficerLearyTalking)) {
- var_45D5B0_animation_state = 31;
- var_45D5B4_animation_frame = 0;
+ _animationState = 31;
+ _animationFrame = 0;
*animation = 604;
} else if (var_45D5B8 == 1) {
*animation = 590;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(590)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(590)) {
var_45D5B8 = Random_Query(0, 2);
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
} else if (var_45D5B8 == 2) {
*animation = 591;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(591)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(591)) {
var_45D5B8 = Random_Query(0, 2);
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
} else if (var_45D5B8 == 0) {
*animation = 589;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(589)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(589)) {
var_45D5B8 = Random_Query(0, 2);
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
default:
*animation = 399;
- *frame = var_45D5B4_animation_frame;
+ *frame = _animationFrame;
return true;
}
}
@@ -894,17 +894,17 @@ bool AIScriptOfficerLeary::ChangeAnimationMode(int mode) {
switch (mode) {
case kAnimationModeIdle:
- switch (var_45D5B0_animation_state) {
+ switch (_animationState) {
case 21:
case 24:
- var_45D5B0_animation_state = 23;
- var_45D5B4_animation_frame = 0;
+ _animationState = 23;
+ _animationFrame = 0;
break;
case 20:
- v1 = var_45D5B4_animation_frame;
+ v1 = _animationFrame;
Actor_Change_Animation_Mode(kActorOfficerLeary, 4);
- var_45D5B4_animation_frame = v1;
- var_45D5B0_animation_state = 21;
+ _animationFrame = v1;
+ _animationState = 21;
break;
case 11:
case 12:
@@ -921,37 +921,37 @@ bool AIScriptOfficerLeary::ChangeAnimationMode(int mode) {
case 23:
break;
default:
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
var_45D5B8 = Random_Query(0, 1);
break;
}
break;
case kAnimationModeWalk:
- var_45D5B0_animation_state = 3;
- var_45D5B4_animation_frame = 0;
+ _animationState = 3;
+ _animationFrame = 0;
break;
case kAnimationModeRun:
- var_45D5B0_animation_state = 4;
- var_45D5B4_animation_frame = 0;
+ _animationState = 4;
+ _animationFrame = 0;
break;
case 3:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 11;
- var_462884 = 592;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 11;
+ _animationNext = 592;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 11;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case kAnimationModeCombatIdle:
- switch (var_45D5B0_animation_state) {
+ switch (_animationState) {
case 21:
case 22:
case 24:
@@ -960,173 +960,173 @@ bool AIScriptOfficerLeary::ChangeAnimationMode(int mode) {
case 8:
case 9:
case 10:
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
+ _animationState = 21;
+ _animationFrame = 0;
break;
case 0:
- var_45D5B0_animation_state = 22;
- var_45D5B4_animation_frame = 0;
+ _animationState = 22;
+ _animationFrame = 0;
break;
default:
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
+ _animationState = 21;
+ _animationFrame = 0;
break;
}
break;
case 6:
- var_45D5B0_animation_state = 24;
- var_45D5B4_animation_frame = 0;
+ _animationState = 24;
+ _animationFrame = 0;
break;
case kAnimationModeCombatWalk:
- var_45D5B0_animation_state = 7;
- var_45D5B4_animation_frame = 0;
+ _animationState = 7;
+ _animationFrame = 0;
break;
case kAnimationModeCombatRun:
- var_45D5B0_animation_state = 8;
- var_45D5B4_animation_frame = 0;
+ _animationState = 8;
+ _animationFrame = 0;
break;
case 12:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 12;
- var_462884 = 593;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 12;
+ _animationNext = 593;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 12;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 12;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 13:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 13;
- var_462884 = 594;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 13;
+ _animationNext = 594;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 13;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 13;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 14:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 14;
- var_462884 = 595;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 14;
+ _animationNext = 595;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 14;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 14;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 15:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 15;
- var_462884 = 596;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 15;
+ _animationNext = 596;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 15;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 15;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 16:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 16;
- var_462884 = 597;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 16;
+ _animationNext = 597;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 16;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 16;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 17:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 17;
- var_462884 = 598;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 17;
+ _animationNext = 598;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
}
- else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 17;
- var_45D5B4_animation_frame = 0;
+ else if (_animationState > 19) {
+ _animationState = 17;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 18:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 18;
- var_462884 = 599;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 18;
+ _animationNext = 599;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 18;
- var_45D5B4_animation_frame = 0;
+ } else if (_animationState > 19) {
+ _animationState = 18;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 19:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 19;
- var_462884 = 600;
+ if (_animationState == 1) {
+ _animationState = 2;
+ _animationStateNext = 19;
+ _animationNext = 600;
if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 19;
- var_45D5B4_animation_frame = 0;
+ } else if (_animationState > 19) {
+ _animationState = 19;
+ _animationFrame = 0;
var_45D5BC = 0;
}
break;
case 21:
- if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 24) {
+ if (_animationState == 24) {
if (Random_Query(0, 1)) {
- var_45D5B0_animation_state = 25;
+ _animationState = 25;
} else {
- var_45D5B0_animation_state = 26;
+ _animationState = 26;
}
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
} else {
if (Random_Query(0, 1)) {
- var_45D5B0_animation_state = 29;
+ _animationState = 29;
} else {
- var_45D5B0_animation_state = 30;
+ _animationState = 30;
}
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
}
break;
case 22:
if (Random_Query(0, 1)) {
- var_45D5B0_animation_state = 25;
+ _animationState = 25;
} else {
- var_45D5B0_animation_state = 26;
+ _animationState = 26;
}
- var_45D5B4_animation_frame = 0;
+ _animationFrame = 0;
break;
case 27:
Game_Flag_Reset(199);
@@ -1135,50 +1135,50 @@ bool AIScriptOfficerLeary::ChangeAnimationMode(int mode) {
Game_Flag_Set(199);
break;
case 44:
- var_45D5B0_animation_state = 5;
- var_45D5B4_animation_frame = 0;
+ _animationState = 5;
+ _animationFrame = 0;
break;
case 45:
- var_45D5B0_animation_state = 6;
- var_45D5B4_animation_frame = 0;
+ _animationState = 6;
+ _animationFrame = 0;
break;
case 46:
- var_45D5B0_animation_state = 9;
- var_45D5B4_animation_frame = 0;
+ _animationState = 9;
+ _animationFrame = 0;
break;
case 47:
- var_45D5B0_animation_state = 10;
- var_45D5B4_animation_frame = 0;
+ _animationState = 10;
+ _animationFrame = 0;
break;
case 48:
- if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 22 || var_45D5B0_animation_state == 24) {
- var_45D5B0_animation_state = 28;
- var_45D5B4_animation_frame = 0;
+ if (_animationState == 24) {
+ _animationState = 28;
+ _animationFrame = 0;
} else {
- var_45D5B0_animation_state = 27;
- var_45D5B4_animation_frame = 0;
+ _animationState = 27;
+ _animationFrame = 0;
}
break;
case 58:
- var_45D5B0_animation_state = 20;
- var_45D5B4_animation_frame = 0;
+ _animationState = 20;
+ _animationFrame = 0;
break;
}
return true;
}
-void AIScriptOfficerLeary::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
- *animationState = var_45D5B0_animation_state;
- *animationFrame = var_45D5B4_animation_frame;
- *a3 = var_462880;
- *a4 = var_462884;
+void AIScriptOfficerLeary::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
}
-void AIScriptOfficerLeary::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
- var_45D5B0_animation_state = animationState;
- var_45D5B4_animation_frame = animationFrame;
- var_462880 = a3;
- var_462884 = a4;
+void AIScriptOfficerLeary::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
}
bool AIScriptOfficerLeary::ReachedMovementTrackWaypoint(int waypointId) {
diff --git a/engines/bladerunner/script/ai/runciter.cpp b/engines/bladerunner/script/ai/runciter.cpp
index c0c3d3ff68..c18dd2d5f0 100644
--- a/engines/bladerunner/script/ai/runciter.cpp
+++ b/engines/bladerunner/script/ai/runciter.cpp
@@ -24,10 +24,17 @@
namespace BladeRunner {
+enum kRunciterStates {
+ kRunciterStateIdle = 0,
+ kRunciterStateWalking = 1,
+ kRunciterStateDying = 14,
+ kRunciterStateDead = 15
+};
+
void AIScriptRunciter::Initialize() {
- var_45CD70_animation_state = 0;
- var_45CD74_animation_frame = 0;
- var_462800 = 0;
+ _animationState = 0;
+ _animationFrame = 0;
+ _animationStateNext = 0;
var_45CD78 = 0;
var_45CD7C = 6;
var_45CD80 = 1;
@@ -40,7 +47,7 @@ bool AIScriptRunciter::Update() {
if (Actor_Query_Goal_Number(kActorRunciter) == 0 && Game_Flag_Query(kFlagRC01PoliceDone)) {
Actor_Set_Goal_Number(kActorRunciter, 2);
}
- if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(kActorRunciter) < 300) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorRunciter) < 300) {
Actor_Set_Goal_Number(kActorRunciter, 300);
}
return false;
@@ -195,219 +202,219 @@ bool AIScriptRunciter::GoalChanged(int currentGoalNumber, int newGoalNumber) {
bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
- switch (var_45CD70_animation_state) {
- case 15:
+ switch (_animationState) {
+ case kRunciterStateDead:
*animation = 528;
- var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(528) - 1;
- *frame = var_45CD74_animation_frame;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(528) - 1;
+ *frame = _animationFrame;
break;
- case 14:
+ case kRunciterStateDying:
*animation = 528;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(528) - 1) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(528) - 1) {
*animation = 528;
- var_45CD70_animation_state = 15;
+ _animationState = kRunciterStateDead;
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 13:
if (var_45CD78 == 0) {
- var_45CD74_animation_frame = 0;
- var_45CD70_animation_state = var_462800;
- *animation = var_462804;
+ _animationFrame = 0;
+ _animationState = _animationStateNext;
+ *animation = _animationNext;
} else if (var_45CD78 == 1) {
*animation = 530;
- var_45CD74_animation_frame += 3;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) {
- var_45CD74_animation_frame = 0;
- var_45CD70_animation_state = var_462800;
- *animation = var_462804;
+ _animationFrame += 3;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(530)) {
+ _animationFrame = 0;
+ _animationState = _animationStateNext;
+ *animation = _animationNext;
}
} else if (var_45CD78 == 2) {
*animation = 531;
- var_45CD74_animation_frame -= 3;
- if (var_45CD74_animation_frame - 3 < 0) {
- var_45CD74_animation_frame = 0;
- var_45CD70_animation_state = var_462800;
- *animation = var_462804;
+ _animationFrame -= 3;
+ if (_animationFrame - 3 < 0) {
+ _animationFrame = 0;
+ _animationState = _animationStateNext;
+ *animation = _animationNext;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 12:
*animation = 532;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(532)) {
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(532)) {
*animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD74_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
var_45CD78 = 0;
Actor_Change_Animation_Mode(kActorRunciter, kAnimationModeCombatIdle);
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 11:
*animation = 541;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(541)) {
- var_45CD74_animation_frame = 0;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(541)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 10:
*animation = 540;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(540)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(540)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 9:
*animation = 539;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(539)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(539)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 8:
*animation = 538;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(538)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(538)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 7:
*animation = 537;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(537)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(537)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 6:
*animation = 536;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(536)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(536)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 5:
*animation = 535;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(535)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(535)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 4:
*animation = 534;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(534)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(534)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
*animation = 533;
- var_45CD70_animation_state = 2;
+ _animationState = 2;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
case 2:
*animation = 533;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(533)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(533)) {
+ _animationFrame = 0;
if (var_45CD88) {
*animation = 529;
- var_45CD70_animation_state = 0;
+ _animationState = 0;
var_45CD78 = 0;
} else {
- var_45CD70_animation_state = 4;
+ _animationState = 4;
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
- case 1:
+ case kRunciterStateWalking:
*animation = 526;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(526)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(526)) {
+ _animationFrame = 0;
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
- case 0:
+ case kRunciterStateIdle:
if (var_45CD78 == 0) {
*animation = 529;
if (var_45CD84) {
var_45CD84--;
} else {
- var_45CD74_animation_frame += var_45CD80;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(529)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame += var_45CD80;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(529)) {
+ _animationFrame = 0;
}
- if (var_45CD74_animation_frame < 0) {
- var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(529) - 1;
+ if (_animationFrame < 0) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(529) - 1;
}
--var_45CD7C;
if (var_45CD7C == 0) {
@@ -415,7 +422,7 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
var_45CD7C = Random_Query(6, 14);
var_45CD84 = Random_Query(0, 4);
}
- if (var_45CD74_animation_frame == 0) {
+ if (_animationFrame == 0) {
if (Random_Query(0, 1) == 1) {
var_45CD78 = Random_Query(1, 2);
var_45CD80 = 1;
@@ -425,9 +432,9 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
}
} else if (var_45CD78 == 1) {
*animation = 530;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) {
- var_45CD74_animation_frame = 0;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(530)) {
+ _animationFrame = 0;
var_45CD78 = 0;
*animation = 529;
var_45CD7C = Random_Query(6, 14);
@@ -438,13 +445,13 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
if (var_45CD84) {
var_45CD84--;
} else {
- var_45CD74_animation_frame += var_45CD80;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+ _animationFrame += var_45CD80;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
var_45CD84 = Random_Query(5, 15);
var_45CD80 = -1;
}
- if (var_45CD74_animation_frame <= 0) {
- var_45CD74_animation_frame = 0;
+ if (_animationFrame <= 0) {
+ _animationFrame = 0;
var_45CD78 = 0;
*animation = 529;
var_45CD7C = Random_Query(6, 14);
@@ -452,12 +459,12 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
}
}
}
- *frame = var_45CD74_animation_frame;
+ *frame = _animationFrame;
break;
default:
*animation = 399;
- var_45CD74_animation_frame = 0;
- *frame = var_45CD74_animation_frame;
+ _animationFrame = 0;
+ *frame = _animationFrame;
break;
}
return true;
@@ -466,147 +473,147 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
bool AIScriptRunciter::ChangeAnimationMode(int mode) {
switch (mode) {
case kAnimationModeCombatIdle:
- if (var_45CD70_animation_state >= 2 && var_45CD70_animation_state <= 11) {
+ if (_animationState <= 11) {
var_45CD88 = 1;
} else {
- var_45CD70_animation_state = 0;
- var_45CD74_animation_frame = 0;
+ _animationState = 0;
+ _animationFrame = 0;
var_45CD78 = 0;
}
break;
case kAnimationModeWalk:
- if (var_45CD70_animation_state > 1) {
- var_45CD70_animation_state = 1;
- var_45CD74_animation_frame = 0;
- } else if (!var_45CD70_animation_state) {
- var_45CD70_animation_state = 13;
- var_462800 = 1;
- var_462804 = 526;
+ if (_animationState > 1) {
+ _animationState = 1;
+ _animationFrame = 0;
+ } else if (!_animationState) {
+ _animationState = 13;
+ _animationStateNext = 1;
+ _animationNext = 526;
}
break;
case 3:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 2;
- var_462804 = 526;
+ _animationState = 13;
+ _animationStateNext = 2;
+ _animationNext = 526;
}
var_45CD88 = 0;
break;
case 12:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 4;
- var_462804 = 534;
+ _animationState = 13;
+ _animationStateNext = 4;
+ _animationNext = 534;
}
var_45CD88 = 0;
break;
case 13:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 5;
- var_462804 = 535;
+ _animationState = 13;
+ _animationStateNext = 5;
+ _animationNext = 535;
}
var_45CD88 = 0;
break;
case 14:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 6;
- var_462804 = 536;
+ _animationState = 13;
+ _animationStateNext = 6;
+ _animationNext = 536;
}
var_45CD88 = 0;
break;
case 15:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 7;
- var_462804 = 537;
+ _animationState = 13;
+ _animationStateNext = 7;
+ _animationNext = 537;
}
var_45CD88 = 0;
break;
case 16:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 8;
- var_462804 = 538;
+ _animationState = 13;
+ _animationStateNext = 8;
+ _animationNext = 538;
}
var_45CD88 = 0;
break;
case 17:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 9;
- var_462804 = 539;
+ _animationState = 13;
+ _animationStateNext = 9;
+ _animationNext = 539;
}
var_45CD88 = 0;
break;
case 18:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 10;
- var_462804 = 540;
+ _animationState = 13;
+ _animationStateNext = 10;
+ _animationNext = 540;
}
var_45CD88 = 0;
break;
case 19:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
+ if (_animationState) {
+ _animationState = 2;
+ _animationFrame = 0;
} else {
- var_45CD70_animation_state = 13;
- var_462800 = 11;
- var_462804 = 541;
+ _animationState = 13;
+ _animationStateNext = 11;
+ _animationNext = 541;
}
var_45CD88 = 0;
break;
case 23:
- var_45CD70_animation_state = 12;
- var_45CD74_animation_frame = 0;
+ _animationState = 12;
+ _animationFrame = 0;
break;
case 48:
- var_45CD70_animation_state = 14;
- var_45CD74_animation_frame = 0;
+ _animationState = 14;
+ _animationFrame = 0;
break;
}
return true;
}
-void AIScriptRunciter::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
- *animationState = var_45CD70_animation_state;
- *animationFrame = var_45CD74_animation_frame;
- *a3 = var_462800;
- *a4 = var_462804;
+void AIScriptRunciter::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
}
-void AIScriptRunciter::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
- var_45CD70_animation_state = animationState;
- var_45CD74_animation_frame = animationFrame;
- var_462800 = a3;
- var_462804 = a4;
+void AIScriptRunciter::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
}
bool AIScriptRunciter::ReachedMovementTrackWaypoint(int waypointId) {
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index c90d023ffb..40df2fb0d8 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -30,6 +30,12 @@ namespace BladeRunner {
class BladeRunnerEngine;
class AIScriptBase : public ScriptBase {
+protected:
+ int _animationState;
+ int _animationFrame;
+ int _animationStateNext;
+ int _animationNext;
+
public:
AIScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {}
@@ -50,8 +56,8 @@ public:
virtual bool GoalChanged(int currentGoalNumber, int newGoalNumber) = 0;
virtual bool UpdateAnimation(int *animation, int *frame) = 0;
virtual bool ChangeAnimationMode(int mode) = 0;
- virtual void QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) = 0;
- virtual void SetAnimationState(int animationState, int animationFrame, int a3, int a4) = 0;
+ virtual void QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *nextAnimation) = 0;
+ virtual void SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) = 0;
virtual bool ReachedMovementTrackWaypoint(int waypointId) = 0;
virtual void FledCombat() = 0;
};
@@ -79,16 +85,14 @@ public: \
bool GoalChanged(int currentGoalNumber, int newGoalNumber); \
bool UpdateAnimation(int *animation, int *frame); \
bool ChangeAnimationMode(int mode); \
- void QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4); \
- void SetAnimationState(int animationState, int animationFrame, int a3, int a4); \
+ void QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext); \
+ void SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext); \
bool ReachedMovementTrackWaypoint(int waypointId); \
void FledCombat(); \
private:
#define END_SCRIPT };
DECLARE_SCRIPT(McCoy)
- int dword_45A0D0_animation_state;
- int dword_45A0D4_animation_frame;
int dword_45A0D8;
int dword_45A0DC;
int dword_45A0E0;
@@ -99,8 +103,6 @@ DECLARE_SCRIPT(McCoy)
int dword_45A0F4;
int dword_45A0F8;
int dword_45A0FC;
- int dword_462718;
- int dword_46271C;
float off_45A100;
float flt_462710;
float flt_462714;
@@ -116,10 +118,6 @@ DECLARE_SCRIPT(McCoy)
END_SCRIPT
DECLARE_SCRIPT(Runciter)
- int var_45CD70_animation_state;
- int var_45CD74_animation_frame;
- int var_462800;
- int var_462804;
int var_45CD78;
int var_45CD7C;
int var_45CD80;
@@ -128,23 +126,15 @@ DECLARE_SCRIPT(Runciter)
END_SCRIPT
DECLARE_SCRIPT(OfficerLeary)
- int var_45D5B0_animation_state;
- int var_45D5B4_animation_frame;
int var_45D5B8;
int var_45D5BC;
- int var_462880;
- int var_462884;
bool sub_431408();
bool sub_431420();
END_SCRIPT
DECLARE_SCRIPT(Leon)
- int var_45EDB0_animation_state;
- int var_45EDB4_animation_frame;
int var_45EDAC;
- int var_462AF0;
- int var_462AF4;
float var_45EDA0_z;
float var_45EDA4_y;
float var_45EDA8_x;
@@ -153,10 +143,6 @@ DECLARE_SCRIPT(Leon)
END_SCRIPT
DECLARE_SCRIPT(Maggie)
- int var_45F3F0_animation_state;
- int var_45F3F4_animation_frame;
- int var_462B30;
- int var_462B34;
int var_45F3F8;
int var_45F3FC;
int var_45F400;
diff --git a/engines/bladerunner/script/scene/ar02.cpp b/engines/bladerunner/script/scene/ar02.cpp
index 72ec31fdb1..d68efb377f 100644
--- a/engines/bladerunner/script/scene/ar02.cpp
+++ b/engines/bladerunner/script/scene/ar02.cpp
@@ -80,7 +80,7 @@ void SceneScriptAR02::SceneLoaded() {
if (!Game_Flag_Query(374)) {
Item_Add_To_World(106, 976, 0, -442.84f, 36.77f, -1144.51f, 360, 36, 36, false, true, false, true);
}
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(374)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(374)) {
Game_Flag_Set(0);
Item_Remove_From_World(106);
}
@@ -99,7 +99,7 @@ bool SceneScriptAR02::ClickedOnActor(int actorId) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) {
Actor_Face_Actor(kActorMcCoy, kActorInsectDealer, true);
Actor_Face_Actor(kActorInsectDealer, kActorMcCoy, true);
- if (Global_Variable_Query(1) == 2) {
+ if (Global_Variable_Query(kVariableChapter) == 2) {
if (Game_Flag_Query(329) && !Game_Flag_Query(366)) {
Game_Flag_Set(366);
Player_Loses_Control();
@@ -122,7 +122,7 @@ bool SceneScriptAR02::ClickedOnActor(int actorId) {
} else {
sub_402694();
}
- } else if (Global_Variable_Query(1) > 2) {
+ } else if (Global_Variable_Query(kVariableChapter) > 2) {
if (Actor_Clue_Query(kActorMcCoy, kCluePeruvianLadyInterview) && !Actor_Clue_Query(kActorMcCoy, kClueDragonflyCollection)) {
Actor_Says(kActorMcCoy, 205, 16);
Actor_Says(kActorInsectDealer, 290, 12);
@@ -152,7 +152,7 @@ bool SceneScriptAR02::ClickedOnActor(int actorId) {
return true;
}
}
- if (actorId == 20 && Global_Variable_Query(1) == 2) {
+ if (actorId == 20 && Global_Variable_Query(kVariableChapter) == 2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -240.79f, 0.0f, -1328.89f, 12, 1, false, 0)) {
Actor_Face_Actor(kActorMcCoy, kActorHasan, true);
Actor_Face_Actor(kActorHasan, kActorMcCoy, true);
diff --git a/engines/bladerunner/script/scene/bb03.cpp b/engines/bladerunner/script/scene/bb03.cpp
index c2444c1daa..0b080f6ae8 100644
--- a/engines/bladerunner/script/scene/bb03.cpp
+++ b/engines/bladerunner/script/scene/bb03.cpp
@@ -104,7 +104,7 @@ bool SceneScriptBB03::ClickedOnExit(int exitId) {
}
if (exitId == 2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 204.0f, 60.16f, -164.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) < 4) {
+ if (Global_Variable_Query(kVariableChapter) < 4) {
if (Actor_Query_Goal_Number(kActorSebastian) == 200) {
Actor_Says(kActorSebastian, 70, 3);
Actor_Says(kActorMcCoy, 7010, 13);
diff --git a/engines/bladerunner/script/scene/bb11.cpp b/engines/bladerunner/script/scene/bb11.cpp
index faa4a6e8a8..e18ad1ffbb 100644
--- a/engines/bladerunner/script/scene/bb11.cpp
+++ b/engines/bladerunner/script/scene/bb11.cpp
@@ -113,7 +113,7 @@ void SceneScriptBB11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptBB11::PlayerWalkedIn() {
- if (Actor_Query_Goal_Number(kActorSadik) == 102 && Global_Variable_Query(1) == 2) {
+ if (Actor_Query_Goal_Number(kActorSadik) == 102 && Global_Variable_Query(kVariableChapter) == 2) {
Actor_Set_Invisible(kActorMcCoy, true);
Actor_Set_Goal_Number(kActorSadik, 103);
Music_Play(11, 61, 0, 1, -1, 0, 0);
diff --git a/engines/bladerunner/script/scene/ct01.cpp b/engines/bladerunner/script/scene/ct01.cpp
index 330339e528..e0af940627 100644
--- a/engines/bladerunner/script/scene/ct01.cpp
+++ b/engines/bladerunner/script/scene/ct01.cpp
@@ -36,7 +36,7 @@ void SceneScriptCT01::InitializeScene() {
} else if (Game_Flag_Query(88)) {
Game_Flag_Reset(88);
Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 28);
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
if (Game_Flag_Query(kFlagSpinnerToCT01)) {
Scene_Loop_Start_Special(0, 0, 0);
} else {
@@ -403,7 +403,7 @@ void SceneScriptCT01::PlayerWalkedOut() {
Ambient_Sounds_Remove_All_Looping_Sounds(1);
}
Music_Stop(5);
- if (!Game_Flag_Query(176) && Global_Variable_Query(1)) {
+ if (!Game_Flag_Query(176) && Global_Variable_Query(kVariableChapter)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeTowards3, true, -1);
diff --git a/engines/bladerunner/script/scene/ct04.cpp b/engines/bladerunner/script/scene/ct04.cpp
index fd7afa56fb..6eadc38d88 100644
--- a/engines/bladerunner/script/scene/ct04.cpp
+++ b/engines/bladerunner/script/scene/ct04.cpp
@@ -72,7 +72,7 @@ bool SceneScriptCT04::ClickedOn3DObject(const char *objectName, bool a2) {
Game_Flag_Set(137);
Actor_Set_Goal_Number(kActorTransient, 2);
}
- if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172) && Global_Variable_Query(1) == 1) {
+ if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172) && Global_Variable_Query(kVariableChapter) == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -147.41f, -621.3f, 724.57f, 0, 1, false, 0)) {
Player_Loses_Control();
Actor_Face_Heading(kActorMcCoy, 792, false);
@@ -160,7 +160,7 @@ bool SceneScriptCT04::ClickedOnActor(int actorId) {
if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorTransient, 36, 1, false)) {
Actor_Face_Actor(kActorMcCoy, kActorTransient, true);
if (!Game_Flag_Query(137)) {
- if (Game_Flag_Query(40)) {
+ if (Game_Flag_Query(kFlagZubenRetired)) {
Actor_Says(kActorMcCoy, 435, 3);
Actor_Set_Goal_Number(kActorTransient, 2);
} else {
diff --git a/engines/bladerunner/script/scene/ct06.cpp b/engines/bladerunner/script/scene/ct06.cpp
index 1bb00c1ca1..d2163aaf3e 100644
--- a/engines/bladerunner/script/scene/ct06.cpp
+++ b/engines/bladerunner/script/scene/ct06.cpp
@@ -35,7 +35,7 @@ void SceneScriptCT06::InitializeScene() {
}
Scene_Exit_Add_2D_Exit(0, 0, 440, 639, 479, 2);
Scene_Exit_Add_2D_Exit(1, 401, 162, 536, 317, 0);
- if (Game_Flag_Query(40) && Actor_Query_In_Set(kActorZuben, 30)) {
+ if (Game_Flag_Query(kFlagZubenRetired) && Actor_Query_In_Set(kActorZuben, 30)) {
Actor_Put_In_Set(kActorZuben, 29);
Actor_Set_At_XYZ(kActorZuben, 58.41f, -58.23f, -24.97f, 240);
Actor_Retired_Here(kActorZuben, 72, 36, 1, kActorMcCoy);
@@ -140,7 +140,7 @@ bool SceneScriptCT06::ClickedOnExit(int exitId) {
return true;
}
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 203.91f, -58.02f, 0.47f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) < 3) {
+ if (Global_Variable_Query(kVariableChapter) < 3) {
Actor_Face_Object(kActorMcCoy, "DOOR", true);
Actor_Says(kActorMcCoy, 8522, 12);
} else {
diff --git a/engines/bladerunner/script/scene/ct09.cpp b/engines/bladerunner/script/scene/ct09.cpp
index 40a7706b3a..4f81a9ee95 100644
--- a/engines/bladerunner/script/scene/ct09.cpp
+++ b/engines/bladerunner/script/scene/ct09.cpp
@@ -74,7 +74,7 @@ bool SceneScriptCT09::ClickedOnActor(int actorId) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 270.0f, 348.52f, 846.0f, 12, 1, false, 0)) {
Player_Loses_Control();
Actor_Face_Actor(kActorMcCoy, kActorDeskClerk, true);
- if (Global_Variable_Query(1) < 3) {
+ if (Global_Variable_Query(kVariableChapter) < 3) {
Actor_Says(kActorMcCoy, 650, 3);
Actor_Says(kActorDeskClerk, 250, 12);
Actor_Says(kActorMcCoy, 665, 18);
@@ -152,7 +152,7 @@ void SceneScriptCT09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptCT09::PlayerWalkedIn() {
bool v0 = false;
- if (Global_Variable_Query(1) == 3 && !Game_Flag_Query(538)) {
+ if (Global_Variable_Query(kVariableChapter) == 3 && !Game_Flag_Query(538)) {
Game_Flag_Set(538);
Actor_Set_Goal_Number(kActorLeon, 1);
v0 = true;
diff --git a/engines/bladerunner/script/scene/ct11.cpp b/engines/bladerunner/script/scene/ct11.cpp
index ad46be78cd..63d114ebfb 100644
--- a/engines/bladerunner/script/scene/ct11.cpp
+++ b/engines/bladerunner/script/scene/ct11.cpp
@@ -41,7 +41,7 @@ void SceneScriptCT11::InitializeScene() {
Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0);
- if (Global_Variable_Query(1) <= 3) {
+ if (Global_Variable_Query(kVariableChapter) <= 3) {
Scene_Loop_Set_Default(0);
} else {
Scene_Loop_Set_Default(2);
@@ -52,7 +52,7 @@ void SceneScriptCT11::SceneLoaded() {
Obstacle_Object("TRASH CAN", true);
Unobstacle_Object("BOX NORTHWEST 1", true);
Unobstacle_Object("BOX SOUTH 1", true);
- if (Global_Variable_Query(1) < 4) {
+ if (Global_Variable_Query(kVariableChapter) < 4) {
if (!Game_Flag_Query(645)) {
Item_Add_To_World(115, 951, 33, 640.21002f, 30.0f, 470.0f, 512, 12, 12, false, true, false, true);
Scene_2D_Region_Add(0, 505, 316, 513, 321);
diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp
index 7800a55dc8..e8d3a5b804 100644
--- a/engines/bladerunner/script/scene/ct12.cpp
+++ b/engines/bladerunner/script/scene/ct12.cpp
@@ -41,10 +41,10 @@ void SceneScriptCT12::InitializeScene() {
Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3);
Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0);
Scene_Exit_Add_2D_Exit(2, 500, 180, 619, 346, 0);
- if (Global_Variable_Query(1) > 2) {
+ if (Global_Variable_Query(kVariableChapter) > 2) {
Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1);
}
- if (Global_Variable_Query(1) > 3) {
+ if (Global_Variable_Query(kVariableChapter) > 3) {
Scene_Exit_Add_2D_Exit(4, 324, 150, 435, 340, 0);
}
Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1);
@@ -59,19 +59,19 @@ void SceneScriptCT12::InitializeScene() {
Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- if (Global_Variable_Query(1) < 2 && Actor_Query_Goal_Number(kActorGaff) == 1) {
+ if (Global_Variable_Query(kVariableChapter) < 2 && Actor_Query_Goal_Number(kActorGaff) == 1) {
Actor_Put_In_Set(kActorGaff, 4);
Actor_Set_At_XYZ(kActorGaff, -534.0f, -6.5f, 952.0f, 367);
Game_Flag_Set(294);
}
if (Game_Flag_Query(123) && Game_Flag_Query(kFlagSpinnerToCT01)) {
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
Scene_Loop_Start_Special(0, 1, 0);
}
Scene_Loop_Set_Default(2);
Game_Flag_Reset(123);
} else if (Game_Flag_Query(123) && !Game_Flag_Query(kFlagSpinnerToCT01)) {
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
Scene_Loop_Start_Special(0, 0, 0);
}
Scene_Loop_Set_Default(2);
@@ -108,7 +108,7 @@ bool SceneScriptCT12::ClickedOnActor(int actorId) {
Actor_Face_Actor(kActorMcCoy, kActorHowieLee, true);
Actor_Says(kActorMcCoy, 8910, 16);
}
- if (actorId == 24 && Global_Variable_Query(1) == 4 && Game_Flag_Query(671) && Game_Flag_Query(703)) {
+ if (actorId == 24 && Global_Variable_Query(kVariableChapter) == 4 && Game_Flag_Query(671) && Game_Flag_Query(703)) {
Actor_Face_Actor(kActorOfficerGrayford, kActorMcCoy, true);
Actor_Face_Actor(kActorMcCoy, kActorOfficerGrayford, true);
Actor_Says(kActorMcCoy, 710, 3);
@@ -174,7 +174,7 @@ bool SceneScriptCT12::ClickedOnExit(int exitId) {
}
if (exitId == 4) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -292.0f, -6.5f, 990.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) == 4) {
+ if (Global_Variable_Query(kVariableChapter) == 4) {
Game_Flag_Set(629);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
@@ -230,7 +230,7 @@ void SceneScriptCT12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptCT12::PlayerWalkedIn() {
- if (Global_Variable_Query(1) < 2 && !Game_Flag_Query(64) && Actor_Query_Goal_Number(kActorGaff) == 1) {
+ if (Global_Variable_Query(kVariableChapter) < 2 && !Game_Flag_Query(64) && Actor_Query_Goal_Number(kActorGaff) == 1) {
Player_Loses_Control();
Loop_Actor_Walk_To_Actor(kActorGaff, kActorMcCoy, 48, 0, false);
Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
@@ -255,7 +255,7 @@ void SceneScriptCT12::PlayerWalkedIn() {
Actor_Says(kActorMcCoy, 700, 3);
Actor_Says(kActorGaff, 70, 3);
Actor_Clue_Acquire(kActorGaff, kClueMcCoyRetiredZuben, 1, -1);
- } else if (Game_Flag_Query(64) && Game_Flag_Query(41)) {
+ } else if (Game_Flag_Query(64) && Game_Flag_Query(kFlagZubenSpared)) {
Actor_Says(kActorGaff, 80, 3);
Actor_Says(kActorGaff, 90, 3);
Actor_Says(kActorMcCoy, 705, 3);
diff --git a/engines/bladerunner/script/scene/dr01.cpp b/engines/bladerunner/script/scene/dr01.cpp
index ea609f538e..685076ceb8 100644
--- a/engines/bladerunner/script/scene/dr01.cpp
+++ b/engines/bladerunner/script/scene/dr01.cpp
@@ -36,10 +36,10 @@ void SceneScriptDR01::InitializeScene() {
}
Scene_Exit_Add_2D_Exit(0, 240, 60, 450, 250, 0);
Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3);
- if (Game_Flag_Query(kFlagSpinnerToDR01) && Global_Variable_Query(1) < 4) {
+ if (Game_Flag_Query(kFlagSpinnerToDR01) && Global_Variable_Query(kVariableChapter) < 4) {
Scene_Exit_Add_2D_Exit(2, 610, 0, 639, 479, 1);
}
- if (Global_Variable_Query(1) >= 3) {
+ if (Global_Variable_Query(kVariableChapter) >= 3) {
Scene_Exit_Add_2D_Exit(3, 0, 45, 142, 201, 0);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(0);
diff --git a/engines/bladerunner/script/scene/dr02.cpp b/engines/bladerunner/script/scene/dr02.cpp
index 6e71bb1d9d..cbdb1ddcd7 100644
--- a/engines/bladerunner/script/scene/dr02.cpp
+++ b/engines/bladerunner/script/scene/dr02.cpp
@@ -128,7 +128,7 @@ bool SceneScriptDR02::ClickedOnExit(int exitId) {
}
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1162.0f, 7.18f, -322.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) > 2) {
+ if (Global_Variable_Query(kVariableChapter) > 2) {
Actor_Says(kActorMcCoy, 8522, 15);
} else {
Game_Flag_Set(226);
diff --git a/engines/bladerunner/script/scene/dr03.cpp b/engines/bladerunner/script/scene/dr03.cpp
index cdee6a181d..d3113ca7f8 100644
--- a/engines/bladerunner/script/scene/dr03.cpp
+++ b/engines/bladerunner/script/scene/dr03.cpp
@@ -31,7 +31,7 @@ void SceneScriptDR03::InitializeScene() {
}
Setup_Scene_Information(330.31f, 4.27f, -910.91f, 297);
Scene_Exit_Add_2D_Exit(0, 377, 122, 445, 266, 0);
- if (Global_Variable_Query(1) == 3) {
+ if (Global_Variable_Query(kVariableChapter) == 3) {
Actor_Put_In_Set(kActorChew, 34);
Actor_Set_At_XYZ(kActorChew, 431.21f, 4.27f, -776.26f, 0);
} else {
diff --git a/engines/bladerunner/script/scene/dr06.cpp b/engines/bladerunner/script/scene/dr06.cpp
index aedfa4550d..ebc19bce41 100644
--- a/engines/bladerunner/script/scene/dr06.cpp
+++ b/engines/bladerunner/script/scene/dr06.cpp
@@ -31,7 +31,7 @@ void SceneScriptDR06::InitializeScene() {
Setup_Scene_Information(-707.57001f, 136.60001f, -1132.64f, 472);
}
Scene_Exit_Add_2D_Exit(0, 601, 11, 639, 479, 1);
- if (Global_Variable_Query(1) > 3 && Game_Flag_Query(715)) {
+ if (Global_Variable_Query(kVariableChapter) > 3 && Game_Flag_Query(715)) {
Scene_Exit_Add_2D_Exit(1, 0, 272, 46, 477, 2);
}
Ambient_Sounds_Add_Looping_Sound(383, 25, 0, 1);
diff --git a/engines/bladerunner/script/scene/hc03.cpp b/engines/bladerunner/script/scene/hc03.cpp
index bf9330dd97..092fcca70b 100644
--- a/engines/bladerunner/script/scene/hc03.cpp
+++ b/engines/bladerunner/script/scene/hc03.cpp
@@ -34,7 +34,7 @@ void SceneScriptHC03::InitializeScene() {
Game_Flag_Reset(386);
}
Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3);
- if (Game_Flag_Query(403) || Global_Variable_Query(1) > 3) {
+ if (Game_Flag_Query(403) || Global_Variable_Query(kVariableChapter) > 3) {
Item_Remove_From_World(121);
Game_Flag_Set(403);
Scene_Exit_Add_2D_Exit(1, 400, 275, 515, 375, 2);
@@ -67,7 +67,7 @@ void SceneScriptHC03::InitializeScene() {
Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
if (Game_Flag_Query(388)) {
Scene_Loop_Set_Default(6);
- } else if (Game_Flag_Query(403) || Global_Variable_Query(1) > 3) {
+ } else if (Game_Flag_Query(403) || Global_Variable_Query(kVariableChapter) > 3) {
Scene_Loop_Set_Default(3);
} else {
Scene_Loop_Set_Default(0);
@@ -76,7 +76,7 @@ void SceneScriptHC03::InitializeScene() {
void SceneScriptHC03::SceneLoaded() {
Obstacle_Object("GUITAR01", true);
- if (Game_Flag_Query(403) || Game_Flag_Query(388) || Global_Variable_Query(1) > 3) {
+ if (Game_Flag_Query(403) || Game_Flag_Query(388) || Global_Variable_Query(kVariableChapter) > 3) {
Unobstacle_Object("GPscisGate", true);
} else {
Obstacle_Object("GPscisGate", true);
diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp
index 6944854ee1..ce36b91e31 100644
--- a/engines/bladerunner/script/scene/hf01.cpp
+++ b/engines/bladerunner/script/scene/hf01.cpp
@@ -131,7 +131,7 @@ bool SceneScriptHF01::ClickedOnActor(int actorId) {
Actor_Says(kActorMcCoy, 8630, 13);
return true;
}
- if (Global_Variable_Query(1) == 5 && (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1) || Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1)) && !Game_Flag_Query(165) && Actor_Query_Goal_Number(kActorCrazylegs) != 2 && Game_Flag_Query(653) && !Game_Flag_Query(662)) {
+ if (Global_Variable_Query(kVariableChapter) == 5 && (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1) || Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1)) && !Game_Flag_Query(165) && Actor_Query_Goal_Number(kActorCrazylegs) != 2 && Game_Flag_Query(653) && !Game_Flag_Query(662)) {
Game_Flag_Set(662);
Actor_Face_Actor(kActorMcCoy, v1, true);
Actor_Face_Actor(v1, kActorMcCoy, true);
@@ -321,7 +321,7 @@ void SceneScriptHF01::PlayerWalkedIn() {
Actor_Voice_Over(960, kActorVoiceOver);
Actor_Voice_Over(970, kActorVoiceOver);
Actor_Voice_Over(980, kActorVoiceOver);
- } else if (!Game_Flag_Query(377) && Global_Variable_Query(1) < 4) {
+ } else if (!Game_Flag_Query(377) && Global_Variable_Query(kVariableChapter) < 4) {
ADQ_Flush();
ADQ_Add(kActorMurray, 0, 14);
ADQ_Add(kActorMurray, 10, 3);
diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp
index 22fd331132..e98bc8c805 100644
--- a/engines/bladerunner/script/scene/hf05.cpp
+++ b/engines/bladerunner/script/scene/hf05.cpp
@@ -33,7 +33,7 @@ void SceneScriptHF05::InitializeScene() {
Setup_Scene_Information(483.0f, 40.63f, -189.0f, 600);
}
Scene_Exit_Add_2D_Exit(0, 443, 270, 515, 350, 0);
- if (Global_Variable_Query(1) > 3) {
+ if (Global_Variable_Query(kVariableChapter) > 3) {
Scene_Exit_Add_2D_Exit(1, 367, 298, 399, 349, 2);
}
Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1);
@@ -273,7 +273,7 @@ void SceneScriptHF05::PlayerWalkedIn() {
}
if (Actor_Query_In_Set(kActorCrazylegs, 41)) {
if (Game_Flag_Query(562)) {
- if (!Game_Flag_Query(563) && Global_Variable_Query(1) == 3) {
+ if (!Game_Flag_Query(563) && Global_Variable_Query(kVariableChapter) == 3) {
sub_402970();
Game_Flag_Set(563);
}
@@ -317,7 +317,7 @@ void SceneScriptHF05::sub_402970() {
void SceneScriptHF05::sub_402AE4() {
Dialogue_Menu_Clear_List();
- if (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansNote) == 1 && Global_Variable_Query(1) == 3) {
+ if (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansNote) == 1 && Global_Variable_Query(kVariableChapter) == 3) {
DM_Add_To_List_Never_Repeat_Once_Selected(1180, 3, 6, 7);
}
if (Actor_Clue_Query(kActorMcCoy, kClueCrazylegsInterview1) == 1) {
@@ -329,7 +329,7 @@ void SceneScriptHF05::sub_402AE4() {
if (Actor_Clue_Query(kActorMcCoy, kClueLucy) == 1 && Actor_Query_Goal_Number(kActorLucy) != 599) {
DM_Add_To_List_Never_Repeat_Once_Selected(1210, 4, 6, 2);
}
- if (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansResources) == 1 || (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansNote) == 1 && Global_Variable_Query(1) == 3)) {
+ if (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansResources) == 1 || (Actor_Clue_Query(kActorMcCoy, kClueGrigoriansNote) == 1 && Global_Variable_Query(kVariableChapter) == 3)) {
DM_Add_To_List_Never_Repeat_Once_Selected(1220, -1, 2, 8);
}
if (Actor_Clue_Query(kActorMcCoy, kClueCarRegistration1) == 1 || Actor_Clue_Query(kActorMcCoy, kClueCarRegistration3) == 1) {
@@ -594,7 +594,7 @@ void SceneScriptHF05::sub_403A34(int actorId) {
void SceneScriptHF05::sub_402370() {
Player_Loses_Control();
- if (Global_Variable_Query(1) == 3) {
+ if (Global_Variable_Query(kVariableChapter) == 3) {
ADQ_Flush();
ADQ_Add(kActorCrazylegs, 130, 18);
ADQ_Add(kActorCrazylegs, 140, 18);
diff --git a/engines/bladerunner/script/scene/hf06.cpp b/engines/bladerunner/script/scene/hf06.cpp
index f1acea722f..f06e099406 100644
--- a/engines/bladerunner/script/scene/hf06.cpp
+++ b/engines/bladerunner/script/scene/hf06.cpp
@@ -244,7 +244,7 @@ void SceneScriptHF06::sub_401EF4() {
Actor_Change_Animation_Mode(kActorSteele, 7);
Loop_Actor_Walk_To_XYZ(kActorSteele, 92.0f, 367.93f, 107.0f, 0, 0, false, 0);
Actor_Face_Actor(kActorSteele, kActorMcCoy, true);
- Actor_Change_Animation_Mode(kActorSteele, 4);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatIdle);
Actor_Says(kActorSteele, 290, 58);
Actor_Says(kActorMcCoy, 2130, -1);
Actor_Says(kActorSteele, 300, 59);
@@ -256,7 +256,7 @@ void SceneScriptHF06::sub_401EF4() {
Actor_Says(kActorSteele, 330, 58);
Actor_Says(kActorSteele, 340, 58);
Actor_Says(kActorSteele, 350, 58);
- Actor_Change_Animation_Mode(kActorSteele, 4);
+ Actor_Change_Animation_Mode(kActorSteele, kAnimationModeCombatIdle);
Game_Flag_Set(644);
Actor_Set_Goal_Number(kActorSteele, 402);
Actor_Face_Actor(kActorSteele, actorId, true);
diff --git a/engines/bladerunner/script/scene/ma01.cpp b/engines/bladerunner/script/scene/ma01.cpp
index d820a175ed..c0f05ad1bf 100644
--- a/engines/bladerunner/script/scene/ma01.cpp
+++ b/engines/bladerunner/script/scene/ma01.cpp
@@ -24,6 +24,18 @@
namespace BladeRunner {
+enum kMA01Loops {
+ kMA01LoopInshotRoof = 0,
+ kMA01LoopMain = 1,
+ kMA01LoopOutDoorAnim = 3,
+ kMA01LoopOutshotRoof = 4
+};
+
+enum kMA01Exits {
+ kMA01ExitMA06 = 0,
+ kMA01ExitSpinner = 1
+};
+
void SceneScriptMA01::InitializeScene() {
Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992);
if (Game_Flag_Query(kFlagSpinnerToMA01)) {
@@ -32,9 +44,9 @@ void SceneScriptMA01::InitializeScene() {
if (Game_Flag_Query(kFlagMA06toMA01)) {
Setup_Scene_Information(1446.0f, 0.0f, -725.0f, 660);
}
- Scene_Exit_Add_2D_Exit(0, 328, 132, 426, 190, 0);
+ Scene_Exit_Add_2D_Exit(kMA01ExitMA06, 328, 132, 426, 190, 0);
if (Game_Flag_Query(kFlagSpinnerToMA01)) {
- Scene_Exit_Add_2D_Exit(1, 234, 240, 398, 328, 2);
+ Scene_Exit_Add_2D_Exit(kMA01ExitSpinner, 234, 240, 398, 328, 2);
}
Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1);
Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1);
@@ -45,13 +57,13 @@ void SceneScriptMA01::InitializeScene() {
Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
if (Game_Flag_Query(kFlagMA06toMA01)) {
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kMA01LoopMain);
Game_Flag_Reset(kFlagMA06toMA01);
} else {
Actor_Set_Invisible(kActorMcCoy, true);
Game_Flag_Set(273);
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA01LoopInshotRoof, false);
+ Scene_Loop_Set_Default(kMA01LoopMain);
}
if (Game_Flag_Query(409)) {
Actor_Set_Goal_Number(kActorGaff, 3);
@@ -88,7 +100,7 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) {
if (Actor_Query_Goal_Number(kActorZuben) == 21) {
return true;
}
- if (exitId == 0) {
+ if (exitId == kMA01ExitMA06) {
if (Actor_Query_Goal_Number(kActorZuben) == 20) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1446.0f, 0.0f, -725.0f, 72, 1, false, 0)) {
Actor_Set_Goal_Number(kActorZuben, 21);
@@ -98,11 +110,11 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Game_Flag_Set(kFlagMA01toMA06);
- Set_Enter(52, kSceneMA06);
+ Set_Enter(kSetMA06, kSceneMA06);
}
return true;
}
- if (exitId == 1) {
+ if (exitId == kMA01ExitSpinner) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 381.0f, 0.0f, 54.0f, 0, 1, false, 0)) {
Player_Loses_Control();
Actor_Face_Heading(kActorMcCoy, 736, false);
@@ -114,71 +126,71 @@ bool SceneScriptMA01::ClickedOnExit(int exitId) {
Game_Flag_Reset(177);
Game_Flag_Reset(258);
Game_Flag_Reset(178);
- int spinnerDest = Spinner_Interface_Choose_Dest(3, false);
+ int spinnerDest = Spinner_Interface_Choose_Dest(kMA01LoopOutDoorAnim, false);
switch (spinnerDest) {
case kSpinnerDestinationPoliceStation:
Game_Flag_Set(178);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToPS01);
- Set_Enter(61, kScenePS01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetPS01, kScenePS01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationRuncitersAnimals:
Game_Flag_Set(182);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToRC01);
- Set_Enter(69, kSceneRC01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetRC01, kSceneRC01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationChinatown:
Game_Flag_Set(176);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToCT01);
- Set_Enter(4, kSceneCT01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetCT01_CT12, kSceneCT01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationTyrellBuilding:
Game_Flag_Set(261);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToTB02);
- Set_Enter(17, kSceneTB02);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetTB02_TB03, kSceneTB02);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationAnimoidRow:
Game_Flag_Set(180);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToAR01);
- Set_Enter(0, kSceneAR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetAR01_AR02, kSceneAR01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationDNARow:
Game_Flag_Set(177);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToDR01);
- Set_Enter(7, kSceneDR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationBradburyBuilding:
Game_Flag_Set(258);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToBB01);
- Set_Enter(20, kSceneBB01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetBB01, kSceneBB01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationNightclubRow:
Game_Flag_Set(181);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToNR01);
- Set_Enter(54, kSceneNR01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetNR01, kSceneNR01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
case kSpinnerDestinationHysteriaHall:
Game_Flag_Set(257);
Game_Flag_Reset(kFlagSpinnerToMA01);
Game_Flag_Set(kFlagSpinnerToHF01);
- Set_Enter(37, kSceneHF01);
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Set_Enter(kSetHF01, kSceneHF01);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA01LoopOutshotRoof, true);
break;
default:
Actor_Set_Invisible(kActorMcCoy, false);
@@ -240,10 +252,10 @@ void SceneScriptMA01::PlayerWalkedIn() {
void SceneScriptMA01::PlayerWalkedOut() {
Actor_Set_Invisible(kActorMcCoy, false);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(kFlagMA01toMA06) && Global_Variable_Query(1) == 1) {
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
+ if (!Game_Flag_Query(kFlagMA01toMA06) && Global_Variable_Query(kVariableChapter) == 1) {
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeTowards2, true, -1);
Outtake_Play(kOuttakeInside1, true, -1);
diff --git a/engines/bladerunner/script/scene/ma02.cpp b/engines/bladerunner/script/scene/ma02.cpp
index bd4407ada0..e8bb134557 100644
--- a/engines/bladerunner/script/scene/ma02.cpp
+++ b/engines/bladerunner/script/scene/ma02.cpp
@@ -24,22 +24,27 @@
namespace BladeRunner {
+enum kMA02Exits {
+ kMA02ExitMA06 = 0,
+ kMA02ExitMA04 = 1
+};
+
void SceneScriptMA02::InitializeScene() {
if (Game_Flag_Query(kFlagMA04ToMA02)) {
Setup_Scene_Information(-172.0f, -144.13f, 6.27f, 500);
- } else {
+ } else { // From MA06
Setup_Scene_Information(23.19f, -144.12f, 378.27f, 750);
- if (Global_Variable_Query(1) == 4) {
+ if (Global_Variable_Query(kVariableChapter) == 4) {
Actor_Set_Goal_Number(kActorRajif, 300);
}
- Game_Flag_Reset(711);
+ Game_Flag_Reset(kFlagMA04WatchedTV);
}
- Scene_Exit_Add_2D_Exit(0, 538, 84, 639, 327, 1);
- Scene_Exit_Add_2D_Exit(1, 56, 98, 150, 260, 0);
- if (Global_Variable_Query(1) >= 4 && Global_Variable_Query(1) == 5 && Game_Flag_Query(653)) {
+ Scene_Exit_Add_2D_Exit(kMA02ExitMA06, 538, 84, 639, 327, 1);
+ Scene_Exit_Add_2D_Exit(kMA02ExitMA04, 56, 98, 150, 260, 0);
+ if (Global_Variable_Query(kVariableChapter) >= 4 && Global_Variable_Query(kVariableChapter) == 5 && Game_Flag_Query(653)) {
Actor_Set_Goal_Number(kActorMaggie, 599);
Actor_Change_Animation_Mode(kActorMaggie, 88);
- Actor_Put_In_Set(kActorMaggie, 10);
+ Actor_Put_In_Set(kActorMaggie, kSetMA02_MA04);
Actor_Set_At_XYZ(kActorMaggie, -35.51f, -144.12f, 428.0f, 0);
Actor_Retired_Here(kActorMaggie, 24, 24, 1, -1);
}
@@ -53,10 +58,10 @@ void SceneScriptMA02::InitializeScene() {
Ambient_Sounds_Add_Sound(87, 10, 60, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(68, 60, 180, 14, 14, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(69, 60, 180, 14, 14, 0, 0, -101, -101, 0, 0);
- if (sub_401F7C()) {
+ if (isPhoneRinging()) {
Ambient_Sounds_Add_Sound(403, 3, 3, 27, 27, -100, -100, -100, -100, 99, 0);
}
- if (Global_Variable_Query(1) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(kActorMcCoy, kClueCrystalsCigarette)) {
+ if (Global_Variable_Query(kVariableChapter) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(kActorMcCoy, kClueCrystalsCigarette)) {
Overlay_Play("MA02OVER", 0, 1, 0, 0);
}
}
@@ -81,9 +86,9 @@ bool SceneScriptMA02::ClickedOn3DObject(const char *objectName, bool a2) {
}
if (Object_Query_Click("BAR-MAIN", objectName) && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -29.0f, -140.4f, 298.0f, 36, 1, false, 0)) {
Actor_Face_Object(kActorMcCoy, "BAR-MAIN", true);
- if (Global_Variable_Query(1) < 4) {
+ if (Global_Variable_Query(kVariableChapter) < 4) {
Actor_Set_Goal_Number(kActorMaggie, 3);
- } else if (Global_Variable_Query(1) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(kActorMcCoy, kClueCrystalsCigarette)) {
+ } else if (Global_Variable_Query(kVariableChapter) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(kActorMcCoy, kClueCrystalsCigarette)) {
Overlay_Remove("MA02OVER");
Item_Pickup_Spin_Effect(985, 480, 240);
Actor_Voice_Over(1150, kActorVoiceOver);
@@ -103,7 +108,7 @@ bool SceneScriptMA02::ClickedOn3DObject(const char *objectName, bool a2) {
bool SceneScriptMA02::ClickedOnActor(int actorId) {
if (actorId == kActorMaggie && Actor_Query_Goal_Number(kActorMaggie) == 599) {
- if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorMaggie, 30, 1, false)) {
+ if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorMaggie, 30, true, false)) {
Actor_Face_Actor(kActorMcCoy, kActorMaggie, true);
Actor_Voice_Over(1140, kActorVoiceOver);
}
@@ -116,18 +121,18 @@ bool SceneScriptMA02::ClickedOnItem(int itemId, bool a2) {
}
bool SceneScriptMA02::ClickedOnExit(int exitId) {
- if (exitId == 0) {
+ if (exitId == kMA02ExitMA06) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 23.19f, -144.12f, 378.27f, 0, 1, false, 0)) {
Music_Stop(10);
Game_Flag_Set(kFlagMA02toMA06);
- Set_Enter(52, kSceneMA06);
+ Set_Enter(kSetMA06, kSceneMA06);
}
return true;
}
- if (exitId == 1) {
+ if (exitId == kMA02ExitMA04) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -168.0f, -144.13f, 10.27f, 0, 1, false, 0)) {
Game_Flag_Set(kFlagMA02ToMA04);
- Set_Enter(50, kSceneMA04);
+ Set_Enter(kSetMA04, kSceneMA04);
}
return true;
}
@@ -146,22 +151,22 @@ void SceneScriptMA02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptMA02::PlayerWalkedIn() {
if (Game_Flag_Query(kFlagMA06ToMA02)) {
- sub_402044();
+ selectNextTvNews();
}
if (Game_Flag_Query(kFlagMA04ToMA02)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -148.12f, -144.13f, 34.27f, 0, 1, false, 0);
}
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(655)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(655)) {
Game_Flag_Set(623);
Game_Flag_Set(655);
- sub_401E4C();
+ dialogueWithRajif();
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 23.19f, -144.12f, 378.27f, 0, 0, false, 0);
Game_Flag_Set(kFlagMA02toMA06);
- Set_Enter(52, kSceneMA06);
+ Set_Enter(kSetMA06, kSceneMA06);
// return true;
return;
}
- if (Global_Variable_Query(1) == 5 && !Game_Flag_Query(654)) {
+ if (Global_Variable_Query(kVariableChapter) == 5 && !Game_Flag_Query(654)) {
if (Game_Flag_Query(653)) {
Actor_Says(kActorMcCoy, 2390, 0);
Music_Play(2, 25, 0, 3, -1, 0, 0);
@@ -171,7 +176,7 @@ void SceneScriptMA02::PlayerWalkedIn() {
Game_Flag_Set(654);
Autosave_Game(3);
}
- if (Global_Variable_Query(1) < 4 && !Game_Flag_Query(kFlagMA04ToMA02) && Actor_Query_Goal_Number(kActorMaggie) != 2) {
+ if (Global_Variable_Query(kVariableChapter) < 4 && !Game_Flag_Query(kFlagMA04ToMA02) && Actor_Query_Goal_Number(kActorMaggie) != 2) {
Actor_Set_Goal_Number(kActorMaggie, 1);
if (!Game_Flag_Query(60)) {
Game_Flag_Set(60);
@@ -201,7 +206,7 @@ void SceneScriptMA02::PlayerWalkedOut() {
void SceneScriptMA02::DialogueQueueFlushed(int a1) {
}
-void SceneScriptMA02::sub_401E4C() {
+void SceneScriptMA02::dialogueWithRajif() {
Actor_Says(kActorMcCoy, 2365, 13);
Actor_Says(kActorRajif, 0, 13);
Actor_Says(kActorMcCoy, 2370, 13);
@@ -214,8 +219,8 @@ void SceneScriptMA02::sub_401E4C() {
Delay(3000);
}
-bool SceneScriptMA02::sub_401F7C() {
- return Global_Variable_Query(1) == 5
+bool SceneScriptMA02::isPhoneRinging() {
+ return Global_Variable_Query(kVariableChapter) == 5
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallClovis)
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallCrystal)
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1)
@@ -224,23 +229,23 @@ bool SceneScriptMA02::sub_401F7C() {
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy2);
}
-void SceneScriptMA02::sub_402044() {
+void SceneScriptMA02::selectNextTvNews() {
int i = 0;
int arr[7];
- if (Global_Variable_Query(1) < 4 && Game_Flag_Query(kFlagGordoIsReplicant)) {
+ if (Global_Variable_Query(kVariableChapter) < 4 && Game_Flag_Query(kFlagGordoIsReplicant)) {
arr[i++] = 0;
}
arr[i++] = 1;
- if (Global_Variable_Query(1) >= 3) {
+ if (Global_Variable_Query(kVariableChapter) >= 3) {
arr[i++] = 2;
}
- if (Global_Variable_Query(1) >= 2 && Global_Variable_Query(1) <= 4) {
+ if (Global_Variable_Query(kVariableChapter) >= 2 && Global_Variable_Query(kVariableChapter) <= 4) {
arr[i++] = 3;
}
if (Game_Flag_Query(171) && Game_Flag_Query(170)) {
arr[i++] = 4;
}
- Global_Variable_Set(52, arr[Random_Query(0, i - 1)]);
+ Global_Variable_Set(kVariableNextTvNews, arr[Random_Query(0, i - 1)]);
}
} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/scene/ma04.cpp b/engines/bladerunner/script/scene/ma04.cpp
index a92890d9bc..f28d998203 100644
--- a/engines/bladerunner/script/scene/ma04.cpp
+++ b/engines/bladerunner/script/scene/ma04.cpp
@@ -24,25 +24,43 @@
namespace BladeRunner {
+enum kMA04Loops {
+ kMA04LoopInshot = 0,
+ kMA04LoopMain = 1,
+ kMA04LoopSleep = 3,
+ kMA04LoopWakeup = 4
+};
+
+enum kMA04Exits {
+ kMA04ExitMA02 = 0,
+ kMA04ExitMA05 = 1,
+ kMA04ExitKitchen = 2
+};
+
+enum kMA04Regions {
+ kMA04RegionPhone = 0,
+ kMA04RegionBed = 1
+};
+
void SceneScriptMA04::InitializeScene() {
if (Game_Flag_Query(kFlagMA05toMA04)) {
Setup_Scene_Information(-7199.0f, 953.97f, 1579.0f, 502);
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA04LoopInshot, false);
}
} else if (Game_Flag_Query(kFlagMA02ToMA04)) {
Setup_Scene_Information(-7099.0f, 954.0f, 1866.0f, 502);
- } else if (Game_Flag_Query(647)) {
+ } else if (Game_Flag_Query(kFlagMcCoySleeping)) {
Setup_Scene_Information(-7107.0f, 954.0f, 1742.0f, 502);
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 4, false);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA04LoopWakeup, false);
} else {
Setup_Scene_Information(-7143.0f, 954.0f, 1868.0f, 733);
}
- Scene_Exit_Add_2D_Exit(0, 496, 0, 639, 354, 1);
- Scene_Exit_Add_2D_Exit(1, 33, 63, 113, 258, 0);
- Scene_Exit_Add_2D_Exit(2, 248, 98, 314, 284, 1);
- Scene_2D_Region_Add(0, 343, 97, 353, 190);
- Scene_2D_Region_Add(1, 0, 340, 116, 479);
+ Scene_Exit_Add_2D_Exit(kMA04ExitMA02, 496, 0, 639, 354, 1);
+ Scene_Exit_Add_2D_Exit(kMA04ExitMA05, 33, 63, 113, 258, 0);
+ Scene_Exit_Add_2D_Exit(kMA04ExitKitchen, 248, 98, 314, 284, 1);
+ Scene_2D_Region_Add(kMA04RegionPhone, 343, 97, 353, 190);
+ Scene_2D_Region_Add(kMA04RegionBed, 0, 340, 116, 479);
Ambient_Sounds_Add_Looping_Sound(408, 30, 0, 1);
Ambient_Sounds_Add_Looping_Sound(103, 30, -80, 1);
Ambient_Sounds_Add_Looping_Sound(104, 12, 0, 1);
@@ -54,10 +72,10 @@ void SceneScriptMA04::InitializeScene() {
Ambient_Sounds_Add_Sound(87, 10, 60, 16, 16, -100, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- if (sub_402758()) {
+ if (isPhoneRinging()) {
Ambient_Sounds_Add_Sound(403, 3, 3, 100, 100, 0, 0, 0, 0, 99, 0);
}
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kMA04LoopMain);
}
void SceneScriptMA04::SceneLoaded() {
@@ -65,7 +83,7 @@ void SceneScriptMA04::SceneLoaded() {
Unobstacle_Object("BEDDog BONE", true);
Unobstacle_Object("BED-BOOK1", true);
Clickable_Object("BED-SHEETS");
- if (Game_Flag_Query(711)) {
+ if (Game_Flag_Query(kFlagMA04WatchedTV)) {
Unclickable_Object("BED-TV-1");
Unclickable_Object("BED-TV-2");
} else {
@@ -85,7 +103,7 @@ bool SceneScriptMA04::ClickedOn3DObject(const char *objectName, bool a2) {
}
if (Object_Query_Click("BED-TV-1", objectName) || Object_Query_Click("BED-TV-2", objectName)) {
if (!Loop_Actor_Walk_To_Scene_Object(kActorMcCoy, "BED-TV-2", 24, true, false)) {
- Game_Flag_Set(711);
+ Game_Flag_Set(kFlagMA04WatchedTV);
Unclickable_Object("BED-TV-1");
Unclickable_Object("BED-TV-2");
Sound_Play(132, 100, 0, 0, 50);
@@ -106,35 +124,35 @@ bool SceneScriptMA04::ClickedOnItem(int itemId, bool a2) {
}
bool SceneScriptMA04::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7099.0f, 954.0f, 1866.0f, 0, 1, false, 0)) {
+ if (exitId == kMA04ExitMA02) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7099.0f, 954.0f, 1866.0f, 0, true, false, 0)) {
Game_Flag_Set(kFlagMA04ToMA02);
- Set_Enter(10, kSceneMA02);
+ Set_Enter(kSetMA02_MA04, kSceneMA02);
}
return true;
}
- if (exitId == 1) {
+ if (exitId == kMA04ExitMA05) {
float x, y, z;
Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
- if (z <= 1677.0f || !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, 1, false, 0)) {
- if (sub_402888()) {
+ if (z <= 1677.0f || !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, true, false, 0)) {
+ if (isPhoneMessageWaiting() || isPhoneRinging()) {
Overlay_Remove("MA04OVER");
}
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, 0, false, 1);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, false, false, 1);
Game_Flag_Set(kFlagMA04toMA05);
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 956.17f, 1568.0f, 0, false);
}
- Set_Enter(51, kSceneMA05);
+ Set_Enter(kSetMA05, kSceneMA05);
}
return true;
}
- if (exitId == 2) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7115.0f, 954.0f, 1742.0f, 0, 1, false, 0)) {
+ if (exitId == kMA04ExitKitchen) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7115.0f, 954.0f, 1742.0f, 0, true, false, 0)) {
int sounds[] = {252, 405, 404, 407, 406};
Ambient_Sounds_Play_Sound(sounds[Random_Query(0, 4)], 50, 0, 0, 0);
Delay(3000);
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 1);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7139.0f, 954.0f, 1746.0f, 0, true, false, 1);
}
}
return false;
@@ -144,14 +162,14 @@ bool SceneScriptMA04::ClickedOn2DRegion(int region) {
if (Player_Query_Combat_Mode()) {
return false;
}
- if (region == 1) {
+ if (region == kMA04RegionBed) {
sleep();
return true;
}
- if (region == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7176.0f, 954.0f, 1806.0f, 0, 1, false, 0)) {
+ if (region == kMA04RegionPhone) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7176.0f, 954.0f, 1806.0f, 0, true, false, 0)) {
Actor_Face_Heading(kActorMcCoy, 256, false);
- if (sub_402758()) {
+ if (isPhoneRinging()) {
Actor_Says(kActorMcCoy, 2680, 0);
Ambient_Sounds_Remove_Sound(403, true);
Sound_Play(123, 100, 0, 0, 50);
@@ -159,48 +177,48 @@ bool SceneScriptMA04::ClickedOn2DRegion(int region) {
Delay(500);
if (Game_Flag_Query(653)) {
if (Global_Variable_Query(45) == 2) {
- sub_4028A8();
+ phoneCallWithDektora();
} else if (Global_Variable_Query(45) == 3) {
- sub_402F2C();
+ phoneCallWithLucy();
} else {
- sub_4034D8();
+ phoneCallWithClovis();
}
} else {
- sub_4032A0();
+ phoneCallWithSteele();
}
Music_Play(2, 52, 0, 3, -1, 0, 0);
return false;
}
- if (Actor_Clue_Query(kActorClovis, kClueMcCoyRetiredZuben) && !Game_Flag_Query(649)) {
+ if (Actor_Clue_Query(kActorClovis, kClueMcCoyRetiredZuben) && !Game_Flag_Query(kFlagPhoneMessageFromClovis)) {
Sound_Play(123, 100, 0, 0, 50);
Overlay_Remove("MA04OVER");
Delay(500);
Actor_Says(kActorClovis, 310, 3);
Actor_Says(kActorClovis, 320, 3);
- if (!Game_Flag_Query(kFlagDirectorsCut) && Global_Variable_Query(1) < 3) {
+ if (!Game_Flag_Query(kFlagDirectorsCut) && Global_Variable_Query(kVariableChapter) < 3) {
Actor_Voice_Over(1300, kActorVoiceOver);
Actor_Voice_Over(1310, kActorVoiceOver);
Actor_Voice_Over(1320, kActorVoiceOver);
}
Actor_Says(kActorMcCoy, 2445, 13);
Sound_Play(123, 100, 0, 0, 50);
- Game_Flag_Set(649);
+ Game_Flag_Set(kFlagPhoneMessageFromClovis);
return true;
}
- if (Actor_Clue_Query(kActorLucy, kClueMcCoyLetZubenEscape) && !Game_Flag_Query(650)) {
+ if (Actor_Clue_Query(kActorLucy, kClueMcCoyLetZubenEscape) && !Game_Flag_Query(kFlagPhoneMessageFromLucy)) {
Sound_Play(123, 100, 0, 0, 50);
Overlay_Remove("MA04OVER");
Delay(500);
Actor_Says(kActorLucy, 500, 3);
Actor_Says(kActorLucy, 510, 3);
- if (!Game_Flag_Query(kFlagDirectorsCut) && Global_Variable_Query(1) < 3) {
+ if (!Game_Flag_Query(kFlagDirectorsCut) && Global_Variable_Query(kVariableChapter) < 3) {
Actor_Voice_Over(1330, kActorVoiceOver);
Actor_Voice_Over(1340, kActorVoiceOver);
Actor_Voice_Over(1350, kActorVoiceOver);
}
Actor_Says(kActorMcCoy, 2445, 13);
Sound_Play(123, 100, 0, 0, 50);
- Game_Flag_Set(650);
+ Game_Flag_Set(kFlagPhoneMessageFromLucy);
return true;
}
Actor_Says(kActorMcCoy, 2670, 13);
@@ -222,7 +240,7 @@ void SceneScriptMA04::SceneFrameAdvanced(int frame) {
} else {
Set_Fade_Density(0.0f);
}
- if (frame == 121 && (Game_Flag_Query(40) == 1 || Game_Flag_Query(41) == 1) && !Game_Flag_Query(159)) {
+ if (frame == 121 && (Game_Flag_Query(kFlagZubenRetired) || Game_Flag_Query(kFlagZubenSpared)) && !Game_Flag_Query(kFlagGuzzaTalkZubenRetired)) {
Sound_Play(403, 50, 0, 0, 50);
}
}
@@ -231,24 +249,24 @@ void SceneScriptMA04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptMA04::PlayerWalkedIn() {
- if (Game_Flag_Query(647)) {
+ if (Game_Flag_Query(kFlagMcCoySleeping)) {
Player_Gains_Control();
}
- if (sub_402820() || sub_402758()) {
+ if (isPhoneMessageWaiting() || isPhoneRinging()) {
Overlay_Play("MA04OVER", 0, 1, 0, 0);
}
- if (Game_Flag_Query(647)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 0);
+ if (Game_Flag_Query(kFlagMcCoySleeping)) {
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7139.0f, 954.0f, 1746.0f, 0, true, false, 0);
} else if (Game_Flag_Query(kFlagMA02ToMA04)) {
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7143.0f, 954.0f, 1868.0f, 0, 1, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7143.0f, 954.0f, 1868.0f, 0, true, false, 0);
}
Game_Flag_Reset(kFlagMA02ToMA04);
Game_Flag_Reset(kFlagMA05toMA04);
- Game_Flag_Reset(647);
- if (Game_Flag_Query(61)) {
- if (Global_Variable_Query(1) == 2 && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallGuzza)) {
+ Game_Flag_Reset(kFlagMcCoySleeping);
+ if (Game_Flag_Query(kFlagChapter1Ended)) {
+ if (Global_Variable_Query(kVariableChapter) == 2 && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallGuzza)) {
Sound_Play(403, 100, 0, 0, 50);
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7176.0f, 954.0f, 1806.0f, 0, 0, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7176.0f, 954.0f, 1806.0f, 0, false, false, 0);
Actor_Face_Heading(kActorMcCoy, 256, true);
Actor_Says(kActorMcCoy, 2680, 0);
Sound_Play(123, 100, 0, 0, 50);
@@ -280,28 +298,28 @@ void SceneScriptMA04::PlayerWalkedIn() {
//return false;
return;
}
- if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && !Game_Flag_Query(146)) {
+ if ((Game_Flag_Query(kFlagZubenRetired) || Game_Flag_Query(kFlagZubenSpared)) && !Game_Flag_Query(kFlagChapter1Ending)) {
Music_Play(2, 52, 0, 2, -1, 0, 0);
Player_Loses_Control();
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1677.0f, 0, 1, false, 0);
- if (sub_402820() || sub_402758()) {
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1677.0f, 0, true, false, 0);
+ if (isPhoneMessageWaiting() || isPhoneRinging()) {
Overlay_Remove("MA04OVER");
}
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, 1, false, 0);
- Game_Flag_Set(146);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 955.0f, 1675.0f, 0, true, false, 0);
+ Game_Flag_Set(kFlagChapter1Ending);
Async_Actor_Walk_To_XYZ(kActorMcCoy, -7204.0f, 956.17f, 1568.0f, 0, false);
- Set_Enter(51, kSceneMA05);
+ Set_Enter(kSetMA05, kSceneMA05);
}
}
void SceneScriptMA04::PlayerWalkedOut() {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (Game_Flag_Query(678)) {
+ if (Game_Flag_Query(kFlagChapter2Intro)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeMovieA, false, -1);
- Game_Flag_Reset(678);
+ Game_Flag_Reset(kFlagChapter2Intro);
}
}
@@ -309,19 +327,22 @@ void SceneScriptMA04::DialogueQueueFlushed(int a1) {
Overlay_Remove("MA04OVR2");
}
-bool SceneScriptMA04::sub_402758() {
- return Global_Variable_Query(1) == 5 && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallClovis) && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallCrystal) && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1) && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora2) && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1) && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy2);
-}
-
-bool SceneScriptMA04::sub_402820() {
- return (Actor_Clue_Query(kActorClovis, kClueMcCoyRetiredZuben) && !Game_Flag_Query(649)) || (Actor_Clue_Query(kActorLucy, kClueMcCoyLetZubenEscape) && !Game_Flag_Query(650));
+bool SceneScriptMA04::isPhoneRinging() {
+ return Global_Variable_Query(kVariableChapter) == 5
+ && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallClovis)
+ && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallCrystal)
+ && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1)
+ && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora2)
+ && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1)
+ && !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy2);
}
-bool SceneScriptMA04::sub_402888() {
- return sub_402820() || sub_402758();
+bool SceneScriptMA04::isPhoneMessageWaiting() {
+ return (Actor_Clue_Query(kActorClovis, kClueMcCoyRetiredZuben) && !Game_Flag_Query(kFlagPhoneMessageFromClovis))
+ || (Actor_Clue_Query(kActorLucy, kClueMcCoyLetZubenEscape) && !Game_Flag_Query(kFlagPhoneMessageFromLucy));
}
-void SceneScriptMA04::sub_4028A8() {
+void SceneScriptMA04::phoneCallWithDektora() {
int answer;
Actor_Says(kActorDektora, 220, 3);
Actor_Says(kActorMcCoy, 2460, 0);
@@ -386,7 +407,7 @@ void SceneScriptMA04::sub_4028A8() {
}
}
-void SceneScriptMA04::sub_402F2C() {
+void SceneScriptMA04::phoneCallWithLucy() {
Actor_Says(kActorLucy, 530, 3);
Actor_Says(kActorMcCoy, 2545, 19);
Actor_Says(kActorLucy, 540, 3);
@@ -421,7 +442,7 @@ void SceneScriptMA04::sub_402F2C() {
Sound_Play(123, 100, 0, 0, 50);
}
-void SceneScriptMA04::sub_4032A0() {
+void SceneScriptMA04::phoneCallWithSteele() {
Actor_Says(kActorSteele, 680, 3);
Actor_Says(kActorMcCoy, 2630, 17);
Actor_Says(kActorSteele, 690, 3);
@@ -442,7 +463,7 @@ void SceneScriptMA04::sub_4032A0() {
Actor_Clue_Acquire(kActorMcCoy, kCluePhoneCallCrystal, true, -1);
}
-void SceneScriptMA04::sub_4034D8() {
+void SceneScriptMA04::phoneCallWithClovis() {
Actor_Says(kActorClovis, 330, 3);
Actor_Says(kActorMcCoy, 2580, 14);
Actor_Says(kActorClovis, 340, 3);
@@ -476,7 +497,7 @@ void SceneScriptMA04::sub_4034D8() {
void SceneScriptMA04::turnOnTV() {
Overlay_Play("MA04OVR2", 0, 1, 0, 0);
- switch (Global_Variable_Query(52)) {
+ switch (Global_Variable_Query(kVariableNextTvNews)) {
case 4:
ADQ_Add(kActorNewscaster, 230, 3);
ADQ_Add(kActorNewscaster, 240, 3);
@@ -537,28 +558,28 @@ void SceneScriptMA04::sleep() {
if (!Loop_Actor_Walk_To_Scene_Object(kActorMcCoy, "BED-SHEETS", 12, true, false)) {
Actor_Says(kActorMcCoy, 8530, 12);
Music_Stop(4);
- if (sub_402820() || sub_402758()) {
+ if (isPhoneMessageWaiting() || isPhoneRinging()) {
Overlay_Remove("MA04OVER");
}
Player_Loses_Control();
- Game_Flag_Set(647);
- if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && Global_Variable_Query(1) == 1) {
+ Game_Flag_Set(kFlagMcCoySleeping);
+ if ((Game_Flag_Query(kFlagZubenRetired) || Game_Flag_Query(kFlagZubenSpared)) && Global_Variable_Query(kVariableChapter) == 1) {
if (Actor_Query_Goal_Number(kActorZuben) == 599) {
Actor_Put_In_Set(kActorZuben, 91);
Actor_Set_At_Waypoint(kActorZuben, 33, 0);
}
- Game_Flag_Set(678);
- Global_Variable_Set(1, 2);
- Chapter_Enter(2, 10, 50);
+ Game_Flag_Set(kFlagChapter2Intro);
+ Global_Variable_Set(kVariableChapter, 2);
+ Chapter_Enter(2, kSetMA02_MA04, kSceneMA04);
if (Query_Difficulty_Level() != 0) {
- if (!Game_Flag_Query(723)) {
- Global_Variable_Increment(2, 200);
+ if (!Game_Flag_Query(kFlagZubenBountyPaid)) {
+ Global_Variable_Increment(kVariableChinyen, 200);
}
}
} else {
- Set_Enter(10, kSceneMA04);
+ Set_Enter(kSetMA02_MA04, kSceneMA04);
}
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, false);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA04LoopSleep, false);
}
}
diff --git a/engines/bladerunner/script/scene/ma05.cpp b/engines/bladerunner/script/scene/ma05.cpp
index 40efc3641d..519f43e30b 100644
--- a/engines/bladerunner/script/scene/ma05.cpp
+++ b/engines/bladerunner/script/scene/ma05.cpp
@@ -24,13 +24,23 @@
namespace BladeRunner {
+enum kMA05Loops {
+ kMA05LoopInshot = 0,
+ kMA05LoopMain = 1,
+ kMA05LoopSpinner = 3
+};
+
+enum kMA05Exits {
+ kMA05ExitMA04 = 0
+};
+
void SceneScriptMA05::InitializeScene() {
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
Setup_Scene_Information(-7204.0f, 953.97f, 1651.0f, 0);
} else {
Setup_Scene_Information(-7207.0f, 956.17f, 1564.0f, 0);
}
- Scene_Exit_Add_2D_Exit(0, 432, 21, 471, 226, 1);
+ Scene_Exit_Add_2D_Exit(kMA05ExitMA04, 432, 21, 471, 226, 1);
Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1);
Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1);
Ambient_Sounds_Add_Looping_Sound(103, 50, 60, 1);
@@ -43,13 +53,13 @@ void SceneScriptMA05::InitializeScene() {
Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(87, 10, 70, 25, 25, -100, 0, -101, -101, 0, 0);
- if (sub_401990()) {
+ if (isPhoneRinging()) {
Ambient_Sounds_Add_Sound(403, 3, 3, 32, 32, 100, 100, -101, -101, 0, 0);
}
- if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) {
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
+ if (Global_Variable_Query(kVariableChapter) != 2 && Global_Variable_Query(kVariableChapter) != 3) {
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA05LoopInshot, false);
}
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kMA05LoopMain);
}
void SceneScriptMA05::SceneLoaded() {
@@ -75,14 +85,14 @@ bool SceneScriptMA05::ClickedOnItem(int itemId, bool a2) {
}
bool SceneScriptMA05::ClickedOnExit(int exitId) {
- if (exitId == 0) {
+ if (exitId == kMA05ExitMA04) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 956.17f, 1579.0f, 0, 0, false, 0)) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 956.17f, 1579.0f, 0, 0, false, 0);
Game_Flag_Set(kFlagMA05toMA04);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Async_Actor_Walk_To_XYZ(kActorMcCoy, -7199.0f, 953.97f, 1685.0f, 0, false);
- Set_Enter(50, kSceneMA04);
+ Set_Enter(kSetMA04, kSceneMA04);
}
return true;
}
@@ -105,19 +115,19 @@ void SceneScriptMA05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptMA05::PlayerWalkedIn() {
Music_Play(2, 52, 0, 2, -1, 0, 0);
- if ((Random_Query(0, 4) == 1 || (Game_Flag_Query(146) == 1 && !Game_Flag_Query(61))) && Global_Variable_Query(1) == 1) {
- Scene_Loop_Set_Default(1);
- Scene_Loop_Start_Special(kSceneLoopMode2, 3, true);
+ if ((Random_Query(0, 4) == 1 || (Game_Flag_Query(kFlagChapter1Ending) && !Game_Flag_Query(kFlagChapter1Ended))) && Global_Variable_Query(kVariableChapter) == 1) {
+ Scene_Loop_Set_Default(kMA05LoopMain);
+ Scene_Loop_Start_Special(kSceneLoopMode2, kMA05LoopSpinner, true);
Sound_Play(69, 100, 0, 0, 50);
}
- if (Game_Flag_Query(146) && !Game_Flag_Query(61)) {
+ if (Game_Flag_Query(kFlagChapter1Ending) && !Game_Flag_Query(kFlagChapter1Ended)) {
if (!Game_Flag_Query(kFlagDirectorsCut)) {
Actor_Voice_Over(1260, kActorVoiceOver);
Actor_Voice_Over(1270, kActorVoiceOver);
Actor_Voice_Over(1280, kActorVoiceOver);
Actor_Voice_Over(1290, kActorVoiceOver);
}
- Game_Flag_Set(61);
+ Game_Flag_Set(kFlagChapter1Ended);
Player_Gains_Control();
}
//return false;
@@ -129,8 +139,8 @@ void SceneScriptMA05::PlayerWalkedOut() {
void SceneScriptMA05::DialogueQueueFlushed(int a1) {
}
-bool SceneScriptMA05::sub_401990() {
- return Global_Variable_Query(1) == 5
+bool SceneScriptMA05::isPhoneRinging() {
+ return Global_Variable_Query(kVariableChapter) == 5
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallClovis)
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallCrystal)
&& !Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1)
diff --git a/engines/bladerunner/script/scene/ma06.cpp b/engines/bladerunner/script/scene/ma06.cpp
index 732b260e72..3f385271e8 100644
--- a/engines/bladerunner/script/scene/ma06.cpp
+++ b/engines/bladerunner/script/scene/ma06.cpp
@@ -24,12 +24,19 @@
namespace BladeRunner {
+// Appears that names for "open" and "close" are switched
+enum kMA06Loops {
+ kMA06LoopDoorOpen = 0,
+ kMA06LoopMain = 1,
+ kMA06LoopDoorClose = 3
+};
+
void SceneScriptMA06::InitializeScene() {
Setup_Scene_Information(40.0f, 1.0f, -20.0f, 400);
Ambient_Sounds_Add_Looping_Sound(210, 50, 0, 1);
Ambient_Sounds_Add_Looping_Sound(408, 33, 0, 1);
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kMA06LoopDoorOpen, false);
+ Scene_Loop_Set_Default(kMA06LoopMain);
Sound_Play(209, 100, 50, 50, 100);
}
@@ -83,13 +90,13 @@ void SceneScriptMA06::PlayerWalkedIn() {
Game_Flag_Reset(kFlagMA07toMA06);
if (Game_Flag_Query(kFlagMA06toMA01)) {
- Set_Enter(49, kSceneMA01);
+ Set_Enter(kSetMA01, kSceneMA01);
} else if (Game_Flag_Query(kFlagMA06ToMA02)) {
- Set_Enter(10, kSceneMA02);
- } else { // kFlagMA06ToMA07
- Set_Enter(53, kSceneMA07);
+ Set_Enter(kSetMA02_MA04, kSceneMA02);
+ } else {
+ Set_Enter(kSetMA07, kSceneMA07);
}
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 3, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kMA06LoopDoorClose, true);
Sound_Play(208, 100, 50, 50, 50);
//return true;
}
@@ -125,7 +132,7 @@ void SceneScriptMA06::activateElevator() {
}
Actor_Says(kActorAnsweringMachine, 80, 3);
Player_Gains_Control();
- int floor = Elevator_Activate(1);
+ int floor = Elevator_Activate(kElevatorMA);
Player_Loses_Control();
Scene_Loop_Start_Special(kSceneLoopMode2, 1, true);
if (floor > 1) {
@@ -138,9 +145,9 @@ void SceneScriptMA06::activateElevator() {
Delay(500);
Actor_Says(kActorAnsweringMachine, 610, 3);
}
- } else {
+ } else { // floor == 0
Actor_Says(kActorMcCoy, 2940, 18);
- if (Global_Variable_Query(1) == 4 && Game_Flag_Query(655)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Game_Flag_Query(655)) {
Sound_Play(412, 100, 0, 0, 50);
Delay(500);
Actor_Says(kActorAnsweringMachine, 610, 3);
diff --git a/engines/bladerunner/script/scene/ma07.cpp b/engines/bladerunner/script/scene/ma07.cpp
index a009096795..bb85a82cde 100644
--- a/engines/bladerunner/script/scene/ma07.cpp
+++ b/engines/bladerunner/script/scene/ma07.cpp
@@ -41,7 +41,7 @@ void SceneScriptMA07::InitializeScene() {
Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- if (Global_Variable_Query(1) > 1) {
+ if (Global_Variable_Query(kVariableChapter) > 1) {
Scene_Exit_Add_2D_Exit(1, 0, 200, 50, 479, 3);
}
if (Game_Flag_Query(665)) {
@@ -73,7 +73,7 @@ bool SceneScriptMA07::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptMA07::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 104.0f, -162.0f, 56.0f, 12, 1, false, 0)) {
- if (Global_Variable_Query(1) == 4 && Game_Flag_Query(671)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Game_Flag_Query(671)) {
Actor_Set_Goal_Number(kActorMcCoy, 400);
} else {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
@@ -131,7 +131,7 @@ void SceneScriptMA07::PlayerWalkedIn() {
if (Game_Flag_Query(kFlagMA06toMA07)) {
Game_Flag_Reset(kFlagMA06toMA07);
}
- if (!Game_Flag_Query(648) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4) {
+ if (!Game_Flag_Query(648) && Game_Flag_Query(671) && Global_Variable_Query(kVariableChapter) == 4) {
Scene_Exits_Disable();
Actor_Set_Goal_Number(kActorGaff, 300);
}
@@ -144,7 +144,7 @@ void SceneScriptMA07::PlayerWalkedIn() {
Delay(1000);
Game_Flag_Reset(666);
Game_Flag_Set(kFlagMA06ToMA02);
- Set_Enter(10, kSceneMA02);
+ Set_Enter(kSetMA02_MA04, kSceneMA02);
}
//return false;
diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp
index 8dd675eb7e..171cea52d8 100644
--- a/engines/bladerunner/script/scene/nr01.cpp
+++ b/engines/bladerunner/script/scene/nr01.cpp
@@ -43,7 +43,7 @@ void SceneScriptNR01::InitializeScene() {
Setup_Scene_Information(76.0f, 23.88f, -109.0f, 966);
}
Scene_Exit_Add_2D_Exit(0, 31, 270, 97, 373, 3);
- if (Global_Variable_Query(1) > 3) {
+ if (Global_Variable_Query(kVariableChapter) > 3) {
Scene_Exit_Add_2D_Exit(1, 201, 320, 276, 357, 2);
}
Scene_Exit_Add_2D_Exit(2, 583, 262, 639, 365, 1);
@@ -110,7 +110,7 @@ bool SceneScriptNR01::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptNR01::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -380.0f, 31.93f, -841.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) > 3) {
+ if (Global_Variable_Query(kVariableChapter) > 3) {
Actor_Says(kActorMcCoy, 8522, 12);
} else {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
diff --git a/engines/bladerunner/script/scene/nr07.cpp b/engines/bladerunner/script/scene/nr07.cpp
index 27d85ecaba..bb43b9b7e9 100644
--- a/engines/bladerunner/script/scene/nr07.cpp
+++ b/engines/bladerunner/script/scene/nr07.cpp
@@ -199,7 +199,7 @@ void SceneScriptNR07::sub_401A10() {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -193.0f, -73.5f, -13.0f, 0, false);
Actor_Says(kActorDektora, 950, 31);
Actor_Face_Actor(kActorDektora, kActorMcCoy, true);
- Actor_Change_Animation_Mode(kActorDektora, 4);
+ Actor_Change_Animation_Mode(kActorDektora, kAnimationModeCombatIdle);
Actor_Face_Actor(kActorMcCoy, kActorDektora, true);
Actor_Says(kActorMcCoy, 3760, 19);
Actor_Says(kActorDektora, 960, 53);
diff --git a/engines/bladerunner/script/scene/ps01.cpp b/engines/bladerunner/script/scene/ps01.cpp
index 28f92a158c..04dc87517b 100644
--- a/engines/bladerunner/script/scene/ps01.cpp
+++ b/engines/bladerunner/script/scene/ps01.cpp
@@ -264,7 +264,7 @@ void SceneScriptPS01::PlayerWalkedOut() {
Actor_Set_Invisible(kActorMcCoy, false);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(718) && Global_Variable_Query(1) == 1) {
+ if (!Game_Flag_Query(718) && Global_Variable_Query(kVariableChapter) == 1) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Outtake_Play(kOuttakeTowards3, true, -1);
diff --git a/engines/bladerunner/script/scene/ps02.cpp b/engines/bladerunner/script/scene/ps02.cpp
index 544ff32a58..6bf90154bf 100644
--- a/engines/bladerunner/script/scene/ps02.cpp
+++ b/engines/bladerunner/script/scene/ps02.cpp
@@ -152,7 +152,7 @@ void SceneScriptPS02::DialogueQueueFlushed(int a1) {
void SceneScriptPS02::sub_4018BC() {
Scene_Exits_Disable();
- switch (Elevator_Activate(2)) {
+ switch (Elevator_Activate(kElevatorPS)) {
case 7:
Game_Flag_Set(133);
break;
diff --git a/engines/bladerunner/script/scene/ps03.cpp b/engines/bladerunner/script/scene/ps03.cpp
index 854e85f666..7f31de5fd0 100644
--- a/engines/bladerunner/script/scene/ps03.cpp
+++ b/engines/bladerunner/script/scene/ps03.cpp
@@ -38,7 +38,7 @@ void SceneScriptPS03::InitializeScene() {
}
Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2);
Scene_Exit_Add_2D_Exit(1, 449, 273, 508, 329, 0);
- if (Global_Variable_Query(1) > 1) {
+ if (Global_Variable_Query(kVariableChapter) > 1) {
Scene_Exit_Add_2D_Exit(2, 358, 245, 411, 288, 0);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(0);
@@ -89,7 +89,7 @@ bool SceneScriptPS03::ClickedOnExit(int exitId) {
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Set_Enter(62, kScenePS02);
Game_Flag_Reset(478);
- if (Global_Variable_Query(1) < 4) {
+ if (Global_Variable_Query(kVariableChapter) < 4) {
Actor_Set_Goal_Number(kActorGuzza, 100);
}
}
diff --git a/engines/bladerunner/script/scene/ps04.cpp b/engines/bladerunner/script/scene/ps04.cpp
index 7629aa822e..ac8f2dc66b 100644
--- a/engines/bladerunner/script/scene/ps04.cpp
+++ b/engines/bladerunner/script/scene/ps04.cpp
@@ -30,7 +30,7 @@ void SceneScriptPS04::InitializeScene() {
Game_Flag_Reset(42);
}
Setup_Scene_Information(-668.0f, -354.0f, 974.0f, 475);
- if (Global_Variable_Query(1) == 1) {
+ if (Global_Variable_Query(kVariableChapter) == 1) {
Actor_Put_In_Set(kActorGuzza, 64);
Actor_Set_At_XYZ(kActorGuzza, -728.0f, -354.0f, 1090.0f, 150);
Actor_Change_Animation_Mode(kActorGuzza, 53);
@@ -56,7 +56,7 @@ void SceneScriptPS04::SceneLoaded() {
Unobstacle_Object("B.DOOR", true);
Unobstacle_Object("B.CHAIR01", true);
Unclickable_Object("CHAIR07");
- if (Global_Variable_Query(1) == 2 && !Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm) && !Game_Flag_Query(727)) {
+ if (Global_Variable_Query(kVariableChapter) == 2 && !Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm) && !Game_Flag_Query(727)) {
Item_Add_To_World(111, 958, 64, -643.5f, -318.82f, 1148.87f, 525, 16, 12, false, true, false, true);
Game_Flag_Set(727);
}
@@ -136,7 +136,7 @@ void SceneScriptPS04::DialogueQueueFlushed(int a1) {
void SceneScriptPS04::sub_4017E4() {
Dialogue_Menu_Clear_List();
- if (Global_Variable_Query(1) > 1) {
+ if (Global_Variable_Query(kVariableChapter) > 1) {
if (Actor_Clue_Query(kActorMcCoy, kClueAttemptedFileAccess)) {
DM_Add_To_List_Never_Repeat_Once_Selected(110, 5, 7, 4);
}
@@ -155,7 +155,7 @@ void SceneScriptPS04::sub_4017E4() {
Dialogue_Menu_Disappear();
switch (answer) {
case 130:
- if (Game_Flag_Query(40) && !Game_Flag_Query(159)) {
+ if (Game_Flag_Query(kFlagZubenRetired) && !Game_Flag_Query(kFlagGuzzaTalkZubenRetired)) {
Actor_Says(kActorMcCoy, 3920, 13);
Actor_Says(kActorGuzza, 140, 30);
Actor_Face_Current_Camera(kActorGuzza, true);
@@ -182,12 +182,12 @@ void SceneScriptPS04::sub_4017E4() {
Actor_Says(kActorGuzza, 250, 34);
Actor_Says(kActorGuzza, 260, 33);
Actor_Says(kActorGuzza, 270, 32);
- Game_Flag_Set(159);
+ Game_Flag_Set(kFlagGuzzaTalkZubenRetired);
if (Query_Difficulty_Level() != 0) {
- Global_Variable_Increment(2, 200);
+ Global_Variable_Increment(kVariableChinyen, 200);
}
- Game_Flag_Set(723);
- } else if (Game_Flag_Query(41) && !Game_Flag_Query(160)) {
+ Game_Flag_Set(kFlagZubenBountyPaid);
+ } else if (Game_Flag_Query(kFlagZubenSpared) && !Game_Flag_Query(kFlagGuzzaTalkZubenEscaped)) {
Actor_Says(kActorMcCoy, 3955, 13);
Actor_Says(kActorGuzza, 280, 30);
Actor_Says(kActorMcCoy, 3960, 18);
@@ -196,7 +196,7 @@ void SceneScriptPS04::sub_4017E4() {
Actor_Says(kActorMcCoy, 3965, 13);
Actor_Says(kActorGuzza, 310, 33);
Actor_Says(kActorGuzza, 320, 34);
- Game_Flag_Set(160);
+ Game_Flag_Set(kFlagGuzzaTalkZubenEscaped);
} else if ((Actor_Clue_Query(kActorMcCoy, kClueChopstickWrapper) || Actor_Clue_Query(kActorMcCoy, kClueSushiMenu)) && Actor_Clue_Query(kActorMcCoy, kClueRunciterInterviewA) && Actor_Query_Friendliness_To_Other(kActorGuzza, kActorMcCoy) < 50 && !Game_Flag_Query(161)) {
Actor_Says(kActorMcCoy, 3970, 18);
Actor_Says(kActorGuzza, 330, 30);
diff --git a/engines/bladerunner/script/scene/ps05.cpp b/engines/bladerunner/script/scene/ps05.cpp
index e2aa7e8c4b..7627ac2254 100644
--- a/engines/bladerunner/script/scene/ps05.cpp
+++ b/engines/bladerunner/script/scene/ps05.cpp
@@ -145,8 +145,8 @@ void SceneScriptPS05::PlayerWalkedIn() {
if (Game_Flag_Query(23)) {
Actor_Set_At_XYZ(kActorMcCoy, 718.72f, 0.37f, -461.26f, 600);
} else if (Game_Flag_Query(22)) {
- sub_401B34();
- sub_401C30();
+ selectNextTvNews();
+ turnOnTV();
}
Game_Flag_Reset(22);
Game_Flag_Reset(23);
@@ -161,27 +161,27 @@ void SceneScriptPS05::DialogueQueueFlushed(int a1) {
Overlay_Remove("PS05OVER");
}
-void SceneScriptPS05::sub_401B34() {
+void SceneScriptPS05::selectNextTvNews() {
int i = 0;
int arr[7];
- if (Global_Variable_Query(1) < 4 && Game_Flag_Query(kFlagGordoIsReplicant)) {
+ if (Global_Variable_Query(kVariableChapter) < 4 && Game_Flag_Query(kFlagGordoIsReplicant)) {
arr[i++] = 0;
}
arr[i++] = 1;
- if (Global_Variable_Query(1) >= 3) {
+ if (Global_Variable_Query(kVariableChapter) >= 3) {
arr[i++] = 2;
}
- if (Global_Variable_Query(1) >= 2 && Global_Variable_Query(1) <= 4) {
+ if (Global_Variable_Query(kVariableChapter) >= 2 && Global_Variable_Query(kVariableChapter) <= 4) {
arr[i++] = 3;
}
if (Game_Flag_Query(171) && Game_Flag_Query(170)) {
arr[i++] = 4;
}
- Global_Variable_Set(52, arr[Random_Query(0, i - 1)]);
+ Global_Variable_Set(kVariableNextTvNews, arr[Random_Query(0, i - 1)]);
}
-void SceneScriptPS05::sub_401C30() {
- switch (Global_Variable_Query(52)) {
+void SceneScriptPS05::turnOnTV() {
+ switch (Global_Variable_Query(kVariableNextTvNews)) {
case 4:
if (!Game_Flag_Query(692)) {
Overlay_Play("PS05OVER", 0, 1, 0, 0);
diff --git a/engines/bladerunner/script/scene/ps07.cpp b/engines/bladerunner/script/scene/ps07.cpp
index f07b4d9e8e..887510343d 100644
--- a/engines/bladerunner/script/scene/ps07.cpp
+++ b/engines/bladerunner/script/scene/ps07.cpp
@@ -161,7 +161,7 @@ void SceneScriptPS07::PlayerWalkedIn() {
}
void SceneScriptPS07::PlayerWalkedOut() {
- if (!Game_Flag_Query(138) && Global_Variable_Query(1) == 1) {
+ if (!Game_Flag_Query(138) && Global_Variable_Query(kVariableChapter) == 1) {
Actor_Set_Goal_Number(kActorKlein, 0);
}
}
diff --git a/engines/bladerunner/script/scene/ps14.cpp b/engines/bladerunner/script/scene/ps14.cpp
index a6b64ab7e8..93877ccc6a 100644
--- a/engines/bladerunner/script/scene/ps14.cpp
+++ b/engines/bladerunner/script/scene/ps14.cpp
@@ -70,14 +70,14 @@ bool SceneScriptPS14::ClickedOnExit(int exitId) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -2101.0f, 508.14f, -1361.0f, 0, 1, false, 0)) {
Actor_Face_Heading(kActorMcCoy, 819, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 3, 1, 0);
- if (Global_Variable_Query(1) == 4 && Game_Flag_Query(671)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Game_Flag_Query(671)) {
if (Actor_Clue_Query(kActorMcCoy, kClueBriefcase)) {
Game_Flag_Set(666);
Actor_Set_Goal_Number(kActorMcCoy, 400);
} else {
Actor_Set_Goal_Number(kActorMcCoy, 500);
}
- } else if (Global_Variable_Query(1) > 3) {
+ } else if (Global_Variable_Query(kVariableChapter) > 3) {
Actor_Says(kActorMcCoy, 8522, 12);
Actor_Face_Heading(kActorMcCoy, 307, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 3, 0, 0);
diff --git a/engines/bladerunner/script/scene/ps15.cpp b/engines/bladerunner/script/scene/ps15.cpp
index 0d18724ced..c49a10ca4f 100644
--- a/engines/bladerunner/script/scene/ps15.cpp
+++ b/engines/bladerunner/script/scene/ps15.cpp
@@ -42,7 +42,7 @@ void SceneScriptPS15::InitializeScene() {
void SceneScriptPS15::SceneLoaded() {
Obstacle_Object("E.ARCH", true);
- if (Global_Variable_Query(1) == 2) {
+ if (Global_Variable_Query(kVariableChapter) == 2) {
Item_Add_To_World(110, 983, 101, -208.0f, -113.43f, 30.28f, 750, 16, 12, false, true, false, true);
}
}
diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp
index c069ed2f08..11eb28ee86 100644
--- a/engines/bladerunner/script/scene/rc01.cpp
+++ b/engines/bladerunner/script/scene/rc01.cpp
@@ -24,6 +24,28 @@
namespace BladeRunner {
+enum kRC01Loops {
+ kRC01LoopInshotWithCrowd = 0,
+ kRC01LoopWithCrowd = 1,
+ kRC01LoopDoorAnimWithCrowd = 3,
+ kRC01LoopOutshotWithCrowd = 4,
+ kRC01LoopInshotNoCrowd = 5,
+ kRC01LoopNoCrowd = 6,
+ kRC01LoopDoorAnimNoCrowd = 8,
+ kRC01LoopOutshotNoCrowd = 9,
+ kRC01LoopNoCrowdNoSpinner = 10
+};
+
+enum kRC01Exits {
+ kRC01ExitRC02 = 0,
+ kRC01ExitSpinner = 1,
+ kRC01ExitRC03 = 2
+};
+
+enum kRC01Regions {
+ kRC01RegionCrowd = 0
+};
+
void SceneScriptRC01::InitializeScene() {
#if BLADERUNNER_DEBUG_GAME
//TODO: not part of game, remove
@@ -31,6 +53,9 @@ void SceneScriptRC01::InitializeScene() {
Game_Flag_Set(kFlagRC02toRC01); // no landing
// Game_Flag_Set(kFlagRC01PoliceDone);
// Game_Flag_Set(kFlagKIAPrivacyAddon);
+ // Game_Flag_Set(kFlagZubenRetired);
+ // Game_Flag_Set(kFlagSpinnerToMA01);
+ // Set_Enter(kSetMA02_MA04, kSceneMA02);
// Spinner_Set_Selectable_Destination_Flag(0, true);
// Spinner_Set_Selectable_Destination_Flag(1, true);
@@ -42,9 +67,9 @@ void SceneScriptRC01::InitializeScene() {
// Spinner_Set_Selectable_Destination_Flag(7, true);
// Spinner_Set_Selectable_Destination_Flag(8, true);
// Spinner_Set_Selectable_Destination_Flag(9, true);
+
// ESPER_Flag_To_Activate();
// Voight_Kampff_Activate(kActorLucy, 50);
-
#endif
if (!Game_Flag_Query(kFlagIntroPlayed)) {
@@ -62,15 +87,15 @@ void SceneScriptRC01::InitializeScene() {
} else {
Setup_Scene_Information(-10.98f, -0.30f, 318.15f, 616);
}
- Scene_Exit_Add_2D_Exit(0, 314, 145, 340, 255, 0);
+ Scene_Exit_Add_2D_Exit(kRC01ExitRC02, 314, 145, 340, 255, 0);
if (Game_Flag_Query(kFlagSpinnerToRC01)) {
- Scene_Exit_Add_2D_Exit(1, 482, 226, 639, 280, 2);
+ Scene_Exit_Add_2D_Exit(kRC01ExitSpinner, 482, 226, 639, 280, 2);
}
- if (Global_Variable_Query(1) > 1 && Game_Flag_Query(710)) {
- Scene_Exit_Add_2D_Exit(2, 0, 0, 10, 479, 3);
+ if (Global_Variable_Query(kVariableChapter) > 1 && Game_Flag_Query(710)) {
+ Scene_Exit_Add_2D_Exit(kRC01ExitRC03, 0, 0, 10, 479, 3);
}
if (!Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_2D_Region_Add(0, 0, 294, 296, 479);
+ Scene_2D_Region_Add(kRC01RegionCrowd, 0, 294, 296, 479);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(false);
@@ -102,18 +127,18 @@ void SceneScriptRC01::InitializeScene() {
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
if (!Game_Flag_Query(kFlagRC02toRC01) && !Game_Flag_Query(kFlagRC03toRC01)) {
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 5, false);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kRC01LoopInshotNoCrowd, false);
}
if (Game_Flag_Query(kFlagSpinnerToRC01)) {
- Scene_Loop_Set_Default(6);
+ Scene_Loop_Set_Default(kRC01LoopNoCrowd);
} else {
- Scene_Loop_Set_Default(10);
+ Scene_Loop_Set_Default(kRC01LoopNoCrowdNoSpinner);
}
} else {
if (!Game_Flag_Query(kFlagRC02toRC01) && !Game_Flag_Query(kFlagRC03toRC01)) {
- Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kRC01LoopInshotWithCrowd, false);
}
- Scene_Loop_Set_Default(1);
+ Scene_Loop_Set_Default(kRC01LoopWithCrowd);
}
I_Sez("Blade Runner");
@@ -195,7 +220,7 @@ void SceneScriptRC01::SceneLoaded() {
}
if (!Game_Flag_Query(kFlagChromeDebrisTaken)) {
- Item_Add_To_World(kItemChromeDebris, 938, 69, -148.60f, -0.30f, 225.15f, 256, 24, 24, false, true, false, true);
+ Item_Add_To_World(kItemChromeDebris, 938, kSetRC01, -148.60f, -0.30f, 225.15f, 256, 24, 24, false, true, false, true);
}
if (!Game_Flag_Query(kFlagIntroPlayed)) {
@@ -246,7 +271,7 @@ bool SceneScriptRC01::ClickedOn3DObject(const char *objectName, bool a2) {
if (Object_Query_Click("DOOR LEFT", objectName)) {
if (!Loop_Actor_Walk_To_Scene_Object(kActorMcCoy, "DOOR LEFT", 48, true, false)) {
Actor_Face_Object(kActorMcCoy, "DOOR LEFT", true);
- if (!Actor_Clue_Query(kActorMcCoy, kClueDoorForced2) && Actor_Query_In_Set(kActorOfficerLeary, 69) && Global_Variable_Query(1)) {
+ if (!Actor_Clue_Query(kActorMcCoy, kClueDoorForced2) && Actor_Query_In_Set(kActorOfficerLeary, kSetRC01) && Global_Variable_Query(kVariableChapter) > 0) {
Actor_Set_Goal_Number(kActorOfficerLeary, 0);
Actor_Face_Actor(kActorOfficerLeary, kActorMcCoy, true);
Actor_Says(kActorOfficerLeary, 0, 12);
@@ -273,8 +298,8 @@ bool SceneScriptRC01::ClickedOn3DObject(const char *objectName, bool a2) {
}
bool SceneScriptRC01::ClickedOnActor(int actorId) {
- if (actorId == kActorOfficerLeary && Global_Variable_Query(1) == 1) {
- if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorOfficerLeary, 36, 1, false)) {
+ if (actorId == kActorOfficerLeary && Global_Variable_Query(kVariableChapter) == 1) {
+ if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorOfficerLeary, 36, true, false)) {
Actor_Face_Actor(kActorMcCoy, kActorOfficerLeary, true);
Actor_Face_Actor(kActorOfficerLeary, kActorMcCoy, true);
if (Actor_Query_Goal_Number(kActorOfficerLeary) == 1) {
@@ -336,7 +361,7 @@ bool SceneScriptRC01::ClickedOnActor(int actorId) {
bool SceneScriptRC01::ClickedOnItem(int itemId, bool a2) {
if (itemId == kItemChromeDebris) {
Actor_Set_Goal_Number(kActorOfficerLeary, 0);
- if (!Loop_Actor_Walk_To_Item(kActorMcCoy, kItemChromeDebris, 36, 1, false)) {
+ if (!Loop_Actor_Walk_To_Item(kActorMcCoy, kItemChromeDebris, 36, true, false)) {
Actor_Face_Item(kActorMcCoy, kItemChromeDebris, true);
Actor_Clue_Acquire(kActorMcCoy, kClueChromeDebris, true, -1);
Actor_Face_Actor(kActorOfficerLeary, kActorMcCoy, true);
@@ -369,16 +394,16 @@ void SceneScriptRC01::walkToCenter() {
}
bool SceneScriptRC01::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -174.77f, 5.55f, 25.95f, 12, 1, false, 0)) {
+ if (exitId == kRC01ExitRC02) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -174.77f, 5.55f, 25.95f, 12, true, false, 0)) {
if (Game_Flag_Query(705)) {
Actor_Says(kActorMcCoy, 8522, 14);
} else {
- switch (Global_Variable_Query(1)) {
+ switch (Global_Variable_Query(kVariableChapter)) {
case 1:
case 4:
Game_Flag_Set(kFlagRC01toRC02);
- Set_Enter(16, kSceneRC02);
+ Set_Enter(kSetRC02_RC51, kSceneRC02);
break;
case 2:
case 3:
@@ -392,12 +417,12 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) {
}
return true;
}
- if (exitId == 1) {
+ if (exitId == kRC01ExitSpinner) {
if (Game_Flag_Query(486)) {
Spinner_Set_Selectable_Destination_Flag(kSpinnerDestinationDNARow, true);
}
I_Sez("MG: Leaving already? The fun is just beginning!");
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -151.98f, -0.3f, 318.15f, 0, 1, false, 0)) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -151.98f, -0.3f, 318.15f, 0, true, false, 0)) {
Player_Loses_Control();
Actor_Set_Immunity_To_Obstacles(kActorMcCoy, true);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -10.98f, -0.3f, 318.15f, 0, 0, false, 0);
@@ -417,9 +442,9 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) {
Game_Flag_Reset(178);
int spinnerDest;
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- spinnerDest = Spinner_Interface_Choose_Dest(kSpinnerDestinationNightclubRow, true);
+ spinnerDest = Spinner_Interface_Choose_Dest(kRC01LoopDoorAnimNoCrowd, true);
} else {
- spinnerDest = Spinner_Interface_Choose_Dest(kSpinnerDestinationChinatown, true);
+ spinnerDest = Spinner_Interface_Choose_Dest(kRC01LoopDoorAnimWithCrowd, true);
}
switch (spinnerDest) {
@@ -427,99 +452,99 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) {
Game_Flag_Set(178);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToPS01);
- Set_Enter(61, kScenePS01);
+ Set_Enter(kSetPS01, kScenePS01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationMcCoysApartment:
Game_Flag_Set(179);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToMA01);
- Set_Enter(49, kSceneMA01);
+ Set_Enter(kSetMA01, kSceneMA01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationChinatown:
Game_Flag_Set(176);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToCT01);
- Set_Enter(4, kSceneCT01);
+ Set_Enter(kSetCT01_CT12, kSceneCT01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationTyrellBuilding:
Game_Flag_Set(261);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToTB02);
- Set_Enter(17, kSceneTB02);
+ Set_Enter(kSetTB02_TB03, kSceneTB02);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationAnimoidRow:
Game_Flag_Set(180);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToAR01);
- Set_Enter(0, kSceneAR01);
+ Set_Enter(kSetAR01_AR02, kSceneAR01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationDNARow:
Game_Flag_Set(177);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToDR01);
- Set_Enter(7, kSceneDR01);
+ Set_Enter(kSetDR01_DR02_DR04, kSceneDR01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationBradburyBuilding:
Game_Flag_Set(258);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToBB01);
- Set_Enter(20, kSceneBB01);
+ Set_Enter(kSetBB01, kSceneBB01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationNightclubRow:
Game_Flag_Set(181);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToNR01);
- Set_Enter(54, kSceneNR01);
+ Set_Enter(kSetNR01, kSceneNR01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
case kSpinnerDestinationHysteriaHall:
Game_Flag_Set(257);
Game_Flag_Reset(kFlagSpinnerToRC01);
Game_Flag_Set(kFlagSpinnerToHF01);
- Set_Enter(37, kSceneHF01);
+ Set_Enter(kSetHF01, kSceneHF01);
if (Game_Flag_Query(kFlagRC01PoliceDone)) {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 9, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotNoCrowd, true);
} else {
- Scene_Loop_Start_Special(kSceneLoopModeChangeSet, 4, true);
+ Scene_Loop_Start_Special(kSceneLoopModeChangeSet, kRC01LoopOutshotWithCrowd, true);
}
break;
default:
@@ -529,12 +554,12 @@ bool SceneScriptRC01::ClickedOnExit(int exitId) {
}
return true;
}
- if (exitId == 2) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -471.98f, -0.3f, 258.15f, 4, 1, false, 0)) {
+ if (exitId == kRC01ExitRC03) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -471.98f, -0.3f, 258.15f, 4, true, false, 0)) {
Game_Flag_Set(kFlagRC01toRC03);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Set_Enter(70, kSceneRC03);
+ Set_Enter(kSetRC03, kSceneRC03);
}
return true;
}
@@ -545,7 +570,7 @@ void SceneScriptRC01::investigateCrowd() {
if (!Game_Flag_Query(kFlagRC01PoliceDone) && !Loop_Actor_Walk_To_Scene_Object(kActorMcCoy, "BARICADE03", 36, true, false)) {
Actor_Set_Goal_Number(kActorOfficerLeary, 0);
Actor_Face_Object(kActorMcCoy, "BARICADE03", true);
- Loop_Actor_Walk_To_Actor(kActorOfficerLeary, kActorMcCoy, 36, 1, false);
+ Loop_Actor_Walk_To_Actor(kActorOfficerLeary, kActorMcCoy, 36, true, false);
Actor_Face_Actor(kActorOfficerLeary, kActorMcCoy, true);
Actor_Says(kActorMcCoy, 4500, 14);
I_Sez("MG: We don't want any of that abstract art oozing out onto the street.");
@@ -555,7 +580,7 @@ void SceneScriptRC01::investigateCrowd() {
}
bool SceneScriptRC01::ClickedOn2DRegion(int region) {
- if (region == 0) {
+ if (region == kRC01RegionCrowd) {
investigateCrowd();
return true;
}
@@ -607,11 +632,11 @@ void SceneScriptRC01::PlayerWalkedIn() {
Player_Gains_Control();
Game_Flag_Reset(kFlagRC02toRC01);
- if (Game_Flag_Query(kFlagRC02Discovered) && !Game_Flag_Query(4)) {
+ if (Game_Flag_Query(kFlagRC02Discovered) && !Game_Flag_Query(kFlagRC02FirstLeave)) {
Actor_Voice_Over(1910, kActorVoiceOver);
Actor_Voice_Over(1920, kActorVoiceOver);
Actor_Voice_Over(1930, kActorVoiceOver);
- Game_Flag_Set(4);
+ Game_Flag_Set(kFlagRC02FirstLeave);
}
//return true;
}
@@ -621,10 +646,10 @@ void SceneScriptRC01::PlayerWalkedIn() {
void SceneScriptRC01::PlayerWalkedOut() {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(kFlagRC01toRC02) && !Game_Flag_Query(kFlagRC01toRC03) && Global_Variable_Query(1)) {
+ if (!Game_Flag_Query(kFlagRC01toRC02) && !Game_Flag_Query(kFlagRC01toRC03) && Global_Variable_Query(kVariableChapter) > 0) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Outtake_Play(kOuttakeAway2, 1, -1);
+ Outtake_Play(kOuttakeAway2, true, -1);
}
// return 1;
}
diff --git a/engines/bladerunner/script/scene/rc02.cpp b/engines/bladerunner/script/scene/rc02.cpp
index 0a95e40a5c..9305b797f4 100644
--- a/engines/bladerunner/script/scene/rc02.cpp
+++ b/engines/bladerunner/script/scene/rc02.cpp
@@ -24,15 +24,20 @@
namespace BladeRunner {
+enum kRC02Exits {
+ kRC02ExitRC01 = 0,
+ kRC02ExitRC51 = 1
+};
+
void SceneScriptRC02::InitializeScene() {
if (Game_Flag_Query(kFlagRC01toRC02)) {
Setup_Scene_Information(-103.0f, -1238.89f, 108603.04f, 1007);
} else {
Setup_Scene_Information(-20.2f, -1238.89f, 108100.73f, 539);
}
- Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2);
- if (Game_Flag_Query(141)) {
- Scene_Exit_Add_2D_Exit(1, 265, 58, 346, 154, 0);
+ Scene_Exit_Add_2D_Exit(kRC02ExitRC01, 0, 460, 639, 479, 2);
+ if (Game_Flag_Query(kFlagRC02LucyDeskAvailable)) {
+ Scene_Exit_Add_2D_Exit(kRC02ExitRC51, 265, 58, 346, 154, 0);
}
Ambient_Sounds_Remove_All_Non_Looping_Sounds(0);
Ambient_Sounds_Add_Looping_Sound(71, 50, 1, 1);
@@ -76,7 +81,7 @@ void SceneScriptRC02::SceneLoaded() {
Unclickable_Object("DRAPE05");
Unclickable_Object("DRAPE06");
Unclickable_Object("DRAPE07");
- if (Actor_Clue_Query(kActorMcCoy, kClueRuncitersVideo) || Global_Variable_Query(1) > 1) {
+ if (Actor_Clue_Query(kActorMcCoy, kClueRuncitersVideo) || Global_Variable_Query(kVariableChapter) > 1) {
Unclickable_Object("SCRTY CA03");
}
if (!Game_Flag_Query(kFlagShellCasingsTaken)) {
@@ -170,8 +175,8 @@ void SceneScriptRC02::dialogueWithRunciter() {
Actor_Face_Object(kActorRunciter, "CURTAIN", true);
Actor_Says(kActorRunciter, 350, 13);
Actor_Face_Actor(kActorRunciter, kActorMcCoy, true);
- Scene_Exit_Add_2D_Exit(1, 265, 58, 346, 154, 0);
- Game_Flag_Set(141);
+ Scene_Exit_Add_2D_Exit(kRC02ExitRC51, 265, 58, 346, 154, 0);
+ Game_Flag_Set(kFlagRC02LucyDeskAvailable);
break;
case 20:
Actor_Says(kActorMcCoy, 4590, 19);
@@ -202,7 +207,7 @@ bool SceneScriptRC02::ClickedOnActor(int actorId) {
return false;
}
- if (Global_Variable_Query(1) == 4) {
+ if (Global_Variable_Query(kVariableChapter) == 4) {
Actor_Face_Actor(kActorMcCoy, kActorRunciter, true);
if (Actor_Query_Goal_Number(kActorRunciter) == 599) {
if (Random_Query(1, 2) == 1) {
@@ -312,22 +317,22 @@ bool SceneScriptRC02::ClickedOnItem(int itemId, bool a2) {
}
bool SceneScriptRC02::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -71.51f, -1238.89f, 108587.15f, 0, 1, false, 0)) {
+ if (exitId == kRC02ExitRC01) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -71.51f, -1238.89f, 108587.15f, 0, true, false, 0)) {
Game_Flag_Set(kFlagRC02toRC01);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_Looping_Sound(71, true);
Ambient_Sounds_Remove_Looping_Sound(75, true);
Ambient_Sounds_Adjust_Looping_Sound(85, 100, -101, 1);
Actor_Set_Goal_Number(kActorRunciter, 0);
- Set_Enter(69, kSceneRC01);
+ Set_Enter(kSetRC01, kSceneRC01);
}
return true;
}
- if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -20.2f, -1238.73f, 108152.73f, 0, 1, false, 0)) {
+ if (exitId == kRC02ExitRC51) {
+ if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -20.2f, -1238.73f, 108152.73f, 0, true, false, 0)) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -8.87f, -1238.89f, 108076.27f, 0, false);
- Set_Enter(16, kSceneRC51);
+ Set_Enter(kSetRC02_RC51, kSceneRC51);
}
return true;
}
@@ -348,7 +353,7 @@ void SceneScriptRC02::PlayerWalkedIn() {
Player_Set_Combat_Mode(false);
if (Game_Flag_Query(kFlagRC01toRC02)) {
Player_Loses_Control();
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, -72.2f, -1238.89f, 108496.73f, 0, 0, false, 0);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, -72.2f, -1238.89f, 108496.73f, 0, false, false, 0);
Player_Gains_Control();
Game_Flag_Reset(kFlagRC01toRC02);
if (!Game_Flag_Query(kFlagRC02Discovered)) {
@@ -359,7 +364,7 @@ void SceneScriptRC02::PlayerWalkedIn() {
Actor_Clue_Acquire(kActorMcCoy, kClueGracefulFootprints, 1, -1);
Game_Flag_Set(kFlagRC02Discovered);
}
- if (Actor_Query_Which_Set_In(kActorRunciter) == 16 && Actor_Query_Goal_Number(kActorRunciter) < 300) {
+ if (Actor_Query_Which_Set_In(kActorRunciter) == kSetRC02_RC51 && Actor_Query_Goal_Number(kActorRunciter) < 300) {
Actor_Set_Goal_Number(kActorRunciter, 1);
}
if (Actor_Query_Goal_Number(kActorRunciter) == 300 && !Game_Flag_Query(704)) {
diff --git a/engines/bladerunner/script/scene/rc03.cpp b/engines/bladerunner/script/scene/rc03.cpp
index ca6bfc96fa..e4e81fc336 100644
--- a/engines/bladerunner/script/scene/rc03.cpp
+++ b/engines/bladerunner/script/scene/rc03.cpp
@@ -24,8 +24,10 @@
namespace BladeRunner {
+
+
void SceneScriptRC03::InitializeScene() {
- if (Game_Flag_Query(kFlagRC01toRC03) ) {
+ if (Game_Flag_Query(kFlagRC01toRC03)) {
Setup_Scene_Information(298.0f, -4.0f, 405.0f, 800);
Game_Flag_Reset(kFlagRC01toRC03);
} else if (Game_Flag_Query(117) ) {
@@ -76,8 +78,8 @@ void SceneScriptRC03::InitializeScene() {
Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- if (Game_Flag_Query(107) && Actor_Query_Goal_Number(kActorIzo) != 102) {
- Scene_Loop_Start_Special(0, 0, 0);
+ if (Game_Flag_Query(107) && Actor_Query_Goal_Number(kActorIzo) != 102) {
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, 0, false);
}
Scene_Loop_Set_Default(1);
}
@@ -141,7 +143,7 @@ bool SceneScriptRC03::ClickedOnExit(int exitId) {
Game_Flag_Set(702);
}
Game_Flag_Set(kFlagRC03toRC01);
- Set_Enter(69, kSceneRC01);
+ Set_Enter(kSetRC01, kSceneRC01);
Actor_Set_Goal_Number(kActorDektora, 100);
}
return true;
@@ -154,7 +156,7 @@ bool SceneScriptRC03::ClickedOnExit(int exitId) {
Game_Flag_Set(116);
Game_Flag_Reset(182);
Game_Flag_Set(180);
- Set_Enter(0, kSceneAR02);
+ Set_Enter(kSetAR01_AR02, kSceneAR02);
}
return true;
}
@@ -166,7 +168,7 @@ bool SceneScriptRC03::ClickedOnExit(int exitId) {
if (Game_Flag_Query(289)) {
Game_Flag_Set(702);
}
- Set_Enter(74, kSceneUG01);
+ Set_Enter(kSetUG01, kSceneUG01);
Actor_Set_Goal_Number(kActorDektora, 100);
}
return true;
@@ -179,18 +181,18 @@ bool SceneScriptRC03::ClickedOnExit(int exitId) {
if (Game_Flag_Query(289)) {
Game_Flag_Set(702);
}
- Set_Enter(8, kSceneHC04);
+ Set_Enter(kSetHC01_HC02_HC03_HC04, kSceneHC04);
Actor_Set_Goal_Number(kActorDektora, 100);
}
return true;
}
if (exitId == 4) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -22.0f, 1.0f, -63.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) == 3 || Global_Variable_Query(1) == 5 || Game_Flag_Query(702)) {
+ if (Global_Variable_Query(kVariableChapter) == 3 || Global_Variable_Query(kVariableChapter) == 5 || Game_Flag_Query(702)) {
Actor_Says(kActorMcCoy, 8522, 14);
} else {
Game_Flag_Set(120);
- Set_Enter(71, kSceneRC04);
+ Set_Enter(kSetRC04, kSceneRC04);
}
}
return true;
@@ -243,7 +245,7 @@ void SceneScriptRC03::PlayerWalkedIn() {
Actor_Set_At_XYZ(kActorIzo, 196.0f, -4.0f, 184.0f, 775);
Actor_Face_Actor(kActorIzo, kActorMcCoy, true);
Actor_Face_Actor(kActorMcCoy, kActorIzo, true);
- Actor_Change_Animation_Mode(kActorIzo, 4);
+ Actor_Change_Animation_Mode(kActorIzo, kAnimationModeCombatIdle);
Actor_Says_With_Pause(kActorIzo, 630, 0, -1);
Actor_Says_With_Pause(kActorIzo, 640, 0, -1);
Actor_Says_With_Pause(kActorIzo, 650, 0, -1);
@@ -282,7 +284,7 @@ void SceneScriptRC03::PlayerWalkedIn() {
Game_Flag_Reset(117);
Game_Flag_Reset(107);
Game_Flag_Reset(121);
- if (Global_Variable_Query(1) == 1 || Global_Variable_Query(1) == 2) {
+ if (Global_Variable_Query(kVariableChapter) == 1 || Global_Variable_Query(kVariableChapter) == 2) {
Actor_Set_Goal_Number(kActorDektora, 103);
}
}
diff --git a/engines/bladerunner/script/scene/rc04.cpp b/engines/bladerunner/script/scene/rc04.cpp
index dee3c7a551..c0fe729935 100644
--- a/engines/bladerunner/script/scene/rc04.cpp
+++ b/engines/bladerunner/script/scene/rc04.cpp
@@ -288,7 +288,7 @@ bool SceneScriptRC04::ClickedOnActor(int actorId) {
if (Player_Query_Combat_Mode()) {
return false;
}
- if (actorId == 14 && Global_Variable_Query(1) == 2 && !Game_Flag_Query(289)) {
+ if (actorId == 14 && Global_Variable_Query(kVariableChapter) == 2 && !Game_Flag_Query(289)) {
Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 104, 0, 0, false);
Actor_Face_Actor(kActorMcCoy, kActorBulletBob, true);
if (Game_Flag_Query(287) && !Game_Flag_Query(292) && Actor_Query_Friendliness_To_Other(kActorBulletBob, kActorMcCoy) > 45) {
@@ -391,8 +391,8 @@ void SceneScriptRC04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
void SceneScriptRC04::PlayerWalkedIn() {
Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 103, 0, 0, false);
- if (Global_Variable_Query(1) != 2 || Game_Flag_Query(287) || Player_Query_Combat_Mode()) {
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(289) && !Game_Flag_Query(306)) {
+ if (Global_Variable_Query(kVariableChapter) != 2 || Game_Flag_Query(287) || Player_Query_Combat_Mode()) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(289) && !Game_Flag_Query(306)) {
Actor_Says(kActorDispatcher, 40, 3);
Actor_Says(kActorBulletBob, 890, 37);
Actor_Set_Goal_Number(kActorBulletBob, 2);
diff --git a/engines/bladerunner/script/scene/rc51.cpp b/engines/bladerunner/script/scene/rc51.cpp
index 6a376a725b..8019ea0462 100644
--- a/engines/bladerunner/script/scene/rc51.cpp
+++ b/engines/bladerunner/script/scene/rc51.cpp
@@ -24,11 +24,20 @@
namespace BladeRunner {
+enum kRC51Loops {
+ kRC51LoopInshotFromRC02 = 0,
+ kRC51LoopMain = 1
+};
+
+enum kRC51Exits {
+ kRC51ExitRC02 = 0
+};
+
void SceneScriptRC51::InitializeScene() {
Setup_Scene_Information(-8.87f, -1238.89f, 108164.27f, 66);
- Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2);
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(1);
+ Scene_Exit_Add_2D_Exit(kRC51ExitRC02, 0, 460, 639, 479, 2);
+ Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kRC51LoopInshotFromRC02, false);
+ Scene_Loop_Set_Default(kRC51LoopMain);
}
void SceneScriptRC51::SceneLoaded() {
@@ -38,14 +47,14 @@ void SceneScriptRC51::SceneLoaded() {
Unclickable_Object("GRL_DSK");
Unclickable_Object("GRL_DSKLEG");
Unclickable_Object("CURTAIN");
- if (!Game_Flag_Query(147)) {
- Item_Add_To_World(82, 937, 16, 47.56f, -1238.89f, 108048.61f, 0, 6, 18, false, true, false, true);
+ if (!Game_Flag_Query(kFlagChopstickWrapperTaken)) {
+ Item_Add_To_World(kItemChopstickWrapper, 937, kSetRC02_RC51, 47.56f, -1238.89f, 108048.61f, 0, 6, 18, false, true, false, true);
}
- if (!Game_Flag_Query(148)) {
- Item_Add_To_World(79, 933, 16, 67.28f, -1193.38f, 108011.27f, 0, 6, 6, false, true, false, true);
+ if (!Game_Flag_Query(kFlagCandyTaken)) {
+ Item_Add_To_World(kItemCandy, 933, kSetRC02_RC51, 67.28f, -1193.38f, 108011.27f, 0, 6, 6, false, true, false, true);
}
- if (!Game_Flag_Query(149)) {
- Item_Add_To_World(98, 971, 16, -69.65f, -1238.89f, 107995.24f, 256, 18, 18, false, true, false, true);
+ if (!Game_Flag_Query(kFlagDogTaken)) {
+ Item_Add_To_World(kItemToyDog, 971, kSetRC02_RC51, -69.65f, -1238.89f, 107995.24f, 256, 18, 18, false, true, false, true);
}
}
@@ -67,41 +76,41 @@ bool SceneScriptRC51::ClickedOnActor(int actorId) {
}
bool SceneScriptRC51::ClickedOnItem(int itemId, bool a2) {
- if (itemId == 82 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 17.97f, -1238.89f, 108053.5f, 0, 1, false, 0)) {
- Actor_Face_Item(kActorMcCoy, 82, true);
+ if (itemId == kItemChopstickWrapper && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 17.97f, -1238.89f, 108053.5f, 0, false, false, 0)) {
+ Actor_Face_Item(kActorMcCoy, kItemChopstickWrapper, true);
Actor_Clue_Acquire(kActorMcCoy, kClueChopstickWrapper, 1, -1);
- Item_Remove_From_World(82);
+ Item_Remove_From_World(kItemChopstickWrapper);
Item_Pickup_Spin_Effect(937, 437, 407);
Actor_Voice_Over(2010, kActorVoiceOver);
- Game_Flag_Set(147);
+ Game_Flag_Set(kFlagChopstickWrapperTaken);
return true;
}
- if (itemId == 79 && !Loop_Actor_Walk_To_Item(kActorMcCoy, 79, 36, 1, false)) {
- Actor_Face_Item(kActorMcCoy, 79, true);
+ if (itemId == kItemCandy && !Loop_Actor_Walk_To_Item(kActorMcCoy, kItemCandy, 36, true, false)) {
+ Actor_Face_Item(kActorMcCoy, kItemCandy, true);
Actor_Clue_Acquire(kActorMcCoy, kClueCandy, 1, -1);
- Item_Remove_From_World(79);
+ Item_Remove_From_World(kItemCandy);
Item_Pickup_Spin_Effect(933, 445, 230);
Actor_Says(kActorMcCoy, 8735, 3);
Actor_Says(kActorMcCoy, 8529, 3);
- Game_Flag_Set(148);
+ Game_Flag_Set(kFlagCandyTaken);
return true;
}
- if (itemId == 98 && !Loop_Actor_Walk_To_Item(kActorMcCoy, 98, 36, 1, false)) {
- Actor_Face_Item(kActorMcCoy, 98, true);
+ if (itemId == kItemToyDog && !Loop_Actor_Walk_To_Item(kActorMcCoy, kItemToyDog, 36, true, false)) {
+ Actor_Face_Item(kActorMcCoy, kItemToyDog, true);
Actor_Clue_Acquire(kActorMcCoy, kClueToyDog, 1, -1);
- Item_Remove_From_World(98);
+ Item_Remove_From_World(kItemToyDog);
Item_Pickup_Spin_Effect(971, 55, 376);
Actor_Says(kActorMcCoy, 8525, 3);
Actor_Says(kActorMcCoy, 8740, 3);
- Game_Flag_Set(149);
+ Game_Flag_Set(kFlagDogTaken);
return true;
}
return false;
}
bool SceneScriptRC51::ClickedOnExit(int exitId) {
- if (exitId == 0 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -8.87f, -1238.89f, 108173.27f, 0, 1, false, 0)) {
- Set_Enter(16, kSceneRC02);
+ if (exitId == kRC51ExitRC02 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -8.87f, -1238.89f, 108173.27f, 0, true, false, 0)) {
+ Set_Enter(kSetRC02_RC51, kSceneRC02);
return true;
}
return false;
@@ -118,7 +127,7 @@ void SceneScriptRC51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptRC51::PlayerWalkedIn() {
- Game_Flag_Set(709);
+ Game_Flag_Set(kFlagRC51Discovered);
}
void SceneScriptRC51::PlayerWalkedOut() {
diff --git a/engines/bladerunner/script/scene/tb02.cpp b/engines/bladerunner/script/scene/tb02.cpp
index 5ae0a54d44..1d305912cf 100644
--- a/engines/bladerunner/script/scene/tb02.cpp
+++ b/engines/bladerunner/script/scene/tb02.cpp
@@ -37,7 +37,7 @@ void SceneScriptTB02::InitializeScene() {
Outtake_Play(kOuttakeTyrellBuildingFly, false, -1);
Setup_Scene_Information(-304.0f, -81.46f, 1434.0f, 250);
}
- if (Global_Variable_Query(1) > 3) {
+ if (Global_Variable_Query(kVariableChapter) > 3) {
Scene_Exit_Add_2D_Exit(0, 0, 455, 639, 479, 2);
}
Ambient_Sounds_Add_Looping_Sound(211, 20, 0, 1);
@@ -46,7 +46,7 @@ void SceneScriptTB02::InitializeScene() {
Ambient_Sounds_Add_Sound(214, 2, 20, 16, 20, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(215, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(216, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0);
- if (Global_Variable_Query(1) <= 3) {
+ if (Global_Variable_Query(kVariableChapter) <= 3) {
Ambient_Sounds_Add_Looping_Sound(45, 35, 0, 1);
Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
@@ -63,7 +63,7 @@ void SceneScriptTB02::InitializeScene() {
Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
}
- if (Game_Flag_Query(kFlagSpinnerToTB02) && Global_Variable_Query(1) < 4) {
+ if (Game_Flag_Query(kFlagSpinnerToTB02) && Global_Variable_Query(kVariableChapter) < 4) {
Scene_Exit_Add_2D_Exit(2, 67, 0, 233, 362, 3);
}
if (Game_Flag_Query(155)) {
@@ -74,7 +74,7 @@ void SceneScriptTB02::InitializeScene() {
}
Actor_Put_In_Set(kActorTyrellGuard, 17);
Actor_Set_At_XYZ(kActorTyrellGuard, -38.53f, 2.93f, 1475.97f, 673);
- if (Global_Variable_Query(1) == 4) {
+ if (Global_Variable_Query(kVariableChapter) == 4) {
if (Actor_Query_Goal_Number(kActorTyrellGuard) < 300) {
Actor_Set_Goal_Number(kActorTyrellGuard, 300);
}
@@ -99,7 +99,7 @@ bool SceneScriptTB02::ClickedOnActor(int actorId) {
if (actorId == 17) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -76.35f, 0.15f, 1564.2f, 0, 1, false, 0)) {
Actor_Face_Actor(kActorMcCoy, kActorTyrellGuard, true);
- int v1 = Global_Variable_Query(1);
+ int v1 = Global_Variable_Query(kVariableChapter);
if (v1 == 2) {
if (Game_Flag_Query(450) && !Game_Flag_Query(451)) {
Actor_Says(kActorMcCoy, 5150, 18);
@@ -167,7 +167,7 @@ bool SceneScriptTB02::ClickedOnExit(int exitId) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -32.0f, 0.0f, 1578.0f, 0, 1, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (Global_Variable_Query(1) < 4) {
+ if (Global_Variable_Query(kVariableChapter) < 4) {
Game_Flag_Set(451);
Game_Flag_Set(96);
Set_Enter(72, kSceneTB05);
@@ -269,7 +269,7 @@ void SceneScriptTB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptTB02::PlayerWalkedIn() {
- if (Game_Flag_Query(625) && ((Game_Flag_Reset(625) , Global_Variable_Query(1) == 2) || Global_Variable_Query(1) == 3)) {
+ if (Game_Flag_Query(625) && ((Game_Flag_Reset(625) , Global_Variable_Query(kVariableChapter) == 2) || Global_Variable_Query(kVariableChapter) == 3)) {
Set_Enter(18, kSceneTB07);
//return true;
return;
@@ -289,7 +289,7 @@ void SceneScriptTB02::PlayerWalkedIn() {
Loop_Actor_Travel_Stairs(kActorMcCoy, 9, 1, 0);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -140.0f, 0.79f, 1470.0f, 0, 0, false, 0);
}
- int v0 = Global_Variable_Query(1);
+ int v0 = Global_Variable_Query(kVariableChapter);
if (v0 > 4) {
//return false;
return;
diff --git a/engines/bladerunner/script/scene/tb03.cpp b/engines/bladerunner/script/scene/tb03.cpp
index 8803740d7a..274ea10cfa 100644
--- a/engines/bladerunner/script/scene/tb03.cpp
+++ b/engines/bladerunner/script/scene/tb03.cpp
@@ -38,7 +38,7 @@ void SceneScriptTB03::InitializeScene() {
Ambient_Sounds_Add_Sound(214, 2, 20, 16, 20, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(215, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(216, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0);
- if (Global_Variable_Query(1) <= 3) {
+ if (Global_Variable_Query(kVariableChapter) <= 3) {
Ambient_Sounds_Add_Looping_Sound(45, 25, 0, 1);
Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
@@ -57,7 +57,7 @@ void SceneScriptTB03::InitializeScene() {
}
Actor_Put_In_Set(kActorTyrellGuard, 17);
Actor_Set_At_XYZ(kActorTyrellGuard, -38.53f, 2.93f, 1475.97f, 673);
- if (Global_Variable_Query(1) == 4) {
+ if (Global_Variable_Query(kVariableChapter) == 4) {
int goal = Actor_Query_Goal_Number(kActorTyrellGuard);
if (goal == 304) {
Actor_Change_Animation_Mode(kActorTyrellGuard, 0);
diff --git a/engines/bladerunner/script/scene/tb07.cpp b/engines/bladerunner/script/scene/tb07.cpp
index 688c9f4c22..21041fdd72 100644
--- a/engines/bladerunner/script/scene/tb07.cpp
+++ b/engines/bladerunner/script/scene/tb07.cpp
@@ -37,7 +37,7 @@ void SceneScriptTB07::InitializeScene() {
Ambient_Sounds_Add_Sound(214, 1, 20, 20, 25, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(215, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(216, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0);
- if (Global_Variable_Query(1) == 4 && !Actor_Clue_Query(kActorMcCoy, kClueDNATyrell)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Actor_Clue_Query(kActorMcCoy, kClueDNATyrell)) {
Item_Add_To_World(83, 941, 18, 9.7f, 48.7f, -174.22f, 0, 12, 12, false, true, false, true);
}
if (Game_Flag_Query(661)) {
@@ -81,7 +81,7 @@ bool SceneScriptTB07::ClickedOnExit(int exitId) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 68.0f, 12.0f, 288.0f, 0, 1, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (Global_Variable_Query(1) == 4) {
+ if (Global_Variable_Query(kVariableChapter) == 4) {
Game_Flag_Set(608);
Set_Enter(17, kSceneTB02);
} else {
@@ -175,7 +175,7 @@ void SceneScriptTB07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptTB07::PlayerWalkedIn() {
- int v0 = Global_Variable_Query(1);
+ int v0 = Global_Variable_Query(kVariableChapter);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 44.0f, 12.0f, 176.0f, 0, 0, false, 0);
if ((v0 == 2 || v0 == 3) && !Game_Flag_Query(612)) {
Player_Set_Combat_Mode(false);
diff --git a/engines/bladerunner/script/scene/ug02.cpp b/engines/bladerunner/script/scene/ug02.cpp
index 2415bb78fd..c6b96c65a5 100644
--- a/engines/bladerunner/script/scene/ug02.cpp
+++ b/engines/bladerunner/script/scene/ug02.cpp
@@ -91,7 +91,7 @@ bool SceneScriptUG02::MouseClick(int x, int y) {
bool SceneScriptUG02::ClickedOn3DObject(const char *objectName, bool a2) {
if (Object_Query_Click("GUN_1", objectName) || Object_Query_Click("GUN_2", objectName) || Object_Query_Click("CRATE_3", objectName)) {
Actor_Face_Object(kActorMcCoy, "GUN_1", true);
- if (!Game_Flag_Query(449) && Global_Variable_Query(1) < 4) {
+ if (!Game_Flag_Query(449) && Global_Variable_Query(kVariableChapter) < 4) {
Actor_Voice_Over(2430, kActorVoiceOver);
Actor_Voice_Over(2440, kActorVoiceOver);
Actor_Voice_Over(2450, kActorVoiceOver);
@@ -100,7 +100,7 @@ bool SceneScriptUG02::ClickedOn3DObject(const char *objectName, bool a2) {
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsCache, 1, -1);
return true;
}
- if (Global_Variable_Query(1) <= 3) {
+ if (Global_Variable_Query(kVariableChapter) <= 3) {
Actor_Says(kActorMcCoy, 8580, 14);
return false;
}
diff --git a/engines/bladerunner/script/scene/ug03.cpp b/engines/bladerunner/script/scene/ug03.cpp
index a8119a893f..88ea49695c 100644
--- a/engines/bladerunner/script/scene/ug03.cpp
+++ b/engines/bladerunner/script/scene/ug03.cpp
@@ -100,7 +100,7 @@ bool SceneScriptUG03::ClickedOnItem(int itemId, bool a2) {
bool SceneScriptUG03::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -139.0f, 0.0f, -13.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) < 4) {
+ if (Global_Variable_Query(kVariableChapter) < 4) {
Actor_Says(kActorMcCoy, 8522, 14);
} else {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
diff --git a/engines/bladerunner/script/scene/ug04.cpp b/engines/bladerunner/script/scene/ug04.cpp
index 8c54e64aad..b747c2fde3 100644
--- a/engines/bladerunner/script/scene/ug04.cpp
+++ b/engines/bladerunner/script/scene/ug04.cpp
@@ -35,7 +35,7 @@ void SceneScriptUG04::InitializeScene() {
Game_Flag_Reset(334);
}
Scene_Exit_Add_2D_Exit(0, 123, 308, 159, 413, 3);
- if (Global_Variable_Query(1) > 3) {
+ if (Global_Variable_Query(kVariableChapter) > 3) {
Scene_Exit_Add_2D_Exit(1, 256, 333, 290, 373, 0);
}
Scene_Exit_Add_2D_Exit(2, 344, 298, 451, 390, 1);
diff --git a/engines/bladerunner/script/scene/ug06.cpp b/engines/bladerunner/script/scene/ug06.cpp
index d69103aef8..e17aa542f7 100644
--- a/engines/bladerunner/script/scene/ug06.cpp
+++ b/engines/bladerunner/script/scene/ug06.cpp
@@ -134,7 +134,7 @@ void SceneScriptUG06::PlayerWalkedIn() {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 66.0f, 0.0f, -36.91f, 0, 0, false, 0);
Game_Flag_Reset(343);
}
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(524)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(524)) {
Player_Loses_Control();
Actor_Voice_Over(2620, kActorVoiceOver);
Actor_Voice_Over(2630, kActorVoiceOver);
diff --git a/engines/bladerunner/script/scene/ug07.cpp b/engines/bladerunner/script/scene/ug07.cpp
index 29e7cfe72d..9a586407fc 100644
--- a/engines/bladerunner/script/scene/ug07.cpp
+++ b/engines/bladerunner/script/scene/ug07.cpp
@@ -112,7 +112,7 @@ bool SceneScriptUG07::ClickedOnExit(int exitId) {
}
}
if (exitId == 2) {
- if (!Game_Flag_Query(607) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4 && !Game_Flag_Query(598)) {
+ if (!Game_Flag_Query(607) && Game_Flag_Query(671) && Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(598)) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 49.0f, -12.21f, -130.0f, 0, 1, false, 0)) {
Game_Flag_Set(598);
Actor_Put_In_Set(kActorClovis, 80);
@@ -165,7 +165,7 @@ void SceneScriptUG07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptUG07::PlayerWalkedIn() {
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(623)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(623)) {
Actor_Set_Goal_Number(kActorOfficerLeary, 307);
Actor_Set_Goal_Number(kActorOfficerGrayford, 307);
}
@@ -176,7 +176,7 @@ void SceneScriptUG07::PlayerWalkedIn() {
}
void SceneScriptUG07::PlayerWalkedOut() {
- if (Global_Variable_Query(1) == 4 && (Actor_Query_Goal_Number(kActorOfficerLeary) == 307 || Actor_Query_Goal_Number(kActorOfficerGrayford) == 307)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && (Actor_Query_Goal_Number(kActorOfficerLeary) == 307 || Actor_Query_Goal_Number(kActorOfficerGrayford) == 307)) {
Non_Player_Actor_Combat_Mode_Off(kActorOfficerLeary);
Non_Player_Actor_Combat_Mode_Off(kActorOfficerGrayford);
Actor_Set_Goal_Number(kActorOfficerLeary, 306);
diff --git a/engines/bladerunner/script/scene/ug09.cpp b/engines/bladerunner/script/scene/ug09.cpp
index 502dda9942..4d2691358a 100644
--- a/engines/bladerunner/script/scene/ug09.cpp
+++ b/engines/bladerunner/script/scene/ug09.cpp
@@ -132,13 +132,13 @@ void SceneScriptUG09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo
}
void SceneScriptUG09::PlayerWalkedIn() {
- if (Global_Variable_Query(1) == 4 && Game_Flag_Query(623)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Game_Flag_Query(623)) {
Game_Flag_Set(630);
}
}
void SceneScriptUG09::PlayerWalkedOut() {
- if (Global_Variable_Query(1) == 4 && Global_Variable_Query(1) != 5) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Global_Variable_Query(kVariableChapter) != 5) {
Game_Flag_Reset(630);
}
if (Game_Flag_Query(432)) {
diff --git a/engines/bladerunner/script/scene/ug10.cpp b/engines/bladerunner/script/scene/ug10.cpp
index fc21e8b580..123693d8ef 100644
--- a/engines/bladerunner/script/scene/ug10.cpp
+++ b/engines/bladerunner/script/scene/ug10.cpp
@@ -72,7 +72,7 @@ void SceneScriptUG10::InitializeScene() {
void SceneScriptUG10::SceneLoaded() {
Obstacle_Object("SLUICEGATE_LEVER", true);
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(474) && Game_Flag_Query(172) && !Game_Flag_Query(693)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(474) && Game_Flag_Query(172) && !Game_Flag_Query(693)) {
Scene_Loop_Set_Default(1);
Scene_Loop_Start_Special(kSceneLoopMode2, 6, true);
Game_Flag_Set(693);
diff --git a/engines/bladerunner/script/scene/ug13.cpp b/engines/bladerunner/script/scene/ug13.cpp
index 0623cea57a..09e33e8b1e 100644
--- a/engines/bladerunner/script/scene/ug13.cpp
+++ b/engines/bladerunner/script/scene/ug13.cpp
@@ -46,7 +46,7 @@ void SceneScriptUG13::InitializeScene() {
Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0);
Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0);
Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0);
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(169)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && !Game_Flag_Query(169)) {
Actor_Set_Goal_Number(kActorTransient, 390);
}
if (Actor_Query_Goal_Number(kActorTransient) == 599) {
@@ -72,7 +72,7 @@ void SceneScriptUG13::SceneLoaded() {
Clickable_Object("BASKET");
Clickable_Object("BOLLARD");
Unclickable_Object("BASKET");
- if (Global_Variable_Query(1) >= 3 && !Actor_Clue_Query(kActorMcCoy, kClueOriginalRequisitionForm) && Game_Flag_Query(169) && (Actor_Clue_Query(kActorMcCoy, kClueShippingForm) || Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm))) {
+ if (Global_Variable_Query(kVariableChapter) >= 3 && !Actor_Clue_Query(kActorMcCoy, kClueOriginalRequisitionForm) && Game_Flag_Query(169) && (Actor_Clue_Query(kActorMcCoy, kClueShippingForm) || Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm))) {
Item_Add_To_World(111, 958, 85, -209.01f, 70.76f, -351.79f, 0, 16, 12, false, true, false, true);
}
}
@@ -103,7 +103,7 @@ bool SceneScriptUG13::ClickedOn3DObject(const char *objectName, bool a2) {
}
bool SceneScriptUG13::ClickedOnActor(int actorId) {
- if (actorId == 12 && Global_Variable_Query(1) == 4 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -248.0f, 44.0f, -390.0f, 12, 1, false, 0)) {
+ if (actorId == 12 && Global_Variable_Query(kVariableChapter) == 4 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -248.0f, 44.0f, -390.0f, 12, 1, false, 0)) {
Actor_Face_Actor(kActorMcCoy, kActorTransient, true);
if (Actor_Query_Goal_Number(kActorTransient) != 6 && Actor_Query_Goal_Number(kActorTransient) != 599) {
if (!Game_Flag_Query(554)) {
diff --git a/engines/bladerunner/script/scene/ug14.cpp b/engines/bladerunner/script/scene/ug14.cpp
index 5e768b90b0..eb2e59ddfc 100644
--- a/engines/bladerunner/script/scene/ug14.cpp
+++ b/engines/bladerunner/script/scene/ug14.cpp
@@ -171,7 +171,7 @@ void SceneScriptUG14::PlayerWalkedIn() {
Actor_Face_Heading(kActorMcCoy, 807, false);
Game_Flag_Reset(347);
}
- if (Global_Variable_Query(1) == 4 && Game_Flag_Query(172) && !Game_Flag_Query(694)) {
+ if (Global_Variable_Query(kVariableChapter) == 4 && Game_Flag_Query(172) && !Game_Flag_Query(694)) {
Overlay_Play("UG14OVER", 0, 0, 1, 0);
Delay(1000);
Actor_Face_Heading(kActorMcCoy, 609, false);
diff --git a/engines/bladerunner/script/scene/ug17.cpp b/engines/bladerunner/script/scene/ug17.cpp
index d501e6dbab..2889cac6a9 100644
--- a/engines/bladerunner/script/scene/ug17.cpp
+++ b/engines/bladerunner/script/scene/ug17.cpp
@@ -75,7 +75,7 @@ bool SceneScriptUG17::ClickedOnExit(int exitId) {
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 1013.0f, 67.96f, -1892.0f, 0, 1, false, 0)) {
Actor_Face_Heading(kActorMcCoy, 89, false);
- if (Global_Variable_Query(1) == 5) {
+ if (Global_Variable_Query(kVariableChapter) == 5) {
Actor_Says(kActorMcCoy, 8522, 14);
} else {
Loop_Actor_Travel_Ladder(kActorMcCoy, 10, 1, 0);
diff --git a/engines/bladerunner/script/scene/ug18.cpp b/engines/bladerunner/script/scene/ug18.cpp
index 8c35ce7985..cafe42654a 100644
--- a/engines/bladerunner/script/scene/ug18.cpp
+++ b/engines/bladerunner/script/scene/ug18.cpp
@@ -55,7 +55,7 @@ void SceneScriptUG18::InitializeScene() {
Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0);
Scene_Loop_Set_Default(4);
- if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(1) == 4) {
+ if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(kVariableChapter) == 4) {
Actor_Set_Goal_Number(kActorGuzza, 300);
Actor_Set_Goal_Number(kActorClovis, 300);
Actor_Set_Goal_Number(kActorSadik, 300);
@@ -77,7 +77,7 @@ void SceneScriptUG18::SceneLoaded() {
Actor_Set_At_Waypoint(kActorSadik, 33, 0);
}
}
- if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(1) == 4) {
+ if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(kVariableChapter) == 4) {
Item_Add_To_World(91, 987, 89, -55.21f, 0.0f, -302.17f, 0, 12, 12, false, true, false, true);
}
}
diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h
index b38df3e5dc..ece96690d3 100644
--- a/engines/bladerunner/script/scene_script.h
+++ b/engines/bladerunner/script/scene_script.h
@@ -261,27 +261,26 @@ DECLARE_SCRIPT(MA01)
END_SCRIPT
DECLARE_SCRIPT(MA02)
- void sub_401E4C();
- bool sub_401F7C();
- void sub_402044();
+ void dialogueWithRajif();
+ bool isPhoneRinging();
+ void selectNextTvNews();
END_SCRIPT
//MA03 does not exists
DECLARE_SCRIPT(MA04)
- bool sub_402758();
- bool sub_402820();
- bool sub_402888();
- void sub_4028A8();
- void sub_402F2C();
- void sub_4032A0();
- void sub_4034D8();
+ bool isPhoneRinging();
+ bool isPhoneMessageWaiting();
+ void phoneCallWithDektora();
+ void phoneCallWithLucy();
+ void phoneCallWithSteele();
+ void phoneCallWithClovis();
void turnOnTV();
void sleep();
END_SCRIPT
DECLARE_SCRIPT(MA05)
- bool sub_401990();
+ bool isPhoneRinging();
END_SCRIPT
DECLARE_SCRIPT(MA06)
@@ -369,8 +368,8 @@ DECLARE_SCRIPT(PS04)
END_SCRIPT
DECLARE_SCRIPT(PS05)
- void sub_401B34();
- void sub_401C30();
+ void selectNextTvNews();
+ void turnOnTV();
END_SCRIPT
DECLARE_SCRIPT(PS06)
diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp
index c67f935fdc..c4b0de81d9 100644
--- a/engines/bladerunner/script/script.cpp
+++ b/engines/bladerunner/script/script.cpp
@@ -255,10 +255,10 @@ void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause,
actor->speechPlay(sentenceId, false);
bool animationModeChanged = false;
if (animationMode >= 0) {
- if (actorId != 0) {
+ if (actorId != kActorMcCoy) {
actor->changeAnimationMode(animationMode, false);
animationModeChanged = true;
- } else if(_vm->_combat->isActive()) {
+ } else if (_vm->_combat->isActive()) {
actor->changeAnimationMode(animationMode, false);
animationModeChanged = true;
}
@@ -934,12 +934,12 @@ bool ScriptBase::Dialogue_Menu_Add_To_List_Never_Repeat_Once_Selected(int answer
return _vm->_dialogueMenu->addToListNeverRepeatOnceSelected(answer, 5, 5, 5);
}
-bool ScriptBase::DM_Add_To_List(int answer, int a2, int a3, int a4) {
- return _vm->_dialogueMenu->addToList(answer, 0, a2, a3, a4);
+bool ScriptBase::DM_Add_To_List(int answer, int priorityPolite, int priorityNormal, int prioritySurly) {
+ return _vm->_dialogueMenu->addToList(answer, false, priorityPolite, priorityNormal, prioritySurly);
}
-bool ScriptBase::DM_Add_To_List_Never_Repeat_Once_Selected(int answer, int a2, int a3, int a4) {
- return _vm->_dialogueMenu->addToListNeverRepeatOnceSelected(answer, a2, a3, a4);
+bool ScriptBase::DM_Add_To_List_Never_Repeat_Once_Selected(int answer, int priorityPolite, int priorityNormal, int prioritySurly) {
+ return _vm->_dialogueMenu->addToListNeverRepeatOnceSelected(answer, priorityPolite, priorityNormal, prioritySurly);
}
void ScriptBase::Dialogue_Menu_Remove_From_List(int answer) {
diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h
index 4632a64340..8ec9575cef 100644
--- a/engines/bladerunner/script/script.h
+++ b/engines/bladerunner/script/script.h
@@ -189,8 +189,8 @@ protected:
bool Dialogue_Menu_Add_To_List(int answer);
bool Dialogue_Menu_Add_DONE_To_List(int answer);
bool Dialogue_Menu_Add_To_List_Never_Repeat_Once_Selected(int answer);
- bool DM_Add_To_List(int answer, int a2, int a3, int a4);
- bool DM_Add_To_List_Never_Repeat_Once_Selected(int answer, int a2, int a3, int a4);
+ bool DM_Add_To_List(int answer, int priorityPolite, int priorityNormal, int prioritySurly);
+ bool DM_Add_To_List_Never_Repeat_Once_Selected(int answer, int priorityPolite, int priorityNormal, int prioritySurly4);
void Dialogue_Menu_Remove_From_List(int answer);
int Dialogue_Menu_Query_Input();
int Dialogue_Menu_Query_List_Size();
diff --git a/engines/bladerunner/ui/elevator.cpp b/engines/bladerunner/ui/elevator.cpp
index 2e6f036b4b..3f668efd75 100644
--- a/engines/bladerunner/ui/elevator.cpp
+++ b/engines/bladerunner/ui/elevator.cpp
@@ -52,10 +52,10 @@ Elevator::~Elevator() {
int Elevator::activate(int elevatorId) {
const char *vqaName;
- if (elevatorId == 1) {
+ if (elevatorId == kElevatorMA) {
_buttonClicked = 3;
vqaName = "MA06ELEV.VQA";
- } else if (elevatorId == 2) {
+ } else if (elevatorId == kElevatorPS) {
_buttonClicked = 1;
vqaName = "PS02ELEV.VQA";
} else {
@@ -81,7 +81,7 @@ int Elevator::activate(int elevatorId) {
_imagePicker->resetImages();
- if (elevatorId == 1) {
+ if (elevatorId == kElevatorMA) {
_imagePicker->defineImage(
0,
Common::Rect(220, 298, 308, 392),
@@ -103,7 +103,7 @@ int Elevator::activate(int elevatorId) {
_shapes[12],
_shapes[15],
nullptr);
- } else {
+ } else { // kElevatorPS
_imagePicker->defineImage(
4,
Common::Rect(395, 131, 448, 164),
diff --git a/engines/bladerunner/ui/kia.cpp b/engines/bladerunner/ui/kia.cpp
index 0a6229411e..a738923a06 100644
--- a/engines/bladerunner/ui/kia.cpp
+++ b/engines/bladerunner/ui/kia.cpp
@@ -290,7 +290,7 @@ void KIA::tick() {
}
if (_currentSectionId != kKIASectionQuit && _transitionId != 14) {
if (_vm->_settings->getDifficulty() > 0) {
- _vm->_mainFont->drawColor(Common::String::format("%04d", _vm->_gameVars[2]), _vm->_surfaceFront, 580, 341, 0x2991);
+ _vm->_mainFont->drawColor(Common::String::format("%04d", _vm->_gameVars[kVariableChinyen]), _vm->_surfaceFront, 580, 341, 0x2991);
} else {
_shapes->get(39)->draw(_vm->_surfaceFront, 583, 342);
}