aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPeter Kohaut2018-03-07 23:05:00 +0100
committerPeter Kohaut2018-03-07 23:05:18 +0100
commitfb95268123050c7171d068e8826fee6f3b2cdfe5 (patch)
tree630599f10a1080aad45db9486f9511de9dfd39da /engines
parent471c592691050dea6fc357c8490d2ce800ede671 (diff)
downloadscummvm-rg350-fb95268123050c7171d068e8826fee6f3b2cdfe5.tar.gz
scummvm-rg350-fb95268123050c7171d068e8826fee6f3b2cdfe5.tar.bz2
scummvm-rg350-fb95268123050c7171d068e8826fee6f3b2cdfe5.zip
BLADERUNNER: Added Sergeant Walls actor
Diffstat (limited to 'engines')
-rw-r--r--engines/bladerunner/module.mk1
-rw-r--r--engines/bladerunner/script/ai/sergeant_walls.cpp255
-rw-r--r--engines/bladerunner/script/ai_script.cpp1
-rw-r--r--engines/bladerunner/script/ai_script.h3
4 files changed, 260 insertions, 0 deletions
diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index d7cec16fe9..a0686fa1c2 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -60,6 +60,7 @@ MODULE_OBJS = \
script/ai/mccoy.o \
script/ai/officer_leary.o \
script/ai/runciter.o \
+ script/ai/sergeant_walls.o \
script/ai/zuben.o \
script/scene_script.o \
script/scene/ar01.o \
diff --git a/engines/bladerunner/script/ai/sergeant_walls.cpp b/engines/bladerunner/script/ai/sergeant_walls.cpp
new file mode 100644
index 0000000000..2c2ae2bd5d
--- /dev/null
+++ b/engines/bladerunner/script/ai/sergeant_walls.cpp
@@ -0,0 +1,255 @@
+/* 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 {
+
+AIScriptSergeantWalls::AIScriptSergeantWalls(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+}
+
+void AIScriptSergeantWalls::Initialize() {
+ _animationFrame = 0;
+ _animationState = 0;
+ _animationStateNext = 0;
+ _animationNext = 0;
+}
+
+bool AIScriptSergeantWalls::Update() {
+ if (Game_Flag_Query(206) && Game_Flag_Query(158)) {
+ Game_Flag_Reset(206);
+ }
+ return false;
+}
+
+void AIScriptSergeantWalls::TimerExpired(int timer) {
+ //return false;
+}
+
+void AIScriptSergeantWalls::CompletedMovementTrack() {
+ //return false;
+}
+
+void AIScriptSergeantWalls::ReceivedClue(int clueId, int fromActorId) {
+ //return false;
+}
+
+void AIScriptSergeantWalls::ClickedByPlayer() {
+ //return false;
+}
+
+void AIScriptSergeantWalls::EnteredScene(int sceneId) {
+ // return false;
+}
+
+void AIScriptSergeantWalls::OtherAgentEnteredThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptSergeantWalls::OtherAgentExitedThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptSergeantWalls::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+ // return false;
+}
+
+void AIScriptSergeantWalls::ShotAtAndMissed() {
+ // return false;
+}
+
+bool AIScriptSergeantWalls::ShotAtAndHit() {
+ return false;
+}
+
+void AIScriptSergeantWalls::Retired(int byActorId) {
+ // return false;
+}
+
+int AIScriptSergeantWalls::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ return 0;
+}
+
+bool AIScriptSergeantWalls::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ return false;
+}
+
+bool AIScriptSergeantWalls::UpdateAnimation(int *animation, int *frame) {
+ switch (_animationState) {
+ case 0:
+ _animationFrame++;
+ if (Game_Flag_Query(206) && !Game_Flag_Query(158)) {
+ *animation = 724;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(724)) {
+ _animationFrame = 0;
+ Game_Flag_Set(158);
+ }
+ } else {
+ *animation = 722;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(722)) {
+ _animationFrame = 0;
+ }
+ }
+ break;
+ case 1:
+ *animation = 725;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(725)) {
+ _animationFrame = 0;
+ }
+ break;
+ case 3:
+ *animation = 726;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(726)) {
+ _animationState = 1;
+ _animationFrame = 0;
+ *animation = 725;
+ }
+ break;
+ case 4:
+ *animation = 727;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(727)) {
+ _animationState = 1;
+ _animationFrame = 0;
+ *animation = 725;
+ }
+ break;
+ case 5:
+ *animation = 728;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(728)) {
+ _animationState = 1;
+ _animationFrame = 0;
+ *animation = 725;
+ }
+ break;
+ case 6:
+ *animation = 729;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(729)) {
+ _animationState = 1;
+ _animationFrame = 0;
+ *animation = 725;
+ }
+ break;
+ case 7:
+ *animation = 730;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(730)) {
+ _animationState = 1;
+ _animationFrame = 0;
+ *animation = 725;
+ }
+ break;
+ case 8:
+ *animation = 731;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(731)) {
+ _animationState = 1;
+ _animationFrame = 0;
+ *animation = 725;
+ }
+ break;
+ case 9:
+ *animation = 724;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(724)) {
+ _animationState = 9;
+ _animationFrame = 0;
+ *animation = 724;
+ }
+ break;
+ default:
+ *animation = 399;
+ break;
+ }
+ *frame = _animationFrame;
+ return true;
+}
+
+bool AIScriptSergeantWalls::ChangeAnimationMode(int mode) {
+ switch (mode) {
+ case kAnimationModeIdle:
+ _animationState = 0;
+ _animationFrame = 0;
+ break;
+ case kAnimationModeTalk:
+ _animationState = 1;
+ _animationFrame = 0;
+ break;
+ case 12:
+ _animationState = 3;
+ _animationFrame = 0;
+ break;
+ case 13:
+ _animationState = 4;
+ _animationFrame = 0;
+ break;
+ case 14:
+ _animationState = 5;
+ _animationFrame = 0;
+ break;
+ case 15:
+ _animationState = 6;
+ _animationFrame = 0;
+ break;
+ case 16:
+ _animationState = 7;
+ _animationFrame = 0;
+ break;
+ case 17:
+ _animationState = 8;
+ _animationFrame = 0;
+ break;
+ case 23:
+ _animationState = 9;
+ _animationFrame = 0;
+ break;
+ }
+ return true;
+}
+
+void AIScriptSergeantWalls::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
+}
+
+void AIScriptSergeantWalls::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
+}
+
+bool AIScriptSergeantWalls::ReachedMovementTrackWaypoint(int waypointId) {
+ return true;
+}
+
+void AIScriptSergeantWalls::FledCombat() {
+ // return false;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 786ec7e27e..4fb2b26e0a 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -45,6 +45,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
_AIScripts[kActorOfficerLeary] = new AIScriptOfficerLeary(_vm);
_AIScripts[kActorHowieLee] = new AIScriptHowieLee(_vm);
_AIScripts[kActorKlein] = new AIScriptKlein(_vm);
+ _AIScripts[kActorSergeantWalls] = new AIScriptSergeantWalls(_vm);
_AIScripts[kActorLeon] = new AIScriptLeon(_vm);
_AIScripts[kActorMaggie] = new AIScriptMaggie(_vm);
_AIScripts[kActorGenwalkerA] = new AIScriptGenericWalkerA(_vm);
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index ff91dda8f6..e3dea397c6 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -153,6 +153,9 @@ END_SCRIPT
DECLARE_SCRIPT(Klein)
END_SCRIPT
+DECLARE_SCRIPT(SergeantWalls)
+END_SCRIPT
+
DECLARE_SCRIPT(Leon)
int var_45EDAC;
float var_45EDA0_z;