aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script/ai
diff options
context:
space:
mode:
Diffstat (limited to 'engines/bladerunner/script/ai')
-rw-r--r--engines/bladerunner/script/ai/mia.cpp16
-rw-r--r--engines/bladerunner/script/ai/murray.cpp30
2 files changed, 27 insertions, 19 deletions
diff --git a/engines/bladerunner/script/ai/mia.cpp b/engines/bladerunner/script/ai/mia.cpp
index 103b6c4dbb..1655a8c599 100644
--- a/engines/bladerunner/script/ai/mia.cpp
+++ b/engines/bladerunner/script/ai/mia.cpp
@@ -41,8 +41,11 @@ void AIScriptMia::Initialize() {
}
bool AIScriptMia::Update() {
- if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorMia) != 300)
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorMia) != 300
+ ) {
Actor_Set_Goal_Number(kActorMia, 300);
+ }
return false;
}
@@ -163,9 +166,6 @@ bool AIScriptMia::UpdateAnimation(int *animation, int *frame) {
_animationState = 2;
}
break;
-
- default:
- break;
}
*frame = _animationFrame;
@@ -176,28 +176,34 @@ bool AIScriptMia::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMia::ChangeAnimationMode(int mode) {
switch (mode) {
case kAnimationModeIdle:
- if (_animationState >= 2 && _animationState <= 4) {
+ if (_animationState >= 2
+ && _animationState <= 4
+ ) {
_flag1 = false;
} else {
_animationFrame = 0;
_animationState = 0;
}
break;
+
case kAnimationModeTalk:
_animationFrame = 0;
_flag1 = false;
_animationState = 2;
break;
+
case 12:
_animationFrame = 0;
_flag1 = false;
_animationState = 3;
break;
+
case 13:
_animationFrame = 0;
_flag1 = false;
_animationState = 4;
break;
+
case 23:
_animationFrame = 0;
_animationState = 1;
diff --git a/engines/bladerunner/script/ai/murray.cpp b/engines/bladerunner/script/ai/murray.cpp
index f187cad373..f7fdcafb39 100644
--- a/engines/bladerunner/script/ai/murray.cpp
+++ b/engines/bladerunner/script/ai/murray.cpp
@@ -41,21 +41,26 @@ void AIScriptMurray::Initialize() {
}
bool AIScriptMurray::Update() {
- if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorMurray) != 300)
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorMurray) != 300
+ ) {
Actor_Set_Goal_Number(kActorMurray, 300);
+ }
- if (Player_Query_Current_Set() == kSetHF01) {
- if (!Actor_Query_In_Set(kActorMcCoy, kSetHF01)
- || !Actor_Query_In_Set(kActorMurray, kSetHF01)
- || Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorMurray) >= 48
- || Game_Flag_Query(377)) {
- return false;
- }
+ if (Player_Query_Current_Set() != kSetHF01) {
+ return true;
+ }
+ if ( Actor_Query_In_Set(kActorMcCoy, kSetHF01)
+ && Actor_Query_In_Set(kActorMurray, kSetHF01)
+ && Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorMurray) < 48
+ && !Game_Flag_Query(kFlagHF01MurrayMiaIntro)
+ ) {
Actor_Set_Goal_Number(kActorMurray, 1);
+ return true;
}
- return true;
+ return false;
}
void AIScriptMurray::TimerExpired(int timer) {
@@ -196,7 +201,7 @@ bool AIScriptMurray::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMurray::ChangeAnimationMode(int mode) {
switch (mode) {
- case 0:
+ case kAnimationModeIdle:
if (_animationState > 0 && _animationState <= 5) {
_flag = true;
} else {
@@ -205,7 +210,7 @@ bool AIScriptMurray::ChangeAnimationMode(int mode) {
}
break;
- case 3:
+ case kAnimationModeTalk:
_animationState = 1;
_animationFrame = 0;
_flag = false;
@@ -234,9 +239,6 @@ bool AIScriptMurray::ChangeAnimationMode(int mode) {
_animationFrame = 0;
_flag = false;
break;
-
- default:
- break;
}
return true;