[Scummvm-git-logs] scummvm master -> b7e8fff99e87092675fc0e48b66a5651782e2fdc
sev-
sev at scummvm.org
Sat Mar 17 11:27:26 CET 2018
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
37c2824382 BLADERUNNER: Added Luther actor
b7e8fff99e BLADERUNNER: Added BulletBob actor
Commit: 37c2824382d74167c04b76ba0b8b780b56d29bae
https://github.com/scummvm/scummvm/commit/37c2824382d74167c04b76ba0b8b780b56d29bae
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-17T11:27:08+01:00
Commit Message:
BLADERUNNER: Added Luther actor
Changed paths:
A engines/bladerunner/script/ai/luther.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 8494dd5..59beb11 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -86,6 +86,7 @@ MODULE_OBJS = \
script/ai/leon.o \
script/ai/lockup_guard.o \
script/ai/lucy.o \
+ script/ai/luther.o \
script/ai/maggie.o \
script/ai/male_announcer.o \
script/ai/marcus.o \
diff --git a/engines/bladerunner/script/ai/luther.cpp b/engines/bladerunner/script/ai/luther.cpp
new file mode 100644
index 0000000..21df880
--- /dev/null
+++ b/engines/bladerunner/script/ai/luther.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 {
+
+AIScriptLuther::AIScriptLuther(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+ _flag = false;
+}
+
+void AIScriptLuther::Initialize() {
+ _animationFrame = 0;
+ _animationState = 0;
+ _animationStateNext = 0;
+ _animationNext = 0;
+
+ _flag = false;
+
+ Actor_Put_In_Set(kActorLuther, kSetUG16);
+ Actor_Set_At_XYZ(kActorLuther, 176.91f, -40.67f, 225.92f, 486);
+ Actor_Set_Goal_Number(kActorLuther, 400);
+ Actor_Set_Targetable(kActorLuther, 1);
+}
+
+bool AIScriptLuther::Update() {
+ if (!Actor_Query_Is_In_Current_Set(kActorLuther)
+ || Player_Query_Combat_Mode() != 1
+ || Global_Variable_Query(29)
+ || Game_Flag_Query(596)
+ || Global_Variable_Query(kVariableChapter) != 4) {
+ if (Actor_Query_Goal_Number(kActorLuther) == 400 && Actor_Query_Goal_Number(kActorLuther) != 499) {
+ Actor_Set_Goal_Number(kActorLuther, 401);
+ } else if (Actor_Query_Goal_Number(kActorLuther) == 494) {
+ Actor_Set_Goal_Number(kActorLuther, 495);
+ ChangeAnimationMode(48);
+ } else if (Actor_Query_Goal_Number(kActorLuther) != 495 || Game_Flag_Query(587)) {
+ if (Actor_Query_Goal_Number(kActorLuther) != 497
+ || Global_Variable_Query(29) >= 2
+ || Game_Flag_Query(568)) {
+ if (Actor_Query_Goal_Number(kActorLuther) != 497
+ || Global_Variable_Query(29) <= 1
+ || Game_Flag_Query(568)) {
+ if (Actor_Query_Goal_Number(kActorLuther) == 498) {
+ Game_Flag_Set(595);
+ Actor_Set_Goal_Number(kActorLuther, 499);
+ Actor_Set_Targetable(kActorLuther, 0);
+ } else {
+ return false;
+ }
+ } else {
+ Actor_Set_Targetable(kActorLuther, 0);
+ Actor_Set_Goal_Number(kActorLuther, 498);
+ Actor_Set_Targetable(kActorLuther, 0);
+ }
+ } else {
+ Game_Flag_Set(568);
+ ChangeAnimationMode(50);
+ ChangeAnimationMode(48);
+ Actor_Set_Goal_Number(kActorLuther, 498);
+ Actor_Set_Targetable(kActorLuther, 0);
+ Scene_Loop_Set_Default(5);
+ Scene_Loop_Start_Special(2, 4, 1);
+ Ambient_Sounds_Play_Sound(559, 50, 0, 0, 99);
+ Ambient_Sounds_Remove_Looping_Sound(516, 1);
+ }
+ } else {
+ AI_Countdown_Timer_Reset(kActorLuther, 2);
+ AI_Countdown_Timer_Start(kActorLuther, 2, 5);
+ Actor_Set_Goal_Number(kActorLuther, 496);
+ Game_Flag_Set(587);
+ }
+ } else {
+ Actor_Says(kActorMcCoy, 5720, 12);
+ Actor_Says(kActorLuther, 80, 13);
+ Actor_Says(kActorLance, 40, 12);
+ Game_Flag_Set(596);
+ }
+
+ return false;
+}
+
+void AIScriptLuther::TimerExpired(int timer) {
+ if (timer != 2)
+ return; //false;
+
+ AI_Countdown_Timer_Reset(kActorLuther, 2);
+ Actor_Set_Goal_Number(kActorLuther, 497);
+
+ return; //true;
+}
+
+void AIScriptLuther::CompletedMovementTrack() {
+ if (Actor_Query_Goal_Number(kActorLuther) != 401)
+ return; //false;
+
+ Actor_Set_Goal_Number(kActorLuther, 402);
+
+ return; //true;
+}
+
+void AIScriptLuther::ReceivedClue(int clueId, int fromActorId) {
+ //return false;
+}
+
+void AIScriptLuther::ClickedByPlayer() {
+ //return false;
+}
+
+void AIScriptLuther::EnteredScene(int sceneId) {
+ // return false;
+}
+
+void AIScriptLuther::OtherAgentEnteredThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptLuther::OtherAgentExitedThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptLuther::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+ // return false;
+}
+
+void AIScriptLuther::ShotAtAndMissed() {
+ // return false;
+}
+
+bool AIScriptLuther::ShotAtAndHit() {
+ if (Actor_Query_Which_Set_In(kActorLuther) == 19) {
+ Actor_Set_Health(kActorLuther, 50, 50);
+ }
+ Global_Variable_Increment(29, 1);
+ Music_Stop(2);
+ if (Global_Variable_Query(29) <= 0) {
+ return false;
+ }
+ if (!Game_Flag_Query(560)) {
+ Game_Flag_Set(557);
+ }
+ Actor_Set_Goal_Number(kActorLuther, 494);
+
+ return true;
+}
+
+void AIScriptLuther::Retired(int byActorId) {
+ Actor_Set_Goal_Number(kActorLuther, 599);
+}
+
+int AIScriptLuther::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ return 0;
+}
+
+bool AIScriptLuther::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ switch (newGoalNumber) {
+ case 401:
+ AI_Movement_Track_Flush(kActorLuther);
+ AI_Movement_Track_Append(kActorLuther, 39, 20);
+ AI_Movement_Track_Append_With_Facing(kActorLuther, 368, 120, 486);
+ AI_Movement_Track_Append(kActorLuther, 40, 10);
+ AI_Movement_Track_Repeat(kActorLuther);
+ break;
+
+ case 402:
+ Actor_Set_Goal_Number(kActorLuther, 401);
+ break;
+
+ case 403:
+ AI_Movement_Track_Flush(kActorLuther);
+ break;
+
+ case 499:
+ Actor_Set_Goal_Number(kActorLuther, 599);
+ break;
+ }
+
+ return false;
+}
+
+bool AIScriptLuther::UpdateAnimation(int *animation, int *frame) {
+ switch (_animationState) {
+ case 0:
+ *animation = 346;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(346) - 1) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 1:
+ *animation = 348;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(348) - 1) {
+ *animation = 346;
+ _animationFrame = 0;
+ _animationState = 0;
+ Actor_Change_Animation_Mode(kActorLuther, 0);
+ }
+ break;
+
+ case 2:
+ if (!_animationFrame && _flag) {
+ *animation = 346;
+ _animationState = 0;
+ } else {
+ *animation = 349;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(349) - 1) {
+ _animationFrame = 0;
+ }
+ }
+ break;
+
+ case 3:
+ *animation = 350;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(350) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
+ *animation = 349;
+ }
+ break;
+
+ case 4:
+ *animation = 351;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(351) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
+ *animation = 349;
+ }
+ break;
+
+ case 5:
+ *animation = 352;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(352) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
+ *animation = 349;
+ }
+ break;
+
+ case 6:
+ *animation = 353;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(353) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
+ *animation = 349;
+ }
+ break;
+
+ case 7:
+ *animation = 354;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(354) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
+ *animation = 349;
+ }
+ break;
+
+ case 8:
+ *animation = 355;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(355) - 1) {
+ _animationFrame = 0;
+ _animationState = 2;
+ *animation = 349;
+ }
+ break;
+
+ case 9:
+ *animation = 356;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(356) - 1) {
+ *animation = 346;
+ _animationFrame = 0;
+ _animationState = 0;
+ Actor_Change_Animation_Mode(kActorLuther, 0);
+ }
+ break;
+
+ case 10:
+ *animation = 357;
+ _animationFrame++;
+ if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(357) - 1) {
+ Actor_Change_Animation_Mode(kActorLuther, 50);
+ *animation = 358;
+ _animationFrame = 0;
+ }
+ break;
+
+ case 11:
+ *animation = 358;
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(358) - 1) {
+ _animationFrame++;
+ }
+ break;
+
+ case 12:
+ *animation = 359;
+ if (_animationFrame == 12) {
+ Ambient_Sounds_Play_Sound(557, 59, 0, 0, 20);
+ }
+ if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+ _animationFrame++;
+ }
+ break;
+
+ default:
+ break;
+ }
+ *frame = _animationFrame;
+
+ return true;
+}
+
+bool AIScriptLuther::ChangeAnimationMode(int mode) {
+ switch (mode) {
+ case 0:
+ if ((unsigned int)(_animationState - 2) > 6) {
+ _animationState = 0;
+ _animationFrame = 0;
+ } else {
+ _flag = 1;
+ }
+ break;
+
+ case 3:
+ _animationState = 2;
+ _animationFrame = 0;
+ _flag = 0;
+ break;
+
+ case 6:
+ _animationState = 9;
+ _animationFrame = 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 23:
+ _animationState = 1;
+ _animationFrame = 0;
+ break;
+
+ case 48:
+ _animationState = 12;
+ _animationFrame = 0;
+ break;
+
+ case 50:
+ _animationState = 11;
+ _animationFrame = 0;
+ break;
+ }
+
+ return true;
+}
+
+void AIScriptLuther::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
+}
+
+void AIScriptLuther::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
+}
+
+bool AIScriptLuther::ReachedMovementTrackWaypoint(int waypointId) {
+ return true;
+}
+
+void AIScriptLuther::FledCombat() {
+ // return false;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 1bca0e0..46b97b3 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -49,6 +49,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
_AIScripts[kActorIzo] = new AIScriptIzo(_vm); // 7
_AIScripts[kActorSadik] = new AIScriptSadik(_vm); // 8
_AIScripts[kActorCrazylegs] = new AIScriptCrazylegs(_vm); // 9
+ _AIScripts[kActorLuther] = new AIScriptLuther(_vm); // 10
_AIScripts[kActorGrigorian] = new AIScriptGrigorian(_vm); // 11
_AIScripts[kActorTransient] = new AIScriptTransient(_vm); // 12
_AIScripts[kActorLance] = new AIScriptLance(_vm); // 13
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index ed76108..e2cb302 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -201,6 +201,10 @@ DECLARE_SCRIPT(Crazylegs)
bool _flag;
END_SCRIPT
+DECLARE_SCRIPT(Luther)
+ bool _flag;
+END_SCRIPT
+
DECLARE_SCRIPT(Grigorian)
int var_45CA10;
int var_45CA14;
Commit: b7e8fff99e87092675fc0e48b66a5651782e2fdc
https://github.com/scummvm/scummvm/commit/b7e8fff99e87092675fc0e48b66a5651782e2fdc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-03-17T11:27:08+01:00
Commit Message:
BLADERUNNER: Added BulletBob actor
Changed paths:
A engines/bladerunner/script/ai/bullet_bob.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 59beb11..de03caa 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/bullet_bob.o \
script/ai/chew.o \
script/ai/clovis.o \
script/ai/crazylegs.o \
diff --git a/engines/bladerunner/script/ai/bullet_bob.cpp b/engines/bladerunner/script/ai/bullet_bob.cpp
new file mode 100644
index 0000000..87394fa
--- /dev/null
+++ b/engines/bladerunner/script/ai/bullet_bob.cpp
@@ -0,0 +1,555 @@
+/* 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 {
+
+AIScriptBulletBob::AIScriptBulletBob(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+ _var1 = 0;
+ _var2 = 6;
+ _var3 = 1;
+ _var4 = 0;
+}
+
+void AIScriptBulletBob::Initialize() {
+ _animationFrame = 0;
+ _animationState = 0;
+ _animationStateNext = 0;
+ _animationNext = 0;
+
+ _var1 = 0;
+ _var2 = 6;
+ _var3 = 1;
+ _var4 = 0;
+
+ Actor_Set_Goal_Number(kActorBulletBob, 0);
+ Actor_Set_Targetable(kActorBulletBob, 1);
+}
+
+bool AIScriptBulletBob::Update() {
+ if (Game_Flag_Query(289) && Actor_Query_Goal_Number(kActorBulletBob) != 4) {
+ Actor_Set_Goal_Number(kActorBulletBob, 4);
+ }
+ if (Player_Query_Combat_Mode() != 1
+ || Player_Query_Current_Scene() != kSceneRC04
+ || Game_Flag_Query(296)
+ || Global_Variable_Query(kVariableChapter) >= 4) {
+ if (Actor_Query_Goal_Number(kActorBulletBob) == 1 && !Player_Query_Combat_Mode()) {
+ AI_Countdown_Timer_Reset(kActorBulletBob, 2);
+ Game_Flag_Reset(296);
+ Game_Flag_Set(303);
+ Actor_Set_Goal_Number(kActorBulletBob, 0);
+ }
+ } else {
+ AI_Countdown_Timer_Reset(kActorBulletBob, 2);
+ AI_Countdown_Timer_Start(kActorBulletBob, 2, 10);
+ Actor_Set_Goal_Number(kActorBulletBob, 1);
+ Actor_Modify_Friendliness_To_Other(kActorBulletBob, kActorMcCoy, -15);
+ Game_Flag_Set(296);
+ }
+ if (Actor_Query_Goal_Number(kActorBulletBob) != 2 || Game_Flag_Query(295) || _animationState) {
+ if (Game_Flag_Query(303) == 1 && Player_Query_Combat_Mode() == 1 && Actor_Query_Goal_Number(kActorBulletBob) != 4) {
+ Actor_Set_Goal_Number(kActorBulletBob, 2);
+ } else {
+ return false;
+ }
+ } else {
+ Actor_Face_Heading(kActorBulletBob, 208, 0);
+ _animationFrame = 0;
+ _animationState = 2;
+ Actor_Set_Goal_Number(kActorBulletBob, 3);
+ Game_Flag_Set(295);
+ }
+
+ return true;
+}
+
+void AIScriptBulletBob::TimerExpired(int timer) {
+ if (timer != 2 || Actor_Query_Goal_Number(kActorBulletBob) != 1)
+ return; //false;
+
+ Actor_Set_Goal_Number(kActorBulletBob, 2);
+ AI_Countdown_Timer_Reset(kActorBulletBob, 2);
+
+ return; //true;
+}
+
+void AIScriptBulletBob::CompletedMovementTrack() {
+ //return false;
+}
+
+void AIScriptBulletBob::ReceivedClue(int clueId, int fromActorId) {
+ //return false;
+}
+
+void AIScriptBulletBob::ClickedByPlayer() {
+ //return false;
+}
+
+void AIScriptBulletBob::EnteredScene(int sceneId) {
+ // return false;
+}
+
+void AIScriptBulletBob::OtherAgentEnteredThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptBulletBob::OtherAgentExitedThisScene(int otherActorId) {
+ // return false;
+}
+
+void AIScriptBulletBob::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+ // return false;
+}
+
+void AIScriptBulletBob::ShotAtAndMissed() {
+ // return false;
+}
+
+bool AIScriptBulletBob::ShotAtAndHit() {
+ Global_Variable_Increment(24, 1);
+ if (Global_Variable_Query(24) > 0) {
+ Actor_Set_Targetable(kActorBulletBob, 0);
+ Actor_Set_Goal_Number(kActorBulletBob, 99);
+ _animationFrame = 0;
+ _animationState = 3;
+ Ambient_Sounds_Play_Speech_Sound(2, 9000, 100, 0, 0, 0);
+ Actor_Face_Heading(kActorBulletBob, 281, 0);
+ }
+
+ return false;
+}
+
+void AIScriptBulletBob::Retired(int byActorId) {
+ // return false;
+}
+
+int AIScriptBulletBob::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ return 0;
+}
+
+bool AIScriptBulletBob::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ if (newGoalNumber || Game_Flag_Query(303) != 1 || Player_Query_Current_Scene() != kSceneRC04) {
+ if (newGoalNumber == 1 && !Game_Flag_Query(303) && Player_Query_Current_Scene() == kSceneRC04) {
+ Actor_Says(kActorBulletBob, 120, 37);
+ Actor_Says(kActorMcCoy, 4915, 13);
+ return true;
+ }
+ if (newGoalNumber == 6) {
+ Scene_Exits_Disable();
+ Actor_Force_Stop_Walking(kActorMcCoy);
+ Ambient_Sounds_Play_Speech_Sound(kActorMcCoy, 9900, 100, 0, 0, 0);
+ Actor_Change_Animation_Mode(kActorMcCoy, 48);
+ Actor_Retired_Here(kActorMcCoy, 6, 6, 1, -1);
+ Scene_Exits_Enable();
+ }
+ if (newGoalNumber != 4) {
+ return false;
+ }
+ if (Actor_Clue_Query(kActorMcCoy, 164) != 1) {
+ Delay(2000);
+ Actor_Voice_Over(2100, kActorVoiceOver);
+ Actor_Voice_Over(2110, kActorVoiceOver);
+ Actor_Voice_Over(2120, kActorVoiceOver);
+ Actor_Voice_Over(2130, kActorVoiceOver);
+ }
+ } else {
+ Actor_Says(kActorBulletBob, 140, 16);
+ }
+
+ return true;
+}
+
+bool AIScriptBulletBob::UpdateAnimation(int *animation, int *frame) {
+ switch (_animationState) {
+ case 0:
+ if (_var1 == 1) {
+ *animation = 516;
+ if (_var4) {
+ _var4--;
+ } else {
+ if (++_animationFrame == 6) {
+ _var4 = Random_Query(4, 8);
+ }
+ if (_animationFrame == 11) {
+ _var4 = Random_Query(2, 6);
+ }
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(515)) {
+ _animationFrame = 0;
+ _var1 = 0;
+ _var3 = 2 * Random_Query(0, 1) - 1;
+ _var2 = Random_Query(3, 7);
+ _var4 = Random_Query(0, 4);
+ }
+ }
+ } else if (_var1 == 0) {
+ *animation = 514;
+ if (_var4) {
+ _var4--;
+ } else {
+ _animationFrame += _var3;
+ if (_animationFrame < 0) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(514) - 1;
+ } else if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(514)) {
+ _animationFrame = 0;
+ }
+ if (!--_var2) {
+ _var3 = 2 * Random_Query(0, 1) - 1;
+ _var2 = Random_Query(3, 7);
+ _var4 = Random_Query(0, 4);
+ }
+ if (!_animationFrame) {
+ _var1 = Random_Query(0, 1);
+ }
+ }
+ }
+ break;
+
+ case 1:
+ *animation = 506;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(506)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 2:
+ *animation = 513;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(513)) {
+ _animationFrame = 0;
+ _animationState = 1;
+ *animation = 506;
+ }
+ if (_animationFrame == 10) {
+ Sound_Play(492, 75, 0, 0, 50);
+ }
+ if (_animationFrame == 5) {
+ Sound_Play(493, 90, 0, 0, 50);
+ Actor_Set_Goal_Number(kActorBulletBob, 6);
+ }
+ break;
+
+ case 3:
+ *animation = 510;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(510) - 1) {
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(510) - 1;
+ _animationState = 16;
+ Game_Flag_Set(289);
+ }
+ break;
+
+ case 4:
+ break;
+
+ case 5:
+ *animation = 525;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(525)) {
+ *animation = 514;
+ _animationFrame = 0;
+ _animationState = 0;
+ }
+ break;
+
+ case 6:
+ *animation = 517;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(517)) {
+ _animationFrame = 0;
+ }
+ break;
+
+ case 7:
+ *animation = 518;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(518)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 8:
+ *animation = 519;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(519)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 9:
+ *animation = 520;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(520)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 10:
+ *animation = 521;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(521)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 11:
+ *animation = 522;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(522)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 12:
+ *animation = 523;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(523)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 13:
+ *animation = 524;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(524)) {
+ _animationFrame = 0;
+ _animationState = 6;
+ *animation = 517;
+ }
+ break;
+
+ case 14:
+ *animation = 512;
+ _animationFrame++;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(512)) {
+ _animationFrame = 0;
+ _animationState = 1;
+ *animation = 506;
+ }
+ break;
+
+ case 15:
+ if (_var1 == 1) {
+ *animation = 516;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(516)) {
+ _animationFrame += 2;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(516)) {
+ _animationFrame = 0;
+ *animation = _animationNext;
+ _animationState = _animationStateNext;
+ }
+ } else {
+ _animationFrame -= 2;
+ if (_animationFrame <= 0) {
+ _animationFrame = 0;
+ *animation = _animationNext;
+ _animationState = _animationStateNext;
+ }
+ }
+ } else if (_var1 == 0) {
+ *animation = 514;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(514)) {
+ _animationFrame += 2;
+ if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(514)) {
+ _animationFrame = 0;
+ *animation = _animationNext;
+ _animationState = _animationStateNext;
+ }
+ } else {
+ _animationFrame -= 2;
+ if (_animationFrame <= 0) {
+ _animationFrame = 0;
+ *animation = _animationNext;
+ _animationState = _animationStateNext;
+ }
+ }
+ }
+ break;
+
+ case 16:
+ *animation = 510;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(510) - 1;
+ break;
+
+ default:
+ break;
+ }
+ *frame = _animationFrame;
+
+ return true;
+}
+
+bool AIScriptBulletBob::ChangeAnimationMode(int mode) {
+ switch (mode) {
+ case 0:
+ if (_animationState > 4 || _animationState) {
+ _animationState = 0;
+ _animationFrame = 0;
+ }
+ break;
+
+ case 3:
+ case 9:
+ case 30:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 6;
+ _animationNext = 517;
+ }
+ break;
+
+ case 4:
+ if (_animationState <= 4 && !_animationState) {
+ _animationState = 14;
+ _animationFrame = 0;
+ }
+ break;
+
+ case 6:
+ _animationState = 2;
+ _animationFrame = 0;
+ break;
+
+ case 10:
+ case 31:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 7;
+ _animationNext = 518;
+ }
+ break;
+
+ case 11:
+ case 33:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 9;
+ _animationNext = 520;
+ }
+ break;
+
+ case 21:
+ case 22:
+ _animationState = 3;
+ _animationFrame = 0;
+ break;
+
+ case 23:
+ _animationState = 5;
+ _animationFrame = 0;
+ break;
+
+ case 32:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 8;
+ _animationNext = 519;
+ }
+ break;
+
+ case 34:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 10;
+ _animationNext = 521;
+ }
+ break;
+
+ case 35:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 11;
+ _animationNext = 522;
+ }
+ break;
+
+ case 36:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 12;
+ _animationNext = 523;
+ }
+ break;
+
+ case 37:
+ if (_animationState < 6 || _animationState > 13) {
+ _animationState = 15;
+ _animationStateNext = 13;
+ _animationNext = 524;
+ }
+ break;
+
+ case 48:
+ _animationState = 4;
+ _animationFrame = 0;
+ break;
+
+ case 88:
+ _animationState = 16;
+ _animationFrame = Slice_Animation_Query_Number_Of_Frames(510) - 1;
+ break;
+
+ default:
+ _animationState = 0;
+ _animationFrame = 0;
+ break;
+ }
+ return true;
+}
+
+void AIScriptBulletBob::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+ *animationState = _animationState;
+ *animationFrame = _animationFrame;
+ *animationStateNext = _animationStateNext;
+ *animationNext = _animationNext;
+}
+
+void AIScriptBulletBob::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+ _animationState = animationState;
+ _animationFrame = animationFrame;
+ _animationStateNext = animationStateNext;
+ _animationNext = animationNext;
+}
+
+bool AIScriptBulletBob::ReachedMovementTrackWaypoint(int waypointId) {
+ return true;
+}
+
+void AIScriptBulletBob::FledCombat() {
+ // return false;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 46b97b3..a3bb543 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -53,6 +53,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
_AIScripts[kActorGrigorian] = new AIScriptGrigorian(_vm); // 11
_AIScripts[kActorTransient] = new AIScriptTransient(_vm); // 12
_AIScripts[kActorLance] = new AIScriptLance(_vm); // 13
+ _AIScripts[kActorBulletBob] = new AIScriptBulletBob(_vm); // 14
_AIScripts[kActorRunciter] = new AIScriptRunciter(_vm); // 15
_AIScripts[kActorInsectDealer] = new AIScriptInsectDealer(_vm); // 16
_AIScripts[kActorTyrellGuard] = new AIScriptTyrellGuard(_vm); // 17
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index e2cb302..5a28402 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -216,6 +216,13 @@ END_SCRIPT
DECLARE_SCRIPT(Lance)
END_SCRIPT
+DECLARE_SCRIPT(BulletBob)
+ int _var1;
+ int _var2;
+ int _var3;
+ int _var4;
+END_SCRIPT
+
DECLARE_SCRIPT(Runciter)
int var_45CD78;
int var_45CD7C;
More information about the Scummvm-git-logs
mailing list