aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2018-03-15 22:42:47 +0100
committerEugene Sandulenko2018-03-15 22:43:02 +0100
commit2ba581cd86c8c8dd78d0c9dc19eee77cc9b02943 (patch)
treeda0a80ab0df7e9145d3a76e4621867c6b3e6072b
parentee8fb2ca19129a677c2e022e623b68239431fcc7 (diff)
downloadscummvm-rg350-2ba581cd86c8c8dd78d0c9dc19eee77cc9b02943.tar.gz
scummvm-rg350-2ba581cd86c8c8dd78d0c9dc19eee77cc9b02943.tar.bz2
scummvm-rg350-2ba581cd86c8c8dd78d0c9dc19eee77cc9b02943.zip
BLADERUNNER: Added Lucy actor
-rw-r--r--engines/bladerunner/module.mk1
-rw-r--r--engines/bladerunner/script/ai/lucy.cpp865
-rw-r--r--engines/bladerunner/script/ai_script.cpp3
-rw-r--r--engines/bladerunner/script/ai_script.h7
4 files changed, 875 insertions, 1 deletions
diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index 1c4c7c5b68..3dfdd81fa6 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -82,6 +82,7 @@ MODULE_OBJS = \
script/ai/lance.o \
script/ai/leon.o \
script/ai/lockup_guard.o \
+ script/ai/lucy.o \
script/ai/maggie.o \
script/ai/male_announcer.o \
script/ai/marcus.o \
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
new file mode 100644
index 0000000000..4b9cc7bde0
--- /dev/null
+++ b/engines/bladerunner/script/ai/lucy.cpp
@@ -0,0 +1,865 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "bladerunner/script/ai_script.h"
+
+namespace BladeRunner {
+
+AIScriptLucy::AIScriptLucy(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+ _flag = 0;
+}
+
+void AIScriptLucy::Initialize() {
+ _animationFrame = 0;
+ _animationState = 0;
+ _animationStateNext = 0;
+ _animationNext = 0;
+
+ _flag = 0;
+
+ Actor_Set_Goal_Number(kActorLucy, 0);
+}
+
+bool AIScriptLucy::Update() {
+ float x, y, z;
+
+ if (Global_Variable_Query(kVariableChapter) == 3 && Actor_Query_Goal_Number(kActorLucy) < 200) {
+ Actor_Set_Goal_Number(kActorLucy, 200);
+ }
+ if (Actor_Query_Goal_Number(kActorLucy) == 230 && Player_Query_Current_Scene() == 37) {
+ Actor_Set_Goal_Number(kActorLucy, 233);
+ }
+ if (Global_Variable_Query(kVariableChapter) == 4 && Actor_Query_Goal_Number(kActorLucy) < 300) {
+ Actor_Set_Goal_Number(kActorLucy, 300);
+ }
+ if (Global_Variable_Query(kVariableChapter) == 4
+ && Actor_Query_Goal_Number(kActorLucy) == 599
+ && Actor_Query_Which_Set_In(kActorLucy) != 99) {
+ if (Actor_Query_Which_Set_In(kActorLucy) != Player_Query_Current_Set()) {
+ Actor_Put_In_Set(kActorLucy, kSetFreeSlotI);
+ Actor_Set_At_Waypoint(kActorLucy, 41, 0);
+ }
+ }
+ if (Game_Flag_Query(616) && Actor_Query_Goal_Number(kActorLucy) == 201) {
+ Actor_Put_In_Set(kActorLucy, kSetHF03);
+ Actor_Set_At_Waypoint(kActorLucy, 371, 156);
+ Actor_Set_Goal_Number(kActorLucy, 250);
+ }
+ if (Actor_Query_Goal_Number(kActorLucy) > 229
+ && Actor_Query_Goal_Number(kActorLucy) < 239
+ && Actor_Query_Goal_Number(kActorLucy) != 232
+ && Player_Query_Current_Scene() == 37
+ && Actor_Query_Which_Set_In(kActorLucy) == 40
+ && !Game_Flag_Query(701)
+ && Actor_Query_Inch_Distance_From_Actor(kActorLucy, kActorMcCoy) < 84
+ && !Player_Query_Combat_Mode()
+ && Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 40) {
+ Actor_Set_Goal_Number(kActorLucy, 232);
+ }
+ if (Actor_Query_Goal_Number(kActorLucy) == 235) {
+ Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
+ if (z > -875.0f) {
+ Game_Flag_Set(586);
+ Actor_Set_Goal_Number(kActorLucy, 236);
+ }
+ }
+ if (Actor_Query_Goal_Number(kActorLucy) == 237) {
+ Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
+ if (x > 350.0f) {
+ Game_Flag_Set(585);
+ Actor_Set_Goal_Number(kActorLucy, 238);
+ }
+ }
+
+ return false;
+}
+
+void AIScriptLucy::TimerExpired(int timer) {
+ AI_Countdown_Timer_Reset(kActorLucy, 0);
+ if (!timer && Actor_Query_Goal_Number(kActorLucy) == 205) {
+ if (Player_Query_Current_Scene() == 36) {
+ AI_Countdown_Timer_Start(kActorLucy, 0, 20);
+ } else {
+ Actor_Set_Goal_Number(kActorLucy, 200);
+ }
+ }
+}
+
+void AIScriptLucy::CompletedMovementTrack() {
+ switch (Actor_Query_Goal_Number(kActorLucy)) {
+ case 205:
+ if (!Game_Flag_Query(616) || Global_Variable_Query(40) != 3) {
+ AI_Countdown_Timer_Reset(kActorLucy, 0);
+ AI_Countdown_Timer_Start(kActorLucy, 0, 30);
+ return; //false;
+ }
+ Actor_Set_Goal_Number(kActorLucy, 250);
+ return; //true;
+
+ case 210:
+ Actor_Set_Goal_Number(kActorLucy, 211);
+ break;
+
+ case 211:
+ Game_Flag_Set(593);
+ Actor_Set_Goal_Number(kActorLucy, 299);
+ break;
+
+ case 212:
+ Actor_Set_Goal_Number(kActorLucy, 213);
+ break;
+
+ case 213:
+ if (Actor_Clue_Query(kActorLucy, 219) && Global_Variable_Query(40) != 3) {
+ Game_Flag_Set(593);
+ } else {
+ Actor_Set_Goal_Number(kActorLucy, 230);
+ Game_Flag_Reset(584);
+ }
+ break;
+
+ case 214:
+ Actor_Set_Goal_Number(kActorLucy, 215);
+ break;
+
+ case 215:
+ Actor_Set_Goal_Number(kActorLucy, 201);
+ break;
+
+ case 220:
+ case 225:
+ Actor_Set_Goal_Number(kActorLucy, 200);
+ break;
+
+ case 233:
+ Game_Flag_Set(585);
+ Actor_Set_Goal_Number(kActorLucy, 234);
+ break;
+
+ case 234:
+ Actor_Set_Goal_Number(kActorLucy, 235);
+ break;
+
+ case 236:
+ Actor_Set_Goal_Number(kActorLucy, 237);
+ break;
+
+ case 238:
+ Game_Flag_Set(593);
+ Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
+ Actor_Set_At_Waypoint(kActorLucy, 33, 0);
+ Actor_Set_Health(kActorLucy, 30, 30);
+ if (Global_Variable_Query(40) == 3) {
+ Actor_Set_Goal_Number(kActorSteele, 240);
+ }
+ break;
+
+ case 239:
+ Game_Flag_Set(593);
+ break;
+
+ default:
+ break;
+ }
+ return; //false;
+}
+
+void AIScriptLucy::ReceivedClue(int clueId, int fromActorId) {
+ //return false;
+}
+
+void AIScriptLucy::ClickedByPlayer() {
+ if (Actor_Query_Goal_Number(kActorLucy) == 599) {
+ Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
+ Actor_Says(kActorMcCoy, 8630, 3);
+ }
+}
+
+void AIScriptLucy::EnteredScene(int sceneId) {
+ // return false;
+}
+
+void AIScriptLucy::OtherAgentEnteredThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptLucy::OtherAgentExitedThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptLucy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+ // return false;
+}
+
+void AIScriptLucy::ShotAtAndMissed() {
+ checkCombat();
+}
+
+bool AIScriptLucy::ShotAtAndHit() {
+ checkCombat();
+
+ return false;
+}
+
+void AIScriptLucy::Retired(int byActorId) {
+ if (byActorId == kActorMcCoy) {
+ Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -6);
+ }
+ if ((byActorId == kActorSteele || byActorId == kActorMcCoy)
+ && Actor_Query_In_Set(kActorSteele, kSetHF06)
+ && Actor_Query_In_Set(kActorMcCoy, kSetHF06)) {
+ Non_Player_Actor_Combat_Mode_On(kActorSteele, 3, 1, 0, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ }
+ if (Query_Difficulty_Level() && byActorId == kActorMcCoy && Game_Flag_Query(46)) {
+ Global_Variable_Increment(2, 200);
+ }
+ Actor_Set_Goal_Number(kActorLucy, 599);
+}
+
+int AIScriptLucy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ return 0;
+}
+
+bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ if (!newGoalNumber) {
+ Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
+ return false;
+ }
+
+ switch (newGoalNumber) {
+ case 200:
+ if (Global_Variable_Query(40) == 3) {
+ if (Game_Flag_Query(591) && Game_Flag_Query(592) && Player_Query_Current_Scene() != 36) {
+ Actor_Set_Goal_Number(kActorLucy, 205);
+ } else {
+ if (Random_Query(1, 2) - 1) {
+ Actor_Set_Goal_Number(kActorLucy, 225);
+ } else {
+ Actor_Set_Goal_Number(kActorLucy, 220);
+ }
+ }
+ } else {
+ int rnd = Random_Query(1, 4) - 1;
+
+ if (rnd) {
+ if (rnd == 1) {
+ Actor_Set_Goal_Number(kActorLucy, 225);
+ } else if (Player_Query_Current_Scene() == 36) {
+ Actor_Set_Goal_Number(kActorLucy, 220);
+ } else {
+ Actor_Set_Goal_Number(kActorLucy, 205);
+ }
+ } else {
+ Actor_Set_Goal_Number(kActorLucy, 220);
+ }
+ }
+ break;
+
+ case 205:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_With_Facing(kActorLucy, 371, 0, 156);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 210:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, 1);
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 377, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 211:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 372, 0);
+ AI_Movement_Track_Append(kActorLucy, 33, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 212:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, 1);
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 378, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 213:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
+ AI_Movement_Track_Append(kActorLucy, 33, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 214:
+ Actor_Says(kActorLucy, 320, 16);
+ Actor_Set_Goal_Number(kActorHolloway, 242);
+ Actor_Set_Immunity_To_Obstacles(6, 1);
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append(kActorLucy, 378, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 215:
+ Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
+ AI_Movement_Track_Append(kActorLucy, 33, 30);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 220:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 10));
+ AI_Movement_Track_Append(kActorLucy, 33, Random_Query(5, 10));
+ AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 10));
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 225:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 15));
+ AI_Movement_Track_Append(kActorLucy, 33, Random_Query(10, 30));
+ AI_Movement_Track_Append(kActorLucy, 40, Random_Query(15, 30));
+ AI_Movement_Track_Append(kActorLucy, 42, Random_Query(10, 20));
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 230:
+ AI_Movement_Track_Flush(kActorLucy);
+ Actor_Put_In_Set(kActorLucy, kSetHF04);
+ Actor_Set_At_Waypoint(kActorLucy, 518, 0);
+ Actor_Set_Targetable(kActorLucy, 1);
+ Actor_Set_Health(kActorLucy, 5, 5);
+ break;
+
+ case 232:
+ Player_Loses_Control();
+ Actor_Says(kActorMcCoy, 1700, 16);
+ AI_Movement_Track_Flush(kActorLucy);
+ Actor_Face_Actor(kActorLucy, 0, 1);
+ Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
+ Actor_Says(kActorLucy, 350, 13);
+ Actor_Says(kActorMcCoy, 1705, 13);
+ Actor_Says(kActorLucy, 360, 13);
+ Actor_Says(kActorMcCoy, 1710, 13);
+
+ if (Global_Variable_Query(kVariableAffectionTowards) == 3) {
+ Actor_Says(kActorLucy, 940, 13);
+ Actor_Says(kActorMcCoy, 6780, 12);
+ Actor_Says(kActorLucy, 950, 12);
+ Actor_Says(kActorLucy, 960, 14);
+ Actor_Says(kActorMcCoy, 6785, 13);
+ Actor_Says(kActorLucy, 970, 16);
+ Actor_Says(kActorLucy, 980, 13);
+ if (Game_Flag_Query(47)) {
+ Actor_Says(kActorLucy, 990, 15);
+ }
+ Actor_Says(kActorMcCoy, 6790, 13);
+ if (Game_Flag_Query(47) && Game_Flag_Query(46)) {
+ Actor_Says(kActorLucy, 1000, 12);
+ }
+ Actor_Says(kActorLucy, 1010, 15);
+ Actor_Says(kActorLucy, 1020, 12);
+ Actor_Says(kActorMcCoy, 6795, 18);
+ Actor_Says(kActorLucy, 1030, 15);
+ Actor_Says(kActorMcCoy, 6800, 16);
+ Actor_Says(kActorLucy, 1040, 12);
+ Actor_Says(kActorMcCoy, 6805, 15);
+ Actor_Says(kActorLucy, 1050, 12);
+ }
+ Actor_Says(kActorLucy, 370, 14);
+ Actor_Set_Goal_Number(kActorLucy, 239);
+ if (Global_Variable_Query(40) == 3) {
+ Actor_Set_Goal_Number(kActorSteele, 243);
+ Game_Flag_Set(593);
+ }
+ Player_Gains_Control();
+ break;
+
+ case 233:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 519, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ Actor_Set_Health(kActorLucy, 5, 5);
+ break;
+
+ case 234:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 520, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 236:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 521, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 238:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 522, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 239:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 523, 0);
+ AI_Movement_Track_Append(kActorLucy, 33, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ Player_Gains_Control();
+ Actor_Set_Health(kActorLucy, 30, 30);
+ break;
+
+ case 240:
+ if (Global_Variable_Query(40) == 3) {
+ Actor_Set_Goal_Number(kActorLucy, 599);
+ Actor_Set_Goal_Number(kActorSteele, 240);
+ } else {
+ Actor_Set_Goal_Number(kActorLucy, 299);
+ Game_Flag_Set(593);
+ }
+ break;
+
+ case 250:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append(kActorLucy, 372, 0);
+ AI_Movement_Track_Append_With_Facing(kActorLucy, 371, 0, 156);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 300:
+ Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
+ Actor_Set_At_Waypoint(kActorLucy, 33, 0);
+ if (Global_Variable_Query(kVariableAffectionTowards) == 3) {
+ Actor_Set_Goal_Number(kActorLucy, 310);
+ }
+ break;
+
+ case 310:
+ Actor_Put_In_Set(kActorLucy, kSetUG01);
+ Actor_Set_At_Waypoint(kActorLucy, 544, 651);
+ break;
+
+ case 311:
+ voightKempTest();
+ break;
+
+ case 312:
+ AI_Movement_Track_Flush(kActorLucy);
+ AI_Movement_Track_Append_Run(kActorLucy, 545, 0);
+ AI_Movement_Track_Append(kActorLucy, 33, 0);
+ AI_Movement_Track_Repeat(kActorLucy);
+ break;
+
+ case 599:
+ Game_Flag_Set(593);
+ break;
+ }
+
+ return false;
+}
+
+bool AIScriptLucy::UpdateAnimation(int *animation, int *frame) {
+ switch (_animationState) {
+ case 0:
+ *animation = 260;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(260)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ if (_animationState == 1) {
+ *animation = 253;
+ }
+ if (_animationState == 2) {
+ *animation = 254;
+ }
+ if (_animationState == 3) {
+ *animation = 255;
+ }
+ if (_animationState == 4) {
+ *animation = 256;
+ }
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 5:
+ case 6:
+ if (_animationState == 5) {
+ *animation = 257;
+ }
+ if (_animationState == 6) {
+ *animation = 258;
+ }
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ *animation = 260;
+ _animationFrame = 0;
+ _animationState = 0;
+ Actor_Change_Animation_Mode(kActorLucy, 0);
+ }
+ break;
+
+ case 7:
+ *animation = 259;
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(259) - 1) {
+ ++_animationFrame;
+ }
+ break;
+
+ case 8:
+ if (!_animationFrame && _flag) {
+ *animation = 260;
+ _animationState = 0;
+ _flag = 0;
+ } else {
+ *animation = 263;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(263)) {
+ _animationFrame = 0;
+ }
+ }
+ break;
+
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ if (_animationState == 9) {
+ *animation = 264;
+ }
+ if (_animationState == 10) {
+ *animation = 265;
+ }
+ if (_animationState == 11) {
+ *animation = 266;
+ }
+ if (_animationState == 12) {
+ *animation = 267;
+ }
+ if (_animationState == 13) {
+ *animation = 268;
+ }
+ if (_animationState == 14) {
+ *animation = 269;
+ }
+ if (_animationState == 15) {
+ *animation = 270;
+ }
+ if (_animationState == 16) {
+ *animation = 271;
+ }
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ _animationFrame = 0;
+ _animationState = 8;
+ *animation = 263;
+ }
+ break;
+
+ case 17:
+ *animation = 272;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(272)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 18:
+ if (!_animationFrame && _flag) {
+ _animationState = 17;
+ _flag = 0;
+ *animation = 272;
+ } else {
+ *animation = 273;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(273)) {
+ _animationFrame = 0;
+ }
+ }
+ break;
+
+ case 19:
+ *animation = 274;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(274)) {
+ *animation = 260;
+ _animationFrame = 0;
+ _animationState = 0;
+ }
+ break;
+
+ case 20:
+ *animation = 275;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(275)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 21:
+ *animation = 276;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(276)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ default:
+ break;
+ }
+ *frame = _animationFrame;
+
+ return true;
+}
+
+bool AIScriptLucy::ChangeAnimationMode(int mode) {
+ switch (mode) {
+ case 0:
+ if (_animationState >= 8 && _animationState <= 16) {
+ _flag = 1;
+ } else {
+ _animationState = 0;
+ _animationFrame = 0;
+ }
+ break;
+
+ case 1:
+ _animationState = 1;
+ _animationFrame = 0;
+ break;
+
+ case 2:
+ _animationState = 2;
+ _animationFrame = 0;
+ break;
+
+ case 3:
+ _flag = 0;
+ _animationState = 8;
+ _animationFrame = 0;
+ break;
+
+ case 4:
+ if (_animationState >= 8 && _animationState <= 16) {
+ _flag = 1;
+ } else {
+ _animationState = 0;
+ _animationFrame = 0;
+ }
+ break;
+
+ case 7:
+ _animationState = 1;
+ _animationFrame = 0;
+ break;
+
+ case 8:
+ _animationState = 2;
+ _animationFrame = 0;
+ break;
+
+ case 12:
+ _flag = 0;
+ _animationState = 9;
+ _animationFrame = 0;
+ break;
+
+ case 13:
+ _flag = 0;
+ _animationState = 10;
+ _animationFrame = 0;
+ break;
+
+ case 14:
+ _flag = 0;
+ _animationState = 11;
+ _animationFrame = 0;
+ break;
+
+ case 15:
+ _flag = 0;
+ _animationState = 12;
+ _animationFrame = 0;
+ break;
+
+ case 16:
+ _flag = 0;
+ _animationState = 13;
+ _animationFrame = 0;
+ break;
+
+ case 17:
+ _flag = 0;
+ _animationState = 14;
+ _animationFrame = 0;
+ break;
+
+ case 18:
+ _flag = 0;
+ _animationState = 15;
+ _animationFrame = 0;
+ break;
+
+ case 19:
+ _flag = 0;
+ _animationState = 16;
+ _animationFrame = 0;
+ break;
+
+ case 21:
+ if (Random_Query(1, 2) == 1) {
+ _animationState = 5;
+ } else {
+ _animationState = 6;
+ }
+ _animationFrame = 0;
+ break;
+
+ case 22:
+ if (Random_Query(1, 2) == 1) {
+ _animationState = 5;
+ } else {
+ _animationState = 6;
+ }
+ _animationFrame = 0;
+ break;
+
+ case 48:
+ _animationState = 7;
+ _animationFrame = 0;
+ break;
+ }
+
+ return true;
+}
+
+void AIScriptLucy::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
+}
+
+void AIScriptLucy::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
+}
+
+bool AIScriptLucy::ReachedMovementTrackWaypoint(int waypointId) {
+ return true;
+}
+
+void AIScriptLucy::FledCombat() {
+ // return false;
+}
+
+void AIScriptLucy::voightKempTest() {
+ Player_Loses_Control();
+ Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
+ Actor_Says(kActorMcCoy, 6815, 11);
+ Actor_Face_Actor(kActorLucy, kActorMcCoy, 1);
+ Actor_Says(kActorLucy, 1060, 16);
+ Actor_Says(kActorLucy, 1070, 17);
+ Delay(1000);
+ Actor_Says(kActorLucy, 1080, 14);
+ Actor_Says(kActorMcCoy, 6820, 16);
+ Actor_Says(kActorLucy, 1090, 13);
+ if (!Game_Flag_Query(378)) {
+ Actor_Says(kActorMcCoy, 6825, 13);
+ }
+ Actor_Says(kActorMcCoy, 6830, 12);
+ Actor_Says(kActorLucy, 1100, 14);
+ Actor_Says(kActorMcCoy, 6835, 14);
+ Actor_Says(kActorLucy, 1110, 15);
+ Actor_Says(kActorMcCoy, 6840, 13);
+ Delay(1000);
+ Actor_Says(kActorMcCoy, 6845, 12);
+ Delay(500);
+ Actor_Says(kActorMcCoy, 6850, 12);
+ Actor_Says(kActorLucy, 1120, 14);
+ Actor_Says(kActorMcCoy, 6855, 13);
+ Actor_Says(kActorMcCoy, 6860, 13);
+ Actor_Says(kActorLucy, 1130, 14);
+ Music_Stop(2);
+ Player_Gains_Control();
+ Voight_Kampff_Activate(6, 40);
+ Player_Loses_Control();
+ if (Actor_Clue_Query(kActorMcCoy, 271)) {
+ Actor_Says(kActorMcCoy, 6865, 13);
+ Actor_Says(kActorLucy, 1140, 14);
+ Actor_Says(kActorMcCoy, 6865, 14);
+ Actor_Says(kActorLucy, 1150, 16);
+ Actor_Says(kActorMcCoy, 6870, 14);
+ Delay(500);
+ Actor_Says(kActorMcCoy, 6875, 13);
+ Actor_Says(kActorLucy, 1160, 16);
+ } else {
+ Actor_Says(kActorMcCoy, 6880, 13);
+ Actor_Says(kActorLucy, 1170, 13);
+ Actor_Says(kActorLucy, 1180, 16);
+ Actor_Says(kActorMcCoy, 6890, 15);
+ Actor_Says(kActorLucy, 1190, 15);
+ Actor_Says(kActorLucy, 1200, 17);
+ Actor_Says(kActorMcCoy, 6885, 13);
+ Actor_Says(kActorLucy, 1210, 17);
+ }
+ Actor_Says(kActorMcCoy, 6895, 15);
+ Actor_Says(kActorMcCoy, 6900, 11);
+ Actor_Says(kActorLucy, 1220, 16);
+ Actor_Says(kActorMcCoy, 6905, 13);
+ Actor_Says(kActorLucy, 1230, 17);
+ Actor_Says(kActorMcCoy, 6910, 13);
+ Delay(2000);
+ Player_Gains_Control();
+ Actor_Set_Goal_Number(kActorLucy, 312);
+}
+
+void AIScriptLucy::checkCombat() {
+ Game_Flag_Set(701);
+ if (Actor_Query_In_Set(kActorLucy, kSetHF01) == 1
+ && Global_Variable_Query(kVariableChapter) == 5
+ && Actor_Query_Goal_Number(kActorLucy) != 450) {
+ if (Global_Variable_Query(kVariableAffectionTowards) == 3) {
+ Global_Variable_Set(45, 0);
+ }
+ Actor_Set_Goal_Number(kActorLucy, 450);
+ Non_Player_Actor_Combat_Mode_On(kActorLucy, 0, 0, 0, 4, 0, 1, 2, -1, 0, 0, 10, 300, 0);
+ }
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index cd4e18b0b5..e5eb77987e 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -44,7 +44,8 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
_AIScripts[kActorGordo] = new AIScriptGordo(_vm); // 2
_AIScripts[kActorDektora] = new AIScriptDektora(_vm); // 3
_AIScripts[kActorGuzza] = new AIScriptGuzza(_vm); // 4
- _AIScripts[kActorClovis] = new AIScriptClovis(_vm); // 4
+ _AIScripts[kActorClovis] = new AIScriptClovis(_vm); // 5
+ _AIScripts[kActorLucy] = new AIScriptLucy(_vm); // 6
_AIScripts[kActorCrazylegs] = new AIScriptCrazylegs(_vm); // 9
_AIScripts[kActorGrigorian] = new AIScriptGrigorian(_vm); // 11
_AIScripts[kActorTransient] = new AIScriptTransient(_vm); // 12
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index eaf5e47780..6a13ac3852 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -171,6 +171,13 @@ DECLARE_SCRIPT(Clovis)
void someAnim();
END_SCRIPT
+DECLARE_SCRIPT(Lucy)
+ bool _flag;
+
+ void voightKempTest();
+ void checkCombat();
+END_SCRIPT
+
DECLARE_SCRIPT(Crazylegs)
bool _flag;
END_SCRIPT