aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script/ai
diff options
context:
space:
mode:
authorPeter Kohaut2019-02-02 18:19:34 +0100
committerPeter Kohaut2019-02-03 00:14:09 +0100
commitcee294137a95742a7be711c23bc4a3dcc7a6465e (patch)
tree612c92299f91bb4c4f9422de526afc0052fa9b1c /engines/bladerunner/script/ai
parentce3b7316568b10bcfc21b314b4d2658bc75e29d1 (diff)
downloadscummvm-rg350-cee294137a95742a7be711c23bc4a3dcc7a6465e.tar.gz
scummvm-rg350-cee294137a95742a7be711c23bc4a3dcc7a6465e.tar.bz2
scummvm-rg350-cee294137a95742a7be711c23bc4a3dcc7a6465e.zip
BLADERUNNER: Cleanup for scene at UG18
Diffstat (limited to 'engines/bladerunner/script/ai')
-rw-r--r--engines/bladerunner/script/ai/clovis.cpp8
-rw-r--r--engines/bladerunner/script/ai/guzza.cpp51
-rw-r--r--engines/bladerunner/script/ai/officer_grayford.cpp2
-rw-r--r--engines/bladerunner/script/ai/officer_leary.cpp2
-rw-r--r--engines/bladerunner/script/ai/sadik.cpp29
-rw-r--r--engines/bladerunner/script/ai/transient.cpp2
6 files changed, 53 insertions, 41 deletions
diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp
index c8a57eed98..653dd3ee3c 100644
--- a/engines/bladerunner/script/ai/clovis.cpp
+++ b/engines/bladerunner/script/ai/clovis.cpp
@@ -305,16 +305,16 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Game_Flag_Set(kFlagChapter3Intro);
return true;
- case 300:
+ case kGoalClovisUG18Wait:
Actor_Put_In_Set(kActorClovis, kSetUG18);
Actor_Set_At_XYZ(kActorClovis, -52.26f, 0.0f, 611.02f, 900);
Actor_Change_Animation_Mode(kActorClovis, kAnimationModeIdle);
return true;
- case 301:
- case 302:
+ case kGoalClovisUG18SadikWillShootGuzza:
+ case kGoalClovisUG18SadikIsShootingGuzza:
case 303:
- case 310:
+ case kGoalClovisUG18Leave:
return true;
case 350:
diff --git a/engines/bladerunner/script/ai/guzza.cpp b/engines/bladerunner/script/ai/guzza.cpp
index f715c0be75..d76ee3ee73 100644
--- a/engines/bladerunner/script/ai/guzza.cpp
+++ b/engines/bladerunner/script/ai/guzza.cpp
@@ -111,7 +111,7 @@ void AIScriptGuzza::ClickedByPlayer() {
Actor_Says(kActorMcCoy, 3970, 13);
Actor_Says(kActorGuzza, 780, -1);
}
- //TODO: test this, seems like a bug in game
+ //TODO: test this, looks like a bug in game
if (Random_Query(1, 4) == 1) {
AI_Movement_Track_Pause(4);
Actor_Says(kActorMcCoy, 4005, 15);
@@ -148,23 +148,23 @@ void AIScriptGuzza::OtherAgentEnteredCombatMode(int otherActorId, int combatMode
}
void AIScriptGuzza::ShotAtAndMissed() {
- if (Actor_Query_Goal_Number(kActorGuzza) == 301) {
+ if (Actor_Query_Goal_Number(kActorGuzza) == kGoalGuzzaUG18Target) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
- Actor_Set_Goal_Number(kActorGuzza, 304);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18MissedByMcCoy);
}
// return false;
}
bool AIScriptGuzza::ShotAtAndHit() {
- if (Actor_Query_Goal_Number(kActorGuzza) == 301) {
+ if (Actor_Query_Goal_Number(kActorGuzza) == kGoalGuzzaUG18Target) {
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatHit);
- Actor_Set_Goal_Number(kActorGuzza, 303);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaUG18HitByMcCoy);
}
return false;
}
void AIScriptGuzza::Retired(int byActorId) {
- Actor_Set_Goal_Number(kActorGuzza, 599);
+ Actor_Set_Goal_Number(kActorGuzza, kGoalGuzzaGone);
// return false;
}
@@ -218,34 +218,34 @@ bool AIScriptGuzza::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorGuzza);
return true;
- case 201:
- Actor_Change_Animation_Mode(kActorGuzza, 53);
+ case kGoalGuzzaSitAtNR03:
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeSit);
_animationState = 1;
_animationFrame = 0;
Actor_Put_In_Set(kActorGuzza, kSetNR03);
Actor_Set_At_XYZ(kActorGuzza, -229.0f, -70.19f, -469.0f, 400);
return true;
- case 300:
+ case kGoalGuzzaUG18Wait:
Actor_Put_In_Set(kActorGuzza, kSetUG18);
Actor_Set_At_XYZ(kActorGuzza, 10.79f, 0.0f, -354.17f, 400);
Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeIdle);
return true;
- case 301:
+ case kGoalGuzzaUG18Target:
Actor_Set_Targetable(kActorGuzza, true);
return true;
- case 302:
- case 303:
- case 304:
+ case kGoalGuzzaUG18WillGetShotBySadik:
+ case kGoalGuzzaUG18HitByMcCoy:
+ case kGoalGuzzaUG18MissedByMcCoy:
Actor_Set_Targetable(kActorGuzza, false);
return true;
- case 305:
- case 306:
- case 307:
- case 390:
+ case kGoalGuzzaUG18ShotByMcCoy:
+ case kGoalGuzzaUG18ShootMcCoy:
+ case kGoalGuzzaUG18FallDown:
+ case kGoalGuzzaUG18ShotBySadik:
return true;
}
return false;
@@ -568,7 +568,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
*animation = 172;
_animationState = 24;
_flag = false;
- Actor_Change_Animation_Mode(kActorGuzza, 4);
+ Actor_Change_Animation_Mode(kActorGuzza, kAnimationModeCombatIdle);
_state = 0;
_counter = 0;
_frameDelta = 1;
@@ -877,12 +877,12 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
}
_animationFrame = 0;
break;
-
+
case 23:
_animationState = 32;
_animationFrame = 0;
break;
-
+
case 30:
if (_animationState == 1) {
_animationState = 3;
@@ -894,6 +894,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 31:
if (_animationState == 1) {
_animationState = 3;
@@ -905,6 +906,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 32:
if (_animationState == 1) {
_animationState = 3;
@@ -916,6 +918,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 33:
if (_animationState == 1) {
_animationState = 3;
@@ -927,6 +930,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case 34:
if (_animationState == 1) {
_animationState = 3;
@@ -938,32 +942,39 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_flag = false;
}
break;
+
case kAnimationModeWalkUp:
_animationState = 9;
_animationFrame = 0;
break;
+
case kAnimationModeWalkDown:
_animationState = 10;
_animationFrame = 0;
break;
+
case 48:
_animationState = 28;
_animationFrame = 0;
break;
+
case 53:
_animationState = 1;
_animationFrame = 0;
break;
+
case 58:
_animationState = 22;
_animationFrame = 0;
_flag = false;
break;
+
case 59:
_animationState = 23;
_animationFrame = 0;
_flag = false;
break;
+
case 61:
_animationState = 33;
_animationFrame = 0;
diff --git a/engines/bladerunner/script/ai/officer_grayford.cpp b/engines/bladerunner/script/ai/officer_grayford.cpp
index da21d21114..a4680c4389 100644
--- a/engines/bladerunner/script/ai/officer_grayford.cpp
+++ b/engines/bladerunner/script/ai/officer_grayford.cpp
@@ -394,7 +394,7 @@ bool AIScriptOfficerGrayford::ShotAtAndHit() {
void AIScriptOfficerGrayford::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorOfficerGrayford, 599);
- Game_Flag_Set(607);
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
}
int AIScriptOfficerGrayford::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp
index 718a39aff7..2aa3fecd77 100644
--- a/engines/bladerunner/script/ai/officer_leary.cpp
+++ b/engines/bladerunner/script/ai/officer_leary.cpp
@@ -264,7 +264,7 @@ bool AIScriptOfficerLeary::ShotAtAndHit() {
void AIScriptOfficerLeary::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorOfficerLeary, 599);
- Game_Flag_Set(607);
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
}
int AIScriptOfficerLeary::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp
index 250e090b5e..109f8d05c7 100644
--- a/engines/bladerunner/script/ai/sadik.cpp
+++ b/engines/bladerunner/script/ai/sadik.cpp
@@ -90,8 +90,9 @@ void AIScriptSadik::TimerExpired(int timer) {
if (timer == 0) {
AI_Countdown_Timer_Reset(kActorSadik, 0);
+ // goals 303, 304 and 305 are never set, cut out part of game?
switch (Actor_Query_Goal_Number(kActorSadik)) {
- case 302:
+ case kGoalSadikUG18Decide:
Actor_Set_Goal_Number(kActorSadik, 305);
break;
@@ -99,8 +100,8 @@ void AIScriptSadik::TimerExpired(int timer) {
Actor_Set_Goal_Number(kActorSadik, 305);
break;
- case 307:
- Actor_Set_Goal_Number(kActorSadik, 308);
+ case kGoalSadikUG18PrepareShootMcCoy:
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18ShootMcCoy);
break;
}
}
@@ -120,8 +121,8 @@ void AIScriptSadik::CompletedMovementTrack() {
Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11KickMcCoy);
break;
- case 301:
- Actor_Set_Goal_Number(kActorSadik, 302);
+ case kGoalSadikUG18Move:
+ Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18Decide);
break;
default:
@@ -171,8 +172,7 @@ void AIScriptSadik::ShotAtAndMissed() {
}
bool AIScriptSadik::ShotAtAndHit() {
-
- if (Actor_Query_Goal_Number(kActorSadik) == 301) {
+ if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikUG18Move) {
if (Game_Flag_Query(kFlagSadikIsReplicant)) {
Actor_Set_Health(kActorSadik, 60, 60);
} else {
@@ -289,13 +289,13 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Set_Goal_Number(kActorMcCoy, 199);
return true;
- case 300:
+ case kGoalSadikUG18Wait:
Actor_Put_In_Set(kActorSadik, kSetUG18);
Actor_Set_At_XYZ(kActorSadik, 111.89f, 0.0f, 408.42f, 0);
Actor_Change_Animation_Mode(kActorSadik, 4);
return true;
- case 301:
+ case kGoalSadikUG18Move:
Actor_Set_Targetable(kActorSadik, true);
World_Waypoint_Set(436, 89, -356.11f, 0.0f, 652.42f);
AI_Movement_Track_Flush(kActorSadik);
@@ -303,10 +303,11 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorSadik);
return true;
- case 302:
+ case kGoalSadikUG18Decide:
Actor_Set_Targetable(kActorSadik, false);
return true;
+ // goals 303, 304 and 305 are never set, cut out part of game?
case 303:
AI_Countdown_Timer_Reset(kActorSadik, 0);
AI_Countdown_Timer_Start(kActorSadik, 0, 5);
@@ -318,16 +319,16 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
return true;
case 305:
- case 306:
- case 310:
+ case kGoalSadikUG18WillShootMcCoy:
+ case kGoalSadikUG18Leave:
return true;
- case 307:
+ case kGoalSadikUG18PrepareShootMcCoy:
Sound_Play(12, 100, 0, 0, 50);
AI_Countdown_Timer_Start(kActorSadik, 0, 2);
return true;
- case 308:
+ case kGoalSadikUG18ShootMcCoy:
if (Player_Query_Current_Scene() == kSceneUG18) {
Actor_Force_Stop_Walking(kActorMcCoy);
Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
diff --git a/engines/bladerunner/script/ai/transient.cpp b/engines/bladerunner/script/ai/transient.cpp
index 62d3c02090..c5dc4caec0 100644
--- a/engines/bladerunner/script/ai/transient.cpp
+++ b/engines/bladerunner/script/ai/transient.cpp
@@ -172,7 +172,7 @@ void AIScriptTransient::Retired(int byActorId) {
Actor_Set_Goal_Number(kActorTransient, 599);
if (Global_Variable_Query(kVariableChapter) == 4) {
- Game_Flag_Set(607);
+ Game_Flag_Set(kFlagMcCoyRetiredHuman);
}
}