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/dektora.cpp8
-rw-r--r--engines/bladerunner/script/ai/early_q.cpp140
-rw-r--r--engines/bladerunner/script/ai/hanoi.cpp46
-rw-r--r--engines/bladerunner/script/ai/mccoy.cpp120
4 files changed, 158 insertions, 156 deletions
diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp
index 4106224e45..cb5f1db9b8 100644
--- a/engines/bladerunner/script/ai/dektora.cpp
+++ b/engines/bladerunner/script/ai/dektora.cpp
@@ -208,7 +208,7 @@ void AIScriptDektora::ClickedByPlayer() {
AI_Movement_Track_Flush(kActorHanoi);
Actor_Force_Stop_Walking(kActorMcCoy);
Player_Loses_Control();
- Actor_Set_Goal_Number(kActorHanoi, 220);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiThrowOutMcCoy);
return; //true;
}
@@ -422,7 +422,7 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
break;
case 211:
- if (Player_Query_Current_Scene() == 61) {
+ if (Player_Query_Current_Scene() == kSceneNR08) {
Game_Flag_Set(651);
} else {
Game_Flag_Set(636);
@@ -431,8 +431,8 @@ bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Change_Animation_Mode(kActorDektora, 0);
Actor_Set_Goal_Number(kActorDektora, 200);
}
- if (Player_Query_Current_Scene() == 61) {
- Actor_Set_Goal_Number(kActorHanoi, 235);
+ if (Player_Query_Current_Scene() == kSceneNR08) {
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR08Leave);
} else {
Game_Flag_Reset(651);
}
diff --git a/engines/bladerunner/script/ai/early_q.cpp b/engines/bladerunner/script/ai/early_q.cpp
index 7237c15a06..093c51d7ac 100644
--- a/engines/bladerunner/script/ai/early_q.cpp
+++ b/engines/bladerunner/script/ai/early_q.cpp
@@ -91,23 +91,23 @@ void AIScriptEarlyQ::TimerExpired(int timer) {
}
if (timer == 0
- && Actor_Query_Goal_Number(kActorEarlyQ) == 205
+ && Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR04GoToMcCoy
) {
Player_Loses_Control();
AI_Countdown_Timer_Reset(kActorEarlyQ, 0);
- Actor_Set_Goal_Number(kActorEarlyQ, 215);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04HandDrink);
return; //true;
}
if (timer == 1
- && Actor_Query_Goal_Number(kActorEarlyQ) == 211
+ && Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR04WaitForPulledGun
) {
AI_Countdown_Timer_Reset(kActorEarlyQ, 1);
Player_Loses_Control();
Actor_Change_Animation_Mode(kActorEarlyQ, 29);
Delay(2500);
- Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, 1);
- Actor_Change_Animation_Mode(kActorEarlyQ, 6);
+ Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, true);
+ Actor_Change_Animation_Mode(kActorEarlyQ, kAnimationModeCombatAttack);
Delay(100);
_vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, kAnimationModeCombatHit);
Delay(250);
@@ -151,15 +151,15 @@ void AIScriptEarlyQ::CompletedMovementTrack() {
Actor_Set_Goal_Number(kActorEarlyQ, 100);
break;
- case 201:
- Game_Flag_Set(569);
- Player_Set_Combat_Mode(0);
- Actor_Set_Targetable(kActorEarlyQ, 1);
- Actor_Set_Goal_Number(kActorEarlyQ, 202);
+ case kGoalEarlyQNR04Enter:
+ Game_Flag_Set(kFlagNR04EarlyQWalkedIn);
+ Player_Set_Combat_Mode(false);
+ Actor_Set_Targetable(kActorEarlyQ, true);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04Talk1);
break;
- case 203:
- Actor_Set_Goal_Number(kActorEarlyQ, 204);
+ case kGoalEarlyQNR04GoToBar:
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04PourDrink);
break;
case kGoalEarlyQNR05Leave:
@@ -198,29 +198,29 @@ void AIScriptEarlyQ::OtherAgentExitedThisScene(int otherActorId) {
}
void AIScriptEarlyQ::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
- if ( Game_Flag_Query(569)
+ if ( Game_Flag_Query(kFlagNR04EarlyQWalkedIn)
&& otherActorId == kActorMcCoy
&& combatMode
- && !Game_Flag_Query(609)
+ && !Game_Flag_Query(kFlagNR04McCoyAimedAtEarlyQ)
) {
- if (!Game_Flag_Query(565)) {
- Game_Flag_Set(565);
+ if (!Game_Flag_Query(kFlagNotUsed565)) {
+ Game_Flag_Set(kFlagNotUsed565);
}
- Game_Flag_Set(609);
+ Game_Flag_Set(kFlagNR04McCoyAimedAtEarlyQ);
AI_Countdown_Timer_Reset(kActorEarlyQ, 0);
- Actor_Set_Goal_Number(kActorEarlyQ, 206);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04McCoyPulledGun);
return; // true;
}
- if ( Actor_Query_Goal_Number(kActorEarlyQ) == 211
+ if ( Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR04WaitForPulledGun
&& otherActorId == kActorMcCoy
&& !combatMode
) {
- if (Game_Flag_Query(565) == 1) {
- Game_Flag_Reset(565);
+ if (Game_Flag_Query(kFlagNotUsed565)) {
+ Game_Flag_Reset(kFlagNotUsed565);
}
AI_Countdown_Timer_Reset(kActorEarlyQ, 1);
- Actor_Set_Goal_Number(kActorEarlyQ, 213);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04Talk3);
return; //true;
}
@@ -228,8 +228,8 @@ void AIScriptEarlyQ::OtherAgentEnteredCombatMode(int otherActorId, int combatMod
}
void AIScriptEarlyQ::ShotAtAndMissed() {
- if (Actor_Query_Goal_Number(kActorEarlyQ) == 211) {
- Actor_Set_Goal_Number(kActorEarlyQ, 216);
+ if (Actor_Query_Goal_Number(kActorEarlyQ) == kGoalEarlyQNR04WaitForPulledGun) {
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04GetShot);
//return true;
}
// return false;
@@ -239,7 +239,7 @@ bool AIScriptEarlyQ::ShotAtAndHit() {
if (Actor_Query_Goal_Number(kActorEarlyQ) >= 201
&& Actor_Query_Goal_Number(kActorEarlyQ) <= 217
) {
- Actor_Set_Goal_Number(kActorEarlyQ, 216);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04GetShot);
return true;
}
@@ -318,7 +318,7 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
break;
- case 201:
+ case kGoalEarlyQNR04Enter:
AI_Movement_Track_Flush(kActorEarlyQ);
AI_Movement_Track_Append(kActorEarlyQ, 40, 0);
AI_Movement_Track_Append(kActorEarlyQ, 322, 0);
@@ -326,95 +326,95 @@ bool AIScriptEarlyQ::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorEarlyQ);
break;
- case 203:
+ case kGoalEarlyQNR04GoToBar:
AI_Movement_Track_Flush(kActorEarlyQ);
AI_Movement_Track_Append(kActorEarlyQ, 355, 0);
AI_Movement_Track_Repeat(kActorEarlyQ);
- Actor_Face_Object(kActorMcCoy, "BAR", 1);
+ Actor_Face_Object(kActorMcCoy, "BAR", true);
break;
- case 205:
+ case kGoalEarlyQNR04GoToMcCoy:
Loop_Actor_Walk_To_Actor(kActorEarlyQ, 0, 36, 0, 0);
AI_Countdown_Timer_Reset(kActorEarlyQ, 0);
AI_Countdown_Timer_Start(kActorEarlyQ, 0, 4);
break;
- case 206:
+ case kGoalEarlyQNR04McCoyPulledGun:
Player_Set_Combat_Mode(kActorSteele);
- Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, 1);
- Actor_Face_Actor(kActorMcCoy, kActorEarlyQ, 1);
+ Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, true);
+ Actor_Face_Actor(kActorMcCoy, kActorEarlyQ, true);
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatIdle);
- _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, 5);
- Actor_Says(kActorEarlyQ, 130, 3);
- Actor_Says(kActorMcCoy, 3400, 5);
- Actor_Says_With_Pause(kActorEarlyQ, 140, 1.0, 3);
- Actor_Says_With_Pause(kActorEarlyQ, 150, 1.0, 3);
- Actor_Says(kActorMcCoy, 3405, 5);
- Actor_Says(kActorEarlyQ, 160, 3);
- Actor_Says(kActorMcCoy, 3410, 5);
- _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, 4);
- Loop_Actor_Walk_To_XYZ(kActorMcCoy, 31.22f, 0.0f, 267.51f, 0, 1, 0, 0);
- Actor_Set_Goal_Number(kActorEarlyQ, 207);
- break;
-
- case 208:
+ _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, kAnimationModeCombatAim);
+ Actor_Says(kActorEarlyQ, 130, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 3400, kAnimationModeCombatAim);
+ Actor_Says_With_Pause(kActorEarlyQ, 140, 1.0, kAnimationModeTalk);
+ Actor_Says_With_Pause(kActorEarlyQ, 150, 1.0, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 3405, kAnimationModeCombatAim);
+ Actor_Says(kActorEarlyQ, 160, kAnimationModeTalk);
+ Actor_Says(kActorMcCoy, 3410, kAnimationModeCombatAim);
+ _vm->_aiScripts->callChangeAnimationMode(kActorMcCoy, kAnimationModeCombatIdle);
+ Loop_Actor_Walk_To_XYZ(kActorMcCoy, 31.22f, 0.0f, 267.51f, 0, true, false, 0);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04SitDown);
+ break;
+
+ case kGoalEarlyQNR04ScorpionsCheck:
if (Game_Flag_Query(kFlagAR02DektoraBoughtScorpions)) {
- Actor_Set_Goal_Number(kActorEarlyQ, 210);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04StungByScorpions);
} else {
- Actor_Set_Goal_Number(kActorEarlyQ, 209);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04Talk2);
}
break;
- case 210:
- Actor_Set_Targetable(kActorEarlyQ, 0);
- Game_Flag_Set(606);
+ case kGoalEarlyQNR04StungByScorpions:
+ Actor_Set_Targetable(kActorEarlyQ, false);
+ Game_Flag_Set(kFlagNR04EarlyQStungByScorpions);
Delay(3500);
Actor_Change_Animation_Mode(kActorEarlyQ, 76);
Delay(2000);
Actor_Set_At_XYZ(kActorEarlyQ, 109.0, 0.0, 374.0, 0);
- Actor_Retired_Here(kActorEarlyQ, 12, 12, 1, -1);
+ Actor_Retired_Here(kActorEarlyQ, 12, 12, true, -1);
Actor_Voice_Over(4180, kActorVoiceOver);
Scene_Exits_Enable();
break;
- case 211:
+ case kGoalEarlyQNR04WaitForPulledGun:
AI_Countdown_Timer_Reset(kActorEarlyQ, 1);
AI_Countdown_Timer_Start(kActorEarlyQ, 1, 5);
break;
- case 212:
- Actor_Says(kActorEarlyQ, 0, 3);
- Actor_Says(kActorEarlyQ, 10, 3);
- Actor_Says(kActorEarlyQ, 20, 3);
- Actor_Clue_Lose(kActorMcCoy, 89);
+ case kGoalEarlyQNR04TakeDisk:
+ Actor_Says(kActorEarlyQ, 0, kAnimationModeTalk);
+ Actor_Says(kActorEarlyQ, 10, kAnimationModeTalk);
+ Actor_Says(kActorEarlyQ, 20, kAnimationModeTalk);
+ Actor_Clue_Lose(kActorMcCoy, kClueEarlyQsClub);
Scene_Exits_Enable();
Player_Gains_Control();
- Game_Flag_Set(627);
- Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy);
+ Game_Flag_Set(kFlagNR01McCoyIsDrugged);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiThrowOutMcCoy);
break;
- case 215:
+ case kGoalEarlyQNR04HandDrink:
if (Actor_Query_Inch_Distance_From_Actor(kActorMcCoy, kActorEarlyQ) > 36) {
Loop_Actor_Walk_To_Actor(kActorEarlyQ, kActorMcCoy, 36, kActorMcCoy, kActorMcCoy);
}
- Actor_Face_Actor(kActorMcCoy, kActorEarlyQ, 1);
- Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorEarlyQ, true);
+ Actor_Face_Actor(kActorEarlyQ, kActorMcCoy, true);
Actor_Change_Animation_Mode(kActorEarlyQ, 23);
- Scene_Loop_Start_Special(2, 2, 0);
+ Scene_Loop_Start_Special(kSceneLoopModeOnce, 2, false);
Ambient_Sounds_Play_Sound(582, 50, 99, 0, 0);
- Actor_Set_Goal_Number(kActorMcCoy, 220);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyNR04Drink);
break;
- case 216:
+ case kGoalEarlyQNR04GetShot:
AI_Movement_Track_Flush(kActorEarlyQ);
- Actor_Change_Animation_Mode(kActorEarlyQ, 48);
+ Actor_Change_Animation_Mode(kActorEarlyQ, kAnimationModeDie);
Delay(250);
Actor_Set_At_XYZ(kActorEarlyQ, 109.0, 0.0, 374.0, 0);
- Actor_Set_Goal_Number(kActorHanoi, 240);
- Player_Set_Combat_Mode(0);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR04Enter);
+ Player_Set_Combat_Mode(false);
break;
- case 217:
+ case kGoalEarlyQNR04Leave:
AI_Movement_Track_Flush(kActorEarlyQ);
AI_Movement_Track_Append(kActorEarlyQ, 354, 0);
AI_Movement_Track_Append(kActorEarlyQ, 322, 0);
diff --git a/engines/bladerunner/script/ai/hanoi.cpp b/engines/bladerunner/script/ai/hanoi.cpp
index 2ddf27b77e..56c39c2003 100644
--- a/engines/bladerunner/script/ai/hanoi.cpp
+++ b/engines/bladerunner/script/ai/hanoi.cpp
@@ -105,8 +105,8 @@ void AIScriptHanoi::TimerExpired(int timer) {
return; //true;
}
- if (Actor_Query_Goal_Number(kActorHanoi) != kGoalHanoiNR03ThrowOutMcCoy) {
- Actor_Set_Goal_Number(kActorHanoi, 202);
+ if (Actor_Query_Goal_Number(kActorHanoi) != kGoalHanoiThrowOutMcCoy) {
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR07TalkToMcCoy);
return; //true;
}
}
@@ -115,20 +115,20 @@ void AIScriptHanoi::TimerExpired(int timer) {
void AIScriptHanoi::CompletedMovementTrack() {
switch (Actor_Query_Goal_Number(kActorHanoi)) {
- case 202:
+ case kGoalHanoiNR07TalkToMcCoy:
Actor_Says(kActorHanoi, 130, 3);
Actor_Says(kActorDektora, 540, 30);
- Actor_Set_Goal_Number(kActorHanoi, 203);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR07GrabMcCoy);
break;
- case 203:
+ case kGoalHanoiNR07GrabMcCoy:
Actor_Face_Actor(kActorHanoi, kActorMcCoy, true);
Actor_Face_Actor(kActorMcCoy, kActorHanoi, true);
Actor_Change_Animation_Mode(kActorHanoi, 23);
Actor_Set_Invisible(kActorMcCoy, true);
Actor_Says(kActorMcCoy, 3595, kAnimationModeTalk);
Actor_Says(kActorHanoi, 140, kAnimationModeTalk);
- Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiThrowOutMcCoy);
break;
case kGoalHanoiNR03GoToDancer:
@@ -139,8 +139,8 @@ void AIScriptHanoi::CompletedMovementTrack() {
Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR08Left);
break;
- case 240:
- Actor_Set_Goal_Number(kActorHanoi, 241);
+ case kGoalHanoiNR04Enter:
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR04ShootMcCoy);
break;
default:
@@ -184,9 +184,9 @@ void AIScriptHanoi::OtherAgentEnteredCombatMode(int otherActorId, int combatMode
&& otherActorId == kActorMcCoy
&& combatMode
) {
- Player_Set_Combat_Mode(kActorMcCoy);
+ Player_Set_Combat_Mode(false);
Player_Loses_Control();
- Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03ThrowOutMcCoy);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiThrowOutMcCoy);
return; //true;
}
return; //false;
@@ -222,11 +222,11 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Countdown_Timer_Start(kActorHanoi, 0, 45);
break;
- case 201:
+ case kGoalHanoiResetTimer:
AI_Countdown_Timer_Reset(kActorHanoi, 0);
break;
- case 202:
+ case kGoalHanoiNR07TalkToMcCoy:
if (Actor_Query_Which_Set_In(kActorMcCoy) == kSetNR07
&& Actor_Query_In_Set(kActorDektora, kSetNR07)
) {
@@ -242,7 +242,7 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
break;
- case 203:
+ case kGoalHanoiNR07GrabMcCoy:
if (Actor_Query_Which_Set_In(kActorMcCoy) != kSetNR07) {
return false;
}
@@ -252,7 +252,7 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) {
break;
case 204:
- Actor_Says(kActorHanoi, 210, 3);
+ Actor_Says(kActorHanoi, 210, kAnimationModeTalk);
Actor_Change_Animation_Mode(kActorHanoi, 23);
break;
@@ -287,7 +287,7 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Countdown_Timer_Start(kActorHanoi, 0, 6);
break;
- case kGoalHanoiNR03ThrowOutMcCoy:
+ case kGoalHanoiThrowOutMcCoy:
Game_Flag_Set(kFlagNR03McCoyThrownOut);
AI_Countdown_Timer_Reset(kActorHanoi, 0);
Player_Loses_Control();
@@ -318,7 +318,7 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case kGoalHanoiNR08Left:
break;
- case 240:
+ case kGoalHanoiNR04Enter:
Actor_Put_In_Set(kActorHanoi, kSetNR04);
Actor_Set_At_XYZ(kActorHanoi, -47.0f, 0.0f, 334.0f, 535);
AI_Movement_Track_Flush(kActorHanoi);
@@ -326,10 +326,10 @@ bool AIScriptHanoi::GoalChanged(int currentGoalNumber, int newGoalNumber) {
AI_Movement_Track_Repeat(kActorHanoi);
break;
- case 241:
- Actor_Face_Actor(kActorHanoi, kActorMcCoy, 1);
- Actor_Change_Animation_Mode(kActorHanoi, 6);
- Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
+ case kGoalHanoiNR04ShootMcCoy:
+ Actor_Face_Actor(kActorHanoi, kActorMcCoy, true);
+ Actor_Change_Animation_Mode(kActorHanoi, kAnimationModeCombatAttack);
+ Actor_Retired_Here(kActorMcCoy, 12, 12, true, -1);
break;
case 9999:
@@ -474,7 +474,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) {
_animationState = 0;
_animationFrame = 0;
*animation = 648;
- Actor_Set_Goal_Number(kActorMcCoy, 210);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyNR01ThrownOut);
Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR03GoToDefaultPosition);
}
break;
@@ -503,7 +503,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) {
_animationState = 8;
_animationFrame = 0;
*animation = 642;
- Actor_Set_Goal_Number(kActorHanoi, 241);
+ Actor_Set_Goal_Number(kActorHanoi, kGoalHanoiNR04ShootMcCoy);
}
break;
@@ -521,7 +521,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) {
if (_animationFrame == 5) {
Actor_Force_Stop_Walking(kActorMcCoy);
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
}
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp
index 720c8ef1ea..a0a122e116 100644
--- a/engines/bladerunner/script/ai/mccoy.cpp
+++ b/engines/bladerunner/script/ai/mccoy.cpp
@@ -31,8 +31,8 @@ AIScriptMcCoy::AIScriptMcCoy(BladeRunnerEngine *vm) : AIScriptBase(vm) {
dword_45A0E4 = 0;
off_45A0EC = 0.0f;
dword_45A0E8 = 0;
- dword_45A0F0 = 0;
- dword_45A0F4 = 0;
+ _animationStateNextSpecial = 0;
+ _animationNextSpecial = 0;
dword_45A0F8 = 0;
dword_45A0FC = 0;
off_45A100 = 0.0f;
@@ -49,12 +49,12 @@ void AIScriptMcCoy::Initialize() {
dword_45A0E4 = 0;
off_45A0EC = 0;
dword_45A0E8 = 3;
- dword_45A0F0 = 3;
- dword_45A0F4 = 20;
+ _animationStateNextSpecial = 3;
+ _animationNextSpecial = 20;
dword_45A0F8 = -1;
dword_45A0FC = 0;
off_45A100 = 0;
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
}
bool AIScriptMcCoy::Update() {
@@ -81,8 +81,8 @@ bool AIScriptMcCoy::Update() {
}
return true;
- case 201:
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ case kGoalMcCoyNRxxStandUp:
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
if (Player_Query_Current_Set() == kSetNR03) {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -166.0f, -70.19f, -501.0f, 0, false, false, 0);
Actor_Face_Heading(kActorMcCoy, 300, false);
@@ -92,17 +92,17 @@ bool AIScriptMcCoy::Update() {
Player_Gains_Control();
return true;
- case 212:
+ case kGoalMcCoyNR01LayDrugged:
if (Global_Variable_Query(47) >= 13) {
Global_Variable_Set(47, 500);
- } else if (Global_Variable_Query(47) > 0) {
+ } if (Global_Variable_Query(47) > 0) {
Global_Variable_Decrement(47, 1);
}
break;
- case 221:
- Actor_Set_Goal_Number(kActorMcCoy, 0);
- Actor_Set_Goal_Number(kActorEarlyQ, 212);
+ case kGoalMcCoyNR04PassOut:
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
+ Actor_Set_Goal_Number(kActorEarlyQ, kGoalEarlyQNR04TakeDisk);
return true;
case 309:
@@ -327,18 +327,17 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Face_Actor(kActorMcCoy, kActorSadik, true);
return true;
-
- case 200:
+ case kGoalMcCoyNRxxSitAtTable:
Player_Loses_Control();
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle);
return true;
- case kGoalMcCoyNR03ThrownOut:
+ case kGoalMcCoyNR01ThrownOut:
Actor_Put_In_Set(kActorMcCoy, kSetNR01);
Actor_Set_At_XYZ(kActorMcCoy, -204.0f, 24.0f, -817.0f, 256);
Actor_Set_Invisible(kActorMcCoy, false);
- if (Game_Flag_Query(627)) {
- Actor_Set_Goal_Number(kActorMcCoy, 212);
+ if (Game_Flag_Query(kFlagNR01McCoyIsDrugged)) {
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyNR01LayDrugged);
} else {
_animationState = 53;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
@@ -346,7 +345,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
return true;
- case 211:
+ case kGoalMcCoyNR01GetUp:
Actor_Face_Heading(kActorMcCoy, 512, false);
Actor_Face_Heading(kActorMcCoy, 768, true);
if (Random_Query(0, 1)) {
@@ -356,11 +355,11 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
Delay(150);
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeIdle);
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
Player_Gains_Control();
return true;
- case 212:
+ case kGoalMcCoyNR01LayDrugged:
Global_Variable_Set(47, 0);
Player_Set_Combat_Mode_Access(false);
Player_Gains_Control();
@@ -369,7 +368,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
_animationFrame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
return true;
- case 220:
+ case kGoalMcCoyNR04Drink:
Actor_Change_Animation_Mode(kActorMcCoy, 75);
return true;
@@ -560,10 +559,10 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
*animation = 19;
_animationState = 0;
_animationFrame = 0;
- Game_Flag_Reset(627);
+ Game_Flag_Reset(kFlagNR01McCoyIsDrugged);
Scene_Exits_Enable();
Player_Set_Combat_Mode_Access(true);
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
}
break;
case 67:
@@ -574,8 +573,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
*animation = 19;
_animationState = 0;
_animationFrame = 0;
- if (Actor_Query_Goal_Number(kActorMcCoy) == 220) {
- Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyNR04Drink) {
+ Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
}
}
break;
@@ -596,7 +595,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
_animationState = 14;
*animation = 0;
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
}
break;
case 64:
@@ -631,8 +630,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
*animation = 19;
_animationFrame = 0;
_animationState = 0;
- if (Actor_Query_Goal_Number(kActorMcCoy) == 200) {
- Actor_Set_Goal_Number(kActorMcCoy, 201);
+ if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyNRxxSitAtTable) {
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyNRxxStandUp);
}
}
break;
@@ -721,8 +720,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyBB11GetUp) {
Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11PrepareToRunAway);
}
- if (Actor_Query_Goal_Number(kActorMcCoy) == 210) {
- Actor_Set_Goal_Number(kActorMcCoy, 211);
+ if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyNR01ThrownOut) {
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyNR01GetUp);
}
}
break;
@@ -740,7 +739,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(28)) {
Player_Set_Combat_Mode(true);
sub_405800();
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
_animationFrame = 0;
Player_Gains_Control();
}
@@ -753,7 +752,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
*animation = 34;
_animationFrame++;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(34)) {
- Actor_Set_Goal_Number(kActorMcCoy, 0);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
*animation = 19;
_animationFrame = 0;
sub_405660();
@@ -996,8 +995,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
_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);
+ if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyNR04Drink) {
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyNR04PassOut);
}
}
break;
@@ -1211,10 +1210,10 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
case 4:
if (_animationFrame == 0 && !Game_Flag_Query(kFlagMcCoyAnimation1)) {
_animationFrame = 1;
- _animationState = dword_45A0F0;
- *animation = dword_45A0F4;
- dword_45A0F0 = 4;
- dword_45A0F4 = 20;
+ _animationState = _animationStateNextSpecial;
+ *animation = _animationNextSpecial;
+ _animationStateNextSpecial = 4;
+ _animationNextSpecial = 20;
} else if (_animationFrame <= 4 && Game_Flag_Query(kFlagMcCoyAnimation1)) {
Game_Flag_Reset(kFlagMcCoyAnimation1);
*animation = 19;
@@ -1380,8 +1379,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 20;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 4;
- dword_45A0F4 = 20;
+ _animationStateNextSpecial = 4;
+ _animationNextSpecial = 20;
}
break;
@@ -1472,8 +1471,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 21;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 5;
- dword_45A0F4 = 21;
+ _animationStateNextSpecial = 5;
+ _animationNextSpecial = 21;
}
break;
@@ -1485,8 +1484,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 27;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 6;
- dword_45A0F4 = 27;
+ _animationStateNextSpecial = 6;
+ _animationNextSpecial = 27;
}
break;
@@ -1498,8 +1497,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 22;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 7;
- dword_45A0F4 = 22;
+ _animationStateNextSpecial = 7;
+ _animationNextSpecial = 22;
}
break;
@@ -1510,8 +1509,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 23;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 8;
- dword_45A0F4 = 23;
+ _animationStateNextSpecial = 8;
+ _animationNextSpecial = 23;
}
break;
@@ -1522,8 +1521,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 24;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 9;
- dword_45A0F4 = 24;
+ _animationStateNextSpecial = 9;
+ _animationNextSpecial = 24;
}
break;
@@ -1534,8 +1533,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 25;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 10;
- dword_45A0F4 = 25;
+ _animationStateNextSpecial = 10;
+ _animationNextSpecial = 25;
}
break;
@@ -1546,8 +1545,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 26;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 11;
- dword_45A0F4 = 26;
+ _animationStateNextSpecial = 11;
+ _animationNextSpecial = 26;
}
break;
@@ -1558,8 +1557,8 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationNext = 27;
} else {
Game_Flag_Reset(kFlagMcCoyAnimation1);
- dword_45A0F0 = 12;
- dword_45A0F4 = 27;
+ _animationStateNextSpecial = 12;
+ _animationNextSpecial = 27;
}
break;
@@ -1763,14 +1762,17 @@ void AIScriptMcCoy::sub_4053E0() {
off_45A100 = off_45A100 - 0.2f;
} else {
flt_462710 = flt_462714;
- Actor_Set_Goal_Number(kActorMcCoy, 0);
- Actor_Retired_Here(kActorMcCoy, 12, 48, 1, -1);
+ Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyDefault);
+ Actor_Retired_Here(kActorMcCoy, 12, 48, true, -1);
}
return Actor_Set_At_XYZ(kActorMcCoy, x, flt_462710, z, Actor_Query_Facing_1024(kActorMcCoy));
}
void AIScriptMcCoy::sub_4054F0() {
- if (Actor_Query_Which_Set_In(kActorMcCoy) == kSetUG15 && Actor_Query_Goal_Number(kActorMcCoy) != 390 && !Game_Flag_Query(682)) {
+ if (Actor_Query_Which_Set_In(kActorMcCoy) == kSetUG15
+ && Actor_Query_Goal_Number(kActorMcCoy) != 390
+ && !Game_Flag_Query(682)
+ ) {
float x, y, z;
Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
if ((z < 220.0f) && (-210.0f < x) && (-70.0f > x)) {