[Scummvm-git-logs] scummvm master -> 654ef04f82de0e05bee0ab07734f39eef3877069

sev- sev at scummvm.org
Tue Mar 13 18:46:16 CET 2018


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b45ba3102f BLADERUNNER: Added Chew actor
d37223a9fc BLADERUNNER: Added Sebastian actor
f85899cf93 BLADERUNNER: Added Rachel actor
11e5e5d378 BLADERUNNER: Added Isabella actor
654ef04f82 BLADERUNNER: Added Dektora actor


Commit: b45ba3102f44c32f68243ffb2f80ce9a7562229d
    https://github.com/scummvm/scummvm/commit/b45ba3102f44c32f68243ffb2f80ce9a7562229d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-13T13:00:22+01:00

Commit Message:
BLADERUNNER: Added Chew actor

Changed paths:
  A engines/bladerunner/script/ai/chew.cpp
    engines/bladerunner/module.mk
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/ai_script.h


diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index 07c315b..29f35dc 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -54,6 +54,7 @@ MODULE_OBJS = \
 	script/ai/baker.o \
 	script/ai/blimp_guy.o \
 	script/ai/bryant.o \
+	script/ai/chew.o \
 	script/ai/crazylegs.o \
 	script/ai/desk_clerk.o \
 	script/ai/dispatcher.o \
diff --git a/engines/bladerunner/script/ai/chew.cpp b/engines/bladerunner/script/ai/chew.cpp
new file mode 100644
index 0000000..b732de2
--- /dev/null
+++ b/engines/bladerunner/script/ai/chew.cpp
@@ -0,0 +1,494 @@
+/* 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 {
+
+AIScriptChew::AIScriptChew(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+	_flag = false;
+	_var1 = 0;
+	_var2 = 0;
+	_var3 = 1;
+}
+
+void AIScriptChew::Initialize() {
+	_animationFrame = 0;
+	_animationState = 0;
+	_animationStateNext = 0;
+	_animationNext = 0;
+
+	_flag = false;
+	_var1 = 0;
+	_var2 = 0;
+	_var3 = 1;
+}
+
+bool AIScriptChew::Update() {
+	return false;
+}
+
+void AIScriptChew::TimerExpired(int timer) {
+	//return false;
+}
+
+void AIScriptChew::CompletedMovementTrack() {
+	//return false;
+}
+
+void AIScriptChew::ReceivedClue(int clueId, int fromActorId) {
+	//return false;
+}
+
+void AIScriptChew::ClickedByPlayer() {
+	//return false;
+}
+
+void AIScriptChew::EnteredScene(int sceneId) {
+	// return false;
+}
+
+void AIScriptChew::OtherAgentEnteredThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptChew::OtherAgentExitedThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptChew::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+	// return false;
+}
+
+void AIScriptChew::ShotAtAndMissed() {
+	// return false;
+}
+
+bool AIScriptChew::ShotAtAndHit() {
+	return false;
+}
+
+void AIScriptChew::Retired(int byActorId) {
+	// return false;
+}
+
+int AIScriptChew::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+	return 0;
+}
+
+bool AIScriptChew::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+	return false;
+}
+
+bool AIScriptChew::UpdateAnimation(int *animation, int *frame) {
+	switch (_animationState) {
+	case 0:
+		if (_var2 == 0) {
+			*animation = 777;
+			if (_var1) {
+				_var1--;
+			} else {
+				_animationFrame++;
+				if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(777)) {
+					_animationFrame = 0;
+					_var3 = 1;
+					_var2 = Random_Query(0, 2);
+				} else if (!Random_Query(0, 1)) {
+					_var1 = 1;
+					if (!Random_Query(0, 3)) {
+						_var3 = -_var3;
+					}
+				}
+			}
+		} else if (_var2 == 1) {
+			*animation = 778;
+			_animationFrame += _var3;
+			if (_animationFrame <= 6) {
+				_var3 = 1;
+			}
+			if (_animationFrame == 13) {
+				if (!Random_Query(0, 1)) {
+					_var3 = -1;
+				}
+			}
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(778)) {
+				_animationFrame = 0;
+				_var2 = Random_Query(0, 2);
+				_var3 = 1;
+			}
+		} else if (_var2 == 2) {
+			*animation = 779;
+			_animationFrame += _var3;
+			if (_animationFrame <= 8) {
+				_var3 = 1;
+			}
+			if (_animationFrame == 16) {
+				if (!Random_Query(0, 1)) {
+					_var3 = -1;
+				}
+			}
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(779)) {
+				_animationFrame = 0;
+				_var2 = Random_Query(0, 2);
+				_var3 = 1;
+			}
+		}
+		break;
+
+	case 1:
+		if (!_var2) {
+			*animation = 777;
+		}
+		if (_var2 == 1) {
+			*animation = 778;
+		}
+		if (_var2 == 2) {
+			*animation = 779;
+		}
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+			_animationFrame += 2;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+				_animationFrame = 0;
+				_animationState = _animationStateNext;
+				*animation = _animationNext;
+			}
+		} else {
+			_animationFrame -= 2;
+			if (_animationFrame <= 0) {
+				_animationFrame = 0;
+				_animationState = _animationStateNext;
+				*animation = _animationNext;
+			}
+		}
+		break;
+
+	case 2:
+		*animation = 780;
+		if (!_animationFrame && _flag) {
+			*animation = 777;
+			_animationState = 0;
+			_var2 = 0;
+		} else {
+			_animationFrame++;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(780)) {
+				_animationFrame = 0;
+			}
+		}
+		break;
+
+	case 3:
+		*animation = 781;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(781)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 4:
+		*animation = 782;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(782)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 5:
+		*animation = 783;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(783)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 6:
+		*animation = 784;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(784)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 7:
+		*animation = 785;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(785)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 8:
+		*animation = 786;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(786)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 9:
+		*animation = 787;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(787)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	case 10:
+		*animation = 775;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(775)) {
+			*animation = 777;
+			_animationFrame = 0;
+			_animationState = 0;
+			_var2 = 0;
+		}
+		break;
+
+	case 11:
+		*animation = 776;
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(776) - 1) {
+			_animationFrame++;
+		}
+		break;
+
+	case 12:
+		*animation = 773;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(773)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 13:
+		*animation = 774;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(774)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 780;
+		}
+		break;
+
+	default:
+		break;
+	}
+	*frame = _animationFrame;
+
+	return true;
+}
+
+bool AIScriptChew::ChangeAnimationMode(int mode) {
+	switch (mode) {
+	case 0:
+		switch (_animationState) {
+		case 0:
+			return true;
+		case 2:
+		case 3:
+		case 4:
+		case 5:
+		case 6:
+		case 7:
+		case 8:
+		case 9:
+			_flag = 1;
+			break;
+		default:
+			_animationState = 0;
+			_var2 = 0;
+			_animationFrame = 0;
+			break;
+		}
+		break;
+
+	case 1:
+		_animationFrame = 0;
+		_animationState = 12;
+		break;
+
+	case 3:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 2;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 2;
+				_animationNext = 780;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 12:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 3;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 3;
+				_animationNext = 781;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 13:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 4;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 4;
+				_animationNext = 782;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 14:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 5;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 5;
+				_animationNext = 783;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 15:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 6;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 6;
+				_animationNext = 784;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 16:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 7;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 7;
+				_animationNext = 785;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 17:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 8;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 8;
+				_animationNext = 786;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 18:
+		if (_animationState < 2 || _animationState > 9) {
+			if (_animationState) {
+				_animationState = 9;
+				_animationFrame = 0;
+				_flag = 0;
+			} else {
+				_animationStateNext = 9;
+				_animationNext = 787;
+				_animationState = 1;
+			}
+		}
+		break;
+
+	case 43:
+		if (_animationState || (!_animationState && _var2 != 1 && _var2 != 2)) {
+			Actor_Change_Animation_Mode(kActorChew, 0);
+			_var2 = Random_Query(1, 2);
+		}
+		break;
+
+	case 48:
+		_animationFrame = 0;
+		_animationState = 11;
+		break;
+
+	default:
+		break;
+	}
+
+	return true;
+}
+
+void AIScriptChew::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+	*animationState     = _animationState;
+	*animationFrame     = _animationFrame;
+	*animationStateNext = _animationStateNext;
+	*animationNext      = _animationNext;
+}
+
+void AIScriptChew::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+	_animationState     = animationState;
+	_animationFrame     = animationFrame;
+	_animationStateNext = animationStateNext;
+	_animationNext      = animationNext;
+}
+
+bool AIScriptChew::ReachedMovementTrackWaypoint(int waypointId) {
+	return true;
+}
+
+void AIScriptChew::FledCombat() {
+	// return false;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 156d128..33ada6a 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -78,6 +78,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
 	_AIScripts[kActorHysteriaPatron3] = new AIScriptHysteriaPatron3(_vm); // 49
 	_AIScripts[kActorShoeshineMan] = new AIScriptShoeshineMan(_vm);       // 50
 	_AIScripts[kActorTyrell] = new AIScriptTyrell(_vm);                   // 51
+	_AIScripts[kActorChew] = new AIScriptChew(_vm);                       // 52
 	_AIScripts[kActorGaff] = new AIScriptGaff(_vm);                       // 53
 	_AIScripts[kActorBryant] = new AIScriptBryant(_vm);                   // 54
 	_AIScripts[kActorTaffy] = new AIScriptTaffy(_vm);                     // 55
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index b3d8237..9324245 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -302,6 +302,13 @@ DECLARE_SCRIPT(Tyrell)
 	int _var;
 END_SCRIPT
 
+DECLARE_SCRIPT(Chew)
+	int _var1;
+	int _var2;
+	int _var3;
+	bool _flag;
+END_SCRIPT
+
 DECLARE_SCRIPT(Gaff)
 END_SCRIPT
 


Commit: d37223a9fc27e07427f5bc6a4b4d4626a66d114a
    https://github.com/scummvm/scummvm/commit/d37223a9fc27e07427f5bc6a4b4d4626a66d114a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-13T13:56:03+01:00

Commit Message:
BLADERUNNER: Added Sebastian actor

Changed paths:
  A engines/bladerunner/script/ai/sebastian.cpp
    engines/bladerunner/module.mk
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/ai_script.h


diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index 29f35dc..55c5a59 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -90,6 +90,7 @@ MODULE_OBJS = \
 	script/ai/officer_leary.o \
 	script/ai/rajif.o \
 	script/ai/runciter.o \
+	script/ai/sebastian.o \
 	script/ai/sergeant_walls.o \
 	script/ai/shoeshine_man.o \
 	script/ai/steele.o \
diff --git a/engines/bladerunner/script/ai/sebastian.cpp b/engines/bladerunner/script/ai/sebastian.cpp
new file mode 100644
index 0000000..4a52f3c
--- /dev/null
+++ b/engines/bladerunner/script/ai/sebastian.cpp
@@ -0,0 +1,491 @@
+/* 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 {
+
+AIScriptSebastian::AIScriptSebastian(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+	_flag = false;
+}
+
+void AIScriptSebastian::Initialize() {
+	_animationFrame = 0;
+	_animationState = 0;
+	_animationStateNext = 0;
+	_animationNext = 0;
+
+	_flag = false;
+
+	Actor_Set_Goal_Number(kActorSebastian, 0);
+}
+
+bool AIScriptSebastian::Update() {
+	if (Actor_Query_Goal_Number(kActorSebastian) < 200 && Global_Variable_Query(kVariableChapter) == 3)
+		Actor_Set_Goal_Number(kActorSebastian, 200);
+
+	return false;
+}
+
+void AIScriptSebastian::TimerExpired(int timer) {
+	//return false;
+}
+
+void AIScriptSebastian::CompletedMovementTrack() {
+	//return false;
+}
+
+void AIScriptSebastian::ReceivedClue(int clueId, int fromActorId) {
+	//return false;
+}
+
+void AIScriptSebastian::ClickedByPlayer() {
+	if (Actor_Query_Goal_Number(kActorSebastian) != 205)
+		return; //false;
+
+	AI_Movement_Track_Pause(56);
+	Actor_Face_Actor(kActorSebastian, kActorMcCoy, 1);
+	Actor_Face_Actor(kActorMcCoy, kActorSebastian, 1);
+	if (Actor_Clue_Query(kActorSebastian, 214)) {
+		Actor_Says(kActorMcCoy, 6985, 16);
+		Actor_Says(kActorSebastian, 610, 14);
+	} else {
+		dialogue();
+	}
+
+	AI_Movement_Track_Unpause(56);
+	return; //true;
+}
+
+void AIScriptSebastian::EnteredScene(int sceneId) {
+	// return false;
+}
+
+void AIScriptSebastian::OtherAgentEnteredThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptSebastian::OtherAgentExitedThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptSebastian::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+	if (otherActorId || !combatMode)
+		return; //false;
+
+	Global_Variable_Increment(46, 1);
+	Actor_Modify_Friendliness_To_Other(kActorSebastian, kActorMcCoy, -5);
+	AI_Movement_Track_Pause(56);
+	Actor_Face_Actor(kActorSebastian, kActorMcCoy, 1);
+
+	if (Global_Variable_Query(46) == 1) {
+		Actor_Says(kActorSebastian, 680, 12);
+		Actor_Face_Actor(kActorMcCoy, kActorSebastian, 1);
+		Actor_Says_With_Pause(kActorMcCoy, 7265, 0.0, 4);
+		Actor_Change_Animation_Mode(kActorMcCoy, 4);
+		Delay(500);
+		Actor_Says(kActorSebastian, 690, 16);
+	} else {
+		Actor_Says(kActorSebastian, 700, 15);
+		Actor_Says_With_Pause(kActorMcCoy, 7270, 0.0, 4);
+		Actor_Change_Animation_Mode(kActorMcCoy, 4);
+	}
+	AI_Movement_Track_Unpause(56);
+
+	return; //true;
+}
+
+void AIScriptSebastian::ShotAtAndMissed() {
+	// return false;
+}
+
+bool AIScriptSebastian::ShotAtAndHit() {
+	return false;
+}
+
+void AIScriptSebastian::Retired(int byActorId) {
+	// return false;
+}
+
+int AIScriptSebastian::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+	return 0;
+}
+
+bool AIScriptSebastian::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+	if (newGoalNumber == 200) {
+		Actor_Put_In_Set(kActorSebastian, kSetBB05);
+		Actor_Set_At_XYZ(kActorSebastian, -13.08f, -60.31f, 100.88f, 470);
+	}
+
+	return false;
+}
+
+bool AIScriptSebastian::UpdateAnimation(int *animation, int *frame) {
+	switch (_animationState) {
+	case 0:
+		*animation = 811;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(811) - 1) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 1:
+		*animation = 809;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(809) - 1) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 2:
+		*animation = 810;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(810) - 1) {
+			Actor_Change_Animation_Mode(kActorSebastian, 0);
+			*animation = 811;
+			_animationFrame = 0;
+			_animationState = 0;
+		}
+		break;
+
+	case 3:
+		*animation = 821;
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(821) - 1) {
+			_animationFrame++;
+		}
+		break;
+
+	case 4:
+		if (!_animationFrame && _flag) {
+			Actor_Change_Animation_Mode(kActorSebastian, 0);
+			*animation = 811;
+			_animationState = 0;
+			_animationFrame = 0;
+		} else {
+			*animation = 813;
+			_animationFrame++;
+			if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(813) - 1) {
+				_animationFrame = 0;
+			}
+		}
+		break;
+
+	case 5:
+		*animation = 814;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(814) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	case 6:
+		*animation = 815;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(815) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	case 7:
+		*animation = 816;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(816) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	case 8:
+		*animation = 817;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(817) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	case 9:
+		*animation = 818;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(818) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	case 10:
+		*animation = 819;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(819) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	case 11:
+		*animation = 820;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(820) - 1) {
+			_animationFrame = 0;
+			_animationState = 4;
+			*animation = 813;
+		}
+		break;
+
+	default:
+		break;
+	}
+	*frame = _animationFrame;
+
+	return true;
+}
+
+bool AIScriptSebastian::ChangeAnimationMode(int mode) {
+	switch (mode) {
+	case 0:
+		if (_animationState > 11) {
+			_animationState = 0;
+			_animationFrame = 0;
+		} else {
+			_flag = true;
+		}
+		break;
+	case 1:
+		_animationState = 1;
+		_animationFrame = 0;
+		break;
+	case 3:
+		_animationState = 4;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 12:
+		_animationState = 5;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 13:
+		_animationState = 6;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 14:
+		_animationState = 7;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 15:
+		_animationState = 8;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 16:
+		_animationState = 9;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 17:
+		_animationState = 10;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 18:
+		_animationState = 11;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 20:
+		_animationState = 2;
+		_animationFrame = 0;
+		break;
+	case 48:
+		_animationState = 3;
+		_animationFrame = 0;
+		break;
+	default:
+		break;
+	}
+
+	return true;
+}
+
+void AIScriptSebastian::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+	*animationState     = _animationState;
+	*animationFrame     = _animationFrame;
+	*animationStateNext = _animationStateNext;
+	*animationNext      = _animationNext;
+}
+
+void AIScriptSebastian::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+	_animationState     = animationState;
+	_animationFrame     = animationFrame;
+	_animationStateNext = animationStateNext;
+	_animationNext      = animationNext;
+}
+
+bool AIScriptSebastian::ReachedMovementTrackWaypoint(int waypointId) {
+	return true;
+}
+
+void AIScriptSebastian::FledCombat() {
+	// return false;
+}
+
+void AIScriptSebastian::dialogue() {
+	Dialogue_Menu_Clear_List();
+
+	if (Actor_Query_Friendliness_To_Other(kActorSebastian, kActorMcCoy) >= 45) {
+		DM_Add_To_List_Never_Repeat_Once_Selected(930, 5, 5, 5);
+		DM_Add_To_List_Never_Repeat_Once_Selected(940, -1, 5, 6);
+		DM_Add_To_List_Never_Repeat_Once_Selected(950, 5, 5, 5);
+	}
+
+	if (Actor_Clue_Query(kActorMcCoy, kClueAnsweringMachineMessage)) {
+		DM_Add_To_List_Never_Repeat_Once_Selected(960, 3, -1, 5);
+	}
+
+	if (Actor_Clue_Query(kActorMcCoy, kClueAnsweringMachineMessage) && Actor_Clue_Query(kActorMcCoy, kClueEnvelope)) {
+		DM_Add_To_List_Never_Repeat_Once_Selected(970, -1, 4, -1);
+	}
+
+	DM_Add_To_List_Never_Repeat_Once_Selected(980, -1, -1, 7);
+	DM_Add_To_List_Never_Repeat_Once_Selected(990, 7, 3, -1);
+
+	if (Dialogue_Menu_Query_List_Size()) {
+		Dialogue_Menu_Add_DONE_To_List(1000);
+		Dialogue_Menu_Appear(320, 240);
+		Dialogue_Menu_Disappear();
+
+		switch (Dialogue_Menu_Query_Input()) {
+		case 930:
+			Actor_Says(kActorMcCoy, 7075, 13);
+			Actor_Says(kActorSebastian, 290, 12);
+			Actor_Says(kActorSebastian, 300, 13);
+			break;
+
+		case 940:
+			Actor_Says(kActorMcCoy, 7080, 15);
+			Actor_Says(kActorSebastian, 310, 13);
+			Actor_Says(kActorSebastian, 320, 16);
+			Actor_Says(kActorSebastian, 340, 12);
+			Actor_Says(kActorMcCoy, 7120, 14);
+			Actor_Says(kActorSebastian, 350, 3);
+			Actor_Says(kActorMcCoy, 7125, 13);
+			Actor_Says(kActorSebastian, 360, 17);
+			Actor_Says_With_Pause(kActorMcCoy, 7130, 1.0, 3);
+			Actor_Says(kActorMcCoy, 7135, 18);
+			break;
+
+		case 950:
+			Actor_Says(kActorMcCoy, 7085, 15);
+			Actor_Says_With_Pause(kActorSebastian, 370, 0.30f, 13);
+			Actor_Says_With_Pause(kActorSebastian, 380, 0.70f, 17);
+			Actor_Says(kActorSebastian, 390, 14);
+			if (Actor_Clue_Query(kActorMcCoy, kClueChessTable)) {
+				Actor_Says(kActorMcCoy, 7140, 3);
+				Actor_Says(kActorSebastian, 400, 12);
+				Actor_Says(kActorMcCoy, 7145, 16);
+				Actor_Says(kActorSebastian, 410, 13);
+				Actor_Says(kActorMcCoy, 7150, 17);
+				Actor_Says(kActorSebastian, 420, 13);
+				Actor_Says(kActorSebastian, 430, 14);
+			}
+			break;
+
+		case 960:
+			Actor_Says(kActorMcCoy, 7090, 17);
+			Actor_Says(kActorSebastian, 440, 14);
+			Actor_Says(kActorSebastian, 450, 13);
+			Actor_Says(kActorMcCoy, 7155, 13);
+			Actor_Says(kActorSebastian, 460, 17);
+			Actor_Says(kActorSebastian, 470, 12);
+			Actor_Says(kActorSebastian, 480, 13);
+			Actor_Says(kActorMcCoy, 7160, 18);
+			Actor_Says(kActorSebastian, 490, 14);
+			Actor_Says(kActorMcCoy, 7165, 14);
+			setMcCoyIsABladeRunner();
+			break;
+
+		case 970:
+			Actor_Says(kActorMcCoy, 7095, 13);
+			Actor_Says(kActorSebastian, 500, 15);
+			Actor_Says(kActorMcCoy, 7170, 17);
+			Actor_Says(kActorSebastian, 510, 12);
+			Actor_Says(kActorMcCoy, 7175, 18);
+			Actor_Says(kActorSebastian, 520, 14);
+			Actor_Says(kActorMcCoy, 7180, 12);
+			Actor_Says(kActorSebastian, 530, 13);
+			Actor_Says(kActorMcCoy, 7185, 12);
+			setMcCoyIsABladeRunner();
+			break;
+
+		case 980:
+			Actor_Says(kActorMcCoy, 7100, 12);
+			Actor_Says(kActorSebastian, 540, 16);
+			Actor_Says(kActorMcCoy, 7195, 18);
+			Actor_Says(kActorSebastian, 720, 12);
+			break;
+
+		case 990:
+			Actor_Says(kActorMcCoy, 7105, 18);
+			setMcCoyIsABladeRunner();
+			break;
+
+		default:
+			break;
+		}
+	} else if (Actor_Query_Friendliness_To_Other(kActorSebastian, kActorMcCoy) >= 45) {
+		Actor_Says(kActorMcCoy, 7115, 13);
+		Actor_Says(kActorSebastian, 280, 14);
+	} else {
+		Actor_Says(kActorMcCoy, 7110, 15);
+		Actor_Says(kActorSebastian, 270, 16);
+	}
+}
+
+void AIScriptSebastian::setMcCoyIsABladeRunner() {
+	Actor_Clue_Acquire(kActorSebastian, kClueMcCoyIsABladeRunner, 1, 0);
+	Actor_Modify_Friendliness_To_Other(kActorSebastian, kActorMcCoy, -5);
+	Actor_Says(kActorSebastian, 560, 15);
+	Actor_Says(kActorMcCoy, 7200, 14);
+	Actor_Says(kActorSebastian, 570, 16);
+	Actor_Says(kActorMcCoy, 7205, 17);
+	Actor_Says(kActorSebastian, 580, 13);
+	Actor_Says_With_Pause(kActorMcCoy, 7210, 1.0f, 16);
+	Actor_Says(kActorSebastian, 590, 12);
+	Actor_Says(kActorMcCoy, 7215, 19);
+	Actor_Says(kActorSebastian, 600, 14);
+	Actor_Says(kActorMcCoy, 7220, 13);
+	Actor_Says_With_Pause(kActorMcCoy, 7225, 0.80f, 14);
+	Actor_Says(kActorSebastian, 610, 15);
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 33ada6a..f3304a9 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -82,6 +82,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
 	_AIScripts[kActorGaff] = new AIScriptGaff(_vm);                       // 53
 	_AIScripts[kActorBryant] = new AIScriptBryant(_vm);                   // 54
 	_AIScripts[kActorTaffy] = new AIScriptTaffy(_vm);                     // 55
+	_AIScripts[kActorSebastian] = new AIScriptSebastian(_vm);             // 56
 	_AIScripts[kActorBlimpGuy] = new AIScriptBlimpGuy(_vm);               // 60
 	_AIScripts[kActorNewscaster] = new AIScriptNewscaster(_vm);           // 61
 	_AIScripts[kActorLeon] = new AIScriptLeon(_vm);                       // 62
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index 9324245..8fcb930 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -318,6 +318,13 @@ END_SCRIPT
 DECLARE_SCRIPT(Taffy)
 END_SCRIPT
 
+DECLARE_SCRIPT(Sebastian)
+	bool _flag;
+
+	void dialogue();
+	void setMcCoyIsABladeRunner();
+END_SCRIPT
+
 DECLARE_SCRIPT(BlimpGuy)
 END_SCRIPT
 


Commit: f85899cf93b33d1ee2a29b75b4b4bd3fbf18b383
    https://github.com/scummvm/scummvm/commit/f85899cf93b33d1ee2a29b75b4b4bd3fbf18b383
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-13T14:30:17+01:00

Commit Message:
BLADERUNNER: Added Rachel actor

Changed paths:
  A engines/bladerunner/script/ai/rachael.cpp
    engines/bladerunner/module.mk
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/ai_script.h


diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index 55c5a59..c69795d 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -88,6 +88,7 @@ MODULE_OBJS = \
 	script/ai/murray.o \
 	script/ai/newscaster.o \
 	script/ai/officer_leary.o \
+	script/ai/rachael.o \
 	script/ai/rajif.o \
 	script/ai/runciter.o \
 	script/ai/sebastian.o \
diff --git a/engines/bladerunner/script/ai/rachael.cpp b/engines/bladerunner/script/ai/rachael.cpp
new file mode 100644
index 0000000..950007e
--- /dev/null
+++ b/engines/bladerunner/script/ai/rachael.cpp
@@ -0,0 +1,439 @@
+/* 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 {
+
+AIScriptRachael::AIScriptRachael(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+	_flag = true;
+}
+
+void AIScriptRachael::Initialize() {
+	_animationFrame = 0;
+	_animationState = 0;
+	_animationStateNext = 0;
+	_animationNext = 0;
+
+	_flag = true;
+
+	Actor_Set_Goal_Number(kActorRachael, 0);
+}
+
+bool AIScriptRachael::Update() {
+	return false;
+}
+
+void AIScriptRachael::TimerExpired(int timer) {
+	//return false;
+}
+
+void AIScriptRachael::CompletedMovementTrack() {
+	//return false;
+}
+
+void AIScriptRachael::ReceivedClue(int clueId, int fromActorId) {
+	//return false;
+}
+
+void AIScriptRachael::ClickedByPlayer() {
+	if (Actor_Query_Goal_Number(kActorRachael) == 305) {
+		Actor_Face_Actor(kActorMcCoy, kActorRachael, 1);
+		Actor_Says(kActorMcCoy, 2730, 12);
+		AI_Movement_Track_Pause(57);
+		dialogue_start();
+
+		if (Player_Query_Agenda() == 2 || Player_Query_Agenda() == 3) {
+			dialogue_agenda2();
+		} else if (Player_Query_Agenda()) {
+			if (Actor_Query_Friendliness_To_Other(kActorSteele, kActorMcCoy) > Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy)) {
+				dialogue_agenda2();
+			} else {
+				dialogue_agenda1();
+			}
+		} else {
+			dialogue_agenda1();
+		}
+
+		Actor_Set_Goal_Number(kActorRachael, 306);
+		AI_Movement_Track_Unpause(57);
+	}
+}
+
+void AIScriptRachael::EnteredScene(int sceneId) {
+	// return false;
+}
+
+void AIScriptRachael::OtherAgentEnteredThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptRachael::OtherAgentExitedThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptRachael::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+	// return false;
+}
+
+void AIScriptRachael::ShotAtAndMissed() {
+	// return false;
+}
+
+bool AIScriptRachael::ShotAtAndHit() {
+	return false;
+}
+
+void AIScriptRachael::Retired(int byActorId) {
+	// return false;
+}
+
+int AIScriptRachael::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+	return 0;
+}
+
+bool AIScriptRachael::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+	switch (newGoalNumber) {
+	case 200:
+		AI_Movement_Track_Flush(kActorRachael);
+		AI_Movement_Track_Append(kActorRachael, 379, 0);
+		AI_Movement_Track_Append(kActorRachael, 39, 0);
+		AI_Movement_Track_Repeat(kActorRachael);
+		break;
+
+	case 300:
+		Actor_Put_In_Set(kActorRachael, kSetMA07);
+		Actor_Set_At_XYZ(kActorRachael, -8.09f, -162.8f, 135.33f, 544);
+		break;
+
+	case 305:
+		AI_Movement_Track_Flush(kActorRachael);
+		AI_Movement_Track_Append(kActorRachael, 468, 0);
+		AI_Movement_Track_Append(kActorRachael, 39, 0);
+		AI_Movement_Track_Repeat(kActorRachael);
+		break;
+
+	case 400:
+		Actor_Put_In_Set(kActorRachael, kSetFreeSlotG);
+		Actor_Set_At_Waypoint(kActorRachael, 39, 0);
+		break;
+
+	default:
+		return false;
+	}
+
+	return true;
+}
+
+bool AIScriptRachael::UpdateAnimation(int *animation, int *frame) {
+	switch (_animationState) {
+	case 0:
+		*animation = 823;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(823) - 1) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 1:
+		*animation = 822;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(822) - 1) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 2:
+		if (!_animationFrame && _flag) {
+			*animation = 823;
+			_animationState = 0;
+		} else {
+			*animation = 825;
+			_animationFrame++;
+			if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(825) - 1) {
+				_animationFrame = 0;
+			}
+		}
+		break;
+
+	case 3:
+		*animation = 826;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(826) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	case 4:
+		*animation = 827;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(827) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	case 5:
+		*animation = 828;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(828) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	case 6:
+		*animation = 829;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(829) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	case 7:
+		*animation = 830;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(830) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	case 8:
+		*animation = 831;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(831) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	case 9:
+		*animation = 832;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(832) - 1) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 825;
+		}
+		break;
+
+	default:
+		break;
+	}
+	*frame = _animationFrame;
+
+	return true;
+}
+
+bool AIScriptRachael::ChangeAnimationMode(int mode) {
+	switch (mode) {
+	case 0:
+		if (_animationState >= 2 && _animationState <= 9) {
+			_flag = 1;
+		} else {
+			_animationState = 0;
+			_animationFrame = 0;
+		}
+		break;
+	case 1:
+		_animationState = 1;
+		_animationFrame = 0;
+		break;
+	case 3:
+		_animationState = 2;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 12:
+		_animationState = 3;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 13:
+		_animationState = 4;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 14:
+		_animationState = 5;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 15:
+		_animationState = 6;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 16:
+		_animationState = 7;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 17:
+		_animationState = 8;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	case 18:
+		_animationState = 9;
+		_animationFrame = 0;
+		_flag = 0;
+		break;
+	default:
+		break;
+	}
+
+	return true;
+}
+
+void AIScriptRachael::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+	*animationState     = _animationState;
+	*animationFrame     = _animationFrame;
+	*animationStateNext = _animationStateNext;
+	*animationNext      = _animationNext;
+}
+
+void AIScriptRachael::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+	_animationState     = animationState;
+	_animationFrame     = animationFrame;
+	_animationStateNext = animationStateNext;
+	_animationNext      = animationNext;
+}
+
+bool AIScriptRachael::ReachedMovementTrackWaypoint(int waypointId) {
+	return true;
+}
+
+void AIScriptRachael::FledCombat() {
+	// return false;
+}
+
+void AIScriptRachael::dialogue_start() {
+	Actor_Face_Actor(kActorRachael, kActorMcCoy, 1);
+	Loop_Actor_Walk_To_Actor(kActorRachael, kActorMcCoy, 84, 0, 0);
+	Actor_Says(kActorRachael, 0, 15);
+	Actor_Says(kActorMcCoy, 2740, 13);
+	Actor_Says(kActorRachael, 10, 14);
+	Actor_Says(kActorMcCoy, 2745, 13);
+	Actor_Says(kActorRachael, 20, 12);
+	Actor_Says_With_Pause(kActorMcCoy, 2750, 1.5f, 3);
+	Actor_Says(kActorRachael, 30, 13);
+	Actor_Says(kActorRachael, 40, 15);
+}
+
+void AIScriptRachael::dialogue_agenda1() {
+	Actor_Says(kActorMcCoy, 2795, 13);
+	Actor_Says(kActorRachael, 140, 15);
+	Actor_Says(kActorMcCoy, 2800, 12);
+	Actor_Says(kActorRachael, 150, 16);
+	Actor_Says(kActorMcCoy, 2805, 18);
+	Actor_Says(kActorRachael, 160, 14);
+	Actor_Says(kActorRachael, 170, 13);
+	Actor_Says(kActorMcCoy, 2810, 14);
+	Actor_Says(kActorRachael, 180, 13);
+	Actor_Says(kActorMcCoy, 2815, 12);
+	Actor_Says(kActorMcCoy, 2820, 13);
+	Actor_Says(kActorRachael, 190, 15);
+	Actor_Says(kActorMcCoy, 2825, 12);
+	Actor_Says(kActorRachael, 200, 15);
+	Actor_Says(kActorMcCoy, 2830, 14);
+	Actor_Says(kActorRachael, 210, 15);
+	Actor_Says(kActorRachael, 220, 16);
+	Actor_Says(kActorMcCoy, 2835, 13);
+	Actor_Says(kActorRachael, 230, 14);
+	Actor_Says(kActorMcCoy, 2840, 12);
+	Actor_Says(kActorRachael, 240, 13);
+	Actor_Says(kActorRachael, 250, 15);
+	Actor_Says(kActorRachael, 260, 16);
+	Actor_Says(kActorMcCoy, 2845, 13);
+	Actor_Says(kActorRachael, 270, 13);
+	Actor_Says(kActorRachael, 280, 14);
+	Actor_Says(kActorMcCoy, 2850, 13);
+	Actor_Says(kActorRachael, 290, 14);
+	Actor_Says_With_Pause(kActorRachael, 300, 1.0f, 3);
+	Actor_Says(kActorMcCoy, 2860, 14);
+}
+
+void AIScriptRachael::dialogue_agenda2() {
+	Actor_Says(kActorRachael, 50, 15);
+	Actor_Says(kActorMcCoy, 2765, 16);
+	Actor_Says(kActorMcCoy, 2770, 17);
+	Actor_Says(kActorRachael, 60, 14);
+	Actor_Says(kActorMcCoy, 2775, 16);
+	Actor_Says(kActorRachael, 70, 13);
+	Actor_Says(kActorRachael, 80, 14);
+	Actor_Says(kActorRachael, 90, 15);
+	Actor_Says(kActorMcCoy, 2780, 17);
+	Actor_Says(kActorRachael, 100, 16);
+	Actor_Says(kActorRachael, 110, 15);
+	Actor_Says(kActorMcCoy, 2785, 17);
+	Actor_Says(kActorRachael, 120, 13);
+	Actor_Says(kActorMcCoy, 2790, 16);
+	Actor_Says(kActorRachael, 130, 14);
+	Actor_Says_With_Pause(kActorRachael, 300, 1.0f, 3);
+	Actor_Says(0, 2860, 14);
+}
+
+// Not used in the game
+void AIScriptRachael::dialogue_agenda3() {
+	Actor_Says(kActorMcCoy, 2865, 3);
+	Actor_Says(kActorRachael, 320, 3);
+	Actor_Says(kActorRachael, 330, 3);
+	Actor_Says(kActorMcCoy, 2870, 3);
+	Actor_Says(kActorRachael, 340, 3);
+	Actor_Says(kActorMcCoy, 2875, 3);
+	Actor_Says(kActorRachael, 350, 3);
+	Actor_Says(kActorMcCoy, 2880, 3);
+	Actor_Says(kActorMcCoy, 2885, 3);
+	Actor_Says(kActorRachael, 360, 3);
+	Actor_Says(kActorRachael, 370, 3);
+	Actor_Says(kActorMcCoy, 2890, 3);
+	Actor_Says(kActorRachael, 380, 3);
+	Actor_Says(kActorRachael, 390, 3);
+	Actor_Says(kActorRachael, 400, 3);
+	Actor_Says(kActorMcCoy, 2895, 3);
+	Actor_Says(kActorRachael, 410, 3);
+	Actor_Says(kActorMcCoy, 2900, 3);
+	Actor_Says(kActorRachael, 420, 3);
+	Actor_Says(kActorMcCoy, 2905, 3);
+	Actor_Says(kActorRachael, 430, 3);
+	Actor_Says(kActorRachael, 440, 3);
+	Actor_Says(kActorMcCoy, 2910, 3);
+	Actor_Says(kActorMcCoy, 2920, 3);
+	Actor_Says(kActorRachael, 450, 3);
+	Actor_Says(kActorMcCoy, 2925, 3);
+	Actor_Says(kActorMcCoy, 2930, 3);
+	Actor_Says(kActorRachael, 460, 3);
+	Actor_Says(kActorMcCoy, 2935, 3);
+	Actor_Says(kActorRachael, 470, 3);
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index f3304a9..303d180 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -83,6 +83,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
 	_AIScripts[kActorBryant] = new AIScriptBryant(_vm);                   // 54
 	_AIScripts[kActorTaffy] = new AIScriptTaffy(_vm);                     // 55
 	_AIScripts[kActorSebastian] = new AIScriptSebastian(_vm);             // 56
+	_AIScripts[kActorRachael] = new AIScriptRachael(_vm);                 // 57
 	_AIScripts[kActorBlimpGuy] = new AIScriptBlimpGuy(_vm);               // 60
 	_AIScripts[kActorNewscaster] = new AIScriptNewscaster(_vm);           // 61
 	_AIScripts[kActorLeon] = new AIScriptLeon(_vm);                       // 62
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index 8fcb930..5117de2 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -325,6 +325,15 @@ DECLARE_SCRIPT(Sebastian)
 	void setMcCoyIsABladeRunner();
 END_SCRIPT
 
+DECLARE_SCRIPT(Rachael)
+	bool _flag;
+
+	void dialogue_start();
+	void dialogue_agenda1();
+	void dialogue_agenda2();
+	void dialogue_agenda3();
+END_SCRIPT
+
 DECLARE_SCRIPT(BlimpGuy)
 END_SCRIPT
 


Commit: 11e5e5d378819ca2d5e000b7daf383492699ffa0
    https://github.com/scummvm/scummvm/commit/11e5e5d378819ca2d5e000b7daf383492699ffa0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-13T15:08:44+01:00

Commit Message:
BLADERUNNER: Added Isabella actor

Changed paths:
  A engines/bladerunner/script/ai/isabella.cpp
    engines/bladerunner/module.mk
    engines/bladerunner/script/ai/chew.cpp
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/ai_script.h


diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index c69795d..0475505 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -75,6 +75,7 @@ MODULE_OBJS = \
 	script/ai/hysteria_patron2.o \
 	script/ai/hysteria_patron3.o \
 	script/ai/insect_dealer.o \
+	script/ai/isabella.o \
 	script/ai/klein.o \
 	script/ai/lance.o \
 	script/ai/leon.o \
diff --git a/engines/bladerunner/script/ai/chew.cpp b/engines/bladerunner/script/ai/chew.cpp
index b732de2..6540392 100644
--- a/engines/bladerunner/script/ai/chew.cpp
+++ b/engines/bladerunner/script/ai/chew.cpp
@@ -164,7 +164,7 @@ bool AIScriptChew::UpdateAnimation(int *animation, int *frame) {
 		if (_var2 == 2) {
 			*animation = 779;
 		}
-		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(*animation)) {
 			_animationFrame += 2;
 			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
 				_animationFrame = 0;
diff --git a/engines/bladerunner/script/ai/isabella.cpp b/engines/bladerunner/script/ai/isabella.cpp
new file mode 100644
index 0000000..307806f
--- /dev/null
+++ b/engines/bladerunner/script/ai/isabella.cpp
@@ -0,0 +1,466 @@
+/* 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 {
+
+AIScriptIsabella::AIScriptIsabella(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+	_var1 = 0;
+	_var2 = 0;
+	_var3 = 0;
+	_var4 = 1;
+}
+
+void AIScriptIsabella::Initialize() {
+	_animationFrame = 0;
+	_animationState = 0;
+	_animationStateNext = 0;
+	_animationNext = 0;
+
+	_var1 = 0;
+	_var2 = 0;
+	_var3 = 0;
+	_var4 = 1;
+}
+
+bool AIScriptIsabella::Update() {
+	return false;
+}
+
+void AIScriptIsabella::TimerExpired(int timer) {
+	//return false;
+}
+
+void AIScriptIsabella::CompletedMovementTrack() {
+	//return false;
+}
+
+void AIScriptIsabella::ReceivedClue(int clueId, int fromActorId) {
+	//return false;
+}
+
+void AIScriptIsabella::ClickedByPlayer() {
+	//return false;
+}
+
+void AIScriptIsabella::EnteredScene(int sceneId) {
+	// return false;
+}
+
+void AIScriptIsabella::OtherAgentEnteredThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptIsabella::OtherAgentExitedThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptIsabella::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+	// return false;
+}
+
+void AIScriptIsabella::ShotAtAndMissed() {
+	// return false;
+}
+
+bool AIScriptIsabella::ShotAtAndHit() {
+	return false;
+}
+
+void AIScriptIsabella::Retired(int byActorId) {
+	// return false;
+}
+
+int AIScriptIsabella::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+	return 0;
+}
+
+bool AIScriptIsabella::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+	return false;
+}
+
+bool AIScriptIsabella::UpdateAnimation(int *animation, int *frame) {
+	bool flag;
+
+	switch (_animationState) {
+	case 0:
+		if (_var3 == 1) {
+			*animation = 839;
+			_animationFrame++;
+			if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(839) - 1) {
+				_animationFrame = 0;
+			}
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(839) - 1;
+			}
+			if (!_animationFrame) {
+				_var3 = 0;
+				_var4 = 2 * Random_Query(0, 1) - 1;
+			}
+		} else if (_var3 == 0) {
+			*animation = 838;
+			if (_var2) {
+				_var2--;
+				if (_var2 == 0) {
+					_var4 = 2 * Random_Query(0, 1) - 1;
+				}
+			} else {
+				_animationFrame += _var4;
+				if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(838) - 1) {
+					_animationFrame = 0;
+				}
+				if (_animationFrame < 0) {
+					_animationFrame = Slice_Animation_Query_Number_Of_Frames(838) - 1;
+				}
+				if (_animationFrame == 1) {
+					if (!Random_Query(0, 1)) {
+						_var2 = Random_Query(4, 8);
+					}
+				}
+				if (_animationFrame == 11) {
+					if (!Random_Query(0, 1)) {
+						_var2 = Random_Query(4, 8);
+					}
+				}
+				if (_animationFrame == 16) {
+					if (!Random_Query(0, 1)) {
+						_var2 = Random_Query(4, 8);
+					}
+				}
+				if (!_animationFrame) {
+					if (!Random_Query(0, 2)) {
+						_var3 = 1;
+					}
+				}
+			}
+		}
+		break;
+
+	case 1:
+		*animation = 840;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(840) - 1) {
+			flag = true;
+			_animationFrame = 0;
+		} else {
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(840) - 1;
+				flag = true;
+			} else {
+				flag = false;
+			}
+		}
+		if (flag) {
+			*animation = 838;
+			_animationState = 0;
+		}
+		break;
+
+	case 2:
+		*animation = 841;
+		if (_animationFrame < 2 && _var1) {
+			_animationFrame = 0;
+			_animationState = 0;
+		} else {
+			_animationFrame++;
+			if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(841) - 1) {
+				_animationFrame = 0;
+			} else {
+				if (_animationFrame < 0) {
+					_animationFrame = Slice_Animation_Query_Number_Of_Frames(841) - 1;
+				}
+			}
+			if (!_animationFrame) {
+				_animationState = Random_Query(2, 3);
+			}
+		}
+		break;
+
+	case 3:
+		*animation = 842;
+		if (_animationFrame < 2 && _var1) {
+			_animationFrame = 0;
+			_animationState = 0;
+		} else {
+			_animationFrame++;
+			if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(842) - 1) {
+				_animationFrame = 0;
+			} else {
+				if (_animationFrame < 0) {
+					_animationFrame = Slice_Animation_Query_Number_Of_Frames(842) - 1;
+				}
+			}
+			if (!_animationFrame) {
+				*animation = 841;
+				_animationState = 2;
+			}
+		}
+		break;
+
+	case 4:
+		*animation = 843;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(843) - 1) {
+			flag = true;
+			_animationFrame = 0;
+		} else {
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(843) - 1;
+				flag = true;
+			} else {
+				flag = false;
+			}
+		}
+		if (flag) {
+			*animation = 841;
+			_animationState = 2;
+		}
+		break;
+
+	case 5:
+		*animation = 844;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(844) - 1) {
+			flag = true;
+			_animationFrame = 0;
+		} else {
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(844) - 1;
+				flag = true;
+			} else {
+				flag = false;
+			}
+		}
+		if (flag) {
+			*animation = 841;
+			_animationState = 2;
+		}
+		break;
+
+	case 6:
+		*animation = 845;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(845) - 1) {
+			flag = true;
+			_animationFrame = 0;
+		} else {
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(845) - 1;
+				flag = true;
+			} else {
+				flag = false;
+			}
+		}
+		if (flag) {
+			*animation = 841;
+			_animationState = 2;
+		}
+		break;
+
+	case 7:
+		*animation = 845;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(845) - 1) {
+			flag = true;
+			_animationFrame = 0;
+		} else {
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(845) - 1;
+				flag = true;
+			} else {
+				flag = false;
+			}
+		}
+		if (flag) {
+			*animation = 841;
+			_animationState = 2;
+		}
+		break;
+
+	case 8:
+		*animation = 844;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(844) - 1) {
+			flag = true;
+			_animationFrame = 0;
+		} else {
+			if (_animationFrame < 0) {
+				_animationFrame = Slice_Animation_Query_Number_Of_Frames(844) - 1;
+				flag = true;
+			} else {
+				flag = false;
+			}
+		}
+		if (flag) {
+			*animation = 841;
+			_animationState = 2;
+		}
+		break;
+
+	case 9:
+		if (!_var3) {
+			*animation = 838;
+		}
+		if (_var3 == 1) {
+			*animation = 839;
+		}
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(*animation)) {
+			_animationFrame += 2;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+				_animationFrame = 0;
+				*animation = _animationNext;
+				_animationState = _animationStateNext;
+			}
+		} else {
+			_animationFrame -= 2;
+			if (_animationFrame <= 0) {
+				_animationFrame = 0;
+				*animation = _animationNext;
+				_animationState = _animationStateNext;
+			}
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	int frames = Slice_Animation_Query_Number_Of_Frames(*animation);
+
+	if (frames != -1)
+		_animationFrame %= frames;
+	else
+		_animationFrame = 0;
+
+	*frame = _animationFrame;
+
+	return true;
+}
+
+bool AIScriptIsabella::ChangeAnimationMode(int mode) {
+	switch (mode) {
+	case 0:
+		if (_animationState > 8) {
+			_animationState = 0;
+			_animationFrame = 0;
+		} else {
+			_var1 = 1;
+		}
+		break;
+
+	case 3:
+	case 9:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 2;
+			_animationNext = 841;
+			_var1 = 0;
+		}
+		break;
+
+	case 10:
+	case 12:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 3;
+			_animationNext = 842;
+			_var1 = 0;
+		}
+		break;
+
+	case 11:
+	case 14:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 5;
+			_animationNext = 844;
+			_var1 = 0;
+		}
+		break;
+
+	case 13:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 4;
+			_animationNext = 843;
+			_var1 = 0;
+		}
+		break;
+
+	case 15:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 6;
+			_animationNext = 845;
+			_var1 = 0;
+		}
+		break;
+
+	case 16:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 7;
+			_animationNext = 845;
+			_var1 = 0;
+		}
+		break;
+
+	case 17:
+		if (_animationState < 2 || _animationState > 8) {
+			_animationState = 9;
+			_animationStateNext = 8;
+			_animationNext = 844;
+			_var1 = 0;
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	return true;
+}
+
+void AIScriptIsabella::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+	*animationState     = _animationState;
+	*animationFrame     = _animationFrame;
+	*animationStateNext = _animationStateNext;
+	*animationNext      = _animationNext;
+}
+
+void AIScriptIsabella::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+	_animationState     = animationState;
+	_animationFrame     = animationFrame;
+	_animationStateNext = animationStateNext;
+	_animationNext      = animationNext;
+}
+
+bool AIScriptIsabella::ReachedMovementTrackWaypoint(int waypointId) {
+	return true;
+}
+
+void AIScriptIsabella::FledCombat() {
+	// return false;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 303d180..c86f673 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -84,6 +84,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
 	_AIScripts[kActorTaffy] = new AIScriptTaffy(_vm);                     // 55
 	_AIScripts[kActorSebastian] = new AIScriptSebastian(_vm);             // 56
 	_AIScripts[kActorRachael] = new AIScriptRachael(_vm);                 // 57
+	_AIScripts[kActorIsabella] = new AIScriptIsabella(_vm);               // 59
 	_AIScripts[kActorBlimpGuy] = new AIScriptBlimpGuy(_vm);               // 60
 	_AIScripts[kActorNewscaster] = new AIScriptNewscaster(_vm);           // 61
 	_AIScripts[kActorLeon] = new AIScriptLeon(_vm);                       // 62
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index 5117de2..11870cd 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -334,6 +334,13 @@ DECLARE_SCRIPT(Rachael)
 	void dialogue_agenda3();
 END_SCRIPT
 
+DECLARE_SCRIPT(Isabella)
+	int _var1;
+	int _var2;
+	int _var3;
+	int _var4;
+END_SCRIPT
+
 DECLARE_SCRIPT(BlimpGuy)
 END_SCRIPT
 


Commit: 654ef04f82de0e05bee0ab07734f39eef3877069
    https://github.com/scummvm/scummvm/commit/654ef04f82de0e05bee0ab07734f39eef3877069
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-13T18:45:50+01:00

Commit Message:
BLADERUNNER: Added Dektora actor

Changed paths:
  A engines/bladerunner/script/ai/dektora.cpp
    engines/bladerunner/module.mk
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/ai_script.h


diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index 0475505..87d87f7 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -56,6 +56,7 @@ MODULE_OBJS = \
 	script/ai/bryant.o \
 	script/ai/chew.o \
 	script/ai/crazylegs.o \
+	script/ai/dektora.o \
 	script/ai/desk_clerk.o \
 	script/ai/dispatcher.o \
 	script/ai/early_q_bartender.o \
diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp
new file mode 100644
index 0000000..905c3d1
--- /dev/null
+++ b/engines/bladerunner/script/ai/dektora.cpp
@@ -0,0 +1,1106 @@
+/* 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 {
+
+AIScriptDektora::AIScriptDektora(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+	_flag = false;
+	_x = _y = _z = 0.0f;
+}
+
+void AIScriptDektora::Initialize() {
+	_animationFrame = 0;
+	_animationState = 0;
+	_animationStateNext = 0;
+	_animationNext = 0;
+
+	_flag = false;
+	_x = _y = _z = 0.0f;
+
+	Actor_Set_Goal_Number(kActorDektora, 0);
+}
+
+bool AIScriptDektora::Update() {
+	int chapter = Global_Variable_Query(kVariableChapter) - 2;
+
+	if (chapter > 2)
+		return true;
+
+	if (chapter) {
+		if (chapter == 1) {
+			if (Actor_Query_Goal_Number(kActorDektora) < 199) {
+				Actor_Set_Goal_Number(kActorDektora, 199);
+			} else {
+				switch (Actor_Query_Goal_Number(kActorDektora)) {
+				case 269:
+					Actor_Set_Goal_Number(kActorDektora, 270);
+					return 1;
+
+				case 270:
+				case 272:
+				case 274:
+					return 1;
+
+				case 271:
+					if (Actor_Query_Inch_Distance_From_Actor(kActorDektora, kActorMcCoy) <= 48) {
+						Actor_Set_Goal_Number(kActorDektora, 279);
+						return 1;
+					}
+
+					if (comp_distance(kActorMcCoy, _x, _y, _z) > 12.0f) {
+						Actor_Query_XYZ(kActorMcCoy, &_x, &_y, &_z);
+						Async_Actor_Walk_To_XYZ(kActorDektora, _x, _y, _z, 36, 0);
+					}
+					break;
+
+				case 273:
+					Actor_Set_Goal_Number(kActorDektora, 274);
+					return 1;
+
+				case 275:
+					Actor_Set_Goal_Number(kActorDektora, 276);
+					return 1;
+				}
+			}
+		} else if (Actor_Query_Goal_Number(kActorDektora) < 300) {
+			Actor_Set_Goal_Number(kActorDektora, 300);
+		}
+	} else if (Game_Flag_Query(489)) {
+		if (Game_Flag_Query(504) == 1
+				&& !Game_Flag_Query(374)
+				&& Player_Query_Current_Scene()
+				&& Player_Query_Current_Scene() != 1) {
+			if (Game_Flag_Query(726)) {
+				Item_Remove_From_World(106);
+			}
+			Game_Flag_Set(374);
+		}
+	} else {
+		Game_Flag_Set(489);
+		Actor_Put_In_Set(kActorDektora, kSetFreeSlotG);
+		Actor_Set_At_Waypoint(kActorDektora, 39, 0);
+		Actor_Set_Goal_Number(kActorDektora, 100);
+	}
+
+	return true;
+}
+
+void AIScriptDektora::TimerExpired(int timer) {
+	if (timer)
+		return; //false;
+
+	if (Actor_Query_Goal_Number(kActorDektora) == 210) {
+		if (Player_Query_Current_Scene() == 61) {
+			AI_Countdown_Timer_Reset(kActorDektora, 0);
+			AI_Countdown_Timer_Start(kActorDektora, 0, 10);
+		} else {
+			Actor_Set_Goal_Number(kActorDektora, 211);
+			AI_Countdown_Timer_Reset(kActorDektora, 0);
+		}
+		return; //true;
+	}
+
+	if (Actor_Query_Goal_Number(kActorDektora) == 270) {
+		AI_Countdown_Timer_Reset(kActorDektora, 0);
+		Actor_Set_Goal_Number(kActorDektora, 271);
+		return; //true;
+	}
+
+	return; //false;
+}
+
+void AIScriptDektora::CompletedMovementTrack() {
+	switch (Actor_Query_Goal_Number(kActorDektora)) {
+	case 100:
+		if (Game_Flag_Query(47) == 1) {
+			Actor_Set_Goal_Number(kActorDektora, 101);
+		} else {
+			Actor_Set_Goal_Number(kActorDektora, 102);
+		}
+		break;
+
+
+	case 101:
+		if (Random_Query(1, 7) == 1
+				&& Actor_Query_Goal_Number(kActorEarlyQ) != 1
+				&& Actor_Query_Goal_Number(kActorEarlyQ) != 101) {
+			Game_Flag_Set(504);
+			Actor_Set_Goal_Number(kActorDektora, 100);
+		} else {
+			Actor_Set_Goal_Number(kActorDektora, 100);
+		}
+		break;
+
+	case 102:
+		if (Random_Query(1, 5) == 1
+				&& Actor_Query_Goal_Number(kActorEarlyQ) != 1
+				&& Actor_Query_Goal_Number(kActorEarlyQ) != 101) {
+			Game_Flag_Set(504);
+			Actor_Set_Goal_Number(kActorDektora, 100);
+		} else {
+			Actor_Set_Goal_Number(kActorDektora, 100);
+		}
+		break;
+
+	case 260:
+		Actor_Set_Goal_Number(kActorDektora, 290);
+		break;
+
+	case 272:
+		AI_Movement_Track_Flush(kActorDektora);
+		Actor_Face_Heading(kActorDektora, 0, 0);
+		Sound_Play(451, 71, 0, 0, 50);
+
+		_animationState = 35;
+		_animationFrame = 0;
+		break;
+
+	default:
+		return; //false;
+
+	}
+
+	return; //true;
+}
+
+void AIScriptDektora::ReceivedClue(int clueId, int fromActorId) {
+	//return false;
+}
+
+void AIScriptDektora::ClickedByPlayer() {
+	if (Actor_Query_Goal_Number(kActorDektora) == 599) {
+		Actor_Face_Actor(0, kActorDektora, 1);
+		Actor_Says(kActorMcCoy, 8630, 12);
+
+		return; //true;
+	}
+
+	if (Actor_Query_Goal_Number(kActorDektora) < 199) {
+		Actor_Face_Actor(kActorMcCoy, kActorDektora, 1);
+		Actor_Says(kActorMcCoy, 8590, 13);
+	}
+
+	if (Actor_Query_Goal_Number(kActorDektora) == 210) {
+		Game_Flag_Set(622);
+		AI_Movement_Track_Flush(kActorHanoi);
+		Actor_Force_Stop_Walking(kActorMcCoy);
+		Player_Loses_Control();
+		Actor_Set_Goal_Number(kActorHanoi, 220);
+
+		return; //true;
+	}
+
+	return; //false;
+}
+
+void AIScriptDektora::EnteredScene(int sceneId) {
+	// return false;
+}
+
+void AIScriptDektora::OtherAgentEnteredThisScene(int otherActorId) {
+	if (!otherActorId && Actor_Query_Goal_Number(kActorDektora) == 246) {
+		Scene_Exits_Disable();
+		Actor_Change_Animation_Mode(kActorDektora, 23);
+	}
+
+	// return false;
+}
+
+void AIScriptDektora::OtherAgentExitedThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptDektora::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+	// return false;
+}
+
+void AIScriptDektora::ShotAtAndMissed() {
+	checkCombat();
+	// return false;
+}
+
+bool AIScriptDektora::ShotAtAndHit() {
+	if (Actor_Query_Goal_Number(kActorDektora) == 270
+			|| Actor_Query_Goal_Number(kActorDektora) == 271
+			|| Actor_Query_Goal_Number(kActorDektora) == 272) {
+		Actor_Set_Health(kActorDektora, 100, 100);
+
+		if (Actor_Query_Goal_Number(kActorDektora) != 272) {
+			Actor_Set_Goal_Number(kActorDektora, 272);
+		}
+		return true;
+	}
+	if (Actor_Query_Goal_Number(kActorDektora) == 260) {
+		AI_Movement_Track_Flush(kActorDektora);
+		Actor_Set_Health(kActorDektora, 0, 100);
+
+		if (Game_Flag_Query(47)) {
+			Actor_Change_Animation_Mode(kActorDektora, 48);
+			Actor_Start_Speech_Sample(kActorDektora, 980);
+			Delay(2000);
+			Actor_Set_Goal_Number(kActorSteele, 212);
+		} else {
+			Actor_Change_Animation_Mode(kActorDektora, 48);
+			Delay(2000);
+			Actor_Set_Goal_Number(kActorMcCoy, 500);
+		}
+
+		return true;
+	}
+
+	checkCombat();
+
+	return false;
+}
+
+void AIScriptDektora::Retired(int byActorId) {
+	if (!byActorId) {
+		Actor_Modify_Friendliness_To_Other(kActorClovis, 0, -5);
+	}
+
+	if (byActorId == kActorSteele && 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 (Actor_Query_In_Set(kActorDektora, kSetKP07)) {
+		Global_Variable_Decrement(51, 1);
+		Actor_Set_Goal_Number(kActorDektora, 599);
+
+		if (!Global_Variable_Query(51)) {
+			Player_Loses_Control();
+			Delay(2000);
+			Player_Set_Combat_Mode(0);
+			Loop_Actor_Walk_To_XYZ(0, -12.0, -41.580002, 72.0, 0, 1, 0, 0);
+			Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
+			Ambient_Sounds_Remove_All_Looping_Sounds(1);
+			Game_Flag_Set(579);
+			Game_Flag_Reset(653);
+			Set_Enter(kSetKP05_KP06, kSetKP03);
+
+			return; //true;
+		}
+	}
+
+	if (Actor_Query_Goal_Number(kActorDektora) != 274) {
+		Actor_Set_Goal_Number(kActorDektora, 599);
+	}
+	return; //false;
+
+	// return false;
+}
+
+int AIScriptDektora::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+	return 0;
+}
+
+bool AIScriptDektora::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+	switch (newGoalNumber) {
+	case 199:
+		AI_Movement_Track_Flush(kActorDektora);
+		Actor_Set_Goal_Number(kActorDektora, 200);
+		break;
+
+	case 200:
+		Actor_Put_In_Set(kActorDektora, kSetNR07);
+		Actor_Set_At_XYZ(kActorDektora, -136.0f, -75.0f, 14.0f, 300);
+		Actor_Change_Animation_Mode(kActorDektora, 53);
+		break;
+
+	case 210:
+		AI_Movement_Track_Flush(kActorDektora);
+		Actor_Put_In_Set(kActorDektora, kSetNR05_NR08);
+		Actor_Set_At_XYZ(kActorDektora, -923.93f, 127.85f, 413.46f, 30);
+		AI_Countdown_Timer_Reset(kActorDektora, 0);
+		AI_Countdown_Timer_Start(kActorDektora, 0, 45);
+		break;
+
+	case 211:
+		if (Player_Query_Current_Scene() == 61) {
+			Game_Flag_Set(651);
+		} else {
+			Game_Flag_Set(636);
+			Actor_Put_In_Set(kActorDektora, kSetFreeSlotA);
+			Actor_Set_At_Waypoint(kActorDektora, 33, 0);
+			Actor_Change_Animation_Mode(kActorDektora, 0);
+			Actor_Set_Goal_Number(kActorDektora, 200);
+		}
+		if (Player_Query_Current_Scene() == 61) {
+			Actor_Set_Goal_Number(kActorHanoi, 235);
+		} else {
+			Game_Flag_Reset(651);
+		}
+		break;
+
+	case 245:
+		Actor_Put_In_Set(kActorDektora, kSetNR05_NR08);
+		Actor_Set_At_XYZ(kActorDektora, -1558.41f, 0.32f, 319.48f, 264);
+		break;
+
+	case 246:
+		Actor_Put_In_Set(kActorDektora, kSetNR10);
+		Actor_Set_At_XYZ(kActorDektora, 19.22f, 2.84f, -122.43f, 768);
+		break;
+
+	case 247:
+		Actor_Set_At_XYZ(kActorDektora, -99.0f, 2.88f, -202.0f, 911);
+		Actor_Set_Invisible(kActorDektora, 0);
+		Actor_Change_Animation_Mode(kActorDektora, 70);
+		Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
+		break;
+
+	case 250:
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Countdown_Timer_Reset(kActorDektora, 0);
+		AI_Countdown_Timer_Reset(kActorDektora, 1);
+		AI_Countdown_Timer_Reset(kActorDektora, 2);
+		Actor_Put_In_Set(kActorDektora, kSetNR11);
+		Actor_Set_At_XYZ(kActorDektora, -184.0f, 0.33f, -268.0f, 256);
+		break;
+
+	case 260:
+		Actor_Set_Targetable(kActorDektora, 1);
+		Actor_Force_Stop_Walking(kActorDektora);
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Movement_Track_Append(kActorDektora, 462, 0);
+		AI_Movement_Track_Repeat(kActorDektora);
+		break;
+
+	case 269:
+	case 271:
+	case 599:
+		break; // return true
+
+	case 270:
+		Game_Flag_Set(633);
+		Actor_Set_Targetable(kActorDektora, 1);
+		Loop_Actor_Walk_To_XYZ(kActorDektora, -135.0f, 0.33f, -267.0f, 0, 0, 0, 0);
+		Actor_Face_Actor(kActorMcCoy, kActorDektora, 1);
+		if (Actor_Query_Goal_Number(kActorSteele) == 216) {
+			Actor_Face_Actor(kActorSteele, kActorDektora, 1);
+			Actor_Change_Animation_Mode(kActorSteele, 6);
+			Delay(250);
+			Sound_Play(3, 100, 0, 0, 50);
+			Actor_Set_Goal_Number(kActorDektora, 272);
+		} else {
+			Actor_Set_Goal_Number(kActorDektora, 271);
+		}
+		break;
+
+	case 272:
+		Actor_Force_Stop_Walking(kActorDektora);
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Movement_Track_Append(kActorDektora, 456, 0);
+		AI_Movement_Track_Repeat(kActorDektora);
+		break;
+
+	case 274:
+		Player_Loses_Control();
+		Scene_Exits_Enable();
+		Game_Flag_Set(632);
+		Actor_Put_In_Set(kActorDektora, kSetNR01);
+		Actor_Set_At_XYZ(kActorDektora, -177.0f, 23.88f, -373.0f, 300);
+		_animationState = 36;
+		_animationFrame = 0;
+		Set_Enter(kSetNR01, kSetNR01);
+		break;
+
+	case 279:
+		Actor_Force_Stop_Walking(kActorDektora);
+		Actor_Put_In_Set(kActorDektora, kSetNR10);
+		Actor_Set_At_XYZ(kActorDektora, 14.0f, 2.84f, -300.0f, 926);
+		Actor_Set_Goal_Number(kActorMcCoy, 231);
+		_animationState = 36;
+		_animationFrame = 0;
+		break;
+
+	case 290:
+		Game_Flag_Set(591);
+		break;
+
+	case 299:
+		Actor_Put_In_Set(kActorDektora, kSetFreeSlotI);
+		Actor_Set_At_Waypoint(kActorDektora, 41, 0);
+		Actor_Set_Goal_Number(kActorDektora, 599);
+		break;
+
+	case 300:
+		AI_Movement_Track_Flush(kActorDektora);
+		Actor_Put_In_Set(kActorDektora, kSetFreeSlotA);
+		Actor_Set_At_Waypoint(kActorDektora, 33, 0);
+		break;
+
+	case 100:
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Movement_Track_Append(kActorDektora, 39, 10);
+		AI_Movement_Track_Repeat(kActorDektora);
+		break;
+
+	case 101:
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Movement_Track_Append_With_Facing(kActorDektora, 287, 15, 278);
+
+		if (Game_Flag_Query(40) == 1) {
+			AI_Movement_Track_Append(kActorDektora, 33, 240);
+		} else if (Game_Flag_Query(41) == 1) {
+			AI_Movement_Track_Append(kActorDektora, 33, 120);
+		} else {
+			AI_Movement_Track_Append(kActorDektora, 33, 90);
+		}
+
+		AI_Movement_Track_Append_With_Facing(kActorDektora, 288, 35, 528);
+
+		if (Random_Query(1, 2) == 1 && Game_Flag_Query(504)) {
+			AI_Movement_Track_Append(kActorDektora, 289, 0);
+			AI_Movement_Track_Append_With_Facing(kActorDektora, 290, 2, 979);
+			AI_Movement_Track_Append(kActorDektora, 289, 0);
+			AI_Movement_Track_Append(kActorDektora, 39, 120);
+		} else {
+			AI_Movement_Track_Append(kActorDektora, 39, 180);
+		}
+
+		AI_Movement_Track_Append(kActorDektora, 282, 0);
+		AI_Movement_Track_Append(kActorDektora, 283, 0);
+		AI_Movement_Track_Append(kActorDektora, 284, 0);
+		AI_Movement_Track_Append(kActorDektora, 285, 0);
+		AI_Movement_Track_Append_With_Facing(kActorDektora, 286, 30, 329);
+		AI_Movement_Track_Repeat(kActorDektora);
+		break;
+
+	case 102:
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Movement_Track_Append_With_Facing(kActorDektora, 287, 15, 278);
+		AI_Movement_Track_Append(kActorDektora, 40, 90);
+
+		if (Game_Flag_Query(40) == 1 && Game_Flag_Query(46) == 1) {
+			AI_Movement_Track_Append(kActorDektora, 33, 180);
+		} else {
+			AI_Movement_Track_Append(kActorDektora, 33, 160);
+		}
+
+		AI_Movement_Track_Append_With_Facing(kActorDektora, 288, 20, 528);
+
+		if (Random_Query(1, 2) == 1) {
+			AI_Movement_Track_Append(kActorDektora, 289, 0);
+			AI_Movement_Track_Append_With_Facing(kActorDektora, 290, 3, 979);
+			AI_Movement_Track_Append(kActorDektora, 289, 0);
+			AI_Movement_Track_Append(kActorDektora, 39, 120);
+		} else {
+			AI_Movement_Track_Append(kActorDektora, 39, 180);
+		}
+
+		AI_Movement_Track_Append(kActorDektora, 282, 0);
+		AI_Movement_Track_Append(kActorDektora, 283, 0);
+		AI_Movement_Track_Append(kActorDektora, 284, 0);
+		AI_Movement_Track_Append(kActorDektora, 285, 0);
+		AI_Movement_Track_Append_With_Facing(kActorDektora, 286, 35, 329);
+		AI_Movement_Track_Repeat(kActorDektora);
+		break;
+
+	case 103:
+		AI_Movement_Track_Flush(kActorDektora);
+		AI_Movement_Track_Append(kActorDektora, 39, 240);
+		AI_Movement_Track_Repeat(kActorDektora);
+		break;
+
+	default:
+		return false;
+
+	}
+
+	return true;
+}
+
+bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
+	switch (_animationState) {
+	case 0:
+		*animation = 156;
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(156) - 1) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 1:
+		*animation = 19;
+		_animationFrame = 0;
+		break;
+
+	case 2:
+		*animation = 158;
+		if (!_animationFrame && _flag) {
+			*animation = 156;
+			_animationState = 0;
+		} else {
+			_animationFrame++;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(158)) {
+				_animationFrame = 0;
+			}
+		}
+		break;
+
+	case 3:
+		*animation = 159;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(159)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 158;
+		}
+		break;
+
+	case 4:
+		*animation = 160;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(160)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 158;
+		}
+		break;
+
+	case 5:
+		*animation = 161;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(161)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 158;
+		}
+		break;
+
+	case 6:
+		*animation = 161;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(161)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 158;
+		}
+		break;
+
+	case 7:
+		*animation = 162;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(162)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 158;
+		}
+		break;
+
+	case 8:
+		*animation = 162;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(162)) {
+			_animationFrame = 0;
+			_animationState = 2;
+			*animation = 158;
+		}
+		break;
+
+	case 9:
+		*animation = 134;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(134)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 10:
+		*animation = 139;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(139)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+		}
+		break;
+
+	case 11:
+		*animation = 140;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(140)) {
+			*animation = 156;
+			_animationFrame = 0;
+			_animationState = 0;
+		}
+		break;
+
+	case 12:
+		*animation = 135;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(135)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+			Actor_Change_Animation_Mode(kActorDektora, 4);
+		}
+		break;
+
+	case 13:
+		*animation = 136;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(136)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+			Actor_Change_Animation_Mode(kActorDektora, 4);
+		}
+		break;
+
+	case 14:
+		*animation = 137;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(137)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+			Actor_Change_Animation_Mode(kActorDektora, 4);
+		}
+		break;
+
+	case 15:
+		*animation = 138;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(138)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+			Actor_Change_Animation_Mode(kActorDektora, 4);
+		}
+		break;
+
+	case 16:
+		*animation = 141;
+		_animationFrame++;
+		if (_animationFrame == 2) {
+			int speech;
+
+			if (Random_Query(1, 2) == 1) {
+				speech = 9010;
+			} else {
+				speech = 9015;
+			}
+			Sound_Play_Speech_Line(kActorDektora, speech, 75, 0, 99);
+		}
+		if (_animationFrame == 5) {
+			Actor_Combat_AI_Hit_Attempt(3);
+		}
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(141)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+			Actor_Change_Animation_Mode(kActorDektora, 4);
+		}
+		break;
+
+	case 17:
+		*animation = 142;
+		_animationFrame++;
+		if (_animationFrame == 6 && Actor_Query_Goal_Number(kActorDektora) == 247) {
+			Actor_Change_Animation_Mode(0, 48);
+		}
+		if (_animationFrame == 3) {
+			int speech;
+
+			if (Random_Query(1, 2) == 1) {
+				speech = 9010;
+			} else {
+				speech = 9015;
+			}
+			Sound_Play_Speech_Line(3, speech, 75, 0, 99);
+		}
+		if (_animationFrame == 6) {
+			Actor_Combat_AI_Hit_Attempt(3);
+		}
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(142)) {
+			_animationFrame = 0;
+			_animationState = 9;
+			*animation = 134;
+			Actor_Change_Animation_Mode(kActorDektora, 4);
+		}
+		break;
+
+	case 18:
+		*animation = 147;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(147)) {
+			*animation = 156;
+			_animationFrame = 0;
+			_animationState = 0;
+			Actor_Change_Animation_Mode(kActorDektora, 0);
+		}
+		break;
+
+	case 19:
+		*animation = 148;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(148)) {
+			*animation = 156;
+			_animationFrame = 0;
+			_animationState = 0;
+			Actor_Change_Animation_Mode(kActorDektora, 0);
+		}
+		break;
+
+	case 20:
+		*animation = 149;
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(149) - 1) {
+			_animationFrame++;
+		}
+		break;
+
+	case 21:
+		*animation = 143;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(143)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 22:
+		*animation = 144;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(144)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 23:
+		*animation = 145;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(145)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 24:
+		*animation = 146;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(146)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 25:
+		*animation = 150;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(150)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 26:
+		*animation = 151;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(151)) {
+			_animationFrame = 0;
+			_animationState = 31;
+			*animation = 155;
+		}
+		break;
+
+	case 27:
+		*animation = 152;
+		if (!_animationFrame && _flag) {
+			*animation = 150;
+			_animationState = 25;
+		} else {
+			_animationFrame++;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(152)) {
+				_animationFrame = 0;
+			}
+		}
+		break;
+
+	case 28:
+		*animation = 153;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(153)) {
+			_animationFrame = 0;
+			_animationState = 27;
+			*animation = 152;
+		}
+		break;
+
+	case 29:
+		*animation = 154;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(154)) {
+			_animationFrame = 0;
+			_animationState = 31;
+			*animation = 155;
+		}
+		break;
+
+	case 30:
+		*animation = 154;
+		_animationFrame--;
+		if (_animationFrame == 0) {
+			_animationFrame = 0;
+			_animationState = 25;
+			*animation = 150;
+		}
+		break;
+
+	case 31:
+		*animation = 155;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(155)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 32:
+		*animation = 163;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(163)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 33:
+		*animation = 166;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(166)) {
+			_animationFrame = 0;
+		}
+		break;
+
+	case 34:
+		*animation = 164;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(164)) {
+			_animationFrame = 0;
+			_animationState = 32;
+			*animation = 163;
+		}
+		break;
+
+	case 35:
+		*animation = 165;
+		_animationFrame++;
+		if (_animationFrame == 2) {
+			Game_Flag_Set(659);
+		}
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+			_animationFrame = 0;
+			_animationState = 36;
+			*animation = 167;
+			Actor_Set_Goal_Number(kActorDektora, 273);
+		}
+		break;
+
+	case 36:
+		*animation = 167;
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(167) - 1) {
+			_animationFrame++;
+		}
+		if (_animationFrame == 11) {
+			Ambient_Sounds_Play_Sound(206, 80, -20, -20, 20);
+		}
+		break;
+
+	case 37:
+		*animation = 168;
+		if (_animationFrame == 1) {
+			switch (Random_Query(0, 2)) {
+			case 0:
+				Sound_Play(567, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 1:
+				Sound_Play(568, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 2:
+				Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			default:
+				break;
+			}
+		}
+		_animationFrame++;
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(168) - 1) {
+			_animationFrame = 0;
+			_animationState = 38;
+			*animation = 169;
+		}
+		break;
+
+	case 38:
+		*animation = 169;
+		_animationFrame++;
+		if (_animationFrame == 1) {
+			switch (Random_Query(0, 2)) {
+			case 0:
+				Sound_Play(567, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 1:
+				Sound_Play(568, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 2:
+				Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			default:
+				break;
+			}
+		}
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+			_animationFrame = 0;
+			_animationState = 39;
+			*animation = 170;
+		}
+		break;
+
+	case 39:
+		*animation = 170;
+		_animationFrame++;
+		if (_animationFrame == 1) {
+			switch (Random_Query(0, 2)) {
+			case 0:
+				Sound_Play(567, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 1:
+				Sound_Play(568, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 2:
+				Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			default:
+				break;
+			}
+		}
+		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+			_animationFrame = 0;
+			_animationState = 40;
+			*animation = 171;
+		}
+		break;
+
+	case 40:
+		*animation = 171;
+		if (_animationFrame == 1) {
+			switch (Random_Query(0, 2)) {
+			case 0:
+				Sound_Play(567, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 1:
+				Sound_Play(568, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			case 2:
+				Sound_Play(569, (100 / Random_Query(5, 9)), 0, 0, 50);
+				break;
+
+			default:
+				break;
+			}
+		}
+		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(171) - 1) {
+			_animationFrame++;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(171) - 1) {
+				Actor_Set_Goal_Number(kActorDektora, 211);
+			}
+		}
+		break;
+
+	case 41:
+		*animation = 157;
+		_animationFrame++;
+		if (_animationFrame == 8 && Actor_Query_In_Set(kActorDektora, kSetNR10)) {
+			Scene_Loop_Start_Special(2, 4, 1);
+		}
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(157)) {
+			*animation = 156;
+			_animationFrame = 0;
+			_animationState = 0;
+			Actor_Change_Animation_Mode(kActorDektora, 0);
+		}
+		break;
+
+	default:
+		break;
+	}
+	*frame = _animationFrame;
+
+	return true;
+}
+
+bool AIScriptDektora::ChangeAnimationMode(int mode) {
+	return true;
+}
+
+void AIScriptDektora::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+	*animationState     = _animationState;
+	*animationFrame     = _animationFrame;
+	*animationStateNext = _animationStateNext;
+	*animationNext      = _animationNext;
+}
+
+void AIScriptDektora::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+	_animationState     = animationState;
+	_animationFrame     = animationFrame;
+	_animationStateNext = animationStateNext;
+	_animationNext      = animationNext;
+}
+
+bool AIScriptDektora::ReachedMovementTrackWaypoint(int waypointId) {
+	return true;
+}
+
+void AIScriptDektora::FledCombat() {
+	// return false;
+}
+
+double AIScriptDektora::comp_distance(int actorId, float x1, float y1, float z1) {
+	float x, y, z;
+
+	Actor_Query_XYZ(actorId, &x, &y, &z);
+
+	return sqrt((z1 - z) * (z1 - z) + (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y));
+}
+
+void AIScriptDektora::checkCombat() {
+	if (Actor_Query_In_Set(kActorDektora, kSetHF01) == 1
+			&& Global_Variable_Query(kVariableChapter) == 5
+			&& Actor_Query_Goal_Number(kActorDektora) != 450) {
+		if (Global_Variable_Query(kVariableAffectionTowards) == 2) {
+			Global_Variable_Set(45, 0);
+		}
+
+		Actor_Set_Goal_Number(kActorDektora, 450);
+		Non_Player_Actor_Combat_Mode_On(kActorDektora, 0, 0, kActorMcCoy, 4, 4, 7, 8, 0, -1, -1, 20, 300, 0);
+	}
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index c86f673..c67e83d 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -42,6 +42,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
 	_AIScripts[kActorMcCoy] = new AIScriptMcCoy(_vm);                     //  0
 	_AIScripts[kActorSteele] = new AIScriptSteele(_vm);                   //  1
 	_AIScripts[kActorGordo] = new AIScriptGordo(_vm);                     //  2
+	_AIScripts[kActorDektora] = new AIScriptDektora(_vm);                 //  3
 	_AIScripts[kActorGuzza] = new AIScriptGuzza(_vm);                     //  4
 	_AIScripts[kActorCrazylegs] = new AIScriptCrazylegs(_vm);             //  9
 	_AIScripts[kActorGrigorian] = new AIScriptGrigorian(_vm);             // 11
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index 11870cd..4479a27 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -144,6 +144,14 @@ DECLARE_SCRIPT(Gordo)
 	void sub_41117C();
 END_SCRIPT
 
+DECLARE_SCRIPT(Dektora)
+	bool _flag;
+	float _x, _y, _z;
+
+	double comp_distance(int actorId, float x1, float y1, float z1);
+	void checkCombat();
+END_SCRIPT
+
 DECLARE_SCRIPT(Guzza)
 	int _frameDelta;
 	int _counter;





More information about the Scummvm-git-logs mailing list