[Scummvm-git-logs] scummvm master -> 1c083fe0004c2b952da3bd8e45de0c4139f62786
peterkohaut
peterkohaut at users.noreply.github.com
Thu Mar 23 16:24:06 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1c083fe000 BLADERUNNER: Reorganized script files
Commit: 1c083fe0004c2b952da3bd8e45de0c4139f62786
https://github.com/scummvm/scummvm/commit/1c083fe0004c2b952da3bd8e45de0c4139f62786
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2017-03-23T16:20:10+01:00
Commit Message:
BLADERUNNER: Reorganized script files
Changed paths:
A engines/bladerunner/script/ai.cpp
A engines/bladerunner/script/ai.h
A engines/bladerunner/script/ai/mccoy.cpp
A engines/bladerunner/script/ai/officer_leroy.cpp
A engines/bladerunner/script/ai/runciter.cpp
A engines/bladerunner/script/scene.cpp
A engines/bladerunner/script/scene.h
A engines/bladerunner/script/scene/ar01.cpp
A engines/bladerunner/script/scene/ar02.cpp
A engines/bladerunner/script/scene/bb01.cpp
A engines/bladerunner/script/scene/bb02.cpp
A engines/bladerunner/script/scene/bb03.cpp
A engines/bladerunner/script/scene/bb04.cpp
A engines/bladerunner/script/scene/bb05.cpp
A engines/bladerunner/script/scene/bb06.cpp
A engines/bladerunner/script/scene/bb07.cpp
A engines/bladerunner/script/scene/bb08.cpp
A engines/bladerunner/script/scene/bb09.cpp
A engines/bladerunner/script/scene/bb10.cpp
A engines/bladerunner/script/scene/bb11.cpp
A engines/bladerunner/script/scene/bb12.cpp
A engines/bladerunner/script/scene/bb51.cpp
A engines/bladerunner/script/scene/ct01.cpp
A engines/bladerunner/script/scene/ct02.cpp
A engines/bladerunner/script/scene/ct03.cpp
A engines/bladerunner/script/scene/ct04.cpp
A engines/bladerunner/script/scene/ct05.cpp
A engines/bladerunner/script/scene/ct06.cpp
A engines/bladerunner/script/scene/ct07.cpp
A engines/bladerunner/script/scene/ct08.cpp
A engines/bladerunner/script/scene/ct09.cpp
A engines/bladerunner/script/scene/ct10.cpp
A engines/bladerunner/script/scene/ct11.cpp
A engines/bladerunner/script/scene/ct12.cpp
A engines/bladerunner/script/scene/ct51.cpp
A engines/bladerunner/script/scene/dr01.cpp
A engines/bladerunner/script/scene/dr02.cpp
A engines/bladerunner/script/scene/dr03.cpp
A engines/bladerunner/script/scene/dr04.cpp
A engines/bladerunner/script/scene/dr05.cpp
A engines/bladerunner/script/scene/dr06.cpp
A engines/bladerunner/script/scene/hc01.cpp
A engines/bladerunner/script/scene/hc02.cpp
A engines/bladerunner/script/scene/hc03.cpp
A engines/bladerunner/script/scene/hc04.cpp
A engines/bladerunner/script/scene/hf01.cpp
A engines/bladerunner/script/scene/hf02.cpp
A engines/bladerunner/script/scene/hf03.cpp
A engines/bladerunner/script/scene/hf04.cpp
A engines/bladerunner/script/scene/hf05.cpp
A engines/bladerunner/script/scene/hf06.cpp
A engines/bladerunner/script/scene/hf07.cpp
A engines/bladerunner/script/scene/kp01.cpp
A engines/bladerunner/script/scene/kp02.cpp
A engines/bladerunner/script/scene/kp03.cpp
A engines/bladerunner/script/scene/kp04.cpp
A engines/bladerunner/script/scene/kp05.cpp
A engines/bladerunner/script/scene/kp06.cpp
A engines/bladerunner/script/scene/kp07.cpp
A engines/bladerunner/script/scene/ma01.cpp
A engines/bladerunner/script/scene/ma02.cpp
A engines/bladerunner/script/scene/ma04.cpp
A engines/bladerunner/script/scene/ma05.cpp
A engines/bladerunner/script/scene/ma06.cpp
A engines/bladerunner/script/scene/ma07.cpp
A engines/bladerunner/script/scene/ma08.cpp
A engines/bladerunner/script/scene/nr01.cpp
A engines/bladerunner/script/scene/nr02.cpp
A engines/bladerunner/script/scene/nr03.cpp
A engines/bladerunner/script/scene/nr04.cpp
A engines/bladerunner/script/scene/nr05.cpp
A engines/bladerunner/script/scene/nr06.cpp
A engines/bladerunner/script/scene/nr07.cpp
A engines/bladerunner/script/scene/nr08.cpp
A engines/bladerunner/script/scene/nr09.cpp
A engines/bladerunner/script/scene/nr10.cpp
A engines/bladerunner/script/scene/nr11.cpp
A engines/bladerunner/script/scene/ps01.cpp
A engines/bladerunner/script/scene/ps02.cpp
A engines/bladerunner/script/scene/ps03.cpp
A engines/bladerunner/script/scene/ps04.cpp
A engines/bladerunner/script/scene/ps05.cpp
A engines/bladerunner/script/scene/ps06.cpp
A engines/bladerunner/script/scene/ps07.cpp
A engines/bladerunner/script/scene/ps09.cpp
A engines/bladerunner/script/scene/ps10.cpp
A engines/bladerunner/script/scene/ps11.cpp
A engines/bladerunner/script/scene/ps12.cpp
A engines/bladerunner/script/scene/ps13.cpp
A engines/bladerunner/script/scene/ps14.cpp
A engines/bladerunner/script/scene/ps15.cpp
A engines/bladerunner/script/scene/rc01.cpp
A engines/bladerunner/script/scene/rc02.cpp
A engines/bladerunner/script/scene/rc03.cpp
A engines/bladerunner/script/scene/rc04.cpp
A engines/bladerunner/script/scene/rc51.cpp
A engines/bladerunner/script/scene/tb02.cpp
A engines/bladerunner/script/scene/tb03.cpp
A engines/bladerunner/script/scene/tb05.cpp
A engines/bladerunner/script/scene/tb06.cpp
A engines/bladerunner/script/scene/tb07.cpp
A engines/bladerunner/script/scene/ug01.cpp
A engines/bladerunner/script/scene/ug02.cpp
A engines/bladerunner/script/scene/ug03.cpp
A engines/bladerunner/script/scene/ug04.cpp
A engines/bladerunner/script/scene/ug05.cpp
A engines/bladerunner/script/scene/ug06.cpp
A engines/bladerunner/script/scene/ug07.cpp
A engines/bladerunner/script/scene/ug08.cpp
A engines/bladerunner/script/scene/ug09.cpp
A engines/bladerunner/script/scene/ug10.cpp
A engines/bladerunner/script/scene/ug12.cpp
A engines/bladerunner/script/scene/ug13.cpp
A engines/bladerunner/script/scene/ug14.cpp
A engines/bladerunner/script/scene/ug15.cpp
A engines/bladerunner/script/scene/ug16.cpp
A engines/bladerunner/script/scene/ug17.cpp
A engines/bladerunner/script/scene/ug18.cpp
A engines/bladerunner/script/scene/ug19.cpp
R engines/bladerunner/script/ai_00_mccoy.cpp
R engines/bladerunner/script/ai_00_mccoy.h
R engines/bladerunner/script/ai_15_runciter.cpp
R engines/bladerunner/script/ai_15_runciter.h
R engines/bladerunner/script/ai_23_officer_leroy.cpp
R engines/bladerunner/script/ai_23_officer_leroy.h
R engines/bladerunner/script/ar01.cpp
R engines/bladerunner/script/ar02.cpp
R engines/bladerunner/script/bb01.cpp
R engines/bladerunner/script/bb02.cpp
R engines/bladerunner/script/bb03.cpp
R engines/bladerunner/script/bb04.cpp
R engines/bladerunner/script/bb05.cpp
R engines/bladerunner/script/bb06.cpp
R engines/bladerunner/script/bb07.cpp
R engines/bladerunner/script/bb08.cpp
R engines/bladerunner/script/bb09.cpp
R engines/bladerunner/script/bb10.cpp
R engines/bladerunner/script/bb11.cpp
R engines/bladerunner/script/bb12.cpp
R engines/bladerunner/script/bb51.cpp
R engines/bladerunner/script/ct01.cpp
R engines/bladerunner/script/ct02.cpp
R engines/bladerunner/script/ct03.cpp
R engines/bladerunner/script/ct04.cpp
R engines/bladerunner/script/ct05.cpp
R engines/bladerunner/script/ct06.cpp
R engines/bladerunner/script/ct07.cpp
R engines/bladerunner/script/ct08.cpp
R engines/bladerunner/script/ct09.cpp
R engines/bladerunner/script/ct10.cpp
R engines/bladerunner/script/ct11.cpp
R engines/bladerunner/script/ct12.cpp
R engines/bladerunner/script/ct51.cpp
R engines/bladerunner/script/dr01.cpp
R engines/bladerunner/script/dr02.cpp
R engines/bladerunner/script/dr03.cpp
R engines/bladerunner/script/dr04.cpp
R engines/bladerunner/script/dr05.cpp
R engines/bladerunner/script/dr06.cpp
R engines/bladerunner/script/hc01.cpp
R engines/bladerunner/script/hc02.cpp
R engines/bladerunner/script/hc03.cpp
R engines/bladerunner/script/hc04.cpp
R engines/bladerunner/script/hf01.cpp
R engines/bladerunner/script/hf02.cpp
R engines/bladerunner/script/hf03.cpp
R engines/bladerunner/script/hf04.cpp
R engines/bladerunner/script/hf05.cpp
R engines/bladerunner/script/hf06.cpp
R engines/bladerunner/script/hf07.cpp
R engines/bladerunner/script/kp01.cpp
R engines/bladerunner/script/kp02.cpp
R engines/bladerunner/script/kp03.cpp
R engines/bladerunner/script/kp04.cpp
R engines/bladerunner/script/kp05.cpp
R engines/bladerunner/script/kp06.cpp
R engines/bladerunner/script/kp07.cpp
R engines/bladerunner/script/ma01.cpp
R engines/bladerunner/script/ma02.cpp
R engines/bladerunner/script/ma04.cpp
R engines/bladerunner/script/ma05.cpp
R engines/bladerunner/script/ma06.cpp
R engines/bladerunner/script/ma07.cpp
R engines/bladerunner/script/ma08.cpp
R engines/bladerunner/script/nr01.cpp
R engines/bladerunner/script/nr02.cpp
R engines/bladerunner/script/nr03.cpp
R engines/bladerunner/script/nr04.cpp
R engines/bladerunner/script/nr05.cpp
R engines/bladerunner/script/nr06.cpp
R engines/bladerunner/script/nr07.cpp
R engines/bladerunner/script/nr08.cpp
R engines/bladerunner/script/nr09.cpp
R engines/bladerunner/script/nr10.cpp
R engines/bladerunner/script/nr11.cpp
R engines/bladerunner/script/ps01.cpp
R engines/bladerunner/script/ps02.cpp
R engines/bladerunner/script/ps03.cpp
R engines/bladerunner/script/ps04.cpp
R engines/bladerunner/script/ps05.cpp
R engines/bladerunner/script/ps06.cpp
R engines/bladerunner/script/ps07.cpp
R engines/bladerunner/script/ps09.cpp
R engines/bladerunner/script/ps10.cpp
R engines/bladerunner/script/ps11.cpp
R engines/bladerunner/script/ps12.cpp
R engines/bladerunner/script/ps13.cpp
R engines/bladerunner/script/ps14.cpp
R engines/bladerunner/script/ps15.cpp
R engines/bladerunner/script/rc01.cpp
R engines/bladerunner/script/rc02.cpp
R engines/bladerunner/script/rc03.cpp
R engines/bladerunner/script/rc04.cpp
R engines/bladerunner/script/rc51.cpp
R engines/bladerunner/script/tb02.cpp
R engines/bladerunner/script/tb03.cpp
R engines/bladerunner/script/tb05.cpp
R engines/bladerunner/script/tb06.cpp
R engines/bladerunner/script/tb07.cpp
R engines/bladerunner/script/ug01.cpp
R engines/bladerunner/script/ug02.cpp
R engines/bladerunner/script/ug03.cpp
R engines/bladerunner/script/ug04.cpp
R engines/bladerunner/script/ug05.cpp
R engines/bladerunner/script/ug06.cpp
R engines/bladerunner/script/ug07.cpp
R engines/bladerunner/script/ug08.cpp
R engines/bladerunner/script/ug09.cpp
R engines/bladerunner/script/ug10.cpp
R engines/bladerunner/script/ug12.cpp
R engines/bladerunner/script/ug13.cpp
R engines/bladerunner/script/ug14.cpp
R engines/bladerunner/script/ug15.cpp
R engines/bladerunner/script/ug16.cpp
R engines/bladerunner/script/ug17.cpp
R engines/bladerunner/script/ug18.cpp
R engines/bladerunner/script/ug19.cpp
engines/bladerunner/actor.cpp
engines/bladerunner/adq.cpp
engines/bladerunner/bladerunner.cpp
engines/bladerunner/bladerunner.h
engines/bladerunner/module.mk
engines/bladerunner/scene.cpp
engines/bladerunner/script/script.cpp
engines/bladerunner/script/script.h
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp
index 597dc60..330ed58 100644
--- a/engines/bladerunner/actor.cpp
+++ b/engines/bladerunner/actor.cpp
@@ -35,7 +35,8 @@
#include "bladerunner/movement_track.h"
#include "bladerunner/scene.h"
#include "bladerunner/scene_objects.h"
-#include "bladerunner/script/script.h"
+#include "bladerunner/script/scene.h"
+#include "bladerunner/script/ai.h"
#include "bladerunner/slice_animations.h"
#include "bladerunner/slice_renderer.h"
#include "bladerunner/waypoints.h"
@@ -199,7 +200,7 @@ void Actor::countdownTimerUpdate(int timerId) {
case 0:
case 1:
case 2:
- if (!_vm->_aiScripts->IsInsideScript() && !_vm->_script->IsInsideScript()) {
+ if (!_vm->_aiScripts->IsInsideScript() && !_vm->_sceneScript->IsInsideScript()) {
_vm->_aiScripts->TimerExpired(this->_id, timerId);
this->_timersRemain[timerId] = 0;
} else {
@@ -926,7 +927,7 @@ void Actor::retire(bool retired, int width, int height, int retiredByActorId) {
_vm->_playerDead = true;
}
if (_isRetired) {
- //TODO: _vm->actorScript->Retired(_id, retiredByActorId);
+ _vm->_aiScripts->Retired(_id, retiredByActorId);
}
}
@@ -1013,7 +1014,7 @@ void Actor::setGoal(int goalNumber) {
}
_vm->_aiScripts->GoalChanged(_id, oldGoalNumber, goalNumber);
- _vm->_script->ActorChangedGoal(_id, goalNumber, oldGoalNumber, _vm->_scene->getSetId() == _setId);
+ _vm->_sceneScript->ActorChangedGoal(_id, goalNumber, oldGoalNumber, _vm->_scene->getSetId() == _setId);
}
int Actor::getGoal() {
diff --git a/engines/bladerunner/adq.cpp b/engines/bladerunner/adq.cpp
index d2d3dec..71315e8 100644
--- a/engines/bladerunner/adq.cpp
+++ b/engines/bladerunner/adq.cpp
@@ -28,7 +28,7 @@
#include "bladerunner/audio_speech.h"
#include "bladerunner/scene.h"
-#include "script/script.h"
+#include "bladerunner/script/scene.h"
namespace BladeRunner {
@@ -99,7 +99,7 @@ void ADQ::flush(int a1, bool callScript) {
}
clear();
if (callScript) {
- _vm->_script->DialogueQueueFlushed(a1);
+ _vm->_sceneScript->DialogueQueueFlushed(a1);
}
}
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 6a06422..78239ad 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -43,7 +43,8 @@
#include "bladerunner/scene.h"
#include "bladerunner/scene_objects.h"
#include "bladerunner/script/init.h"
-#include "bladerunner/script/script.h"
+#include "bladerunner/script/scene.h"
+#include "bladerunner/script/ai.h"
#include "bladerunner/settings.h"
#include "bladerunner/shape.h"
#include "bladerunner/slice_animations.h"
@@ -72,7 +73,7 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst)
_playerLosesControlCounter = 0;
_crimesDatabase = nullptr;
- _script = new Script(this);
+ _sceneScript = new SceneScript(this);
_settings = new Settings(this);
_lights = new Lights(this);
_combat = new Combat(this);
@@ -120,7 +121,7 @@ BladeRunnerEngine::~BladeRunnerEngine() {
delete _combat;
delete _lights;
delete _settings;
- delete _script;
+ delete _sceneScript;
}
bool BladeRunnerEngine::hasFeature(EngineFeature f) const {
@@ -346,11 +347,17 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
void BladeRunnerEngine::initChapterAndScene() {
// TODO: Init actors...
- for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i)
+ for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) {
_aiScripts->Initialize(i);
+ }
- for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i)
+ for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) {
_actors[i]->changeAnimationMode(0);
+ }
+
+ for (int i = 1, end = _gameInfo->getActorCount(); i != end; ++i) { // skip first actor, probably player
+ _actors[i]->movementTrackNext(true);
+ }
_settings->setChapter(1);
_settings->setNewSetAndScene(_gameInfo->getInitialSetId(), _gameInfo->getInitialSceneId());
@@ -587,7 +594,7 @@ void BladeRunnerEngine::gameTick() {
_adq->tick();
if (_scene->didPlayerWalkIn()) {
- _script->PlayerWalkedIn();
+ _sceneScript->PlayerWalkedIn();
}
// TODO: Gun range announcements
// TODO: ZBUF repair dirty rects
@@ -597,7 +604,7 @@ void BladeRunnerEngine::gameTick() {
bool backgroundChanged = false;
int frame = _scene->advanceFrame(_surface1, _zBuffer1);
if (frame >= 0) {
- _script->SceneFrameAdvanced(frame);
+ _sceneScript->SceneFrameAdvanced(frame);
backgroundChanged = true;
}
(void)backgroundChanged;
@@ -626,7 +633,7 @@ void BladeRunnerEngine::gameTick() {
//if (!dialogueMenu)
actorsUpdate();
- if (_settings->getNewScene() == -1 || _script->IsInsideScript() || _aiScripts->IsInsideScript()) {
+ if (_settings->getNewScene() == -1 || _sceneScript->IsInsideScript() || _aiScripts->IsInsideScript()) {
_sliceRenderer->setView(*_view);
// Tick and draw all actors in current set
@@ -846,28 +853,28 @@ void BladeRunnerEngine::handleMouseClick(int x, int y) {
void BladeRunnerEngine::handleMouseClickExit(int x, int y, int exitIndex) {
// clickedOnExit(exitType, x, y);
debug("clicked on exit %d %d %d", exitIndex, x, y);
- _script->ClickedOnExit(exitIndex);
+ _sceneScript->ClickedOnExit(exitIndex);
}
void BladeRunnerEngine::handleMouseClickRegion(int x, int y, int regionIndex) {
debug("clicked on region %d %d %d", regionIndex, x, y);
- _script->ClickedOn2DRegion(regionIndex);
+ _sceneScript->ClickedOn2DRegion(regionIndex);
}
void BladeRunnerEngine::handleMouseClick3DObject(int x, int y, int objectId, bool isClickable, bool isTarget) {
const char *objectName = _scene->objectGetName(objectId);
debug("Clicked on object %s", objectName);
- _script->ClickedOn3DObject(objectName, false);
+ _sceneScript->ClickedOn3DObject(objectName, false);
}
void BladeRunnerEngine::handleMouseClickItem(int x, int y, int itemId) {
debug("Clicked on item %d", itemId);
- _script->ClickedOnItem(itemId, false);
+ _sceneScript->ClickedOnItem(itemId, false);
}
void BladeRunnerEngine::handleMouseClickActor(int x, int y, int actorId) {
debug("Clicked on actor %d", actorId);
- _script->ClickedOnActor(actorId);
+ _sceneScript->ClickedOnActor(actorId);
}
void BladeRunnerEngine::gameWaitForActive() {
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index 0aab576..87bb7db 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -55,7 +55,7 @@ class Mouse;
class Obstacles;
class Scene;
class SceneObjects;
-class Script;
+class SceneScript;
class Settings;
class Shape;
class SliceAnimations;
@@ -91,7 +91,7 @@ public:
Obstacles *_obstacles;
Scene *_scene;
SceneObjects *_sceneObjects;
- Script *_script;
+ SceneScript *_sceneScript;
Settings *_settings;
SliceAnimations *_sliceAnimations;
SliceRenderer *_sliceRenderer;
diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index f8394e9..5ef5735 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -38,125 +38,127 @@ MODULE_OBJS = \
regions.o \
scene.o \
scene_objects.o \
- script/ai_00_mccoy.o \
- script/ai_15_runciter.o \
- script/ai_23_officer_leroy.o \
+ script/script.o \
script/init.o \
script/kia.o \
script/vk.o \
script/esper.o \
- script/ar01.o \
- script/ar02.o \
- script/bb01.o \
- script/bb02.o \
- script/bb03.o \
- script/bb04.o \
- script/bb05.o \
- script/bb06.o \
- script/bb07.o \
- script/bb08.o \
- script/bb09.o \
- script/bb10.o \
- script/bb11.o \
- script/bb12.o \
- script/bb51.o \
- script/ct01.o \
- script/ct02.o \
- script/ct03.o \
- script/ct04.o \
- script/ct05.o \
- script/ct06.o \
- script/ct07.o \
- script/ct08.o \
- script/ct09.o \
- script/ct10.o \
- script/ct11.o \
- script/ct12.o \
- script/ct51.o \
- script/dr01.o \
- script/dr02.o \
- script/dr03.o \
- script/dr04.o \
- script/dr05.o \
- script/dr06.o \
- script/hc01.o \
- script/hc02.o \
- script/hc03.o \
- script/hc04.o \
- script/hf01.o \
- script/hf02.o \
- script/hf03.o \
- script/hf04.o \
- script/hf05.o \
- script/hf06.o \
- script/kp01.o \
- script/kp02.o \
- script/kp03.o \
- script/kp04.o \
- script/kp05.o \
- script/kp06.o \
- script/kp07.o \
- script/ma01.o \
- script/ma02.o \
- script/ma04.o \
- script/ma05.o \
- script/ma06.o \
- script/ma07.o \
- script/ma08.o \
- script/nr01.o \
- script/nr02.o \
- script/nr03.o \
- script/nr04.o \
- script/nr05.o \
- script/nr06.o \
- script/nr07.o \
- script/nr08.o \
- script/nr09.o \
- script/nr10.o \
- script/nr11.o \
- script/ps01.o \
- script/ps02.o \
- script/ps03.o \
- script/ps04.o \
- script/ps05.o \
- script/ps06.o \
- script/ps07.o \
- script/ps09.o \
- script/ps10.o \
- script/ps11.o \
- script/ps12.o \
- script/ps13.o \
- script/ps14.o \
- script/ps15.o \
- script/rc01.o \
- script/rc02.o \
- script/rc03.o \
- script/rc04.o \
- script/rc51.o \
- script/tb02.o \
- script/tb03.o \
- script/tb05.o \
- script/tb06.o \
- script/tb07.o \
- script/ug01.o \
- script/ug02.o \
- script/ug03.o \
- script/ug04.o \
- script/ug05.o \
- script/ug06.o \
- script/ug07.o \
- script/ug08.o \
- script/ug09.o \
- script/ug10.o \
- script/ug12.o \
- script/ug13.o \
- script/ug14.o \
- script/ug15.o \
- script/ug16.o \
- script/ug17.o \
- script/ug18.o \
- script/ug19.o \
- script/script.o \
+ script/ai.o \
+ script/ai/mccoy.o \
+ script/ai/runciter.o \
+ script/ai/officer_leroy.o \
+ script/scene.o \
+ script/scene/ar01.o \
+ script/scene/ar02.o \
+ script/scene/bb01.o \
+ script/scene/bb02.o \
+ script/scene/bb03.o \
+ script/scene/bb04.o \
+ script/scene/bb05.o \
+ script/scene/bb06.o \
+ script/scene/bb07.o \
+ script/scene/bb08.o \
+ script/scene/bb09.o \
+ script/scene/bb10.o \
+ script/scene/bb11.o \
+ script/scene/bb12.o \
+ script/scene/bb51.o \
+ script/scene/ct01.o \
+ script/scene/ct02.o \
+ script/scene/ct03.o \
+ script/scene/ct04.o \
+ script/scene/ct05.o \
+ script/scene/ct06.o \
+ script/scene/ct07.o \
+ script/scene/ct08.o \
+ script/scene/ct09.o \
+ script/scene/ct10.o \
+ script/scene/ct11.o \
+ script/scene/ct12.o \
+ script/scene/ct51.o \
+ script/scene/dr01.o \
+ script/scene/dr02.o \
+ script/scene/dr03.o \
+ script/scene/dr04.o \
+ script/scene/dr05.o \
+ script/scene/dr06.o \
+ script/scene/hc01.o \
+ script/scene/hc02.o \
+ script/scene/hc03.o \
+ script/scene/hc04.o \
+ script/scene/hf01.o \
+ script/scene/hf02.o \
+ script/scene/hf03.o \
+ script/scene/hf04.o \
+ script/scene/hf05.o \
+ script/scene/hf06.o \
+ script/scene/kp01.o \
+ script/scene/kp02.o \
+ script/scene/kp03.o \
+ script/scene/kp04.o \
+ script/scene/kp05.o \
+ script/scene/kp06.o \
+ script/scene/kp07.o \
+ script/scene/ma01.o \
+ script/scene/ma02.o \
+ script/scene/ma04.o \
+ script/scene/ma05.o \
+ script/scene/ma06.o \
+ script/scene/ma07.o \
+ script/scene/ma08.o \
+ script/scene/nr01.o \
+ script/scene/nr02.o \
+ script/scene/nr03.o \
+ script/scene/nr04.o \
+ script/scene/nr05.o \
+ script/scene/nr06.o \
+ script/scene/nr07.o \
+ script/scene/nr08.o \
+ script/scene/nr09.o \
+ script/scene/nr10.o \
+ script/scene/nr11.o \
+ script/scene/ps01.o \
+ script/scene/ps02.o \
+ script/scene/ps03.o \
+ script/scene/ps04.o \
+ script/scene/ps05.o \
+ script/scene/ps06.o \
+ script/scene/ps07.o \
+ script/scene/ps09.o \
+ script/scene/ps10.o \
+ script/scene/ps11.o \
+ script/scene/ps12.o \
+ script/scene/ps13.o \
+ script/scene/ps14.o \
+ script/scene/ps15.o \
+ script/scene/rc01.o \
+ script/scene/rc02.o \
+ script/scene/rc03.o \
+ script/scene/rc04.o \
+ script/scene/rc51.o \
+ script/scene/tb02.o \
+ script/scene/tb03.o \
+ script/scene/tb05.o \
+ script/scene/tb06.o \
+ script/scene/tb07.o \
+ script/scene/ug01.o \
+ script/scene/ug02.o \
+ script/scene/ug03.o \
+ script/scene/ug04.o \
+ script/scene/ug05.o \
+ script/scene/ug06.o \
+ script/scene/ug07.o \
+ script/scene/ug08.o \
+ script/scene/ug09.o \
+ script/scene/ug10.o \
+ script/scene/ug12.o \
+ script/scene/ug13.o \
+ script/scene/ug14.o \
+ script/scene/ug15.o \
+ script/scene/ug16.o \
+ script/scene/ug17.o \
+ script/scene/ug18.o \
+ script/scene/ug19.o \
set.o \
settings.o \
set_effects.o \
diff --git a/engines/bladerunner/scene.cpp b/engines/bladerunner/scene.cpp
index abf0285..05abfbe 100644
--- a/engines/bladerunner/scene.cpp
+++ b/engines/bladerunner/scene.cpp
@@ -31,7 +31,7 @@
#include "bladerunner/items.h"
#include "bladerunner/settings.h"
#include "bladerunner/scene_objects.h"
-#include "bladerunner/script/script.h"
+#include "bladerunner/script/scene.h"
#include "bladerunner/slice_renderer.h"
#include "common/str.h"
@@ -78,11 +78,11 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
_vqaPlayer = new VQAPlayer(_vm);
Common::String sceneName = _vm->_gameInfo->getSceneName(sceneId);
- if (!_vm->_script->open(sceneName))
+ if (!_vm->_sceneScript->Open(sceneName))
return false;
if (!isLoadingGame)
- _vm->_script->InitializeScene();
+ _vm->_sceneScript->InitializeScene();
Common::String setResourceName = Common::String::format("%s-MIN.SET", sceneName.c_str());
if (!_set->open(setResourceName))
@@ -93,7 +93,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
if (isLoadingGame) {
// TODO: Advance VQA frame
if (sceneId >= 73 && sceneId <= 76)
- _vm->_script->SceneLoaded();
+ _vm->_sceneScript->SceneLoaded();
return true;
}
@@ -110,7 +110,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
_vm->_playerActor->setAtXYZ(_actorStartPosition, _actorStartFacing);
_vm->_playerActor->setSetId(setId);
- _vm->_script->SceneLoaded();
+ _vm->_sceneScript->SceneLoaded();
_vm->_sceneObjects->clear();
@@ -137,7 +137,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
// TODO: calculate walking obstacles??
if (_specialLoopMode) {
- _vm->_script->PlayerWalkedIn();
+ _vm->_sceneScript->PlayerWalkedIn();
}
return true;
@@ -151,7 +151,7 @@ bool Scene::close(bool isLoadingGame) {
//_vm->_policeMaze->clear(!isLoadingGame);
if (isLoadingGame) {
- _vm->_script->PlayerWalkedOut();
+ _vm->_sceneScript->PlayerWalkedOut();
}
// if (SceneScript_isLoaded() && !SceneScript_unload()) {
diff --git a/engines/bladerunner/script/ai.cpp b/engines/bladerunner/script/ai.cpp
new file mode 100644
index 0000000..d51200d
--- /dev/null
+++ b/engines/bladerunner/script/ai.cpp
@@ -0,0 +1,168 @@
+/* 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.h"
+
+#include "bladerunner/bladerunner.h"
+
+#include "bladerunner/actor.h"
+
+namespace BladeRunner {
+
+AIScripts::AIScripts(BladeRunnerEngine *vm, int actorsCount) : _vm(vm), _inScriptCounter(0) {
+ _actorsCount = actorsCount;
+ _actorUpdating = new bool[actorsCount];
+ _AIScripts = new AIScriptBase*[actorsCount];
+ for (int i = 0; i < actorsCount; ++i) {
+ _AIScripts[i] = nullptr;
+ _actorUpdating[i] = false;
+ }
+
+ _AIScripts[0] = new AIScriptMcCoy(_vm);
+ _AIScripts[15] = new AIScriptRunciter(_vm);
+ _AIScripts[23] = new AIScriptOfficerLeroy(_vm);
+}
+
+AIScripts::~AIScripts() {
+ for (int i = 0; i < _actorsCount; ++i) {
+ delete _AIScripts[i];
+ _AIScripts[i] = nullptr;
+ }
+ delete[] _AIScripts;
+ delete[] _actorUpdating;
+}
+
+void AIScripts::Initialize(int actor) {
+ assert(actor < _actorsCount);
+ if (_AIScripts[actor])
+ _AIScripts[actor]->Initialize();
+}
+
+void AIScripts::Update(int actor) {
+ assert(actor < _actorsCount);
+ if (this->_actorUpdating[actor] != 1) {
+ this->_actorUpdating[actor] = true;
+ ++this->_inScriptCounter;
+ if (_AIScripts[actor])
+ _AIScripts[actor]->Update();
+ --this->_inScriptCounter;
+ this->_actorUpdating[actor] = false;
+ }
+}
+
+void AIScripts::TimerExpired(int actor, int timer) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->TimerExpired(timer);
+ }
+ _inScriptCounter--;
+}
+
+void AIScripts::CompletedMovementTrack(int actor) {
+ assert(actor < _actorsCount);
+ if (!_vm->_actors[actor]->inCombat()) {
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->CompletedMovementTrack();
+ }
+ _inScriptCounter--;
+ }
+}
+
+void AIScripts::EnteredScene(int actor, int setId) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->EnteredScene(setId);
+ }
+ _inScriptCounter--;
+}
+
+void AIScripts::OtherAgentEnteredThisScene(int actor, int otherActorId) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->OtherAgentEnteredThisScene(otherActorId);
+ }
+ _inScriptCounter--;
+}
+
+void AIScripts::OtherAgentExitedThisScene(int actor, int otherActorId) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->OtherAgentExitedThisScene(otherActorId);
+ }
+ _inScriptCounter--;
+}
+
+void AIScripts::Retired(int actor, int retiredByActorId) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->Retired(retiredByActorId);
+ }
+ _inScriptCounter--;
+}
+
+void AIScripts::GoalChanged(int actor, int currentGoalNumber, int newGoalNumber) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->GoalChanged(currentGoalNumber, newGoalNumber);
+ }
+ _inScriptCounter--;
+}
+
+bool AIScripts::ReachedMovementTrackWaypoint(int actor, int waypointId) {
+ assert(actor < _actorsCount);
+ bool result = false;
+ if (!_vm->_actors[actor]->inCombat()) {
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ result = _AIScripts[actor]->ReachedMovementTrackWaypoint(waypointId);
+ }
+ _inScriptCounter--;
+ }
+ return result;
+}
+
+void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->UpdateAnimation(animation, frame);
+ }
+ _inScriptCounter--;
+}
+
+void AIScripts::ChangeAnimationMode(int actor, int mode) {
+ assert(actor < _actorsCount);
+ _inScriptCounter++;
+ if (_AIScripts[actor]) {
+ _AIScripts[actor]->ChangeAnimationMode(mode);
+ }
+ _inScriptCounter--;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai.h b/engines/bladerunner/script/ai.h
new file mode 100644
index 0000000..056b22a
--- /dev/null
+++ b/engines/bladerunner/script/ai.h
@@ -0,0 +1,174 @@
+/* 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.
+ *
+ */
+
+#ifndef BLADERUNNER_SCRIPT_AI_H
+#define BLADERUNNER_SCRIPT_AI_H
+
+#include "bladerunner/script/script.h"
+
+namespace BladeRunner {
+
+class BladeRunnerEngine;
+
+class AIScriptBase : public ScriptBase {
+public:
+ AIScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {}
+
+ virtual void Initialize() = 0;
+ virtual bool Update() = 0;
+ virtual void TimerExpired(int timer) = 0;
+ virtual void CompletedMovementTrack() = 0;
+ virtual void ReceivedClue(int clueId, int fromActorId) = 0;
+ virtual void ClickedByPlayer() = 0;
+ virtual void EnteredScene(int setId) = 0;
+ virtual void OtherAgentEnteredThisScene(int otherActorId) = 0;
+ virtual void OtherAgentExitedThisScene(int otherActorId) = 0;
+ virtual void OtherAgentEnteredCombatMode(int otherActorId, int combatMode) = 0;
+ virtual void ShotAtAndMissed() = 0;
+ virtual void ShotAtAndHit() = 0;
+ virtual void Retired(int byActorId) = 0;
+ virtual int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) = 0;
+ virtual bool GoalChanged(int currentGoalNumber, int newGoalNumber) = 0;
+ virtual bool UpdateAnimation(int *animation, int *frame) = 0;
+ virtual bool ChangeAnimationMode(int mode) = 0;
+ virtual void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) = 0;
+ virtual void SetAnimationState(int animationState, int a2, int a3, int a4) = 0;
+ virtual bool ReachedMovementTrackWaypoint(int waypointId) = 0;
+ virtual void FledCombat() = 0;
+};
+
+#define DECLARE_SCRIPT(name) \
+class AIScript##name : public AIScriptBase { \
+public: \
+ AIScript##name(BladeRunnerEngine *vm) \
+ : AIScriptBase(vm) \
+ {} \
+ void Initialize(); \
+ bool Update(); \
+ void TimerExpired(int timer); \
+ void CompletedMovementTrack(); \
+ void ReceivedClue(int clueId, int fromActorId); \
+ void ClickedByPlayer(); \
+ void EnteredScene(int setId); \
+ void OtherAgentEnteredThisScene(int otherActorId); \
+ void OtherAgentExitedThisScene(int otherActorId); \
+ void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); \
+ void ShotAtAndMissed(); \
+ void ShotAtAndHit(); \
+ void Retired(int byActorId); \
+ int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); \
+ bool GoalChanged(int currentGoalNumber, int newGoalNumber); \
+ bool UpdateAnimation(int *animation, int *frame); \
+ bool ChangeAnimationMode(int mode); \
+ void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4); \
+ void SetAnimationState(int animationState, int a2, int a3, int a4); \
+ bool ReachedMovementTrackWaypoint(int waypointId); \
+ void FledCombat(); \
+private:
+#define END_SCRIPT };
+
+DECLARE_SCRIPT(McCoy)
+ int dword_45A0D0_animation_state;
+ int dword_45A0D4_animation_frame;
+ int dword_45A0D8;
+ int dword_45A0DC;
+ int dword_45A0E0;
+ int dword_45A0E4;
+ float off_45A0EC;
+ int dword_45A0E8;
+ int dword_45A0F0;
+ int dword_45A0F4;
+ int dword_45A0F8;
+ int dword_45A0FC;
+ int dword_462718;
+ int dword_46271C;
+ float off_45A100;
+ float flt_462710;
+ float flt_462714;
+
+ void sub_4053E0();
+ void sub_4054F0();
+ void sub_405660();
+ void sub_405800();
+ void sub_4058B0();
+ void sub_405920();
+ void sub_405940(float a1);
+ void sub_4059D0(float a1);
+END_SCRIPT
+
+DECLARE_SCRIPT(Runciter)
+ int var_45CD70_animation_state;
+ int var_45CD74_animation_frame;
+ int var_462800;
+ int var_462804;
+ int var_45CD78;
+ int var_45CD7C;
+ int var_45CD80;
+ int var_45CD84;
+ int var_45CD88;
+END_SCRIPT
+
+DECLARE_SCRIPT(OfficerLeroy)
+ int var_45D5B0_animation_state;
+ int var_45D5B4_animation_frame;
+ int var_45D5B8;
+ int var_45D5BC;
+ int var_462880;
+ int var_462884;
+
+ bool sub_431408();
+ bool sub_431420();
+END_SCRIPT
+
+#undef DECLARE_SCRIPT
+#undef END_SCRIPT
+
+class AIScripts {
+private:
+ BladeRunnerEngine *_vm;
+ int _inScriptCounter;
+ int _actorsCount;
+ AIScriptBase **_AIScripts;
+ bool *_actorUpdating;
+public:
+ AIScripts(BladeRunnerEngine *vm, int actorsCount);
+ ~AIScripts();
+
+ void Initialize(int actor);
+ void Update(int actor);
+ void TimerExpired(int actor, int timer);
+ void CompletedMovementTrack(int actor);
+ void EnteredScene(int actor, int setId);
+ void OtherAgentEnteredThisScene(int actor, int otherActorId);
+ void OtherAgentExitedThisScene(int actor, int otherActorId);
+ void Retired(int actor, int retiredByActorId);
+ void GoalChanged(int actor, int currentGoalNumber, int newGoalNumber);
+ bool ReachedMovementTrackWaypoint(int actor, int waypointId);
+ void UpdateAnimation(int actor, int *animation, int *frame);
+ void ChangeAnimationMode(int actor, int mode);
+
+ bool IsInsideScript() { return _inScriptCounter > 0; }
+};
+
+} // End of namespace BladeRunner
+
+#endif
diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp
new file mode 100644
index 0000000..fb9561c
--- /dev/null
+++ b/engines/bladerunner/script/ai/mccoy.cpp
@@ -0,0 +1,1851 @@
+/* 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.h"
+
+namespace BladeRunner {
+
+void AIScriptMcCoy::Initialize() {
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D8 = 0;
+ dword_45A0DC = 30;
+ dword_45A0E0 = 1;
+ dword_45A0E4 = 0;
+ off_45A0EC = 0;
+ dword_45A0E8 = 3;
+ dword_45A0F0 = 3;
+ dword_45A0F4 = 20;
+ dword_45A0F8 = -1;
+ dword_45A0FC = 0;
+ off_45A100 = 0;
+ Actor_Set_Goal_Number(0, 0);
+}
+
+bool AIScriptMcCoy::Update() {
+ if (dword_45A0F8 != -1) {
+ Sound_Play(dword_45A0F8, 100, 0, 0, 50);
+ dword_45A0F8 = -1;
+ }
+ switch (Actor_Query_Goal_Number(0)) {
+ case 101:
+ Actor_Set_Goal_Number(0, 102);
+ return true;
+ case 102:
+ if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 36 && !Game_Flag_Query(375)) {
+ Actor_Change_Animation_Mode(0, 21);
+ Game_Flag_Set(375);
+ }
+ if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 4) {
+ Actor_Set_Goal_Number(0, 103);
+ }
+ return true;
+ case 201:
+ Actor_Set_Goal_Number(0, 0);
+ if (Player_Query_Current_Set() == 55) {
+ Loop_Actor_Walk_To_XYZ(0, -166.0f, -70.19f, -501.0f, 0, 0, false, 0);
+ Actor_Face_Heading(0, 300, false);
+ } else {
+ Loop_Actor_Walk_To_XYZ(0, -461.0f, 0.0f, -373.0f, 0, 0, false, 0);
+ }
+ Player_Gains_Control();
+ return true;
+ case 212:
+ if (Global_Variable_Query(47) >= 13) {
+ Global_Variable_Set(47, 500);
+ } else if (Global_Variable_Query(47) > 0) {
+ Global_Variable_Decrement(47, 1);
+ }
+ break;
+ case 221:
+ Actor_Set_Goal_Number(0, 0);
+ Actor_Set_Goal_Number(18, 212);
+ return true;
+ case 309:
+ sub_4053E0();
+ break;
+ case 391:
+ Actor_Retired_Here(0, 12, 48, 1, -1);
+ Actor_Set_Goal_Number(0, 599);
+ break;
+ case 231:
+ sub_4053E0();
+ break;
+ }
+ return false;
+}
+
+void AIScriptMcCoy::TimerExpired(int timer) {
+}
+
+void AIScriptMcCoy::CompletedMovementTrack() {
+}
+
+void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) {
+ switch (clueId) {
+ case 8:
+ case 9:
+ Spinner_Set_Selectable_Destination_Flag(3, 1);
+ break;
+ case 44:
+ case 47:
+ Spinner_Set_Selectable_Destination_Flag(4, 1);
+ break;
+ case 53:
+ case 263:
+ if (Query_Difficulty_Level() == 0) {
+ Spinner_Set_Selectable_Destination_Flag(4, 1);
+ }
+ break;
+ case 90:
+ Spinner_Set_Selectable_Destination_Flag(8, 1);
+ break;
+ case 84:
+ case 113:
+ case 114:
+ case 115:
+ case 118:
+ Spinner_Set_Selectable_Destination_Flag(9, 1);
+ Spinner_Set_Selectable_Destination_Flag(8, 1);
+ break;
+ case 66:
+ case 80:
+ case 82:
+ case 83:
+ Global_Variable_Increment(49, 1);
+ break;
+ case 125:
+ Global_Variable_Increment(49, 5);
+ break;
+ case 124:
+ case 128:
+ Global_Variable_Increment(49, 3);
+ break;
+ case 120:
+ case 121:
+ Global_Variable_Increment(49, 2);
+ break;
+ case 147:
+ case 148:
+ case 149:
+ case 150:
+ case 151:
+ case 152:
+ Global_Variable_Increment(48, 1);
+ break;
+ }
+ if (Global_Variable_Query(49) > 6 && Global_Variable_Query(1) > 3 && !Actor_Clue_Query(0, 126)) {
+ Delay(500);
+ Actor_Voice_Over(3320, 99);
+ switch (clueId) {
+ case 66:
+ case 80:
+ case 82:
+ case 83:
+ case 121:
+ case 128:
+ Actor_Voice_Over(3340, 99);
+ Actor_Voice_Over(3350, 99);
+ Actor_Voice_Over(3360, 99);
+ Actor_Voice_Over(3370, 99);
+ Actor_Voice_Over(3380, 99);
+ break;
+ case 124:
+ Actor_Voice_Over(3330, 99);
+ break;
+ case 120:
+ Actor_Voice_Over(3390, 99);
+ Actor_Voice_Over(3400, 99);
+ Actor_Voice_Over(3420, 99);
+ break;
+ }
+ Actor_Clue_Acquire(0, 126, 1, -1);
+ if (clueId == 125) {
+ Actor_Voice_Over(2780, 99);
+ Actor_Voice_Over(2800, 99);
+ Actor_Voice_Over(2810, 99);
+ } else if (Actor_Clue_Query(0, 125)) {
+ Actor_Voice_Over(3430, 99);
+ Actor_Voice_Over(3440, 99);
+ Actor_Voice_Over(3450, 99);
+ Actor_Voice_Over(3460, 99);
+ Actor_Voice_Over(3470, 99);
+ Actor_Voice_Over(3480, 99);
+ Actor_Voice_Over(3490, 99);
+ Actor_Voice_Over(3500, 99);
+ } else {
+ Actor_Voice_Over(3510, 99);
+ Actor_Voice_Over(3520, 99);
+ Actor_Voice_Over(3530, 99);
+ Actor_Voice_Over(3540, 99);
+ }
+ }
+}
+
+void AIScriptMcCoy::ClickedByPlayer() {
+}
+
+void AIScriptMcCoy::EnteredScene(int sceneId) {
+}
+
+void AIScriptMcCoy::OtherAgentEnteredThisScene(int otherActorId) {
+}
+
+void AIScriptMcCoy::OtherAgentExitedThisScene(int otherActorId) {
+}
+
+void AIScriptMcCoy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+}
+
+void AIScriptMcCoy::ShotAtAndMissed() {
+}
+
+void AIScriptMcCoy::ShotAtAndHit() {
+}
+
+void AIScriptMcCoy::Retired(int byActorId) {
+ if (byActorId == 1 && Actor_Query_In_Set(1, 42)) {
+ if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) != 599) {
+ Non_Player_Actor_Combat_Mode_On(1, 3, 1, 3, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) != 599) {
+ Non_Player_Actor_Combat_Mode_On(1, 3, 1, 6, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ }
+ }
+ if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) {
+ Non_Player_Actor_Combat_Mode_On(23, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ }
+ if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) {
+ Non_Player_Actor_Combat_Mode_On(24, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ }
+ if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) {
+ Non_Player_Actor_Combat_Mode_On(23, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ }
+ if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) {
+ Non_Player_Actor_Combat_Mode_On(24, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
+ }
+}
+
+int AIScriptMcCoy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ return 0;
+}
+
+bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ unsigned int v5;
+ unsigned int v7;
+
+ switch (newGoalNumber) {
+ case 0:
+ return true;
+ case 1:
+ sub_4058B0();
+ return true;
+ case 2:
+ sub_405920();
+ return true;
+ case 100:
+ Actor_Set_At_Waypoint(0, 315, 263);
+ dword_45A0D0_animation_state = 53;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ Actor_Set_Invisible(0, false);
+ return true;
+ case 102:
+ Async_Actor_Walk_To_Waypoint(0, 316, 0, 1);
+ return true;
+ case 103:
+ Actor_Face_Actor(0, 8, true);
+ return true;
+ case 231:
+ Player_Set_Combat_Mode(false);
+ Preload(18);
+ Set_Enter(59, 63);
+ Player_Loses_Control();
+ Actor_Force_Stop_Walking(0);
+ Actor_Put_In_Set(0, 59);
+ Actor_Set_At_XYZ(0, 14.0f, 110.84f, -300.0f, 926);
+ Actor_Change_Animation_Mode(0, 48);
+ dword_45A0D0_animation_state = 27;
+ dword_45A0D4_animation_frame = 0;
+ flt_462714 = 2.84f;
+ flt_462710 = 110.84f;
+ off_45A100 = -6.0f;
+ return true;
+ case 230:
+ dword_45A0FC = Actor_Query_Goal_Number(1) == 215;
+ Actor_Change_Animation_Mode(0, 6);
+ return true;
+ case 220:
+ Actor_Change_Animation_Mode(0, 75);
+ return true;
+ case 212:
+ Global_Variable_Set(47, 0);
+ Player_Set_Combat_Mode_Access(false);
+ Player_Gains_Control();
+ Scene_Exits_Disable();
+ dword_45A0D0_animation_state = 68;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ return true;
+ case 211:
+ Actor_Face_Heading(0, 512, false);
+ Actor_Face_Heading(0, 768, true);
+ if (Random_Query(0, 1)) {
+ Actor_Change_Animation_Mode(0, 18);
+ } else {
+ Actor_Change_Animation_Mode(0, 16);
+ }
+ Delay(150);
+ Actor_Change_Animation_Mode(0, 0);
+ Actor_Set_Goal_Number(0, 0);
+ Player_Gains_Control();
+ return true;
+ case 210:
+ Actor_Put_In_Set(0, 54);
+ Actor_Set_At_XYZ(0, -204.0, 24.0, -817.0, 256);
+ Actor_Set_Invisible(0, false);
+ if (Game_Flag_Query(627)) {
+ Actor_Set_Goal_Number(0, 212);
+ } else {
+ dword_45A0D0_animation_state = 53;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ Actor_Set_Invisible(0, false);
+ }
+ return true;
+ case 200:
+ Player_Loses_Control();
+ Actor_Change_Animation_Mode(0, 0);
+ return true;
+ case 301:
+ dword_45A0D0_animation_state = 62;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 302:
+ dword_45A0D0_animation_state = 64;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 303:
+ dword_45A0D0_animation_state = 65;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 350:
+ Sound_Play(123, 50, 0, 0, 50);
+ Delay(1000);
+ Sound_Play(403, 30, 0, 0, 50);
+ Delay(1000);
+ Sound_Play(123, 50, 0, 0, 50);
+ Actor_Says(4, 1380, 3);
+ Actor_Says(0, 6610, 13);
+ Actor_Says(4, 1390, 3);
+ Actor_Says(0, 6615, 18);
+ Actor_Says(4, 1420, 3);
+ Actor_Says(0, 6625, 11);
+ Actor_Says(4, 1430, 3);
+ Actor_Says(0, 6630, 12);
+ Actor_Says(0, 6635, 17);
+ Actor_Says(0, 6640, 13);
+ Actor_Says(0, 6645, 19);
+ Actor_Says(0, 6650, 18);
+ Actor_Says(0, 6655, 11);
+ Actor_Says(4, 1440, 3);
+ Actor_Says(0, 6660, 17);
+ Actor_Says(0, 6665, 13);
+ Delay(1000);
+ Actor_Says(4, 1450, 3);
+ Actor_Says(0, 6670, 14);
+ Actor_Says(0, 6675, 11);
+ Actor_Says(4, 1460, 3);
+ Actor_Says(0, 6680, 12);
+ Actor_Says(4, 1470, 3);
+ Actor_Says(0, 6685, 13);
+ Delay(500);
+ Actor_Says(0, 6695, 16);
+ Actor_Says(0, 6700, 17);
+ Actor_Says(4, 1480, 3);
+ Actor_Says(0, 6705, 11);
+ Sound_Play(123, 50, 0, 0, 50);
+ return true;
+ case 390:
+ Actor_Force_Stop_Walking(0);
+ Player_Loses_Control();
+ flt_462710 = 48.07f;
+ off_45A100 = -4.0f;
+ flt_462714 = -20.0f;
+ if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
+ dword_45A0D0_animation_state = 50;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ }
+ return true;
+ case 400:
+ Actor_Set_Health(0, 50, 50);
+ Game_Flag_Set(373);
+ v5 = Global_Variable_Query(45);
+ if (v5 == 1) {
+ Actor_Modify_Friendliness_To_Other(1, 0, 3);
+ } else if (v5 == 2) {
+ Actor_Modify_Friendliness_To_Other(1, 0, -5);
+ Actor_Modify_Friendliness_To_Other(5, 0, 3);
+ } else if (v5 == 3) {
+ Actor_Modify_Friendliness_To_Other(1, 0, -5);
+ Actor_Modify_Friendliness_To_Other(5, 0, 5);
+ }
+ if (Game_Flag_Query(666)) {
+ Actor_Modify_Friendliness_To_Other(1, 0, 3);
+ }
+ if (Actor_Query_Friendliness_To_Other(1, 0) < Actor_Query_Friendliness_To_Other(5, 0)) {
+ Game_Flag_Set(653);
+ }
+ v7 = Global_Variable_Query(45);
+ if (v7 == 1) {
+ if (Game_Flag_Query(653)) {
+ Global_Variable_Set(45, 0);
+ }
+ } else if (v7 == 2 || v7 == 3) {
+ if (!Game_Flag_Query(653)) {
+ Global_Variable_Set(45, 0);
+ }
+ }
+ if (!Game_Flag_Query(653)) {
+ Game_Flag_Set(461);
+ }
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
+ Ambient_Sounds_Remove_All_Looping_Sounds(1);
+ Global_Variable_Set(1, 5);
+ Outtake_Play(10, 0, -1);
+ if (Game_Flag_Query(666)) {
+ Chapter_Enter(5, 53, 53);
+ } else {
+ Game_Flag_Set(34);
+ Chapter_Enter(5, 10, 49);
+ }
+ return true;
+ case 500:
+ Music_Stop(3);
+ Player_Set_Combat_Mode(false);
+ Actor_Change_Animation_Mode(0, 0);
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ Game_Flag_Set(465);
+ Set_Enter(67, 72);
+ return true;
+ }
+ return false;
+}
+
+bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
+ int v7, v18, v19, v46;
+ switch (dword_45A0D0_animation_state) {
+ case 71:
+ *animation = 52;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(52)) {
+ Actor_Change_Animation_Mode(0, 0);
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ Player_Gains_Control();
+ }
+ break;
+ case 70:
+ *animation = 51;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(51)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ break;
+ case 69:
+ *animation = 50;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(50)) {
+ Actor_Change_Animation_Mode(0, 53);
+ *animation = 51;
+ }
+ break;
+ case 68:
+ *animation = 18;
+ v7 = Slice_Animation_Query_Number_Of_Frames(*animation) - 1 - Global_Variable_Query(47);
+ if (dword_45A0D4_animation_frame < v7) {
+ dword_45A0D4_animation_frame++;
+ } else if (dword_45A0D4_animation_frame > v7) {
+ dword_45A0D4_animation_frame--;
+ }
+ if (dword_45A0D4_animation_frame <= 0) {
+ Actor_Change_Animation_Mode(0, 0);
+ *animation = 19;
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ Game_Flag_Reset(627);
+ Scene_Exits_Enable();
+ Player_Set_Combat_Mode_Access(true);
+ Actor_Set_Goal_Number(0, 0);
+ }
+ break;
+ case 67:
+ *animation = 53;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(53)) {
+ Actor_Change_Animation_Mode(0, 0);
+ *animation = 19;
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ if (Actor_Query_Goal_Number(0) == 220) {
+ Actor_Change_Animation_Mode(0, 48);
+ }
+ }
+ break;
+ case 66:
+ *animation = 40;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(40)) {
+ Actor_Change_Animation_Mode(0, 0);
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ }
+ break;
+ case 65:
+ *animation = 45;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(45)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 14;
+ *animation = 0;
+ Actor_Set_Goal_Number(0, 0);
+ }
+ break;
+ case 64:
+ *animation = 44;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(44)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 63;
+ *animation = 43;
+ }
+ break;
+ case 63:
+ *animation = 43;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(43)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ break;
+ case 62:
+ *animation = 42;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(42)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 63;
+ *animation = 43;
+ }
+ break;
+ case 61:
+ *animation = 41;
+ dword_45A0D4_animation_frame--;
+ if (dword_45A0D4_animation_frame <= 0) {
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ if (Actor_Query_Goal_Number(0) == 200) {
+ Actor_Set_Goal_Number(0, 201);
+ }
+ }
+ break;
+ case 60:
+ *animation = 41;
+ if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(41) - 1) {
+ dword_45A0D4_animation_frame++;
+ }
+ return true;
+ case 59:
+ *animation = 48;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(48)) {
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0DC = 0;
+ dword_45A0D0_animation_state = 0;
+ Player_Gains_Control();
+ Item_Add_To_World(109, 982, 6, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false);
+ }
+ break;
+ case 58:
+ *animation = 47;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame == 6) {
+ v18 = Random_Query(0, 2);
+ v19 = 0;
+ if (v18 == 0) {
+ v19 = 595;
+ } else if (v18 == 1) {
+ v19 = 594;
+ } else if (v18 == 2) {
+ v19 = 593;
+ }
+ Ambient_Sounds_Play_Sound(v19, 39, 0, 0, 99);
+ }
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { //why -1?
+ dword_45A0D4_animation_frame = 0;
+ }
+ break;
+ case 57:
+ *animation = 46;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(46)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ if (!Game_Flag_Query(550)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 59;
+ *animation = 48;
+ }
+ break;
+ case 56:
+ *animation = 49;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(49)) {
+ dword_45A0D4_animation_frame = 0;
+ if (Actor_Query_Which_Set_In(0) == 87) {
+ dword_45A0D0_animation_state = 27;
+ } else {
+ *animation = 19;
+ dword_45A0D0_animation_state = 0;
+ Actor_Change_Animation_Mode(0, 0);
+ }
+ }
+ break;
+ case 55:
+ *animation = 32;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame == 7) {
+ Actor_Change_Animation_Mode(66, 52);
+ }
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ *animation = 19;
+ dword_45A0D0_animation_state = 0;
+ }
+ break;
+ case 53:
+ *animation = 18;
+ dword_45A0D4_animation_frame--;
+ if (dword_45A0D4_animation_frame <= 0) {
+ Actor_Change_Animation_Mode(0, 0);
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ if (Actor_Query_Goal_Number(0) == 100) {
+ Actor_Set_Goal_Number(0, 101);
+ }
+ if (Actor_Query_Goal_Number(0) == 210) {
+ Actor_Set_Goal_Number(0, 211);
+ }
+ }
+ break;
+ case 52:
+ *animation = 31;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(31)) {
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(31) - 1;
+ dword_45A0D0_animation_state = 50;
+ }
+ break;
+ case 51:
+ *animation = 28;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(28)) {
+ Player_Set_Combat_Mode(true);
+ sub_405800();
+ Actor_Set_Goal_Number(0, 0);
+ dword_45A0D4_animation_frame = 0;
+ Player_Gains_Control();
+ }
+ break;
+ case 50:
+ *animation = 18;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ break;
+ case 49:
+ *animation = 34;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(34)) {
+ Actor_Set_Goal_Number(0, 0);
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ sub_405660();
+ }
+ break;
+ case 48:
+ *animation = 33;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(33)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 49;
+ *animation = 34;
+ }
+ break;
+ case 47:
+ *animation = 29;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(29)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 48;
+ *animation = 33;
+ }
+ break;
+ case 46:
+ Actor_Set_Invisible(0, false);
+ *animation = 36;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(36)) {
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ Player_Gains_Control();
+ sub_405660();
+ Actor_Face_Heading(0, (Actor_Query_Facing_1024(0) + 512) & 1023, false);
+ }
+ break;
+ case 45:
+ *animation = 35;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(35)) {
+ Actor_Set_Invisible(0, true);
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ sub_405660();
+ }
+ break;
+ case 44:
+ *animation = 30;
+ if (dword_45A0D4_animation_frame++ == 127) {
+ Game_Flag_Set(325);
+ }
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(30)) {
+ *animation = 19;
+ sub_405660();
+ Actor_Set_At_XYZ(0, -203.41f, -621.3f, 724.57f, 538);
+ Player_Gains_Control();
+ }
+ break;
+ case 43:
+ *animation = 38;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(38) - 1) { //why -1?
+ dword_45A0D4_animation_frame = 0;
+ }
+ switch (dword_45A0D4_animation_frame) {
+ case 9:
+ Sound_Left_Footstep_Walk(0);
+ break;
+ case 4:
+ Sound_Right_Footstep_Walk(0);
+ break;
+ case 1:
+ Sound_Right_Footstep_Walk(0);
+ break;
+ }
+ break;
+ case 42:
+ *animation = 37;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(37) - 1) { //why -1?
+ dword_45A0D4_animation_frame = 0;
+ }
+ switch (dword_45A0D4_animation_frame) {
+ case 9:
+ Sound_Left_Footstep_Walk(0);
+ break;
+ case 4:
+ Sound_Right_Footstep_Walk(0);
+ break;
+ case 1:
+ Sound_Right_Footstep_Walk(0);
+ break;
+ }
+ break;
+ case 41:
+ *animation = 7;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(7)) {
+ dword_45A0D4_animation_frame = 0;
+ ++off_45A0EC;
+ }
+ if (dword_45A0D4_animation_frame == 9) {
+ Sound_Left_Footstep_Walk(0);
+ } else if (dword_45A0D4_animation_frame == 4) {
+ Sound_Right_Footstep_Walk(0);
+ }
+ if (Game_Flag_Query(359)) {
+ sub_4059D0(-0.2f);
+ }
+ break;
+ case 40:
+ *animation = 6;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(6)) {
+ dword_45A0D4_animation_frame = 0;
+ ++off_45A0EC;
+ }
+ if (dword_45A0D4_animation_frame == 8) {
+ Sound_Left_Footstep_Walk(0);
+ } else if (dword_45A0D4_animation_frame == 3) {
+ Sound_Right_Footstep_Walk(0);
+ }
+ if (Game_Flag_Query(358)) {
+ sub_405940(0.5f);
+ }
+ break;
+ case 39:
+ *animation = 16;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(16)) {
+ dword_45A0D4_animation_frame = 0;
+ ++off_45A0EC;
+ }
+ if (dword_45A0D4_animation_frame == 8) {
+ Sound_Left_Footstep_Walk(0);
+ } else if (dword_45A0D4_animation_frame == 3) {
+ Sound_Right_Footstep_Walk(0);
+ }
+ if (Game_Flag_Query(359)) {
+ sub_4059D0(-0.2f);
+ }
+ break;
+ case 38:
+ *animation = 15;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(15)) {
+ dword_45A0D4_animation_frame = 0;
+ ++off_45A0EC;
+ }
+ if (dword_45A0D4_animation_frame == 9) {
+ Sound_Left_Footstep_Walk(0);
+ } else if (dword_45A0D4_animation_frame == 4) {
+ Sound_Right_Footstep_Walk(0);
+ }
+ if (Game_Flag_Query(358)) {
+ sub_405940(0.5f);
+ }
+ break;
+ case 37:
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(4)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ *animation = 4;
+ if (dword_45A0D4_animation_frame == 6) {
+ Sound_Left_Footstep_Run(0);
+ }
+ if (dword_45A0D4_animation_frame == 0) {
+ Sound_Right_Footstep_Run(0);
+ }
+ break;
+ case 36:
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(3)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ *animation = 3;
+ if (dword_45A0D4_animation_frame == 15) {
+ Sound_Left_Footstep_Walk(0);
+ }
+ if (dword_45A0D4_animation_frame == 6) {
+ Sound_Right_Footstep_Walk(0);
+ }
+ break;
+ case 32:
+ dword_45A0D4_animation_frame = 1;
+ dword_45A0D0_animation_state = 30;
+ *animation = 13;
+ break;
+ case 31:
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(14)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ *animation = 14;
+ if (dword_45A0D4_animation_frame == 5) {
+ Sound_Left_Footstep_Run(0);
+ } else if (dword_45A0D4_animation_frame == 12) {
+ Sound_Right_Footstep_Run(0);
+ }
+ break;
+ case 30:
+ *animation = 13;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(13)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ if (dword_45A0D4_animation_frame == 2) {
+ Sound_Right_Footstep_Walk(0);
+ } else if (dword_45A0D4_animation_frame == 10) {
+ Sound_Left_Footstep_Walk(0);
+ }
+ break;
+ case 29:
+ v46 = dword_45A0D4_animation_frame + dword_45A0E0;
+ *animation = 18;
+ dword_45A0D4_animation_frame = v46;
+ if (v46 < 14) {
+ dword_45A0E0 = 1;
+ }
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
+ Actor_Change_Animation_Mode(0, 48);
+ *animation = 18;
+ dword_45A0D0_animation_state = 27;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ }
+ break;
+ case 28:
+ *animation = 5;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(5)) {
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
+ dword_45A0D0_animation_state = 50;
+ sub_4054F0();
+ }
+ break;
+ case 27:
+ *animation = 18;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(18)) {
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
+ dword_45A0D0_animation_state = 50;
+ sub_4054F0();
+ if (Actor_Query_Goal_Number(0) == 220) {
+ Actor_Set_Goal_Number(0, 221);
+ }
+ }
+ break;
+ case 26:
+ *animation = 17;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) {
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ Actor_Change_Animation_Mode(0, 0);
+ }
+ break;
+ case 25:
+ *animation = 17;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) {
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ Actor_Change_Animation_Mode(0, 0);
+ }
+ break;
+ case 24:
+ *animation = 1;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 14;
+ *animation = 0;
+ Actor_Change_Animation_Mode(0, 4);
+ }
+ break;
+ case 23:
+ *animation = 1;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 14;
+ *animation = 0;
+ Actor_Change_Animation_Mode(0, 4);
+ }
+ break;
+ case 22:
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 17;
+ *animation = 12;
+ break;
+ case 21:
+ *animation = 12;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame == 1 && Actor_Query_Goal_Number(0) == 230 && dword_45A0FC == 1) {
+ dword_45A0F8 = 27;
+ }
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(12)) {
+ dword_45A0D0_animation_state = 17;
+ dword_45A0D4_animation_frame = 0;
+ *animation = 12;
+ if (Actor_Query_Goal_Number(0) == 230) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 21;
+ dword_45A0FC = 1;
+ *animation = 12;
+ }
+ }
+ break;
+ case 19:
+ *animation = 11;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= 12) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 14;
+ *animation = 0;
+ }
+ break;
+ case 18:
+ *animation = 10;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(10)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 17;
+ *animation = 12;
+ }
+ break;
+ case 17:
+ *animation = 12;
+ dword_45A0D4_animation_frame = 0;
+ // weird, but thats in game code
+ if (Slice_Animation_Query_Number_Of_Frames(12) <= 0) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 17;
+ }
+ break;
+ case 16:
+ *animation = 9;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(9)) {
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ }
+ break;
+ case 15:
+ *animation = 8;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(8)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 14;
+ *animation = 0;
+ }
+ break;
+ case 14:
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(0)) {
+ dword_45A0D0_animation_state = 14;
+ dword_45A0D4_animation_frame = 0;
+ }
+ *animation = 0;
+ break;
+ case 13:
+ *animation = 19;
+ if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(19) / 2) {
+ dword_45A0D4_animation_frame -= 3;
+ if (dword_45A0D4_animation_frame <= 0) {
+ dword_45A0D4_animation_frame = 0;
+ *animation = dword_46271C;
+ dword_45A0D0_animation_state = dword_462718;
+ }
+ } else {
+ dword_45A0D4_animation_frame += 3;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) {
+ dword_45A0D4_animation_frame = 0;
+ *animation = dword_46271C;
+ dword_45A0D0_animation_state = dword_462718;
+ }
+ }
+ break;
+ case 12:
+ *animation = 27;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 11:
+ *animation = 26;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(26)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 10:
+ *animation = 25;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(25)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 9:
+ *animation = 24;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(24)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 8:
+ *animation = 23;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(23)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 7:
+ *animation = 22;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(22)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 6:
+ *animation = 27;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 5:
+ *animation = 21;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(21)) {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 3;
+ *animation = 20;
+ }
+ break;
+ case 3:
+ case 4:
+ if (dword_45A0D4_animation_frame == 0 && !Game_Flag_Query(236)) {
+ dword_45A0D4_animation_frame = 1;
+ dword_45A0D0_animation_state = dword_45A0F0;
+ *animation = dword_45A0F4;
+ dword_45A0F0 = 4;
+ dword_45A0F4 = 20;
+ } else if (dword_45A0D4_animation_frame <= 4 && Game_Flag_Query(236)) {
+ Game_Flag_Reset(236);
+ *animation = 19;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 0;
+ } else {
+ *animation = 20;
+ dword_45A0D4_animation_frame++;
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(20)) {
+ dword_45A0D4_animation_frame = 0;
+ }
+ }
+ break;
+ case 0:
+ *animation = 19;
+ if (dword_45A0D8 < dword_45A0DC) {
+ //*frame = dword_45A0E8;
+ dword_45A0D4_animation_frame += dword_45A0E0;
+ if (dword_45A0D4_animation_frame > dword_45A0E8) {
+ dword_45A0D4_animation_frame = dword_45A0E8;
+ dword_45A0E0 = -1;
+ } else if (dword_45A0D4_animation_frame < dword_45A0E4) {
+ dword_45A0D4_animation_frame = dword_45A0E4;
+ dword_45A0E0 = 1;
+ }
+ dword_45A0D8++;
+ } else {
+ dword_45A0D4_animation_frame += dword_45A0E0;
+ dword_45A0DC = 0;
+ if (dword_45A0D4_animation_frame == 18 && Random_Query(0, 2)) {
+ dword_45A0E0 = -1;
+ dword_45A0D8 = 0;
+ dword_45A0E4 = 14;
+ dword_45A0E8 = 18;
+ dword_45A0DC = Random_Query(0, 30);
+ }
+ if (dword_45A0D4_animation_frame == 26) {
+ if (Random_Query(0, 2)) {
+ dword_45A0E0 = -1;
+ dword_45A0D8 = 0;
+ dword_45A0E4 = 23;
+ dword_45A0E8 = 26;
+ dword_45A0DC = Random_Query(0, 30);
+ }
+ }
+ if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) {
+ dword_45A0D4_animation_frame = 0;
+ if (Random_Query(0, 2)) {
+ dword_45A0D8 = 0;
+ dword_45A0E4 = 0;
+ dword_45A0E8 = 3;
+ dword_45A0DC = Random_Query(0, 45);
+ }
+ }
+ if (dword_45A0D4_animation_frame < 0) {
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(19) - 1;
+ }
+ }
+ break;
+ }
+ *frame = dword_45A0D4_animation_frame;
+ return true;
+}
+
+bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
+ int v2;
+ switch (mode) {
+ case 85:
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 69;
+ return true;
+ case 75:
+ dword_45A0D0_animation_state = 67;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 68:
+ dword_45A0D0_animation_state = 29;
+ dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
+ dword_45A0E0 = -1;
+ return true;
+ case 65:
+ case 67:
+ dword_45A0D0_animation_state = 43;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 64:
+ case 66:
+ dword_45A0D0_animation_state = 42;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 53:
+ if (dword_45A0D0_animation_state != 60 && (Player_Query_Current_Set() == 55 || Player_Query_Current_Set() == 13)) {
+ dword_45A0D0_animation_state = 60;
+ dword_45A0D4_animation_frame = 0;
+ } else {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 70;
+ }
+ return true;
+ case 52:
+ dword_45A0D0_animation_state = 55;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 51:
+ dword_45A0D0_animation_state = 27;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 49:
+ dword_45A0D0_animation_state = 28;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 48:
+ switch (dword_45A0D0_animation_state) {
+ case 14:
+ dword_45A0D0_animation_state = 28;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 13:
+ dword_45A0D0_animation_state = 22;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 10:
+ dword_45A0D0_animation_state = 18;
+ dword_45A0D4_animation_frame = 8 * (13 - dword_45A0D4_animation_frame) / 13;
+ return true;
+ case 8:
+ case 9:
+ case 12:
+ return true;
+ case 11:
+ dword_45A0D0_animation_state = 18;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 7:
+ dword_45A0D0_animation_state = 14;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ dword_45A0D0_animation_state = 15;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ default:
+ if (dword_45A0D0_animation_state != 50) {
+ dword_45A0D0_animation_state = 27;
+ dword_45A0D4_animation_frame = 0;
+ }
+ break;
+ }
+ return true;
+ case 47:
+ dword_45A0D0_animation_state = 41;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 46:
+ dword_45A0D0_animation_state = 40;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 45:
+ dword_45A0D0_animation_state = 39;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 44:
+ dword_45A0D0_animation_state = 38;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 42:
+ dword_45A0D0_animation_state = 46;
+ dword_45A0D4_animation_frame = 0;
+ Player_Loses_Control();
+ return true;
+ case 41:
+ dword_45A0D0_animation_state = 45;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 40:
+ dword_45A0D0_animation_state = 44;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 39:
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 52;
+ if (Player_Query_Current_Set() == 27) {
+ dword_45A0D4_animation_frame = 23;
+ }
+ return true;
+ case 38:
+ dword_45A0D0_animation_state = 47;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 29:
+ Player_Loses_Control();
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 71;
+ return true;
+ case 23:
+ dword_45A0D0_animation_state = 66;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 22:
+ if (Random_Query(0, 1)) {
+ dword_45A0D0_animation_state = 23;
+ } else {
+ dword_45A0D0_animation_state = 24;
+ }
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 21:
+ switch (dword_45A0D0_animation_state) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ dword_45A0D0_animation_state = 28;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 1:
+ case 8:
+ dword_45A0D0_animation_state = 27;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ default:
+
+ if (Random_Query(0, 1)) {
+ dword_45A0D0_animation_state = 26;
+ } else {
+ dword_45A0D0_animation_state = 25;
+ }
+ dword_45A0D4_animation_frame = 0;
+ break;
+ }
+ return true;
+ case 20:
+ v2 = Actor_Query_Which_Set_In(0);
+ if (v2 == 27) {
+ dword_45A0D0_animation_state = 51;
+ dword_45A0D4_animation_frame = 0;
+ Player_Loses_Control();
+ Game_Flag_Set(210);
+ } else if (v2 == 70 || v2 == 87) {
+ dword_45A0D0_animation_state = 56;
+ dword_45A0D4_animation_frame = 0;
+ }
+ return true;
+ case 19:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 12;
+ dword_46271C = 27;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 12;
+ dword_45A0F4 = 27;
+ }
+ return true;
+ case 18:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 11;
+ dword_46271C = 26;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 11;
+ dword_45A0F4 = 26;
+ }
+ return true;
+ case 17:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 10;
+ dword_46271C = 25;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 10;
+ dword_45A0F4 = 25;
+ }
+ return true;
+ case 16:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 9;
+ dword_46271C = 24;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 9;
+ dword_45A0F4 = 24;
+ }
+ return true;
+ case 15:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 8;
+ dword_46271C = 23;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 8;
+ dword_45A0F4 = 23;
+ }
+ return true;
+ case 11:
+ case 14:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 7;
+ dword_46271C = 22;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 7;
+ dword_45A0F4 = 22;
+ }
+ return true;
+ case 10:
+ case 13:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 6;
+ dword_46271C = 27;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 6;
+ dword_45A0F4 = 27;
+ }
+ return true;
+ case 9:
+ case 12:
+ if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 5;
+ dword_46271C = 21;
+ } else {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 5;
+ dword_45A0F4 = 21;
+ }
+ return true;
+ case 8:
+ if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
+ dword_45A0D0_animation_state = 37;
+ dword_45A0D4_animation_frame = 0;
+ }
+ return true;
+ case 7:
+ if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
+ dword_45A0D0_animation_state = 36;
+ dword_45A0D4_animation_frame = 0;
+ }
+ return true;
+ case 6:
+ dword_45A0D0_animation_state = 21;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 5:
+ switch (dword_45A0D0_animation_state) {
+ case 1:
+ case 2:
+ case 5:
+ dword_45A0D0_animation_state = 14;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 0:
+ case 3:
+ case 4:
+ dword_45A0D0_animation_state = 15;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ default:
+ dword_45A0D0_animation_state = 18;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ }
+ return true;
+ case 4:
+ switch (dword_45A0D0_animation_state) {
+ case 22:
+ dword_45A0D0_animation_state = 19;
+ dword_45A0D4_animation_frame = 41;
+ break;
+ case 18:
+ dword_45A0D0_animation_state = 19;
+ dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8);
+ break;
+ case 17:
+ case 20:
+ dword_45A0D0_animation_state = 19;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 16:
+ dword_45A0D0_animation_state = 15;
+ dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16;
+ break;
+ case 14:
+ case 15:
+ case 19:
+ case 21:
+ case 2:
+ case 3:
+ return true;
+ default:
+ dword_45A0D0_animation_state = 15;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 13:
+ dword_45A0D0_animation_state = 16;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 0:
+ case 1:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0DC = 0;
+ break;
+ }
+ return true;
+ case 3:
+ if (dword_45A0D0_animation_state >= 3 && dword_45A0D0_animation_state <= 12) {
+ Game_Flag_Reset(236);
+ dword_45A0F0 = 4;
+ dword_45A0F4 = 20;
+ } else {
+ dword_45A0D0_animation_state = 13;
+ dword_462718 = 3;
+ dword_46271C = 20;
+ }
+ return true;
+ case 2:
+ if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) {
+ return true;
+ }
+ if (!Game_Flag_Query(550)) {
+ dword_45A0D0_animation_state = 31;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ }
+ dword_45A0D0_animation_state = 58;
+ dword_45A0D4_animation_frame = 4;
+ return true;
+ case 1:
+ if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) {
+ return true;
+ }
+ if (!Game_Flag_Query(550)) {
+ dword_45A0D0_animation_state = 32;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ }
+ dword_45A0D0_animation_state = 58;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ case 0:
+ if (Game_Flag_Query(550)) {
+ if (dword_45A0D4_animation_frame > 6) {
+ dword_45A0D0_animation_state = 57;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ }
+ int v3 = Random_Query(0, 2);
+ int v4 = 0;
+ if (v3 == 0) {
+ v4 = 595;
+ } else if (v3 == 1) {
+ v4 = 594;
+ } else if (v3 == 2) {
+ v4 = 593;
+ }
+ Ambient_Sounds_Play_Sound(v4, 39, 0, 0, 99);
+ dword_45A0D0_animation_state = 57;
+ dword_45A0D4_animation_frame = 0;
+ return true;
+ }
+ if (dword_45A0D0_animation_state == 60) {
+ dword_45A0D0_animation_state = 61;
+ return true;
+ }
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0DC = 0;
+ return true;
+ }
+ return true;
+}
+
+void AIScriptMcCoy::QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) {
+ *animationState = dword_45A0D0_animation_state;
+ *a2 = dword_45A0D4_animation_frame;
+ *a3 = dword_462718;
+ *a4 = dword_46271C;
+}
+
+void AIScriptMcCoy::SetAnimationState(int animationState, int a2, int a3, int a4) {
+ dword_45A0D0_animation_state = animationState;
+ dword_45A0D4_animation_frame = a2;
+ dword_462718 = a3;
+ dword_46271C = a4;
+}
+
+bool AIScriptMcCoy::ReachedMovementTrackWaypoint(int waypointId) {
+ return true;
+}
+
+void AIScriptMcCoy::FledCombat() {}
+
+void AIScriptMcCoy::sub_4053E0() {
+ float x, y, z;
+ Actor_Query_XYZ(0, &x, &y, &z);
+ flt_462710 = flt_462710 + off_45A100;
+ if (flt_462714 < flt_462710) {
+ off_45A100 = off_45A100 - 0.2f;
+ } else {
+ flt_462710 = flt_462714;
+ Actor_Set_Goal_Number(0, 0);
+ Actor_Retired_Here(0, 12, 48, 1, -1);
+ }
+ return Actor_Set_At_XYZ(0, x, flt_462710, z, Actor_Query_Facing_1024(0));
+}
+
+void AIScriptMcCoy::sub_4054F0() {
+ if (Actor_Query_Which_Set_In(0) == 87 && Actor_Query_Goal_Number(0) != 390 && !Game_Flag_Query(682)) {
+ float x, y, z;
+ Actor_Query_XYZ(0, &x, &y, &z);
+ if ((z < 220.0f) && (-210.0f < x) && (-70.0f > x)) {
+ Game_Flag_Set(682);
+ Scene_Loop_Set_Default(3);
+ Scene_Loop_Start_Special(2, 2, 1);
+ Actor_Set_Goal_Number(0, 390);
+ Actor_Query_XYZ(64, &x, &y, &z);
+ if (-200.0 < x && -62.0f > x) {
+ Actor_Set_Goal_Number(64, 309);
+ }
+ } else {
+ Actor_Set_Goal_Number(0, 391);
+ }
+ }
+}
+
+void AIScriptMcCoy::sub_405660() {
+ if (Game_Flag_Query(550)) {
+ if (dword_45A0D4_animation_frame <= 6) {
+ int v1 = Random_Query(0, 2);
+ int v2 = 0;
+ if (v1 == 0) {
+ v2 = 595;
+ } else if (v1 == 1) {
+ v2 = 594;
+ } else if (v1 == 2) {
+ v2 = 593;
+ }
+ Ambient_Sounds_Play_Sound(v2, 39, 0, 0, 99);
+ }
+ dword_45A0D0_animation_state = 57;
+ dword_45A0D4_animation_frame = 0;
+ return;
+ }
+ switch (dword_45A0D0_animation_state) {
+ case 17:
+ case 20:
+ case 21:
+ case 36:
+ dword_45A0D0_animation_state = 16;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 16:
+ case 25:
+ case 26:
+ break;
+ case 15:
+ dword_45A0D0_animation_state = 16;
+ dword_45A0D4_animation_frame = 16 - 16 * dword_45A0D4_animation_frame / 12;
+ break;
+ case 14:
+ dword_45A0D0_animation_state = 16;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ Game_Flag_Set(236);
+ dword_45A0D8 = 0;
+ dword_45A0DC = 30;
+ dword_45A0E4 = 0;
+ dword_45A0E0 = 1;
+ dword_45A0E8 = 3;
+ break;
+ case 60:
+ dword_45A0D0_animation_state = 61;
+ break;
+ default:
+ dword_45A0D0_animation_state = 0;
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0DC = 0;
+ }
+}
+
+void AIScriptMcCoy::sub_405800() {
+ switch (dword_45A0D0_animation_state) {
+ case 36:
+ case 37:
+ case 40:
+ case 41:
+ case 51:
+ dword_45A0D0_animation_state = 14;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 22:
+ dword_45A0D0_animation_state = 19;
+ dword_45A0D4_animation_frame = 41;
+ break;
+ case 18:
+ dword_45A0D0_animation_state = 19;
+ dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8);
+ break;
+ case 17:
+ case 20:
+ dword_45A0D0_animation_state = 19;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ case 16:
+ dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16;
+ dword_45A0D0_animation_state = 15;
+ break;
+ case 14:
+ case 15:
+ case 19:
+ case 21:
+ break;
+ default:
+ dword_45A0D0_animation_state = 15;
+ dword_45A0D4_animation_frame = 0;
+ break;
+ }
+}
+
+void AIScriptMcCoy::sub_4058B0() {
+ int v0 = Actor_Query_Which_Set_In(0);
+ if (v0 == 27) {
+ dword_45A0D0_animation_state = 51;
+ dword_45A0D4_animation_frame = 0;
+ Player_Loses_Control();
+ Game_Flag_Set(210);
+ } else if (v0 == 70 || v0 == 87) {
+ dword_45A0D0_animation_state = 56;
+ dword_45A0D4_animation_frame = 0;
+ }
+}
+
+void AIScriptMcCoy::sub_405920() {
+ dword_45A0D4_animation_frame = 0;
+ dword_45A0D0_animation_state = 47;
+}
+
+void AIScriptMcCoy::sub_405940(float a1) {
+ float x, y, z;
+ int currentAngle = Actor_Query_Facing_1024(0);
+ Actor_Query_XYZ(0, &x, &y, &z);
+ int angle = currentAngle - 12;
+ y = y + a1;
+ if (angle < 0) {
+ angle = currentAngle + 1012;
+ }
+ if (angle > 1023) {
+ angle -= 1024;
+ }
+ Actor_Set_At_XYZ(0, x, y, z, angle);
+}
+
+void AIScriptMcCoy::sub_4059D0(float a1) {
+ float x, y, z;
+ int currentAngle = Actor_Query_Facing_1024(0);
+ Actor_Query_XYZ(0, &x, &y, &z);
+ int angle = currentAngle + 15;
+ y = y + a1;
+ if (angle < 0) {
+ angle = currentAngle + 1039;
+ }
+ if (angle > 1023) {
+ angle -= 1024;
+ }
+ return Actor_Set_At_XYZ(0, x, y, z, angle);
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai/officer_leroy.cpp b/engines/bladerunner/script/ai/officer_leroy.cpp
new file mode 100644
index 0000000..9dc4165
--- /dev/null
+++ b/engines/bladerunner/script/ai/officer_leroy.cpp
@@ -0,0 +1,1214 @@
+/* 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.h"
+
+namespace BladeRunner {
+
+void AIScriptOfficerLeroy::Initialize() {
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ var_462880 = 0;
+ var_45D5B8 = 0;
+ var_45D5BC = 0;
+
+ Actor_Put_In_Set(23, 69);
+ Actor_Set_At_XYZ(23, -261.80f, 6.00f, 79.58f, 512);
+ Actor_Set_Goal_Number(23, 0);
+ Actor_Set_Frame_Rate_FPS(23, 8);
+}
+
+bool AIScriptOfficerLeroy::Update() {
+ if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(23) < 300) {
+ AI_Movement_Track_Flush(23);
+ Actor_Set_Goal_Number(23, 300);
+ } else if (Global_Variable_Query(1) == 5 && Actor_Query_Goal_Number(23) < 400) {
+ AI_Movement_Track_Flush(23);
+ Actor_Set_Goal_Number(23, 400);
+ } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(163) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) {
+ Game_Flag_Set(186);
+ Actor_Set_Goal_Number(23, 3);
+ } else if (Actor_Query_Goal_Number(23) != 1 && Actor_Query_Goal_Number(23) != 2 && Game_Flag_Query(199) == 1) {
+ Game_Flag_Reset(199);
+ } else if (Global_Variable_Query(15) > 4 && !Actor_Clue_Query(23, 239)) {
+ Actor_Clue_Acquire(23, 239, 1, -1);
+ } else if (Game_Flag_Query(629) == 1) {
+ Game_Flag_Reset(629);
+ } else if (Game_Flag_Query(623) == 1 && !Game_Flag_Query(664)) {
+ Game_Flag_Set(664);
+ Actor_Set_Goal_Number(23, 305);
+ } else if (Actor_Query_Goal_Number(23) == 310 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) {
+ Non_Player_Actor_Combat_Mode_Off(23);
+ Actor_Set_Goal_Number(23, 305);
+ } else if (Actor_Query_Goal_Number(23) == 599 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) {
+ Actor_Set_Health(23, 40, 40);
+ Actor_Set_Goal_Number(23, 305);
+ } else if (Actor_Query_Goal_Number(23) == 305) {
+ switch (Actor_Query_Which_Set_In(23)) {
+ case 7:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 0, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 20:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 1, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 33:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 5, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 53:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 7, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 54:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 70:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 18, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 74:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 77:
+ case 78:
+ case 79:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 81:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 13, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 83:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 84:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 16, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ case 86:
+ if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
+ Actor_Set_Goal_Number(23, 310);
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 17, 4, 7, 8, -1, -1, -1, 10, 300, 0);
+ }
+ break;
+ }
+ }
+ return false;
+}
+
+void AIScriptOfficerLeroy::TimerExpired(int timer) {
+ if (timer == 1) {
+ AI_Countdown_Timer_Reset(23, 1);
+ if (Actor_Query_In_Set(0, 41)) {
+ Actor_Set_Goal_Number(23, 430);
+ Actor_Set_Goal_Number(24, 430);
+ } else {
+ Game_Flag_Set(684);
+ }
+ } else if (timer == 2) {
+ AI_Countdown_Timer_Reset(23, 2);
+ sub_431420();
+ }
+}
+
+void AIScriptOfficerLeroy::CompletedMovementTrack() {
+ int v0;
+ unsigned int v1;
+
+ v0 = Actor_Query_Goal_Number(23);
+ if (v0 == 1) {
+ Actor_Set_Goal_Number(23, 2);
+ return;
+ }
+ //todo: tidyup
+ v1 = v0 - 305;
+ if (v1 > 3) {
+ return;
+ }
+ if (!v1) {
+ Actor_Set_Goal_Number(23, 306);
+ return;
+ }
+ if (v1 != 2) {
+ if (v1 == 3) {
+ Actor_Change_Animation_Mode(23, 4);
+ Actor_Face_Actor(23, 0, true);
+ Actor_Set_Goal_Number(23, 309);
+ }
+ return;
+ }
+ Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 12, 4, 7, 8, 0, -1, -1, 15, 300, 0);
+}
+
+void AIScriptOfficerLeroy::ReceivedClue(int clueId, int fromActorId) {
+ if (clueId == 222) {
+ Actor_Modify_Friendliness_To_Other(23, 0, 5);
+ }
+ if (clueId == 215) {
+ Actor_Modify_Friendliness_To_Other(23, 0, -4);
+ }
+}
+
+void AIScriptOfficerLeroy::ClickedByPlayer() {}
+
+void AIScriptOfficerLeroy::EnteredScene(int sceneId) {}
+
+void AIScriptOfficerLeroy::OtherAgentEnteredThisScene(int otherActorId) {}
+
+void AIScriptOfficerLeroy::OtherAgentExitedThisScene(int otherActorId) {}
+
+void AIScriptOfficerLeroy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {}
+
+void AIScriptOfficerLeroy::ShotAtAndMissed() {}
+
+void AIScriptOfficerLeroy::ShotAtAndHit() {
+ if (Actor_Query_Goal_Number(23) == 307) {
+ Actor_Set_Health(23, 50, 50);
+ }
+}
+
+void AIScriptOfficerLeroy::Retired(int byActorId) {
+ Actor_Set_Goal_Number(23, 599);
+ Game_Flag_Set(607);
+}
+
+int AIScriptOfficerLeroy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ if (otherActorId) {
+ return 0;
+ }
+ switch (clueId) {
+ case 242:
+ return -6;
+ case 240:
+ return -2;
+ case 239:
+ return -5;
+ case 228:
+ return 2;
+ case 227:
+ return 4;
+ case 226:
+ return 4;
+ case 225:
+ return 3;
+ case 224:
+ return 3;
+ case 223:
+ return 2;
+ case 222:
+ return 3;
+ case 215:
+ return -5;
+ }
+ return 0;
+}
+
+bool AIScriptOfficerLeroy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ switch (newGoalNumber) {
+ case 1:
+ AI_Movement_Track_Flush(23);
+ if (Random_Query(1, 2) == 1) {
+ AI_Movement_Track_Append(23, 57, 7);
+ AI_Movement_Track_Append(23, 58, 7);
+ } else {
+ AI_Movement_Track_Append(23, 58, 7);
+ AI_Movement_Track_Append(23, 57, 7);
+ }
+ AI_Movement_Track_Repeat(23);
+ return true;
+ case 2:
+ if (Random_Query(1, 3) == 1) {
+ if (Random_Query(1, 2) == 1 && !Actor_Clue_Query(23, 16)) {
+ Actor_Clue_Acquire(23, 16, 0, -1);
+ } else if (!Actor_Clue_Query(23, 17)) {
+ Actor_Clue_Acquire(23, 17, 0, -1);
+ }
+ }
+ if (Game_Flag_Query(182)) {
+ if (Actor_Clue_Query(23, 16) && Actor_Clue_Query(23, 17)) {
+ Actor_Set_Goal_Number(23, 0);
+ } else {
+ Actor_Set_Goal_Number(23, 1);
+ }
+ } else {
+ Actor_Set_Goal_Number(23, 0);
+ }
+ return true;
+ case 3:
+ AI_Movement_Track_Flush(23);
+ AI_Movement_Track_Append(23, 39, Random_Query(120, 240));
+ AI_Movement_Track_Append(23, 35, 0);
+ AI_Movement_Track_Repeat(23);
+ return true;
+ case 99:
+ AI_Movement_Track_Flush(23);
+ return false;
+ case 102:
+ AI_Movement_Track_Flush(23);
+ AI_Movement_Track_Append(23, 107, 0);
+ AI_Movement_Track_Append(23, 108, 0);
+ AI_Movement_Track_Repeat(23);
+ return true;
+ case 300:
+ Actor_Set_Goal_Number(23, 305);
+ return true;
+ case 305:
+ AI_Movement_Track_Flush(23);
+ switch (Random_Query(1, 10)) {
+ case 1:
+ AI_Movement_Track_Append(23, 398, 15);
+ AI_Movement_Track_Append(23, 399, 0);
+ AI_Movement_Track_Append(23, 400, 0);
+ AI_Movement_Track_Append(23, 401, 0);
+ AI_Movement_Track_Append_With_Facing(23, 402, 3, 276);
+ AI_Movement_Track_Append(23, 403, 0);
+ AI_Movement_Track_Append(23, 404, 15);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 2:
+ AI_Movement_Track_Append(23, 385, 10);
+ AI_Movement_Track_Append(23, 242, 2);
+ AI_Movement_Track_Append(23, 386, 2);
+ AI_Movement_Track_Append(23, 387, 15);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 3:
+ AI_Movement_Track_Append(23, 390, 10);
+ AI_Movement_Track_Append(23, 391, 0);
+ AI_Movement_Track_Append(23, 392, 5);
+ AI_Movement_Track_Append(23, 345, 0);
+ AI_Movement_Track_Append(23, 393, 15);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 4:
+ AI_Movement_Track_Append(23, 381, 15);
+ AI_Movement_Track_Append(23, 382, 0);
+ AI_Movement_Track_Append(23, 383, 15);
+ AI_Movement_Track_Append(23, 382, 3);
+ AI_Movement_Track_Append(23, 384, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 5:
+ AI_Movement_Track_Append(23, 388, 10);
+ AI_Movement_Track_Append(23, 389, 10);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 6:
+ AI_Movement_Track_Append(23, 385, 10);
+ AI_Movement_Track_Append(23, 242, 2);
+ AI_Movement_Track_Append(23, 386, 2);
+ AI_Movement_Track_Append(23, 387, 15);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 7:
+ AI_Movement_Track_Append(23, 394, 15);
+ AI_Movement_Track_Append(23, 395, 0);
+ AI_Movement_Track_Append(23, 396, 0);
+ AI_Movement_Track_Append(23, 397, 15);
+ AI_Movement_Track_Append(23, 396, 0);
+ AI_Movement_Track_Append(23, 395, 0);
+ AI_Movement_Track_Append(23, 430, 15);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 8:
+ switch (Random_Query(1, 7)) {
+ case 1:
+ AI_Movement_Track_Append(23, 302, 0);
+ AI_Movement_Track_Append(23, 407, 0);
+ AI_Movement_Track_Append(23, 408, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 2:
+ AI_Movement_Track_Append(23, 536, 0);
+ AI_Movement_Track_Append(23, 537, 0);
+ AI_Movement_Track_Append(23, 538, 1);
+ AI_Movement_Track_Append(23, 537, 0);
+ AI_Movement_Track_Append(23, 536, 0);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 3:
+ AI_Movement_Track_Append(23, 296, 10);
+ AI_Movement_Track_Append(23, 409, 2);
+ AI_Movement_Track_Append(23, 296, 10);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 4:
+ AI_Movement_Track_Append(23, 411, 10);
+ AI_Movement_Track_Append(23, 412, 5);
+ AI_Movement_Track_Append(23, 411, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 5:
+ AI_Movement_Track_Append(23, 413, 10);
+ AI_Movement_Track_Append(23, 414, 0);
+ AI_Movement_Track_Append_With_Facing(23, 431, 0, 1017);
+ AI_Movement_Track_Append(23, 432, 10);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 6:
+ AI_Movement_Track_Append(23, 415, 0);
+ AI_Movement_Track_Append_With_Facing(23, 416, 0, 620);
+ AI_Movement_Track_Append(23, 417, 0);
+ AI_Movement_Track_Append(23, 418, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ break;
+ case 7:
+ AI_Movement_Track_Append(23, 405, 10);
+ AI_Movement_Track_Append(23, 406, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ return false;
+ default:
+ return false;
+ }
+ //no break
+ case 9:
+ if (Random_Query(1, 2) - 1 == 1) {
+ AI_Movement_Track_Append(23, 433, 10);
+ AI_Movement_Track_Append(23, 434, 0);
+ AI_Movement_Track_Append(23, 435, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ return false;
+ }
+ AI_Movement_Track_Append(23, 420, 10);
+ AI_Movement_Track_Append(23, 422, 2);
+ AI_Movement_Track_Append(23, 421, 1);
+ AI_Movement_Track_Append_With_Facing(23, 422, 4, 182);
+ AI_Movement_Track_Append(23, 420, 10);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ //no break
+ case 10:
+ AI_Movement_Track_Append(23, 310, 0);
+ AI_Movement_Track_Append(23, 307, 0);
+ AI_Movement_Track_Append(23, 309, 0);
+ AI_Movement_Track_Append(23, 310, 0);
+ AI_Movement_Track_Append(23, 35, 30);
+ AI_Movement_Track_Repeat(23);
+ return false;
+ default:
+ return false;
+ }
+ //no break
+ case 306:
+ Actor_Set_Goal_Number(23, 305);
+ return true;
+ case 307:
+ AI_Movement_Track_Flush(23);
+ AI_Movement_Track_Append_With_Facing(23, 416, 0, 556);
+ Actor_Change_Animation_Mode(23, 4);
+ AI_Movement_Track_Repeat(23);
+ return true;
+ case 308:
+ AI_Movement_Track_Flush(23);
+ AI_Movement_Track_Append_Run_With_Facing(23, 440, 2, 355);
+ AI_Movement_Track_Append_Run_With_Facing(23, 441, 0, 825);
+ AI_Movement_Track_Repeat(23);
+ return true;
+ case 400:
+ AI_Movement_Track_Flush(23);
+ AI_Movement_Track_Append(23, 35, 0);
+ AI_Movement_Track_Repeat(23);
+ Actor_Set_Goal_Number(23, 410);
+ return true;
+ case 420:
+ AI_Countdown_Timer_Reset(23, 1);
+ AI_Countdown_Timer_Start(23, 1, 120);
+ Actor_Set_Goal_Number(23, 410);
+ return true;
+ case 425:
+ AI_Countdown_Timer_Reset(23, 1);
+ AI_Countdown_Timer_Start(23, 1, 60);
+ Actor_Set_Goal_Number(23, 410);
+ return true;
+ case 430:
+ Actor_Set_Goal_Number(23, 410);
+ Actor_Set_Goal_Number(24, 410);
+ return false;
+ default:
+ return false;
+ }
+}
+
+bool AIScriptOfficerLeroy::UpdateAnimation(int *animation, int *frame) {
+ int v57;
+ int a1;
+
+ switch (var_45D5B0_animation_state) {
+ case 32:
+ *animation = 603;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(603)) {
+ *animation = 589;
+ var_45D5B0_animation_state = 0;
+ var_45D5B8 = 0;
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 31:
+ *animation = 604;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(604)) {
+ *animation = 601;
+ var_45D5B0_animation_state = 1;
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 30:
+ *animation = 587;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(587)) {
+ *animation = 589;
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ Actor_Change_Animation_Mode(23, 0);
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 29:
+ *animation = 586;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(586)) {
+ *animation = 589;
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ Actor_Change_Animation_Mode(23, 0);
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 28:
+ *animation = 576;
+ if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(576) - 1) {
+ ++var_45D5B4_animation_frame;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 27:
+ *animation = 588;
+ if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(588) - 1) {
+ ++var_45D5B4_animation_frame;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 26:
+ *animation = 573;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(573)) {
+ var_45D5B0_animation_state = 21;
+ var_45D5B4_animation_frame = 0;
+ *animation = 571;
+ Actor_Change_Animation_Mode(23, 4);
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 25:
+ *animation = 572;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(572)) {
+ var_45D5B0_animation_state = 21;
+ var_45D5B4_animation_frame = 0;
+ *animation = 571;
+ Actor_Change_Animation_Mode(23, 4);
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 24:
+ *animation = 581;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame == 4) {
+ if (Random_Query(1, 2) == 1) {
+ Sound_Play_Speech_Line(23, 9010, 75, 0, 99);
+ } else {
+ Sound_Play_Speech_Line(23, 9015, 75, 0, 99);
+ }
+ }
+ if (var_45D5B4_animation_frame == 5) {
+ Actor_Combat_AI_Hit_Attempt(23);
+ }
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(581)) {
+ var_45D5B0_animation_state = 21;
+ var_45D5B4_animation_frame = 0;
+ *animation = 571;
+ Actor_Change_Animation_Mode(23, 4);
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 23:
+ *animation = 580;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(580)) {
+ *animation = 589;
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 22:
+ *animation = 579;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(579)) {
+ var_45D5B0_animation_state = 21;
+ var_45D5B4_animation_frame = 0;
+ *animation = 571;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 21:
+ *animation = 571;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(571)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 20:
+ *animation = 571;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(571) - 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 19:
+ *animation = 600;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(600)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 18:
+ *animation = 599;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(599)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 17:
+ *animation = 598;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(598)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 16:
+ *animation = 597;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(597)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 15:
+ *animation = 596;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(596)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 14:
+ *animation = 595;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(595)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 13:
+ *animation = 594;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(594)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 12:
+ *animation = 593;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(593)) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ *animation = 592;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 11:
+ if (var_45D5BC && var_45D5B4_animation_frame <= 2) {
+ var_45D5BC = 0;
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ *animation = 589;
+ var_45D5B8 = Random_Query(0, 1);
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ }
+
+ *animation = 592;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(592)) {
+ var_45D5B4_animation_frame = 0;
+ if (var_45D5BC) {
+ var_45D5BC = 0;
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ *animation = 589;
+ var_45D5B8 = Random_Query(0, 1);
+ } else {
+ var_45D5B0_animation_state = Random_Query(0, 8) + 11;
+ }
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 10:
+ *animation = 578;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(578)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 9:
+ *animation = 577;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(577)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 8:
+ *animation = 575;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(575)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 7:
+ *animation = 574;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(574)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 6:
+ *animation = 585;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(585)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 5:
+ *animation = 584;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(584)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 4:
+ *animation = 583;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(583)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 3:
+ *animation = 582;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(582)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 2:
+ if (Game_Flag_Query(199)) {
+ *animation = 603;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(603) - 1) {
+ Game_Flag_Reset(199);
+ var_45D5B4_animation_frame = 0;
+ var_45D5B0_animation_state = var_462880;
+ *animation = var_462884;
+ }
+ } else {
+ if (var_45D5B8 == 0) {
+ *animation = 589;
+ }
+ if (var_45D5B8 == 1) {
+ *animation = 590;
+ }
+ if (var_45D5B8 == 2) {
+ *animation = 591;
+ }
+ if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) {
+ a1 = *animation;
+ var_45D5B4_animation_frame += 3;
+ v57 = var_45D5B4_animation_frame;
+ if (v57 > Slice_Animation_Query_Number_Of_Frames(a1) - 1) {
+ var_45D5B4_animation_frame = 0;
+ var_45D5B0_animation_state = var_462880;
+ *animation = var_462884;
+ }
+ } else {
+ var_45D5B4_animation_frame -= 3;
+ if (var_45D5B4_animation_frame < 0) {
+ var_45D5B4_animation_frame = 0;
+ var_45D5B0_animation_state = var_462880;
+ *animation = var_462884;
+ }
+ }
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 1:
+ *animation = 601;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(601)) {
+ var_45D5B4_animation_frame = 0;
+ }
+ if (!Game_Flag_Query(199)) {
+ var_45D5B0_animation_state = 32;
+ var_45D5B4_animation_frame = 0;
+ *animation = 603;
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ case 0:
+ if (Game_Flag_Query(199) && !Game_Flag_Query(392)) {
+ var_45D5B0_animation_state = 31;
+ var_45D5B4_animation_frame = 0;
+ *animation = 604;
+ } else if (var_45D5B8 == 1) {
+ *animation = 590;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(590)) {
+ var_45D5B8 = Random_Query(0, 2);
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B8 == 2) {
+ *animation = 591;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(591)) {
+ var_45D5B8 = Random_Query(0, 2);
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B8 == 0) {
+ *animation = 589;
+ var_45D5B4_animation_frame++;
+ if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(589)) {
+ var_45D5B8 = Random_Query(0, 2);
+ var_45D5B4_animation_frame = 0;
+ }
+ }
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ default:
+ *animation = 399;
+ *frame = var_45D5B4_animation_frame;
+ return true;
+ }
+}
+
+bool AIScriptOfficerLeroy::ChangeAnimationMode(int mode) {
+ int v1;
+
+ switch (mode) {
+ case 28:
+ Game_Flag_Set(199);
+ break;
+ case 27:
+ Game_Flag_Reset(199);
+ break;
+ case 22:
+ if (Random_Query(0, 1)) {
+ var_45D5B0_animation_state = 25;
+ } else {
+ var_45D5B0_animation_state = 26;
+ }
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 21:
+ if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 24) {
+ if (Random_Query(0, 1)) {
+ var_45D5B0_animation_state = 25;
+ } else {
+ var_45D5B0_animation_state = 26;
+ }
+ var_45D5B4_animation_frame = 0;
+ } else {
+ if (Random_Query(0, 1)) {
+ var_45D5B0_animation_state = 29;
+ } else {
+ var_45D5B0_animation_state = 30;
+ }
+ var_45D5B4_animation_frame = 0;
+ }
+ break;
+ case 19:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 19;
+ var_462884 = 600;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 19;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 18:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 18;
+ var_462884 = 599;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 18;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 17:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 17;
+ var_462884 = 598;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 17;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 16:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 16;
+ var_462884 = 597;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 16;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 15:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 15;
+ var_462884 = 596;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 15;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 14:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 14;
+ var_462884 = 595;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 14;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 13:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 13;
+ var_462884 = 594;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 13;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 12:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 12;
+ var_462884 = 593;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 12;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 8:
+ var_45D5B0_animation_state = 8;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 7:
+ var_45D5B0_animation_state = 7;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 6:
+ var_45D5B0_animation_state = 24;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 4:
+ switch (var_45D5B0_animation_state) {
+ case 21:
+ case 22:
+ case 24:
+ return true;
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ var_45D5B0_animation_state = 21;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 0:
+ var_45D5B0_animation_state = 22;
+ var_45D5B4_animation_frame = 0;
+ break;
+ default:
+ var_45D5B0_animation_state = 21;
+ var_45D5B4_animation_frame = 0;
+ break;
+ }
+ break;
+ case 3:
+ if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
+ var_45D5B0_animation_state = 2;
+ var_462880 = 11;
+ var_462884 = 592;
+ if (Game_Flag_Query(199) == 1) {
+ var_45D5B4_animation_frame = 0;
+ }
+ } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
+ var_45D5B0_animation_state = 11;
+ var_45D5B4_animation_frame = 0;
+ var_45D5BC = 0;
+ }
+ break;
+ case 2:
+ var_45D5B0_animation_state = 4;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 1:
+ var_45D5B0_animation_state = 3;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 0:
+ switch (var_45D5B0_animation_state) {
+ case 21:
+ case 24:
+ var_45D5B0_animation_state = 23;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 20:
+ v1 = var_45D5B4_animation_frame;
+ Actor_Change_Animation_Mode(23, 4);
+ var_45D5B4_animation_frame = v1;
+ var_45D5B0_animation_state = 21;
+ break;
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ var_45D5BC = 1;
+ break;
+ case 0:
+ case 23:
+ return true;
+ default:
+ var_45D5B0_animation_state = 0;
+ var_45D5B4_animation_frame = 0;
+ var_45D5B8 = Random_Query(0, 1);
+ break;
+ }
+ break;
+ case 5:
+ case 9:
+ case 10:
+ case 11:
+ case 20:
+ case 23:
+ case 24:
+ case 25:
+ case 26:
+ return true;
+ default:
+ switch (mode) {
+ case 58:
+ var_45D5B0_animation_state = 20;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 48:
+ if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 22 || var_45D5B0_animation_state == 24) {
+ var_45D5B0_animation_state = 28;
+ var_45D5B4_animation_frame = 0;
+ } else {
+ var_45D5B0_animation_state = 27;
+ var_45D5B4_animation_frame = 0;
+ }
+ break;
+ case 47:
+ var_45D5B0_animation_state = 10;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 46:
+ var_45D5B0_animation_state = 9;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 45:
+ var_45D5B0_animation_state = 6;
+ var_45D5B4_animation_frame = 0;
+ break;
+ case 44:
+ var_45D5B0_animation_state = 5;
+ var_45D5B4_animation_frame = 0;
+ break;
+ default:
+ return true;
+ }
+ break;
+ }
+ return true;
+}
+
+void AIScriptOfficerLeroy::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
+ *animationState = var_45D5B0_animation_state;
+ *animationFrame = var_45D5B4_animation_frame;
+ *a3 = var_462880;
+ *a4 = var_462884;
+}
+
+void AIScriptOfficerLeroy::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
+ var_45D5B0_animation_state = animationState;
+ var_45D5B4_animation_frame = animationFrame;
+ var_462880 = a3;
+ var_462884 = a4;
+}
+
+bool AIScriptOfficerLeroy::ReachedMovementTrackWaypoint(int waypointId) {
+ if (waypointId == 57 || waypointId == 58) {
+ sub_431408();
+ AI_Countdown_Timer_Reset(23, 2);
+ AI_Countdown_Timer_Start(23, 2, 6);
+ }
+ return true;
+}
+
+void AIScriptOfficerLeroy::FledCombat() {
+ Actor_Set_Goal_Number(23, 300);
+}
+
+bool AIScriptOfficerLeroy::sub_431408() {
+ Game_Flag_Set(199);
+ return true;
+}
+
+bool AIScriptOfficerLeroy::sub_431420() {
+ Game_Flag_Reset(199);
+ return true;
+}
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai/runciter.cpp b/engines/bladerunner/script/ai/runciter.cpp
new file mode 100644
index 0000000..998f385
--- /dev/null
+++ b/engines/bladerunner/script/ai/runciter.cpp
@@ -0,0 +1,653 @@
+/* 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.h"
+
+namespace BladeRunner {
+
+void AIScriptRunciter::Initialize() {
+ var_45CD70_animation_state = 0;
+ var_45CD74_animation_frame = 0;
+ var_462800 = 0;
+ var_45CD78 = 0;
+ var_45CD7C = 6;
+ var_45CD80 = 1;
+ var_45CD84 = 0;
+ var_45CD88 = 0;
+ Actor_Set_Goal_Number(15, 0);
+}
+
+bool AIScriptRunciter::Update() {
+ if (Actor_Query_Goal_Number(15) == 0 && Game_Flag_Query(186)) {
+ Actor_Set_Goal_Number(15, 2);
+ }
+ if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(15) < 300) {
+ Actor_Set_Goal_Number(15, 300);
+ }
+ return false;
+}
+
+void AIScriptRunciter::TimerExpired(int timer) {}
+
+void AIScriptRunciter::CompletedMovementTrack() {
+ if (Actor_Query_Goal_Number(15) == 1) {
+ if (Player_Query_Current_Scene() == 79) {
+ switch (Random_Query(1, 5)) {
+ case 2:
+ case 3:
+ ADQ_Add(15, 530, -1);
+ break;
+ case 1:
+ case 5:
+ ADQ_Add(15, 80, -1);
+ break;
+ case 4:
+ ADQ_Add(15, 930, -1);
+ break;
+ }
+ }
+ Actor_Set_Goal_Number(15, 99);
+ Actor_Set_Goal_Number(15, 1);
+ //return true;
+ }
+ //return false;
+}
+
+void AIScriptRunciter::ReceivedClue(int clueId, int fromActorId) {}
+
+void AIScriptRunciter::ClickedByPlayer() {}
+
+void AIScriptRunciter::EnteredScene(int sceneId) {}
+
+void AIScriptRunciter::OtherAgentEnteredThisScene(int otherActorId) {}
+
+void AIScriptRunciter::OtherAgentExitedThisScene(int otherActorId) {}
+
+void AIScriptRunciter::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+ if (Actor_Query_Goal_Number(15) == 300 && combatMode == 1 && !Game_Flag_Query(705)) {
+ Actor_Set_Targetable(15, true);
+ Actor_Face_Actor(15, 0, true);
+ Actor_Says(15, 420, 12);
+ Actor_Face_Actor(0, 15, true);
+ Actor_Change_Animation_Mode(0, 5);
+ if (Actor_Clue_Query(0, 158)) {
+ Actor_Says(0, 4770, -1);
+ Actor_Says(15, 590, 13);
+ Actor_Says(0, 4775, -1);
+ Actor_Says(15, 600, 17);
+ Sound_Play(492, 100, 0, 100, 50);
+ Actor_Says(0, 4780, -1);
+ Actor_Says(15, 610, 18);
+ Actor_Says(0, 4785, -1);
+ Actor_Says(15, 620, 15);
+ if (Game_Flag_Query(46)) {
+ Actor_Says(15, 630, 12);
+ Actor_Says(15, 640, 17);
+ Actor_Says(0, 4790, -1);
+ Actor_Says(15, 650, 18);
+ Actor_Says(15, 660, 19);
+ Actor_Clue_Acquire(0, 280, 1, 15);
+ } else {
+ Actor_Says(15, 670, 18);
+ Actor_Says(0, 4795, -1);
+ Actor_Says(15, 730, 17);
+ }
+ } else if (Actor_Clue_Query(0, 76)) {
+ Actor_Says(0, 4730, -1);
+ Actor_Says(15, 480, 17);
+ Actor_Says(0, 4735, -1);
+ Actor_Says(15, 490, 16);
+ Sound_Play(492, 100, 0, 100, 50);
+ Actor_Says(0, 4740, -1);
+ Actor_Says(15, 500, 18);
+ Actor_Says(15, 510, 19);
+ Actor_Says(0, 4745, -1);
+ Actor_Says(0, 4750, -1);
+ Actor_Says(15, 520, 17);
+ Actor_Says(15, 530, 18);
+ Actor_Says(15, 540, 16);
+ }
+ Game_Flag_Set(705);
+ }
+}
+
+void AIScriptRunciter::ShotAtAndMissed() {}
+
+void AIScriptRunciter::ShotAtAndHit() {
+ Actor_Set_Targetable(15, false);
+ Actor_Change_Animation_Mode(15, 48);
+ Actor_Set_Goal_Number(15, 599);
+ Delay(2000);
+ if (Actor_Clue_Query(0, 158)) {
+ Actor_Voice_Over(2050, 99);
+ Actor_Voice_Over(2060, 99);
+ } else {
+ Actor_Voice_Over(2070, 99);
+ Actor_Voice_Over(2080, 99);
+ Actor_Voice_Over(2090, 99);
+ }
+ Actor_Modify_Friendliness_To_Other(5, 0, 3);
+}
+
+void AIScriptRunciter::Retired(int byActorId) {}
+
+int AIScriptRunciter::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+ return 0;
+}
+
+bool AIScriptRunciter::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+ if (newGoalNumber == 0) {
+ Actor_Put_In_Set(15, 16);
+ Actor_Set_At_Waypoint(15, 92, 567);
+ return false;
+ }
+ if (newGoalNumber == 1) {
+ AI_Movement_Track_Flush(15);
+ if (Random_Query(0, 1) == 1) {
+ if (Random_Query(0, 1) == 0) {
+ AI_Movement_Track_Append_With_Facing(15, 89, Random_Query(6, 10), 567);
+ }
+ AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002);
+ AI_Movement_Track_Append(15, 92, 5);
+ } else {
+ AI_Movement_Track_Append_With_Facing(15, 91, Random_Query(3, 10), 120);
+ if (Random_Query(1, 3) == 1) {
+ AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002);
+ }
+ AI_Movement_Track_Append_With_Facing(15, 90, Random_Query(5, 10), 170);
+ }
+ AI_Movement_Track_Repeat(15);
+ return true;
+ }
+ if (newGoalNumber == 2) {
+ AI_Movement_Track_Flush(15);
+ AI_Movement_Track_Append(15, 39, 120);
+ AI_Movement_Track_Append(15, 40, 0);
+ AI_Movement_Track_Repeat(15);
+ return false;
+ }
+ if (newGoalNumber == 300) {
+ Actor_Put_In_Set(15, 16);
+ Actor_Set_At_Waypoint(15, 93, 1007);
+ return false;
+ }
+ return false;
+}
+
+bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
+
+ switch (var_45CD70_animation_state) {
+ case 15:
+ *animation = 528;
+ var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(528) - 1;
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 14:
+ *animation = 528;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(528) - 1) {
+ *animation = 528;
+ var_45CD70_animation_state = 15;
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 13:
+ if (var_45CD78 == 0) {
+ var_45CD74_animation_frame = 0;
+ var_45CD70_animation_state = var_462800;
+ *animation = var_462804;
+ } else if (var_45CD78 == 1) {
+ *animation = 530;
+ var_45CD74_animation_frame += 3;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) {
+ var_45CD74_animation_frame = 0;
+ var_45CD70_animation_state = var_462800;
+ *animation = var_462804;
+ }
+ } else if (var_45CD78 == 2) {
+ *animation = 531;
+ var_45CD74_animation_frame -= 3;
+ if (var_45CD74_animation_frame - 3 < 0) {
+ var_45CD74_animation_frame = 0;
+ var_45CD70_animation_state = var_462800;
+ *animation = var_462804;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 12:
+ *animation = 532;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(532)) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD74_animation_frame = 0;
+ var_45CD78 = 0;
+ Actor_Change_Animation_Mode(15, 0);
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 11:
+ *animation = 541;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(541)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 10:
+ *animation = 540;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(540)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 9:
+ *animation = 539;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(539)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 8:
+ *animation = 538;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(538)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 7:
+ *animation = 537;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(537)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 6:
+ *animation = 536;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(536)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 5:
+ *animation = 535;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(535)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 4:
+ *animation = 534;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(534)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ *animation = 533;
+ var_45CD70_animation_state = 2;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 2:
+ *animation = 533;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(533)) {
+ var_45CD74_animation_frame = 0;
+ if (var_45CD88) {
+ *animation = 529;
+ var_45CD70_animation_state = 0;
+ var_45CD78 = 0;
+ } else {
+ var_45CD70_animation_state = 4;
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 1:
+ *animation = 526;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(526)) {
+ var_45CD74_animation_frame = 0;
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ case 0:
+ if (var_45CD78 == 0) {
+ *animation = 529;
+ if (var_45CD84) {
+ var_45CD84--;
+ } else {
+ var_45CD74_animation_frame += var_45CD80;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(529)) {
+ var_45CD74_animation_frame = 0;
+ }
+ if (var_45CD74_animation_frame < 0) {
+ var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(529) - 1;
+ }
+ --var_45CD7C;
+ if (var_45CD7C == 0) {
+ var_45CD80 = 2 * Random_Query(0, 1) - 1;
+ var_45CD7C = Random_Query(6, 14);
+ var_45CD84 = Random_Query(0, 4);
+ }
+ if (var_45CD74_animation_frame == 0) {
+ if (Random_Query(0, 1) == 1) {
+ var_45CD78 = Random_Query(1, 2);
+ var_45CD80 = 1;
+ var_45CD84 = 0;
+ }
+ }
+ }
+ } else if (var_45CD78 == 1) {
+ *animation = 530;
+ var_45CD74_animation_frame++;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) {
+ var_45CD74_animation_frame = 0;
+ var_45CD78 = 0;
+ *animation = 529;
+ var_45CD7C = Random_Query(6, 14);
+ var_45CD80 = 2 * Random_Query(0, 1) - 1;
+ }
+ } else if (var_45CD78 == 2) {
+ *animation = 531;
+ if (var_45CD84) {
+ var_45CD84--;
+ } else {
+ var_45CD74_animation_frame += var_45CD80;
+ if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
+ var_45CD84 = Random_Query(5, 15);
+ var_45CD80 = -1;
+ }
+ if (var_45CD74_animation_frame <= 0) {
+ var_45CD74_animation_frame = 0;
+ var_45CD78 = 0;
+ *animation = 529;
+ var_45CD7C = Random_Query(6, 14);
+ var_45CD80 = 2 * Random_Query(0, 1) - 1;
+ }
+ }
+ }
+ *frame = var_45CD74_animation_frame;
+ break;
+ default:
+ *animation = 399;
+ var_45CD74_animation_frame = 0;
+ *frame = var_45CD74_animation_frame;
+ break;
+ }
+ return true;
+}
+
+bool AIScriptRunciter::ChangeAnimationMode(int mode) {
+
+ switch (mode) {
+ case 23:
+ var_45CD70_animation_state = 12;
+ var_45CD74_animation_frame = 0;
+ break;
+ case 19:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 11;
+ var_462804 = 541;
+ }
+ var_45CD88 = 0;
+ break;
+ case 18:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 10;
+ var_462804 = 540;
+ }
+ var_45CD88 = 0;
+ break;
+ case 17:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 9;
+ var_462804 = 539;
+ }
+ var_45CD88 = 0;
+ break;
+ case 16:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 8;
+ var_462804 = 538;
+ }
+ var_45CD88 = 0;
+ break;
+ case 15:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 7;
+ var_462804 = 537;
+ }
+ var_45CD88 = 0;
+ break;
+ case 14:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 6;
+ var_462804 = 536;
+ }
+ var_45CD88 = 0;
+ break;
+ case 13:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 5;
+ var_462804 = 535;
+ }
+ var_45CD88 = 0;
+ break;
+ case 12:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 4;
+ var_462804 = 534;
+ }
+ var_45CD88 = 0;
+ break;
+ case 3:
+ if (var_45CD70_animation_state) {
+ var_45CD70_animation_state = 2;
+ var_45CD74_animation_frame = 0;
+ } else {
+ var_45CD70_animation_state = 13;
+ var_462800 = 2;
+ var_462804 = 526;
+ }
+ var_45CD88 = 0;
+ break;
+ case 1:
+ if (var_45CD70_animation_state > 1) {
+ var_45CD70_animation_state = 1;
+ var_45CD74_animation_frame = 0;
+ } else if (!var_45CD70_animation_state) {
+ var_45CD70_animation_state = 13;
+ var_462800 = 1;
+ var_462804 = 526;
+ }
+ break;
+ case 0:
+ if (var_45CD70_animation_state >= 2 && var_45CD70_animation_state <= 11) {
+ var_45CD88 = 1;
+ } else {
+ var_45CD70_animation_state = 0;
+ var_45CD74_animation_frame = 0;
+ var_45CD78 = 0;
+ }
+ break;
+ case 2:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 20:
+ case 21:
+ case 22:
+ break;
+ default:
+ if (mode == 48) {
+ var_45CD70_animation_state = 14;
+ var_45CD74_animation_frame = 0;
+ }
+ break;
+ }
+ return true;
+}
+
+void AIScriptRunciter::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
+ *animationState = var_45CD70_animation_state;
+ *animationFrame = var_45CD74_animation_frame;
+ *a3 = var_462800;
+ *a4 = var_462804;
+}
+
+void AIScriptRunciter::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
+ var_45CD70_animation_state = animationState;
+ var_45CD74_animation_frame = animationFrame;
+ var_462800 = a3;
+ var_462804 = a4;
+}
+
+bool AIScriptRunciter::ReachedMovementTrackWaypoint(int waypointId) {
+ switch (waypointId) {
+ case 93:
+ Actor_Face_Heading(15, 1002, true);
+ break;
+ case 92:
+ Actor_Face_Heading(15, 664, true);
+ break;
+ case 91:
+ Actor_Face_Heading(15, 120, true);
+ break;
+ case 90:
+ Actor_Face_Heading(15, 170, true);
+ break;
+ case 89:
+ Actor_Face_Heading(15, 567, true);
+ break;
+ default:
+ return true;
+ }
+ return true;
+}
+
+void AIScriptRunciter::FledCombat() {}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_00_mccoy.cpp b/engines/bladerunner/script/ai_00_mccoy.cpp
deleted file mode 100644
index 70f1272..0000000
--- a/engines/bladerunner/script/ai_00_mccoy.cpp
+++ /dev/null
@@ -1,1855 +0,0 @@
-/* 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_00_mccoy.h"
-
-namespace BladeRunner {
-
-AIScript_McCoy::AIScript_McCoy(BladeRunnerEngine *vm)
- : AIScriptBase(vm) {
-}
-
-void AIScript_McCoy::Initialize() {
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D8 = 0;
- dword_45A0DC = 30;
- dword_45A0E0 = 1;
- dword_45A0E4 = 0;
- off_45A0EC = 0;
- dword_45A0E8 = 3;
- dword_45A0F0 = 3;
- dword_45A0F4 = 20;
- dword_45A0F8 = -1;
- dword_45A0FC = 0;
- off_45A100 = 0;
- Actor_Set_Goal_Number(0, 0);
-}
-
-bool AIScript_McCoy::Update() {
- if (dword_45A0F8 != -1) {
- Sound_Play(dword_45A0F8, 100, 0, 0, 50);
- dword_45A0F8 = -1;
- }
- switch (Actor_Query_Goal_Number(0)) {
- case 101:
- Actor_Set_Goal_Number(0, 102);
- return true;
- case 102:
- if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 36 && !Game_Flag_Query(375)) {
- Actor_Change_Animation_Mode(0, 21);
- Game_Flag_Set(375);
- }
- if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 4) {
- Actor_Set_Goal_Number(0, 103);
- }
- return true;
- case 201:
- Actor_Set_Goal_Number(0, 0);
- if (Player_Query_Current_Set() == 55) {
- Loop_Actor_Walk_To_XYZ(0, -166.0f, -70.19f, -501.0f, 0, 0, false, 0);
- Actor_Face_Heading(0, 300, false);
- } else {
- Loop_Actor_Walk_To_XYZ(0, -461.0f, 0.0f, -373.0f, 0, 0, false, 0);
- }
- Player_Gains_Control();
- return true;
- case 212:
- if (Global_Variable_Query(47) >= 13) {
- Global_Variable_Set(47, 500);
- } else if (Global_Variable_Query(47) > 0) {
- Global_Variable_Decrement(47, 1);
- }
- break;
- case 221:
- Actor_Set_Goal_Number(0, 0);
- Actor_Set_Goal_Number(18, 212);
- return true;
- case 309:
- sub_4053E0();
- break;
- case 391:
- Actor_Retired_Here(0, 12, 48, 1, -1);
- Actor_Set_Goal_Number(0, 599);
- break;
- case 231:
- sub_4053E0();
- break;
- }
- return false;
-}
-
-void AIScript_McCoy::TimerExpired(int timer) {
-}
-
-void AIScript_McCoy::CompletedMovementTrack() {
-}
-
-void AIScript_McCoy::ReceivedClue(int clueId, int fromActorId) {
- switch (clueId) {
- case 8:
- case 9:
- Spinner_Set_Selectable_Destination_Flag(3, 1);
- break;
- case 44:
- case 47:
- Spinner_Set_Selectable_Destination_Flag(4, 1);
- break;
- case 53:
- case 263:
- if (Query_Difficulty_Level() == 0) {
- Spinner_Set_Selectable_Destination_Flag(4, 1);
- }
- break;
- case 90:
- Spinner_Set_Selectable_Destination_Flag(8, 1);
- break;
- case 84:
- case 113:
- case 114:
- case 115:
- case 118:
- Spinner_Set_Selectable_Destination_Flag(9, 1);
- Spinner_Set_Selectable_Destination_Flag(8, 1);
- break;
- case 66:
- case 80:
- case 82:
- case 83:
- Global_Variable_Increment(49, 1);
- break;
- case 125:
- Global_Variable_Increment(49, 5);
- break;
- case 124:
- case 128:
- Global_Variable_Increment(49, 3);
- break;
- case 120:
- case 121:
- Global_Variable_Increment(49, 2);
- break;
- case 147:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- Global_Variable_Increment(48, 1);
- break;
- }
- if (Global_Variable_Query(49) > 6 && Global_Variable_Query(1) > 3 && !Actor_Clue_Query(0, 126)) {
- Delay(500);
- Actor_Voice_Over(3320, 99);
- switch (clueId) {
- case 66:
- case 80:
- case 82:
- case 83:
- case 121:
- case 128:
- Actor_Voice_Over(3340, 99);
- Actor_Voice_Over(3350, 99);
- Actor_Voice_Over(3360, 99);
- Actor_Voice_Over(3370, 99);
- Actor_Voice_Over(3380, 99);
- break;
- case 124:
- Actor_Voice_Over(3330, 99);
- break;
- case 120:
- Actor_Voice_Over(3390, 99);
- Actor_Voice_Over(3400, 99);
- Actor_Voice_Over(3420, 99);
- break;
- }
- Actor_Clue_Acquire(0, 126, 1, -1);
- if (clueId == 125) {
- Actor_Voice_Over(2780, 99);
- Actor_Voice_Over(2800, 99);
- Actor_Voice_Over(2810, 99);
- } else if (Actor_Clue_Query(0, 125)) {
- Actor_Voice_Over(3430, 99);
- Actor_Voice_Over(3440, 99);
- Actor_Voice_Over(3450, 99);
- Actor_Voice_Over(3460, 99);
- Actor_Voice_Over(3470, 99);
- Actor_Voice_Over(3480, 99);
- Actor_Voice_Over(3490, 99);
- Actor_Voice_Over(3500, 99);
- } else {
- Actor_Voice_Over(3510, 99);
- Actor_Voice_Over(3520, 99);
- Actor_Voice_Over(3530, 99);
- Actor_Voice_Over(3540, 99);
- }
- }
-}
-
-void AIScript_McCoy::ClickedByPlayer() {
-}
-
-void AIScript_McCoy::EnteredScene(int sceneId) {
-}
-
-void AIScript_McCoy::OtherAgentEnteredThisScene(int otherActorId) {
-}
-
-void AIScript_McCoy::OtherAgentExitedThisScene(int otherActorId) {
-}
-
-void AIScript_McCoy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
-}
-
-void AIScript_McCoy::ShotAtAndMissed() {
-}
-
-void AIScript_McCoy::ShotAtAndHit() {
-}
-
-void AIScript_McCoy::Retired(int byActorId) {
- if (byActorId == 1 && Actor_Query_In_Set(1, 42)) {
- if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) != 599) {
- Non_Player_Actor_Combat_Mode_On(1, 3, 1, 3, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0);
- } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) != 599) {
- Non_Player_Actor_Combat_Mode_On(1, 3, 1, 6, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0);
- }
- }
- if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) {
- Non_Player_Actor_Combat_Mode_On(23, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
- }
- if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) {
- Non_Player_Actor_Combat_Mode_On(24, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
- }
- if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) {
- Non_Player_Actor_Combat_Mode_On(23, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
- }
- if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) {
- Non_Player_Actor_Combat_Mode_On(24, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0);
- }
-}
-
-int AIScript_McCoy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
- return 0;
-}
-
-bool AIScript_McCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
- unsigned int v5;
- unsigned int v7;
-
- switch (newGoalNumber) {
- case 0:
- return true;
- case 1:
- sub_4058B0();
- return true;
- case 2:
- sub_405920();
- return true;
- case 100:
- Actor_Set_At_Waypoint(0, 315, 263);
- dword_45A0D0_animation_state = 53;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- Actor_Set_Invisible(0, false);
- return true;
- case 102:
- Async_Actor_Walk_To_Waypoint(0, 316, 0, 1);
- return true;
- case 103:
- Actor_Face_Actor(0, 8, true);
- return true;
- case 231:
- Player_Set_Combat_Mode(false);
- Preload(18);
- Set_Enter(59, 63);
- Player_Loses_Control();
- Actor_Force_Stop_Walking(0);
- Actor_Put_In_Set(0, 59);
- Actor_Set_At_XYZ(0, 14.0f, 110.84f, -300.0f, 926);
- Actor_Change_Animation_Mode(0, 48);
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
- flt_462714 = 2.84f;
- flt_462710 = 110.84f;
- off_45A100 = -6.0f;
- return true;
- case 230:
- dword_45A0FC = Actor_Query_Goal_Number(1) == 215;
- Actor_Change_Animation_Mode(0, 6);
- return true;
- case 220:
- Actor_Change_Animation_Mode(0, 75);
- return true;
- case 212:
- Global_Variable_Set(47, 0);
- Player_Set_Combat_Mode_Access(false);
- Player_Gains_Control();
- Scene_Exits_Disable();
- dword_45A0D0_animation_state = 68;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- return true;
- case 211:
- Actor_Face_Heading(0, 512, false);
- Actor_Face_Heading(0, 768, true);
- if (Random_Query(0, 1)) {
- Actor_Change_Animation_Mode(0, 18);
- } else {
- Actor_Change_Animation_Mode(0, 16);
- }
- Delay(150);
- Actor_Change_Animation_Mode(0, 0);
- Actor_Set_Goal_Number(0, 0);
- Player_Gains_Control();
- return true;
- case 210:
- Actor_Put_In_Set(0, 54);
- Actor_Set_At_XYZ(0, -204.0, 24.0, -817.0, 256);
- Actor_Set_Invisible(0, false);
- if (Game_Flag_Query(627)) {
- Actor_Set_Goal_Number(0, 212);
- } else {
- dword_45A0D0_animation_state = 53;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- Actor_Set_Invisible(0, false);
- }
- return true;
- case 200:
- Player_Loses_Control();
- Actor_Change_Animation_Mode(0, 0);
- return true;
- case 301:
- dword_45A0D0_animation_state = 62;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 302:
- dword_45A0D0_animation_state = 64;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 303:
- dword_45A0D0_animation_state = 65;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 350:
- Sound_Play(123, 50, 0, 0, 50);
- Delay(1000);
- Sound_Play(403, 30, 0, 0, 50);
- Delay(1000);
- Sound_Play(123, 50, 0, 0, 50);
- Actor_Says(4, 1380, 3);
- Actor_Says(0, 6610, 13);
- Actor_Says(4, 1390, 3);
- Actor_Says(0, 6615, 18);
- Actor_Says(4, 1420, 3);
- Actor_Says(0, 6625, 11);
- Actor_Says(4, 1430, 3);
- Actor_Says(0, 6630, 12);
- Actor_Says(0, 6635, 17);
- Actor_Says(0, 6640, 13);
- Actor_Says(0, 6645, 19);
- Actor_Says(0, 6650, 18);
- Actor_Says(0, 6655, 11);
- Actor_Says(4, 1440, 3);
- Actor_Says(0, 6660, 17);
- Actor_Says(0, 6665, 13);
- Delay(1000);
- Actor_Says(4, 1450, 3);
- Actor_Says(0, 6670, 14);
- Actor_Says(0, 6675, 11);
- Actor_Says(4, 1460, 3);
- Actor_Says(0, 6680, 12);
- Actor_Says(4, 1470, 3);
- Actor_Says(0, 6685, 13);
- Delay(500);
- Actor_Says(0, 6695, 16);
- Actor_Says(0, 6700, 17);
- Actor_Says(4, 1480, 3);
- Actor_Says(0, 6705, 11);
- Sound_Play(123, 50, 0, 0, 50);
- return true;
- case 390:
- Actor_Force_Stop_Walking(0);
- Player_Loses_Control();
- flt_462710 = 48.07f;
- off_45A100 = -4.0f;
- flt_462714 = -20.0f;
- if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 50;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- }
- return true;
- case 400:
- Actor_Set_Health(0, 50, 50);
- Game_Flag_Set(373);
- v5 = Global_Variable_Query(45);
- if (v5 == 1) {
- Actor_Modify_Friendliness_To_Other(1, 0, 3);
- } else if (v5 == 2) {
- Actor_Modify_Friendliness_To_Other(1, 0, -5);
- Actor_Modify_Friendliness_To_Other(5, 0, 3);
- } else if (v5 == 3) {
- Actor_Modify_Friendliness_To_Other(1, 0, -5);
- Actor_Modify_Friendliness_To_Other(5, 0, 5);
- }
- if (Game_Flag_Query(666)) {
- Actor_Modify_Friendliness_To_Other(1, 0, 3);
- }
- if (Actor_Query_Friendliness_To_Other(1, 0) < Actor_Query_Friendliness_To_Other(5, 0)) {
- Game_Flag_Set(653);
- }
- v7 = Global_Variable_Query(45);
- if (v7 == 1) {
- if (Game_Flag_Query(653)) {
- Global_Variable_Set(45, 0);
- }
- } else if (v7 == 2 || v7 == 3) {
- if (!Game_Flag_Query(653)) {
- Global_Variable_Set(45, 0);
- }
- }
- if (!Game_Flag_Query(653)) {
- Game_Flag_Set(461);
- }
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Global_Variable_Set(1, 5);
- Outtake_Play(10, 0, -1);
- if (Game_Flag_Query(666)) {
- Chapter_Enter(5, 53, 53);
- } else {
- Game_Flag_Set(34);
- Chapter_Enter(5, 10, 49);
- }
- return true;
- case 500:
- Music_Stop(3);
- Player_Set_Combat_Mode(false);
- Actor_Change_Animation_Mode(0, 0);
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- Game_Flag_Set(465);
- Set_Enter(67, 72);
- return true;
- }
- return false;
-}
-
-bool AIScript_McCoy::UpdateAnimation(int *animation, int *frame) {
- int v7, v18, v19, v46;
- switch (dword_45A0D0_animation_state) {
- case 71:
- *animation = 52;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(52)) {
- Actor_Change_Animation_Mode(0, 0);
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- Player_Gains_Control();
- }
- break;
- case 70:
- *animation = 51;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(51)) {
- dword_45A0D4_animation_frame = 0;
- }
- break;
- case 69:
- *animation = 50;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(50)) {
- Actor_Change_Animation_Mode(0, 53);
- *animation = 51;
- }
- break;
- case 68:
- *animation = 18;
- v7 = Slice_Animation_Query_Number_Of_Frames(*animation) - 1 - Global_Variable_Query(47);
- if (dword_45A0D4_animation_frame < v7) {
- dword_45A0D4_animation_frame++;
- } else if (dword_45A0D4_animation_frame > v7) {
- dword_45A0D4_animation_frame--;
- }
- if (dword_45A0D4_animation_frame <= 0) {
- Actor_Change_Animation_Mode(0, 0);
- *animation = 19;
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- Game_Flag_Reset(627);
- Scene_Exits_Enable();
- Player_Set_Combat_Mode_Access(true);
- Actor_Set_Goal_Number(0, 0);
- }
- break;
- case 67:
- *animation = 53;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(53)) {
- Actor_Change_Animation_Mode(0, 0);
- *animation = 19;
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- if (Actor_Query_Goal_Number(0) == 220) {
- Actor_Change_Animation_Mode(0, 48);
- }
- }
- break;
- case 66:
- *animation = 40;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(40)) {
- Actor_Change_Animation_Mode(0, 0);
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- }
- break;
- case 65:
- *animation = 45;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(45)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
- *animation = 0;
- Actor_Set_Goal_Number(0, 0);
- }
- break;
- case 64:
- *animation = 44;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(44)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 63;
- *animation = 43;
- }
- break;
- case 63:
- *animation = 43;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(43)) {
- dword_45A0D4_animation_frame = 0;
- }
- break;
- case 62:
- *animation = 42;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(42)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 63;
- *animation = 43;
- }
- break;
- case 61:
- *animation = 41;
- dword_45A0D4_animation_frame--;
- if (dword_45A0D4_animation_frame <= 0) {
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- if (Actor_Query_Goal_Number(0) == 200) {
- Actor_Set_Goal_Number(0, 201);
- }
- }
- break;
- case 60:
- *animation = 41;
- if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(41) - 1) {
- dword_45A0D4_animation_frame++;
- }
- return true;
- case 59:
- *animation = 48;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(48)) {
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0DC = 0;
- dword_45A0D0_animation_state = 0;
- Player_Gains_Control();
- Item_Add_To_World(109, 982, 6, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false);
- }
- break;
- case 58:
- *animation = 47;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame == 6) {
- v18 = Random_Query(0, 2);
- v19 = 0;
- if (v18 == 0) {
- v19 = 595;
- } else if (v18 == 1) {
- v19 = 594;
- } else if (v18 == 2) {
- v19 = 593;
- }
- Ambient_Sounds_Play_Sound(v19, 39, 0, 0, 99);
- }
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { //why -1?
- dword_45A0D4_animation_frame = 0;
- }
- break;
- case 57:
- *animation = 46;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(46)) {
- dword_45A0D4_animation_frame = 0;
- }
- if (!Game_Flag_Query(550)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 59;
- *animation = 48;
- }
- break;
- case 56:
- *animation = 49;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(49)) {
- dword_45A0D4_animation_frame = 0;
- if (Actor_Query_Which_Set_In(0) == 87) {
- dword_45A0D0_animation_state = 27;
- } else {
- *animation = 19;
- dword_45A0D0_animation_state = 0;
- Actor_Change_Animation_Mode(0, 0);
- }
- }
- break;
- case 55:
- *animation = 32;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame == 7) {
- Actor_Change_Animation_Mode(66, 52);
- }
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
- *animation = 19;
- dword_45A0D0_animation_state = 0;
- }
- break;
- case 53:
- *animation = 18;
- dword_45A0D4_animation_frame--;
- if (dword_45A0D4_animation_frame <= 0) {
- Actor_Change_Animation_Mode(0, 0);
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- if (Actor_Query_Goal_Number(0) == 100) {
- Actor_Set_Goal_Number(0, 101);
- }
- if (Actor_Query_Goal_Number(0) == 210) {
- Actor_Set_Goal_Number(0, 211);
- }
- }
- break;
- case 52:
- *animation = 31;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(31)) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(31) - 1;
- dword_45A0D0_animation_state = 50;
- }
- break;
- case 51:
- *animation = 28;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(28)) {
- Player_Set_Combat_Mode(true);
- sub_405800();
- Actor_Set_Goal_Number(0, 0);
- dword_45A0D4_animation_frame = 0;
- Player_Gains_Control();
- }
- break;
- case 50:
- *animation = 18;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- break;
- case 49:
- *animation = 34;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(34)) {
- Actor_Set_Goal_Number(0, 0);
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- sub_405660();
- }
- break;
- case 48:
- *animation = 33;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(33)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 49;
- *animation = 34;
- }
- break;
- case 47:
- *animation = 29;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(29)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 48;
- *animation = 33;
- }
- break;
- case 46:
- Actor_Set_Invisible(0, false);
- *animation = 36;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(36)) {
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- Player_Gains_Control();
- sub_405660();
- Actor_Face_Heading(0, (Actor_Query_Facing_1024(0) + 512) & 1023, false);
- }
- break;
- case 45:
- *animation = 35;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(35)) {
- Actor_Set_Invisible(0, true);
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- sub_405660();
- }
- break;
- case 44:
- *animation = 30;
- if (dword_45A0D4_animation_frame++ == 127) {
- Game_Flag_Set(325);
- }
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(30)) {
- *animation = 19;
- sub_405660();
- Actor_Set_At_XYZ(0, -203.41f, -621.3f, 724.57f, 538);
- Player_Gains_Control();
- }
- break;
- case 43:
- *animation = 38;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(38) - 1) { //why -1?
- dword_45A0D4_animation_frame = 0;
- }
- switch (dword_45A0D4_animation_frame) {
- case 9:
- Sound_Left_Footstep_Walk(0);
- break;
- case 4:
- Sound_Right_Footstep_Walk(0);
- break;
- case 1:
- Sound_Right_Footstep_Walk(0);
- break;
- }
- break;
- case 42:
- *animation = 37;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(37) - 1) { //why -1?
- dword_45A0D4_animation_frame = 0;
- }
- switch (dword_45A0D4_animation_frame) {
- case 9:
- Sound_Left_Footstep_Walk(0);
- break;
- case 4:
- Sound_Right_Footstep_Walk(0);
- break;
- case 1:
- Sound_Right_Footstep_Walk(0);
- break;
- }
- break;
- case 41:
- *animation = 7;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(7)) {
- dword_45A0D4_animation_frame = 0;
- ++off_45A0EC;
- }
- if (dword_45A0D4_animation_frame == 9) {
- Sound_Left_Footstep_Walk(0);
- } else if (dword_45A0D4_animation_frame == 4) {
- Sound_Right_Footstep_Walk(0);
- }
- if (Game_Flag_Query(359)) {
- sub_4059D0(-0.2f);
- }
- break;
- case 40:
- *animation = 6;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(6)) {
- dword_45A0D4_animation_frame = 0;
- ++off_45A0EC;
- }
- if (dword_45A0D4_animation_frame == 8) {
- Sound_Left_Footstep_Walk(0);
- } else if (dword_45A0D4_animation_frame == 3) {
- Sound_Right_Footstep_Walk(0);
- }
- if (Game_Flag_Query(358)) {
- sub_405940(0.5f);
- }
- break;
- case 39:
- *animation = 16;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(16)) {
- dword_45A0D4_animation_frame = 0;
- ++off_45A0EC;
- }
- if (dword_45A0D4_animation_frame == 8) {
- Sound_Left_Footstep_Walk(0);
- } else if (dword_45A0D4_animation_frame == 3) {
- Sound_Right_Footstep_Walk(0);
- }
- if (Game_Flag_Query(359)) {
- sub_4059D0(-0.2f);
- }
- break;
- case 38:
- *animation = 15;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(15)) {
- dword_45A0D4_animation_frame = 0;
- ++off_45A0EC;
- }
- if (dword_45A0D4_animation_frame == 9) {
- Sound_Left_Footstep_Walk(0);
- } else if (dword_45A0D4_animation_frame == 4) {
- Sound_Right_Footstep_Walk(0);
- }
- if (Game_Flag_Query(358)) {
- sub_405940(0.5f);
- }
- break;
- case 37:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(4)) {
- dword_45A0D4_animation_frame = 0;
- }
- *animation = 4;
- if (dword_45A0D4_animation_frame == 6) {
- Sound_Left_Footstep_Run(0);
- }
- if (dword_45A0D4_animation_frame == 0) {
- Sound_Right_Footstep_Run(0);
- }
- break;
- case 36:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(3)) {
- dword_45A0D4_animation_frame = 0;
- }
- *animation = 3;
- if (dword_45A0D4_animation_frame == 15) {
- Sound_Left_Footstep_Walk(0);
- }
- if (dword_45A0D4_animation_frame == 6) {
- Sound_Right_Footstep_Walk(0);
- }
- break;
- case 32:
- dword_45A0D4_animation_frame = 1;
- dword_45A0D0_animation_state = 30;
- *animation = 13;
- break;
- case 31:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(14)) {
- dword_45A0D4_animation_frame = 0;
- }
- *animation = 14;
- if (dword_45A0D4_animation_frame == 5) {
- Sound_Left_Footstep_Run(0);
- } else if (dword_45A0D4_animation_frame == 12) {
- Sound_Right_Footstep_Run(0);
- }
- break;
- case 30:
- *animation = 13;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(13)) {
- dword_45A0D4_animation_frame = 0;
- }
- if (dword_45A0D4_animation_frame == 2) {
- Sound_Right_Footstep_Walk(0);
- } else if (dword_45A0D4_animation_frame == 10) {
- Sound_Left_Footstep_Walk(0);
- }
- break;
- case 29:
- v46 = dword_45A0D4_animation_frame + dword_45A0E0;
- *animation = 18;
- dword_45A0D4_animation_frame = v46;
- if (v46 < 14) {
- dword_45A0E0 = 1;
- }
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
- Actor_Change_Animation_Mode(0, 48);
- *animation = 18;
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- }
- break;
- case 28:
- *animation = 5;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(5)) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
- dword_45A0D0_animation_state = 50;
- sub_4054F0();
- }
- break;
- case 27:
- *animation = 18;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(18)) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1;
- dword_45A0D0_animation_state = 50;
- sub_4054F0();
- if (Actor_Query_Goal_Number(0) == 220) {
- Actor_Set_Goal_Number(0, 221);
- }
- }
- break;
- case 26:
- *animation = 17;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) {
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- Actor_Change_Animation_Mode(0, 0);
- }
- break;
- case 25:
- *animation = 17;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) {
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- Actor_Change_Animation_Mode(0, 0);
- }
- break;
- case 24:
- *animation = 1;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
- *animation = 0;
- Actor_Change_Animation_Mode(0, 4);
- }
- break;
- case 23:
- *animation = 1;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
- *animation = 0;
- Actor_Change_Animation_Mode(0, 4);
- }
- break;
- case 22:
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 17;
- *animation = 12;
- break;
- case 21:
- *animation = 12;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame == 1 && Actor_Query_Goal_Number(0) == 230 && dword_45A0FC == 1) {
- dword_45A0F8 = 27;
- }
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(12)) {
- dword_45A0D0_animation_state = 17;
- dword_45A0D4_animation_frame = 0;
- *animation = 12;
- if (Actor_Query_Goal_Number(0) == 230) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 21;
- dword_45A0FC = 1;
- *animation = 12;
- }
- }
- break;
- case 19:
- *animation = 11;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= 12) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
- *animation = 0;
- }
- break;
- case 18:
- *animation = 10;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(10)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 17;
- *animation = 12;
- }
- break;
- case 17:
- *animation = 12;
- dword_45A0D4_animation_frame = 0;
- // weird, but thats in game code
- if (Slice_Animation_Query_Number_Of_Frames(12) <= 0) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 17;
- }
- break;
- case 16:
- *animation = 9;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(9)) {
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- }
- break;
- case 15:
- *animation = 8;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(8)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 14;
- *animation = 0;
- }
- break;
- case 14:
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(0)) {
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
- }
- *animation = 0;
- break;
- case 13:
- *animation = 19;
- if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(19) / 2) {
- dword_45A0D4_animation_frame -= 3;
- if (dword_45A0D4_animation_frame <= 0) {
- dword_45A0D4_animation_frame = 0;
- *animation = dword_46271C;
- dword_45A0D0_animation_state = dword_462718;
- }
- } else {
- dword_45A0D4_animation_frame += 3;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) {
- dword_45A0D4_animation_frame = 0;
- *animation = dword_46271C;
- dword_45A0D0_animation_state = dword_462718;
- }
- }
- break;
- case 12:
- *animation = 27;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 11:
- *animation = 26;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(26)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 10:
- *animation = 25;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(25)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 9:
- *animation = 24;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(24)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 8:
- *animation = 23;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(23)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 7:
- *animation = 22;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(22)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 6:
- *animation = 27;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 5:
- *animation = 21;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(21)) {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 3;
- *animation = 20;
- }
- break;
- case 3:
- case 4:
- if (dword_45A0D4_animation_frame == 0 && !Game_Flag_Query(236)) {
- dword_45A0D4_animation_frame = 1;
- dword_45A0D0_animation_state = dword_45A0F0;
- *animation = dword_45A0F4;
- dword_45A0F0 = 4;
- dword_45A0F4 = 20;
- } else if (dword_45A0D4_animation_frame <= 4 && Game_Flag_Query(236)) {
- Game_Flag_Reset(236);
- *animation = 19;
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 0;
- } else {
- *animation = 20;
- dword_45A0D4_animation_frame++;
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(20)) {
- dword_45A0D4_animation_frame = 0;
- }
- }
- break;
- case 0:
- *animation = 19;
- if (dword_45A0D8 < dword_45A0DC) {
- //*frame = dword_45A0E8;
- dword_45A0D4_animation_frame += dword_45A0E0;
- if (dword_45A0D4_animation_frame > dword_45A0E8) {
- dword_45A0D4_animation_frame = dword_45A0E8;
- dword_45A0E0 = -1;
- } else if (dword_45A0D4_animation_frame < dword_45A0E4) {
- dword_45A0D4_animation_frame = dword_45A0E4;
- dword_45A0E0 = 1;
- }
- dword_45A0D8++;
- } else {
- dword_45A0D4_animation_frame += dword_45A0E0;
- dword_45A0DC = 0;
- if (dword_45A0D4_animation_frame == 18 && Random_Query(0, 2)) {
- dword_45A0E0 = -1;
- dword_45A0D8 = 0;
- dword_45A0E4 = 14;
- dword_45A0E8 = 18;
- dword_45A0DC = Random_Query(0, 30);
- }
- if (dword_45A0D4_animation_frame == 26) {
- if (Random_Query(0, 2)) {
- dword_45A0E0 = -1;
- dword_45A0D8 = 0;
- dword_45A0E4 = 23;
- dword_45A0E8 = 26;
- dword_45A0DC = Random_Query(0, 30);
- }
- }
- if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) {
- dword_45A0D4_animation_frame = 0;
- if (Random_Query(0, 2)) {
- dword_45A0D8 = 0;
- dword_45A0E4 = 0;
- dword_45A0E8 = 3;
- dword_45A0DC = Random_Query(0, 45);
- }
- }
- if (dword_45A0D4_animation_frame < 0) {
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(19) - 1;
- }
- }
- break;
- }
- *frame = dword_45A0D4_animation_frame;
- return true;
-}
-
-bool AIScript_McCoy::ChangeAnimationMode(int mode) {
- int v2;
- switch (mode) {
- case 85:
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 69;
- return true;
- case 75:
- dword_45A0D0_animation_state = 67;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 68:
- dword_45A0D0_animation_state = 29;
- dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1;
- dword_45A0E0 = -1;
- return true;
- case 65:
- case 67:
- dword_45A0D0_animation_state = 43;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 64:
- case 66:
- dword_45A0D0_animation_state = 42;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 53:
- if (dword_45A0D0_animation_state != 60 && (Player_Query_Current_Set() == 55 || Player_Query_Current_Set() == 13)) {
- dword_45A0D0_animation_state = 60;
- dword_45A0D4_animation_frame = 0;
- } else {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 70;
- }
- return true;
- case 52:
- dword_45A0D0_animation_state = 55;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 51:
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 49:
- dword_45A0D0_animation_state = 28;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 48:
- switch (dword_45A0D0_animation_state) {
- case 14:
- dword_45A0D0_animation_state = 28;
- dword_45A0D4_animation_frame = 0;
- break;
- case 13:
- dword_45A0D0_animation_state = 22;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 10:
- dword_45A0D0_animation_state = 18;
- dword_45A0D4_animation_frame = 8 * (13 - dword_45A0D4_animation_frame) / 13;
- return true;
- case 8:
- case 9:
- case 12:
- return true;
- case 11:
- dword_45A0D0_animation_state = 18;
- dword_45A0D4_animation_frame = 0;
- break;
- case 7:
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
- break;
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
- break;
- default:
- if (dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
- }
- break;
- }
- return true;
- case 47:
- dword_45A0D0_animation_state = 41;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 46:
- dword_45A0D0_animation_state = 40;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 45:
- dword_45A0D0_animation_state = 39;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 44:
- dword_45A0D0_animation_state = 38;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 42:
- dword_45A0D0_animation_state = 46;
- dword_45A0D4_animation_frame = 0;
- Player_Loses_Control();
- return true;
- case 41:
- dword_45A0D0_animation_state = 45;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 40:
- dword_45A0D0_animation_state = 44;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 39:
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 52;
- if (Player_Query_Current_Set() == 27) {
- dword_45A0D4_animation_frame = 23;
- }
- return true;
- case 38:
- dword_45A0D0_animation_state = 47;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 29:
- Player_Loses_Control();
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 71;
- return true;
- case 23:
- dword_45A0D0_animation_state = 66;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 22:
- if (Random_Query(0, 1)) {
- dword_45A0D0_animation_state = 23;
- } else {
- dword_45A0D0_animation_state = 24;
- }
- dword_45A0D4_animation_frame = 0;
- return true;
- case 21:
- switch (dword_45A0D0_animation_state) {
- case 0:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- dword_45A0D0_animation_state = 28;
- dword_45A0D4_animation_frame = 0;
- break;
- case 1:
- case 8:
- dword_45A0D0_animation_state = 27;
- dword_45A0D4_animation_frame = 0;
- break;
- default:
-
- if (Random_Query(0, 1)) {
- dword_45A0D0_animation_state = 26;
- } else {
- dword_45A0D0_animation_state = 25;
- }
- dword_45A0D4_animation_frame = 0;
- break;
- }
- return true;
- case 20:
- v2 = Actor_Query_Which_Set_In(0);
- if (v2 == 27) {
- dword_45A0D0_animation_state = 51;
- dword_45A0D4_animation_frame = 0;
- Player_Loses_Control();
- Game_Flag_Set(210);
- } else if (v2 == 70 || v2 == 87) {
- dword_45A0D0_animation_state = 56;
- dword_45A0D4_animation_frame = 0;
- }
- return true;
- case 19:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 12;
- dword_46271C = 27;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 12;
- dword_45A0F4 = 27;
- }
- return true;
- case 18:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 11;
- dword_46271C = 26;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 11;
- dword_45A0F4 = 26;
- }
- return true;
- case 17:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 10;
- dword_46271C = 25;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 10;
- dword_45A0F4 = 25;
- }
- return true;
- case 16:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 9;
- dword_46271C = 24;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 9;
- dword_45A0F4 = 24;
- }
- return true;
- case 15:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 8;
- dword_46271C = 23;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 8;
- dword_45A0F4 = 23;
- }
- return true;
- case 11:
- case 14:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 7;
- dword_46271C = 22;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 7;
- dword_45A0F4 = 22;
- }
- return true;
- case 10:
- case 13:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 6;
- dword_46271C = 27;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 6;
- dword_45A0F4 = 27;
- }
- return true;
- case 9:
- case 12:
- if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 5;
- dword_46271C = 21;
- } else {
- Game_Flag_Reset(236);
- dword_45A0F0 = 5;
- dword_45A0F4 = 21;
- }
- return true;
- case 8:
- if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 37;
- dword_45A0D4_animation_frame = 0;
- }
- return true;
- case 7:
- if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) {
- dword_45A0D0_animation_state = 36;
- dword_45A0D4_animation_frame = 0;
- }
- return true;
- case 6:
- dword_45A0D0_animation_state = 21;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 5:
- switch (dword_45A0D0_animation_state) {
- case 1:
- case 2:
- case 5:
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
- break;
- case 0:
- case 3:
- case 4:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
- break;
- default:
- dword_45A0D0_animation_state = 18;
- dword_45A0D4_animation_frame = 0;
- break;
- }
- return true;
- case 4:
- switch (dword_45A0D0_animation_state) {
- case 22:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 41;
- break;
- case 18:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8);
- break;
- case 17:
- case 20:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 0;
- break;
- case 16:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16;
- break;
- case 14:
- case 15:
- case 19:
- case 21:
- case 2:
- case 3:
- return true;
- default:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
- break;
- case 13:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 0;
- break;
- case 0:
- case 1:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- dword_45A0DC = 0;
- break;
- }
- return true;
- case 3:
- if (dword_45A0D0_animation_state >= 3 && dword_45A0D0_animation_state <= 12) {
- Game_Flag_Reset(236);
- dword_45A0F0 = 4;
- dword_45A0F4 = 20;
- } else {
- dword_45A0D0_animation_state = 13;
- dword_462718 = 3;
- dword_46271C = 20;
- }
- return true;
- case 2:
- if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) {
- return true;
- }
- if (!Game_Flag_Query(550)) {
- dword_45A0D0_animation_state = 31;
- dword_45A0D4_animation_frame = 0;
- return true;
- }
- dword_45A0D0_animation_state = 58;
- dword_45A0D4_animation_frame = 4;
- return true;
- case 1:
- if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) {
- return true;
- }
- if (!Game_Flag_Query(550)) {
- dword_45A0D0_animation_state = 32;
- dword_45A0D4_animation_frame = 0;
- return true;
- }
- dword_45A0D0_animation_state = 58;
- dword_45A0D4_animation_frame = 0;
- return true;
- case 0:
- if (Game_Flag_Query(550)) {
- if (dword_45A0D4_animation_frame > 6) {
- dword_45A0D0_animation_state = 57;
- dword_45A0D4_animation_frame = 0;
- return true;
- }
- int v3 = Random_Query(0, 2);
- int v4 = 0;
- if (v3 == 0) {
- v4 = 595;
- } else if (v3 == 1) {
- v4 = 594;
- } else if (v3 == 2) {
- v4 = 593;
- }
- Ambient_Sounds_Play_Sound(v4, 39, 0, 0, 99);
- dword_45A0D0_animation_state = 57;
- dword_45A0D4_animation_frame = 0;
- return true;
- }
- if (dword_45A0D0_animation_state == 60) {
- dword_45A0D0_animation_state = 61;
- return true;
- }
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- dword_45A0DC = 0;
- return true;
- }
- return true;
-}
-
-void AIScript_McCoy::QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) {
- *animationState = dword_45A0D0_animation_state;
- *a2 = dword_45A0D4_animation_frame;
- *a3 = dword_462718;
- *a4 = dword_46271C;
-}
-
-void AIScript_McCoy::SetAnimationState(int animationState, int a2, int a3, int a4) {
- dword_45A0D0_animation_state = animationState;
- dword_45A0D4_animation_frame = a2;
- dword_462718 = a3;
- dword_46271C = a4;
-}
-
-bool AIScript_McCoy::ReachedMovementTrackWaypoint(int waypointId) {
- return true;
-}
-
-void AIScript_McCoy::FledCombat() {}
-
-void AIScript_McCoy::sub_4053E0() {
- float x, y, z;
- Actor_Query_XYZ(0, &x, &y, &z);
- flt_462710 = flt_462710 + off_45A100;
- if (flt_462714 < flt_462710) {
- off_45A100 = off_45A100 - 0.2f;
- } else {
- flt_462710 = flt_462714;
- Actor_Set_Goal_Number(0, 0);
- Actor_Retired_Here(0, 12, 48, 1, -1);
- }
- return Actor_Set_At_XYZ(0, x, flt_462710, z, Actor_Query_Facing_1024(0));
-}
-
-void AIScript_McCoy::sub_4054F0() {
- if (Actor_Query_Which_Set_In(0) == 87 && Actor_Query_Goal_Number(0) != 390 && !Game_Flag_Query(682)) {
- float x, y, z;
- Actor_Query_XYZ(0, &x, &y, &z);
- if ((z < 220.0f) && (-210.0f < x) && (-70.0f > x)) {
- Game_Flag_Set(682);
- Scene_Loop_Set_Default(3);
- Scene_Loop_Start_Special(2, 2, 1);
- Actor_Set_Goal_Number(0, 390);
- Actor_Query_XYZ(64, &x, &y, &z);
- if (-200.0 < x && -62.0f > x) {
- Actor_Set_Goal_Number(64, 309);
- }
- } else {
- Actor_Set_Goal_Number(0, 391);
- }
- }
-}
-
-void AIScript_McCoy::sub_405660() {
- if (Game_Flag_Query(550)) {
- if (dword_45A0D4_animation_frame <= 6) {
- int v1 = Random_Query(0, 2);
- int v2 = 0;
- if (v1 == 0) {
- v2 = 595;
- } else if (v1 == 1) {
- v2 = 594;
- } else if (v1 == 2) {
- v2 = 593;
- }
- Ambient_Sounds_Play_Sound(v2, 39, 0, 0, 99);
- }
- dword_45A0D0_animation_state = 57;
- dword_45A0D4_animation_frame = 0;
- return;
- }
- switch (dword_45A0D0_animation_state) {
- case 17:
- case 20:
- case 21:
- case 36:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 0;
- break;
- case 16:
- case 25:
- case 26:
- break;
- case 15:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 16 - 16 * dword_45A0D4_animation_frame / 12;
- break;
- case 14:
- dword_45A0D0_animation_state = 16;
- dword_45A0D4_animation_frame = 0;
- break;
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- Game_Flag_Set(236);
- dword_45A0D8 = 0;
- dword_45A0DC = 30;
- dword_45A0E4 = 0;
- dword_45A0E0 = 1;
- dword_45A0E8 = 3;
- break;
- case 60:
- dword_45A0D0_animation_state = 61;
- break;
- default:
- dword_45A0D0_animation_state = 0;
- dword_45A0D4_animation_frame = 0;
- dword_45A0DC = 0;
- }
-}
-
-void AIScript_McCoy::sub_405800() {
- switch (dword_45A0D0_animation_state) {
- case 36:
- case 37:
- case 40:
- case 41:
- case 51:
- dword_45A0D0_animation_state = 14;
- dword_45A0D4_animation_frame = 0;
- break;
- case 22:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 41;
- break;
- case 18:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8);
- break;
- case 17:
- case 20:
- dword_45A0D0_animation_state = 19;
- dword_45A0D4_animation_frame = 0;
- break;
- case 16:
- dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16;
- dword_45A0D0_animation_state = 15;
- break;
- case 14:
- case 15:
- case 19:
- case 21:
- break;
- default:
- dword_45A0D0_animation_state = 15;
- dword_45A0D4_animation_frame = 0;
- break;
- }
-}
-
-void AIScript_McCoy::sub_4058B0() {
- int v0 = Actor_Query_Which_Set_In(0);
- if (v0 == 27) {
- dword_45A0D0_animation_state = 51;
- dword_45A0D4_animation_frame = 0;
- Player_Loses_Control();
- Game_Flag_Set(210);
- } else if (v0 == 70 || v0 == 87) {
- dword_45A0D0_animation_state = 56;
- dword_45A0D4_animation_frame = 0;
- }
-}
-
-void AIScript_McCoy::sub_405920() {
- dword_45A0D4_animation_frame = 0;
- dword_45A0D0_animation_state = 47;
-}
-
-void AIScript_McCoy::sub_405940(float a1) {
- float x, y, z;
- int currentAngle = Actor_Query_Facing_1024(0);
- Actor_Query_XYZ(0, &x, &y, &z);
- int angle = currentAngle - 12;
- y = y + a1;
- if (angle < 0) {
- angle = currentAngle + 1012;
- }
- if (angle > 1023) {
- angle -= 1024;
- }
- Actor_Set_At_XYZ(0, x, y, z, angle);
-}
-
-void AIScript_McCoy::sub_4059D0(float a1) {
- float x, y, z;
- int currentAngle = Actor_Query_Facing_1024(0);
- Actor_Query_XYZ(0, &x, &y, &z);
- int angle = currentAngle + 15;
- y = y + a1;
- if (angle < 0) {
- angle = currentAngle + 1039;
- }
- if (angle > 1023) {
- angle -= 1024;
- }
- return Actor_Set_At_XYZ(0, x, y, z, angle);
-}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_00_mccoy.h b/engines/bladerunner/script/ai_00_mccoy.h
deleted file mode 100644
index 2fda82f..0000000
--- a/engines/bladerunner/script/ai_00_mccoy.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 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/script.h"
-
-#include "bladerunner/bladerunner.h"
-
-namespace BladeRunner {
-class AIScript_McCoy : public AIScriptBase {
- int dword_45A0D0_animation_state;
- int dword_45A0D4_animation_frame;
- int dword_45A0D8;
- int dword_45A0DC;
- int dword_45A0E0;
- int dword_45A0E4;
- float off_45A0EC;
- int dword_45A0E8;
- int dword_45A0F0;
- int dword_45A0F4;
- int dword_45A0F8;
- int dword_45A0FC;
- int dword_462718;
- int dword_46271C;
- float off_45A100;
- float flt_462710;
- float flt_462714;
-
-public:
- AIScript_McCoy(BladeRunnerEngine *vm);
-
- void Initialize();
- bool Update();
- void TimerExpired(int timer);
- void CompletedMovementTrack();
- void ReceivedClue(int clueId, int fromActorId);
- void ClickedByPlayer();
- void EnteredScene(int sceneId);
- void OtherAgentEnteredThisScene(int otherActorId);
- void OtherAgentExitedThisScene(int otherActorId);
- void OtherAgentEnteredCombatMode(int otherActorId, int combatMode);
- void ShotAtAndMissed();
- void ShotAtAndHit();
- void Retired(int byActorId);
- int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId);
- bool GoalChanged(int currentGoalNumber, int newGoalNumber);
- bool UpdateAnimation(int *animation, int *frame);
- bool ChangeAnimationMode(int mode);
- void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4);
- void SetAnimationState(int animationState, int a2, int a3, int a4);
- bool ReachedMovementTrackWaypoint(int a1);
- void FledCombat();
-
-private:
- void sub_4053E0();
- void sub_4054F0();
- void sub_405660();
- void sub_405800();
- void sub_4058B0();
- void sub_405920();
- void sub_405940(float a1);
- void sub_4059D0(float a1);
-
-};
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_15_runciter.cpp b/engines/bladerunner/script/ai_15_runciter.cpp
deleted file mode 100644
index b26339b..0000000
--- a/engines/bladerunner/script/ai_15_runciter.cpp
+++ /dev/null
@@ -1,656 +0,0 @@
-/* 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_15_runciter.h"
-
-namespace BladeRunner {
-
-AIScript_Runciter::AIScript_Runciter(BladeRunnerEngine *vm)
- : AIScriptBase(vm) {}
-
-void AIScript_Runciter::Initialize() {
- var_45CD70_animation_state = 0;
- var_45CD74_animation_frame = 0;
- var_462800 = 0;
- var_45CD78 = 0;
- var_45CD7C = 6;
- var_45CD80 = 1;
- var_45CD84 = 0;
- var_45CD88 = 0;
- Actor_Set_Goal_Number(15, 0);
-}
-
-bool AIScript_Runciter::Update() {
- if (Actor_Query_Goal_Number(15) == 0 && Game_Flag_Query(186)) {
- Actor_Set_Goal_Number(15, 2);
- }
- if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(15) < 300) {
- Actor_Set_Goal_Number(15, 300);
- }
- return false;
-}
-
-void AIScript_Runciter::TimerExpired(int timer) {}
-
-void AIScript_Runciter::CompletedMovementTrack() {
- if (Actor_Query_Goal_Number(15) == 1) {
- if (Player_Query_Current_Scene() == 79) {
- switch (Random_Query(1, 5)) {
- case 2:
- case 3:
- ADQ_Add(15, 530, -1);
- break;
- case 1:
- case 5:
- ADQ_Add(15, 80, -1);
- break;
- case 4:
- ADQ_Add(15, 930, -1);
- break;
- }
- }
- Actor_Set_Goal_Number(15, 99);
- Actor_Set_Goal_Number(15, 1);
- //return true;
- }
- //return false;
-}
-
-void AIScript_Runciter::ReceivedClue(int clueId, int fromActorId) {}
-
-void AIScript_Runciter::ClickedByPlayer() {}
-
-void AIScript_Runciter::EnteredScene(int sceneId) {}
-
-void AIScript_Runciter::OtherAgentEnteredThisScene(int otherActorId) {}
-
-void AIScript_Runciter::OtherAgentExitedThisScene(int otherActorId) {}
-
-void AIScript_Runciter::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
- if (Actor_Query_Goal_Number(15) == 300 && combatMode == 1 && !Game_Flag_Query(705)) {
- Actor_Set_Targetable(15, true);
- Actor_Face_Actor(15, 0, true);
- Actor_Says(15, 420, 12);
- Actor_Face_Actor(0, 15, true);
- Actor_Change_Animation_Mode(0, 5);
- if (Actor_Clue_Query(0, 158)) {
- Actor_Says(0, 4770, -1);
- Actor_Says(15, 590, 13);
- Actor_Says(0, 4775, -1);
- Actor_Says(15, 600, 17);
- Sound_Play(492, 100, 0, 100, 50);
- Actor_Says(0, 4780, -1);
- Actor_Says(15, 610, 18);
- Actor_Says(0, 4785, -1);
- Actor_Says(15, 620, 15);
- if (Game_Flag_Query(46)) {
- Actor_Says(15, 630, 12);
- Actor_Says(15, 640, 17);
- Actor_Says(0, 4790, -1);
- Actor_Says(15, 650, 18);
- Actor_Says(15, 660, 19);
- Actor_Clue_Acquire(0, 280, 1, 15);
- } else {
- Actor_Says(15, 670, 18);
- Actor_Says(0, 4795, -1);
- Actor_Says(15, 730, 17);
- }
- } else if (Actor_Clue_Query(0, 76)) {
- Actor_Says(0, 4730, -1);
- Actor_Says(15, 480, 17);
- Actor_Says(0, 4735, -1);
- Actor_Says(15, 490, 16);
- Sound_Play(492, 100, 0, 100, 50);
- Actor_Says(0, 4740, -1);
- Actor_Says(15, 500, 18);
- Actor_Says(15, 510, 19);
- Actor_Says(0, 4745, -1);
- Actor_Says(0, 4750, -1);
- Actor_Says(15, 520, 17);
- Actor_Says(15, 530, 18);
- Actor_Says(15, 540, 16);
- }
- Game_Flag_Set(705);
- }
-}
-
-void AIScript_Runciter::ShotAtAndMissed() {}
-
-void AIScript_Runciter::ShotAtAndHit() {
- Actor_Set_Targetable(15, false);
- Actor_Change_Animation_Mode(15, 48);
- Actor_Set_Goal_Number(15, 599);
- Delay(2000);
- if (Actor_Clue_Query(0, 158)) {
- Actor_Voice_Over(2050, 99);
- Actor_Voice_Over(2060, 99);
- } else {
- Actor_Voice_Over(2070, 99);
- Actor_Voice_Over(2080, 99);
- Actor_Voice_Over(2090, 99);
- }
- Actor_Modify_Friendliness_To_Other(5, 0, 3);
-}
-
-void AIScript_Runciter::Retired(int byActorId) {}
-
-int AIScript_Runciter::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
- return 0;
-}
-
-bool AIScript_Runciter::GoalChanged(int currentGoalNumber, int newGoalNumber) {
- if (newGoalNumber == 0) {
- Actor_Put_In_Set(15, 16);
- Actor_Set_At_Waypoint(15, 92, 567);
- return false;
- }
- if (newGoalNumber == 1) {
- AI_Movement_Track_Flush(15);
- if (Random_Query(0, 1) == 1) {
- if (Random_Query(0, 1) == 0) {
- AI_Movement_Track_Append_With_Facing(15, 89, Random_Query(6, 10), 567);
- }
- AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002);
- AI_Movement_Track_Append(15, 92, 5);
- } else {
- AI_Movement_Track_Append_With_Facing(15, 91, Random_Query(3, 10), 120);
- if (Random_Query(1, 3) == 1) {
- AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002);
- }
- AI_Movement_Track_Append_With_Facing(15, 90, Random_Query(5, 10), 170);
- }
- AI_Movement_Track_Repeat(15);
- return true;
- }
- if (newGoalNumber == 2) {
- AI_Movement_Track_Flush(15);
- AI_Movement_Track_Append(15, 39, 120);
- AI_Movement_Track_Append(15, 40, 0);
- AI_Movement_Track_Repeat(15);
- return false;
- }
- if (newGoalNumber == 300) {
- Actor_Put_In_Set(15, 16);
- Actor_Set_At_Waypoint(15, 93, 1007);
- return false;
- }
- return false;
-}
-
-bool AIScript_Runciter::UpdateAnimation(int *animation, int *frame) {
-
- switch (var_45CD70_animation_state) {
- case 15:
- *animation = 528;
- var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(528) - 1;
- *frame = var_45CD74_animation_frame;
- break;
- case 14:
- *animation = 528;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(528) - 1) {
- *animation = 528;
- var_45CD70_animation_state = 15;
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 13:
- if (var_45CD78 == 0) {
- var_45CD74_animation_frame = 0;
- var_45CD70_animation_state = var_462800;
- *animation = var_462804;
- } else if (var_45CD78 == 1) {
- *animation = 530;
- var_45CD74_animation_frame += 3;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) {
- var_45CD74_animation_frame = 0;
- var_45CD70_animation_state = var_462800;
- *animation = var_462804;
- }
- } else if (var_45CD78 == 2) {
- *animation = 531;
- var_45CD74_animation_frame -= 3;
- if (var_45CD74_animation_frame - 3 < 0) {
- var_45CD74_animation_frame = 0;
- var_45CD70_animation_state = var_462800;
- *animation = var_462804;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 12:
- *animation = 532;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(532)) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD74_animation_frame = 0;
- var_45CD78 = 0;
- Actor_Change_Animation_Mode(15, 0);
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 11:
- *animation = 541;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(541)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 10:
- *animation = 540;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(540)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 9:
- *animation = 539;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(539)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 8:
- *animation = 538;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(538)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 7:
- *animation = 537;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(537)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 6:
- *animation = 536;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(536)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 5:
- *animation = 535;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(535)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 4:
- *animation = 534;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(534)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- *animation = 533;
- var_45CD70_animation_state = 2;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 2:
- *animation = 533;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(533)) {
- var_45CD74_animation_frame = 0;
- if (var_45CD88) {
- *animation = 529;
- var_45CD70_animation_state = 0;
- var_45CD78 = 0;
- } else {
- var_45CD70_animation_state = 4;
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 1:
- *animation = 526;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(526)) {
- var_45CD74_animation_frame = 0;
- }
- *frame = var_45CD74_animation_frame;
- break;
- case 0:
- if (var_45CD78 == 0) {
- *animation = 529;
- if (var_45CD84) {
- var_45CD84--;
- } else {
- var_45CD74_animation_frame += var_45CD80;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(529)) {
- var_45CD74_animation_frame = 0;
- }
- if (var_45CD74_animation_frame < 0) {
- var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(529) - 1;
- }
- --var_45CD7C;
- if (var_45CD7C == 0) {
- var_45CD80 = 2 * Random_Query(0, 1) - 1;
- var_45CD7C = Random_Query(6, 14);
- var_45CD84 = Random_Query(0, 4);
- }
- if (var_45CD74_animation_frame == 0) {
- if (Random_Query(0, 1) == 1) {
- var_45CD78 = Random_Query(1, 2);
- var_45CD80 = 1;
- var_45CD84 = 0;
- }
- }
- }
- } else if (var_45CD78 == 1) {
- *animation = 530;
- var_45CD74_animation_frame++;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) {
- var_45CD74_animation_frame = 0;
- var_45CD78 = 0;
- *animation = 529;
- var_45CD7C = Random_Query(6, 14);
- var_45CD80 = 2 * Random_Query(0, 1) - 1;
- }
- } else if (var_45CD78 == 2) {
- *animation = 531;
- if (var_45CD84) {
- var_45CD84--;
- } else {
- var_45CD74_animation_frame += var_45CD80;
- if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) {
- var_45CD84 = Random_Query(5, 15);
- var_45CD80 = -1;
- }
- if (var_45CD74_animation_frame <= 0) {
- var_45CD74_animation_frame = 0;
- var_45CD78 = 0;
- *animation = 529;
- var_45CD7C = Random_Query(6, 14);
- var_45CD80 = 2 * Random_Query(0, 1) - 1;
- }
- }
- }
- *frame = var_45CD74_animation_frame;
- break;
- default:
- *animation = 399;
- var_45CD74_animation_frame = 0;
- *frame = var_45CD74_animation_frame;
- break;
- }
- return true;
-}
-
-bool AIScript_Runciter::ChangeAnimationMode(int mode) {
-
- switch (mode) {
- case 23:
- var_45CD70_animation_state = 12;
- var_45CD74_animation_frame = 0;
- break;
- case 19:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 11;
- var_462804 = 541;
- }
- var_45CD88 = 0;
- break;
- case 18:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 10;
- var_462804 = 540;
- }
- var_45CD88 = 0;
- break;
- case 17:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 9;
- var_462804 = 539;
- }
- var_45CD88 = 0;
- break;
- case 16:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 8;
- var_462804 = 538;
- }
- var_45CD88 = 0;
- break;
- case 15:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 7;
- var_462804 = 537;
- }
- var_45CD88 = 0;
- break;
- case 14:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 6;
- var_462804 = 536;
- }
- var_45CD88 = 0;
- break;
- case 13:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 5;
- var_462804 = 535;
- }
- var_45CD88 = 0;
- break;
- case 12:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 4;
- var_462804 = 534;
- }
- var_45CD88 = 0;
- break;
- case 3:
- if (var_45CD70_animation_state) {
- var_45CD70_animation_state = 2;
- var_45CD74_animation_frame = 0;
- } else {
- var_45CD70_animation_state = 13;
- var_462800 = 2;
- var_462804 = 526;
- }
- var_45CD88 = 0;
- break;
- case 1:
- if (var_45CD70_animation_state > 1) {
- var_45CD70_animation_state = 1;
- var_45CD74_animation_frame = 0;
- } else if (!var_45CD70_animation_state) {
- var_45CD70_animation_state = 13;
- var_462800 = 1;
- var_462804 = 526;
- }
- break;
- case 0:
- if (var_45CD70_animation_state >= 2 && var_45CD70_animation_state <= 11) {
- var_45CD88 = 1;
- } else {
- var_45CD70_animation_state = 0;
- var_45CD74_animation_frame = 0;
- var_45CD78 = 0;
- }
- break;
- case 2:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 20:
- case 21:
- case 22:
- break;
- default:
- if (mode == 48) {
- var_45CD70_animation_state = 14;
- var_45CD74_animation_frame = 0;
- }
- break;
- }
- return true;
-}
-
-void AIScript_Runciter::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
- *animationState = var_45CD70_animation_state;
- *animationFrame = var_45CD74_animation_frame;
- *a3 = var_462800;
- *a4 = var_462804;
-}
-
-void AIScript_Runciter::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
- var_45CD70_animation_state = animationState;
- var_45CD74_animation_frame = animationFrame;
- var_462800 = a3;
- var_462804 = a4;
-}
-
-bool AIScript_Runciter::ReachedMovementTrackWaypoint(int waypointId) {
- switch (waypointId) {
- case 93:
- Actor_Face_Heading(15, 1002, true);
- break;
- case 92:
- Actor_Face_Heading(15, 664, true);
- break;
- case 91:
- Actor_Face_Heading(15, 120, true);
- break;
- case 90:
- Actor_Face_Heading(15, 170, true);
- break;
- case 89:
- Actor_Face_Heading(15, 567, true);
- break;
- default:
- return true;
- }
- return true;
-}
-
-void AIScript_Runciter::FledCombat() {}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_15_runciter.h b/engines/bladerunner/script/ai_15_runciter.h
deleted file mode 100644
index b2cb70d..0000000
--- a/engines/bladerunner/script/ai_15_runciter.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 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/script.h"
-
-#include "bladerunner/bladerunner.h"
-
-namespace BladeRunner {
-
-class AIScript_Runciter : public AIScriptBase {
- int var_45CD70_animation_state;
- int var_45CD74_animation_frame;
- int var_462800;
- int var_462804;
- int var_45CD78;
- int var_45CD7C;
- int var_45CD80;
- int var_45CD84;
- int var_45CD88;
-public:
- AIScript_Runciter(BladeRunnerEngine *vm);
-
- void Initialize();
- bool Update();
- void TimerExpired(int timer);
- void CompletedMovementTrack();
- void ReceivedClue(int clueId, int fromActorId);
- void ClickedByPlayer();
- void EnteredScene(int sceneId);
- void OtherAgentEnteredThisScene(int otherActorId);
- void OtherAgentExitedThisScene(int otherActorId);
- void OtherAgentEnteredCombatMode(int otherActorId, int combatMode);
- void ShotAtAndMissed();
- void ShotAtAndHit();
- void Retired(int byActorId);
- int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId);
- bool GoalChanged(int currentGoalNumber, int newGoalNumber);
- bool UpdateAnimation(int *animation, int *frame);
- bool ChangeAnimationMode(int mode);
- void QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4);
- void SetAnimationState(int animationState, int animationFrame, int a3, int a4);
- bool ReachedMovementTrackWaypoint(int a1);
- void FledCombat();
-};
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_23_officer_leroy.cpp b/engines/bladerunner/script/ai_23_officer_leroy.cpp
deleted file mode 100644
index 8f97466..0000000
--- a/engines/bladerunner/script/ai_23_officer_leroy.cpp
+++ /dev/null
@@ -1,1217 +0,0 @@
-/* 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_23_officer_leroy.h"
-
-namespace BladeRunner {
-
-AIScript_Officer_Leroy::AIScript_Officer_Leroy(BladeRunnerEngine *vm)
- : AIScriptBase(vm), var_45D5B0_animation_state(0), var_45D5B4_animation_frame(0), var_45D5B8(0), var_45D5BC(0), var_462880(0), var_462884(0) {}
-
-void AIScript_Officer_Leroy::Initialize() {
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- var_462880 = 0;
- var_45D5B8 = 0;
- var_45D5BC = 0;
-
- Actor_Put_In_Set(23, 69);
- Actor_Set_At_XYZ(23, -261.80f, 6.00f, 79.58f, 512);
- Actor_Set_Goal_Number(23, 0);
- Actor_Set_Frame_Rate_FPS(23, 8);
-}
-
-bool AIScript_Officer_Leroy::Update() {
- if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(23) < 300) {
- AI_Movement_Track_Flush(23);
- Actor_Set_Goal_Number(23, 300);
- } else if (Global_Variable_Query(1) == 5 && Actor_Query_Goal_Number(23) < 400) {
- AI_Movement_Track_Flush(23);
- Actor_Set_Goal_Number(23, 400);
- } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(163) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) {
- Game_Flag_Set(186);
- Actor_Set_Goal_Number(23, 3);
- } else if (Actor_Query_Goal_Number(23) != 1 && Actor_Query_Goal_Number(23) != 2 && Game_Flag_Query(199) == 1) {
- Game_Flag_Reset(199);
- } else if (Global_Variable_Query(15) > 4 && !Actor_Clue_Query(23, 239)) {
- Actor_Clue_Acquire(23, 239, 1, -1);
- } else if (Game_Flag_Query(629) == 1) {
- Game_Flag_Reset(629);
- } else if (Game_Flag_Query(623) == 1 && !Game_Flag_Query(664)) {
- Game_Flag_Set(664);
- Actor_Set_Goal_Number(23, 305);
- } else if (Actor_Query_Goal_Number(23) == 310 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) {
- Non_Player_Actor_Combat_Mode_Off(23);
- Actor_Set_Goal_Number(23, 305);
- } else if (Actor_Query_Goal_Number(23) == 599 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) {
- Actor_Set_Health(23, 40, 40);
- Actor_Set_Goal_Number(23, 305);
- } else if (Actor_Query_Goal_Number(23) == 305) {
- switch (Actor_Query_Which_Set_In(23)) {
- case 7:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 0, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 20:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 1, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 33:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 5, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 53:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 7, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 54:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 70:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 18, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 74:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 77:
- case 78:
- case 79:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 81:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 13, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 83:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 84:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 16, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- case 86:
- if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) {
- Actor_Set_Goal_Number(23, 310);
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 17, 4, 7, 8, -1, -1, -1, 10, 300, 0);
- }
- break;
- }
- }
- return false;
-}
-
-void AIScript_Officer_Leroy::TimerExpired(int timer) {
- if (timer == 1) {
- AI_Countdown_Timer_Reset(23, 1);
- if (Actor_Query_In_Set(0, 41)) {
- Actor_Set_Goal_Number(23, 430);
- Actor_Set_Goal_Number(24, 430);
- } else {
- Game_Flag_Set(684);
- }
- } else if (timer == 2) {
- AI_Countdown_Timer_Reset(23, 2);
- sub_431420();
- }
-}
-
-void AIScript_Officer_Leroy::CompletedMovementTrack() {
- int v0;
- unsigned int v1;
-
- v0 = Actor_Query_Goal_Number(23);
- if (v0 == 1) {
- Actor_Set_Goal_Number(23, 2);
- return;
- }
- //todo: tidyup
- v1 = v0 - 305;
- if (v1 > 3) {
- return;
- }
- if (!v1) {
- Actor_Set_Goal_Number(23, 306);
- return;
- }
- if (v1 != 2) {
- if (v1 == 3) {
- Actor_Change_Animation_Mode(23, 4);
- Actor_Face_Actor(23, 0, true);
- Actor_Set_Goal_Number(23, 309);
- }
- return;
- }
- Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 12, 4, 7, 8, 0, -1, -1, 15, 300, 0);
-}
-
-void AIScript_Officer_Leroy::ReceivedClue(int clueId, int fromActorId) {
- if (clueId == 222) {
- Actor_Modify_Friendliness_To_Other(23, 0, 5);
- }
- if (clueId == 215) {
- Actor_Modify_Friendliness_To_Other(23, 0, -4);
- }
-}
-
-void AIScript_Officer_Leroy::ClickedByPlayer() {}
-
-void AIScript_Officer_Leroy::EnteredScene(int sceneId) {}
-
-void AIScript_Officer_Leroy::OtherAgentEnteredThisScene(int otherActorId) {}
-
-void AIScript_Officer_Leroy::OtherAgentExitedThisScene(int otherActorId) {}
-
-void AIScript_Officer_Leroy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {}
-
-void AIScript_Officer_Leroy::ShotAtAndMissed() {}
-
-void AIScript_Officer_Leroy::ShotAtAndHit() {
- if (Actor_Query_Goal_Number(23) == 307) {
- Actor_Set_Health(23, 50, 50);
- }
-}
-
-void AIScript_Officer_Leroy::Retired(int byActorId) {
- Actor_Set_Goal_Number(23, 599);
- Game_Flag_Set(607);
-}
-
-int AIScript_Officer_Leroy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
- if (otherActorId) {
- return 0;
- }
- switch (clueId) {
- case 242:
- return -6;
- case 240:
- return -2;
- case 239:
- return -5;
- case 228:
- return 2;
- case 227:
- return 4;
- case 226:
- return 4;
- case 225:
- return 3;
- case 224:
- return 3;
- case 223:
- return 2;
- case 222:
- return 3;
- case 215:
- return -5;
- }
- return 0;
-}
-
-bool AIScript_Officer_Leroy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
- switch (newGoalNumber) {
- case 1:
- AI_Movement_Track_Flush(23);
- if (Random_Query(1, 2) == 1) {
- AI_Movement_Track_Append(23, 57, 7);
- AI_Movement_Track_Append(23, 58, 7);
- } else {
- AI_Movement_Track_Append(23, 58, 7);
- AI_Movement_Track_Append(23, 57, 7);
- }
- AI_Movement_Track_Repeat(23);
- return true;
- case 2:
- if (Random_Query(1, 3) == 1) {
- if (Random_Query(1, 2) == 1 && !Actor_Clue_Query(23, 16)) {
- Actor_Clue_Acquire(23, 16, 0, -1);
- } else if (!Actor_Clue_Query(23, 17)) {
- Actor_Clue_Acquire(23, 17, 0, -1);
- }
- }
- if (Game_Flag_Query(182)) {
- if (Actor_Clue_Query(23, 16) && Actor_Clue_Query(23, 17)) {
- Actor_Set_Goal_Number(23, 0);
- } else {
- Actor_Set_Goal_Number(23, 1);
- }
- } else {
- Actor_Set_Goal_Number(23, 0);
- }
- return true;
- case 3:
- AI_Movement_Track_Flush(23);
- AI_Movement_Track_Append(23, 39, Random_Query(120, 240));
- AI_Movement_Track_Append(23, 35, 0);
- AI_Movement_Track_Repeat(23);
- return true;
- case 99:
- AI_Movement_Track_Flush(23);
- return false;
- case 102:
- AI_Movement_Track_Flush(23);
- AI_Movement_Track_Append(23, 107, 0);
- AI_Movement_Track_Append(23, 108, 0);
- AI_Movement_Track_Repeat(23);
- return true;
- case 300:
- Actor_Set_Goal_Number(23, 305);
- return true;
- case 305:
- AI_Movement_Track_Flush(23);
- switch (Random_Query(1, 10)) {
- case 1:
- AI_Movement_Track_Append(23, 398, 15);
- AI_Movement_Track_Append(23, 399, 0);
- AI_Movement_Track_Append(23, 400, 0);
- AI_Movement_Track_Append(23, 401, 0);
- AI_Movement_Track_Append_With_Facing(23, 402, 3, 276);
- AI_Movement_Track_Append(23, 403, 0);
- AI_Movement_Track_Append(23, 404, 15);
- AI_Movement_Track_Repeat(23);
- break;
- case 2:
- AI_Movement_Track_Append(23, 385, 10);
- AI_Movement_Track_Append(23, 242, 2);
- AI_Movement_Track_Append(23, 386, 2);
- AI_Movement_Track_Append(23, 387, 15);
- AI_Movement_Track_Repeat(23);
- break;
- case 3:
- AI_Movement_Track_Append(23, 390, 10);
- AI_Movement_Track_Append(23, 391, 0);
- AI_Movement_Track_Append(23, 392, 5);
- AI_Movement_Track_Append(23, 345, 0);
- AI_Movement_Track_Append(23, 393, 15);
- AI_Movement_Track_Repeat(23);
- break;
- case 4:
- AI_Movement_Track_Append(23, 381, 15);
- AI_Movement_Track_Append(23, 382, 0);
- AI_Movement_Track_Append(23, 383, 15);
- AI_Movement_Track_Append(23, 382, 3);
- AI_Movement_Track_Append(23, 384, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 5:
- AI_Movement_Track_Append(23, 388, 10);
- AI_Movement_Track_Append(23, 389, 10);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 6:
- AI_Movement_Track_Append(23, 385, 10);
- AI_Movement_Track_Append(23, 242, 2);
- AI_Movement_Track_Append(23, 386, 2);
- AI_Movement_Track_Append(23, 387, 15);
- AI_Movement_Track_Repeat(23);
- break;
- case 7:
- AI_Movement_Track_Append(23, 394, 15);
- AI_Movement_Track_Append(23, 395, 0);
- AI_Movement_Track_Append(23, 396, 0);
- AI_Movement_Track_Append(23, 397, 15);
- AI_Movement_Track_Append(23, 396, 0);
- AI_Movement_Track_Append(23, 395, 0);
- AI_Movement_Track_Append(23, 430, 15);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 8:
- switch (Random_Query(1, 7)) {
- case 1:
- AI_Movement_Track_Append(23, 302, 0);
- AI_Movement_Track_Append(23, 407, 0);
- AI_Movement_Track_Append(23, 408, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 2:
- AI_Movement_Track_Append(23, 536, 0);
- AI_Movement_Track_Append(23, 537, 0);
- AI_Movement_Track_Append(23, 538, 1);
- AI_Movement_Track_Append(23, 537, 0);
- AI_Movement_Track_Append(23, 536, 0);
- AI_Movement_Track_Repeat(23);
- break;
- case 3:
- AI_Movement_Track_Append(23, 296, 10);
- AI_Movement_Track_Append(23, 409, 2);
- AI_Movement_Track_Append(23, 296, 10);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 4:
- AI_Movement_Track_Append(23, 411, 10);
- AI_Movement_Track_Append(23, 412, 5);
- AI_Movement_Track_Append(23, 411, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 5:
- AI_Movement_Track_Append(23, 413, 10);
- AI_Movement_Track_Append(23, 414, 0);
- AI_Movement_Track_Append_With_Facing(23, 431, 0, 1017);
- AI_Movement_Track_Append(23, 432, 10);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 6:
- AI_Movement_Track_Append(23, 415, 0);
- AI_Movement_Track_Append_With_Facing(23, 416, 0, 620);
- AI_Movement_Track_Append(23, 417, 0);
- AI_Movement_Track_Append(23, 418, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- break;
- case 7:
- AI_Movement_Track_Append(23, 405, 10);
- AI_Movement_Track_Append(23, 406, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- return false;
- default:
- return false;
- }
- //no break
- case 9:
- if (Random_Query(1, 2) - 1 == 1) {
- AI_Movement_Track_Append(23, 433, 10);
- AI_Movement_Track_Append(23, 434, 0);
- AI_Movement_Track_Append(23, 435, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- return false;
- }
- AI_Movement_Track_Append(23, 420, 10);
- AI_Movement_Track_Append(23, 422, 2);
- AI_Movement_Track_Append(23, 421, 1);
- AI_Movement_Track_Append_With_Facing(23, 422, 4, 182);
- AI_Movement_Track_Append(23, 420, 10);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- //no break
- case 10:
- AI_Movement_Track_Append(23, 310, 0);
- AI_Movement_Track_Append(23, 307, 0);
- AI_Movement_Track_Append(23, 309, 0);
- AI_Movement_Track_Append(23, 310, 0);
- AI_Movement_Track_Append(23, 35, 30);
- AI_Movement_Track_Repeat(23);
- return false;
- default:
- return false;
- }
- //no break
- case 306:
- Actor_Set_Goal_Number(23, 305);
- return true;
- case 307:
- AI_Movement_Track_Flush(23);
- AI_Movement_Track_Append_With_Facing(23, 416, 0, 556);
- Actor_Change_Animation_Mode(23, 4);
- AI_Movement_Track_Repeat(23);
- return true;
- case 308:
- AI_Movement_Track_Flush(23);
- AI_Movement_Track_Append_Run_With_Facing(23, 440, 2, 355);
- AI_Movement_Track_Append_Run_With_Facing(23, 441, 0, 825);
- AI_Movement_Track_Repeat(23);
- return true;
- case 400:
- AI_Movement_Track_Flush(23);
- AI_Movement_Track_Append(23, 35, 0);
- AI_Movement_Track_Repeat(23);
- Actor_Set_Goal_Number(23, 410);
- return true;
- case 420:
- AI_Countdown_Timer_Reset(23, 1);
- AI_Countdown_Timer_Start(23, 1, 120);
- Actor_Set_Goal_Number(23, 410);
- return true;
- case 425:
- AI_Countdown_Timer_Reset(23, 1);
- AI_Countdown_Timer_Start(23, 1, 60);
- Actor_Set_Goal_Number(23, 410);
- return true;
- case 430:
- Actor_Set_Goal_Number(23, 410);
- Actor_Set_Goal_Number(24, 410);
- return false;
- default:
- return false;
- }
-}
-
-bool AIScript_Officer_Leroy::UpdateAnimation(int *animation, int *frame) {
- int v57;
- int a1;
-
- switch (var_45D5B0_animation_state) {
- case 32:
- *animation = 603;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(603)) {
- *animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B8 = 0;
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 31:
- *animation = 604;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(604)) {
- *animation = 601;
- var_45D5B0_animation_state = 1;
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 30:
- *animation = 587;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(587)) {
- *animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- Actor_Change_Animation_Mode(23, 0);
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 29:
- *animation = 586;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(586)) {
- *animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- Actor_Change_Animation_Mode(23, 0);
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 28:
- *animation = 576;
- if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(576) - 1) {
- ++var_45D5B4_animation_frame;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 27:
- *animation = 588;
- if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(588) - 1) {
- ++var_45D5B4_animation_frame;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 26:
- *animation = 573;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(573)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
- *animation = 571;
- Actor_Change_Animation_Mode(23, 4);
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 25:
- *animation = 572;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(572)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
- *animation = 571;
- Actor_Change_Animation_Mode(23, 4);
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 24:
- *animation = 581;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame == 4) {
- if (Random_Query(1, 2) == 1) {
- Sound_Play_Speech_Line(23, 9010, 75, 0, 99);
- } else {
- Sound_Play_Speech_Line(23, 9015, 75, 0, 99);
- }
- }
- if (var_45D5B4_animation_frame == 5) {
- Actor_Combat_AI_Hit_Attempt(23);
- }
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(581)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
- *animation = 571;
- Actor_Change_Animation_Mode(23, 4);
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 23:
- *animation = 580;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(580)) {
- *animation = 589;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 22:
- *animation = 579;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(579)) {
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
- *animation = 571;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 21:
- *animation = 571;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(571)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 20:
- *animation = 571;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(571) - 1) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 19:
- *animation = 600;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(600)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 18:
- *animation = 599;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(599)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 17:
- *animation = 598;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(598)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 16:
- *animation = 597;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(597)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 15:
- *animation = 596;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(596)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 14:
- *animation = 595;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(595)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 13:
- *animation = 594;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(594)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 12:
- *animation = 593;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(593)) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- *animation = 592;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 11:
- if (var_45D5BC && var_45D5B4_animation_frame <= 2) {
- var_45D5BC = 0;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- *animation = 589;
- var_45D5B8 = Random_Query(0, 1);
- *frame = var_45D5B4_animation_frame;
- return true;
- }
-
- *animation = 592;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(592)) {
- var_45D5B4_animation_frame = 0;
- if (var_45D5BC) {
- var_45D5BC = 0;
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- *animation = 589;
- var_45D5B8 = Random_Query(0, 1);
- } else {
- var_45D5B0_animation_state = Random_Query(0, 8) + 11;
- }
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 10:
- *animation = 578;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(578)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 9:
- *animation = 577;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(577)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 8:
- *animation = 575;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(575)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 7:
- *animation = 574;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(574)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 6:
- *animation = 585;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(585)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 5:
- *animation = 584;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(584)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 4:
- *animation = 583;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(583)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 3:
- *animation = 582;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(582)) {
- var_45D5B4_animation_frame = 0;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 2:
- if (Game_Flag_Query(199)) {
- *animation = 603;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(603) - 1) {
- Game_Flag_Reset(199);
- var_45D5B4_animation_frame = 0;
- var_45D5B0_animation_state = var_462880;
- *animation = var_462884;
- }
- } else {
- if (var_45D5B8 == 0) {
- *animation = 589;
- }
- if (var_45D5B8 == 1) {
- *animation = 590;
- }
- if (var_45D5B8 == 2) {
- *animation = 591;
- }
- if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) {
- a1 = *animation;
- var_45D5B4_animation_frame += 3;
- v57 = var_45D5B4_animation_frame;
- if (v57 > Slice_Animation_Query_Number_Of_Frames(a1) - 1) {
- var_45D5B4_animation_frame = 0;
- var_45D5B0_animation_state = var_462880;
- *animation = var_462884;
- }
- } else {
- var_45D5B4_animation_frame -= 3;
- if (var_45D5B4_animation_frame < 0) {
- var_45D5B4_animation_frame = 0;
- var_45D5B0_animation_state = var_462880;
- *animation = var_462884;
- }
- }
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 1:
- *animation = 601;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(601)) {
- var_45D5B4_animation_frame = 0;
- }
- if (!Game_Flag_Query(199)) {
- var_45D5B0_animation_state = 32;
- var_45D5B4_animation_frame = 0;
- *animation = 603;
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- case 0:
- if (Game_Flag_Query(199) && !Game_Flag_Query(392)) {
- var_45D5B0_animation_state = 31;
- var_45D5B4_animation_frame = 0;
- *animation = 604;
- } else if (var_45D5B8 == 1) {
- *animation = 590;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(590)) {
- var_45D5B8 = Random_Query(0, 2);
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B8 == 2) {
- *animation = 591;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(591)) {
- var_45D5B8 = Random_Query(0, 2);
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B8 == 0) {
- *animation = 589;
- var_45D5B4_animation_frame++;
- if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(589)) {
- var_45D5B8 = Random_Query(0, 2);
- var_45D5B4_animation_frame = 0;
- }
- }
- *frame = var_45D5B4_animation_frame;
- return true;
- default:
- *animation = 399;
- *frame = var_45D5B4_animation_frame;
- return true;
- }
-}
-
-bool AIScript_Officer_Leroy::ChangeAnimationMode(int mode) {
- int v1;
-
- switch (mode) {
- case 28:
- Game_Flag_Set(199);
- break;
- case 27:
- Game_Flag_Reset(199);
- break;
- case 22:
- if (Random_Query(0, 1)) {
- var_45D5B0_animation_state = 25;
- } else {
- var_45D5B0_animation_state = 26;
- }
- var_45D5B4_animation_frame = 0;
- break;
- case 21:
- if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 24) {
- if (Random_Query(0, 1)) {
- var_45D5B0_animation_state = 25;
- } else {
- var_45D5B0_animation_state = 26;
- }
- var_45D5B4_animation_frame = 0;
- } else {
- if (Random_Query(0, 1)) {
- var_45D5B0_animation_state = 29;
- } else {
- var_45D5B0_animation_state = 30;
- }
- var_45D5B4_animation_frame = 0;
- }
- break;
- case 19:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 19;
- var_462884 = 600;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 19;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 18:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 18;
- var_462884 = 599;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 18;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 17:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 17;
- var_462884 = 598;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 17;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 16:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 16;
- var_462884 = 597;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 16;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 15:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 15;
- var_462884 = 596;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 15;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 14:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 14;
- var_462884 = 595;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 14;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 13:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 13;
- var_462884 = 594;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 13;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 12:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 12;
- var_462884 = 593;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 12;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 8:
- var_45D5B0_animation_state = 8;
- var_45D5B4_animation_frame = 0;
- break;
- case 7:
- var_45D5B0_animation_state = 7;
- var_45D5B4_animation_frame = 0;
- break;
- case 6:
- var_45D5B0_animation_state = 24;
- var_45D5B4_animation_frame = 0;
- break;
- case 4:
- switch (var_45D5B0_animation_state) {
- case 21:
- case 22:
- case 24:
- return true;
- case 7:
- case 8:
- case 9:
- case 10:
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
- break;
- case 0:
- var_45D5B0_animation_state = 22;
- var_45D5B4_animation_frame = 0;
- break;
- default:
- var_45D5B0_animation_state = 21;
- var_45D5B4_animation_frame = 0;
- break;
- }
- break;
- case 3:
- if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) {
- var_45D5B0_animation_state = 2;
- var_462880 = 11;
- var_462884 = 592;
- if (Game_Flag_Query(199) == 1) {
- var_45D5B4_animation_frame = 0;
- }
- } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) {
- var_45D5B0_animation_state = 11;
- var_45D5B4_animation_frame = 0;
- var_45D5BC = 0;
- }
- break;
- case 2:
- var_45D5B0_animation_state = 4;
- var_45D5B4_animation_frame = 0;
- break;
- case 1:
- var_45D5B0_animation_state = 3;
- var_45D5B4_animation_frame = 0;
- break;
- case 0:
- switch (var_45D5B0_animation_state) {
- case 21:
- case 24:
- var_45D5B0_animation_state = 23;
- var_45D5B4_animation_frame = 0;
- break;
- case 20:
- v1 = var_45D5B4_animation_frame;
- Actor_Change_Animation_Mode(23, 4);
- var_45D5B4_animation_frame = v1;
- var_45D5B0_animation_state = 21;
- break;
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- var_45D5BC = 1;
- break;
- case 0:
- case 23:
- return true;
- default:
- var_45D5B0_animation_state = 0;
- var_45D5B4_animation_frame = 0;
- var_45D5B8 = Random_Query(0, 1);
- break;
- }
- break;
- case 5:
- case 9:
- case 10:
- case 11:
- case 20:
- case 23:
- case 24:
- case 25:
- case 26:
- return true;
- default:
- switch (mode) {
- case 58:
- var_45D5B0_animation_state = 20;
- var_45D5B4_animation_frame = 0;
- break;
- case 48:
- if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 22 || var_45D5B0_animation_state == 24) {
- var_45D5B0_animation_state = 28;
- var_45D5B4_animation_frame = 0;
- } else {
- var_45D5B0_animation_state = 27;
- var_45D5B4_animation_frame = 0;
- }
- break;
- case 47:
- var_45D5B0_animation_state = 10;
- var_45D5B4_animation_frame = 0;
- break;
- case 46:
- var_45D5B0_animation_state = 9;
- var_45D5B4_animation_frame = 0;
- break;
- case 45:
- var_45D5B0_animation_state = 6;
- var_45D5B4_animation_frame = 0;
- break;
- case 44:
- var_45D5B0_animation_state = 5;
- var_45D5B4_animation_frame = 0;
- break;
- default:
- return true;
- }
- break;
- }
- return true;
-}
-
-void AIScript_Officer_Leroy::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) {
- *animationState = var_45D5B0_animation_state;
- *animationFrame = var_45D5B4_animation_frame;
- *a3 = var_462880;
- *a4 = var_462884;
-}
-
-void AIScript_Officer_Leroy::SetAnimationState(int animationState, int animationFrame, int a3, int a4) {
- var_45D5B0_animation_state = animationState;
- var_45D5B4_animation_frame = animationFrame;
- var_462880 = a3;
- var_462884 = a4;
-}
-
-bool AIScript_Officer_Leroy::ReachedMovementTrackWaypoint(int waypointId) {
- if (waypointId == 57 || waypointId == 58) {
- sub_431408();
- AI_Countdown_Timer_Reset(23, 2);
- AI_Countdown_Timer_Start(23, 2, 6);
- }
- return true;
-}
-
-void AIScript_Officer_Leroy::FledCombat() {
- Actor_Set_Goal_Number(23, 300);
-}
-
-bool AIScript_Officer_Leroy::sub_431408() {
- Game_Flag_Set(199);
- return true;
-}
-
-bool AIScript_Officer_Leroy::sub_431420() {
- Game_Flag_Reset(199);
- return true;
-}
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_23_officer_leroy.h b/engines/bladerunner/script/ai_23_officer_leroy.h
deleted file mode 100644
index c78d80d..0000000
--- a/engines/bladerunner/script/ai_23_officer_leroy.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* 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/script.h"
-
-#include "bladerunner/bladerunner.h"
-
-namespace BladeRunner {
-
-class AIScript_Officer_Leroy : public AIScriptBase {
- int var_45D5B0_animation_state;
- int var_45D5B4_animation_frame;
- int var_45D5B8;
- int var_45D5BC;
- int var_462880;
- int var_462884;
-public:
- AIScript_Officer_Leroy(BladeRunnerEngine *vm);
-
- void Initialize();
- bool Update();
- void TimerExpired(int timer);
- void CompletedMovementTrack();
- void ReceivedClue(int clueId, int fromActorId);
- void ClickedByPlayer();
- void EnteredScene(int sceneId);
- void OtherAgentEnteredThisScene(int otherActorId);
- void OtherAgentExitedThisScene(int otherActorId);
- void OtherAgentEnteredCombatMode(int otherActorId, int combatMode);
- void ShotAtAndMissed();
- void ShotAtAndHit();
- void Retired(int byActorId);
- int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId);
- bool GoalChanged(int currentGoalNumber, int newGoalNumber);
- bool UpdateAnimation(int *animation, int *frame);
- bool ChangeAnimationMode(int mode);
- void QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4);
- void SetAnimationState(int animationState, int animationFrame, int a3, int a4);
- bool ReachedMovementTrackWaypoint(int a1);
- void FledCombat();
-
-private:
- bool sub_431408();
- bool sub_431420();
-};
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ar01.cpp b/engines/bladerunner/script/ar01.cpp
deleted file mode 100644
index dda8a8c..0000000
--- a/engines/bladerunner/script/ar01.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-/* 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/script.h"
-
-namespace BladeRunner {
-
-void ScriptAR01::InitializeScene() {
- Music_Play(0, 25, 0, 2, -1, 1, 2);
- if (Game_Flag_Query(323)) {
- Setup_Scene_Information(-477.0f, 0.0f, -149.0f, 333);
- } else if (Game_Flag_Query(321) == 1) {
- Setup_Scene_Information(-182.0f, 0.0f, -551.0f, 518);
- } else {
- Setup_Scene_Information(-152.0f, 0.0f, 332.0f, 545);
- }
- Scene_Exit_Add_2D_Exit(0, 134, 165, 177, 290, 3);
- Scene_Exit_Add_2D_Exit(1, 319, 0, 639, 207, 0);
- if (Game_Flag_Query(252)) {
- Scene_Exit_Add_2D_Exit(2, 0, 404, 99, 479, 2);
- }
- Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1);
- Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1);
- Ambient_Sounds_Add_Looping_Sound(241, 50, 1, 1);
- Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(242, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(243, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(244, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(245, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(246, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(247, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(248, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(249, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- if (Game_Flag_Query(252) && !Game_Flag_Query(321) && !Game_Flag_Query(323)) {
- Actor_Set_Invisible(0, true);
- Game_Flag_Set(273);
- Scene_Loop_Start_Special(0, 1, 0);
- Scene_Loop_Set_Default(2);
- } else if (Game_Flag_Query(252) && Game_Flag_Query(321)) {
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(2);
- Game_Flag_Reset(321);
- } else if (!Game_Flag_Query(252) && Game_Flag_Query(321)) {
- Scene_Loop_Start_Special(0, 6, 0);
- Scene_Loop_Set_Default(7);
- Game_Flag_Reset(321);
- } else if (Game_Flag_Query(252) && Game_Flag_Query(323)) {
- Scene_Loop_Set_Default(2);
- } else if (!Game_Flag_Query(252) && Game_Flag_Query(323)) {
- Scene_Loop_Set_Default(7);
- } else {
- Scene_Loop_Set_Default(7);
- }
-}
-
-void ScriptAR01::SceneLoaded() {
- Obstacle_Object("DF_BOOTH", true);
- Unobstacle_Object("SPINNER BODY", true);
-}
-
-bool ScriptAR01::MouseClick(int x, int y) {
- return false;
-}
-
-bool ScriptAR01::ClickedOn3DObject(const char *objectName, bool a2) {
- return false;
-}
-
-bool ScriptAR01::ClickedOnActor(int actorId) {
- if (actorId == 16 || actorId == 20) {
- Actor_Face_Actor(0, actorId, true);
- Actor_Says(0, 8910, 14);
- return true;
- }
- if (actorId == 29) {
- Actor_Set_Goal_Number(29, 2);
- if (!Loop_Actor_Walk_To_XYZ(0, -120.73f, 0.0f, 219.17f, 12, 1, false, 0)) {
- Actor_Face_Actor(0, 29, true);
- Actor_Face_Actor(29, 0, true);
- if (Game_Flag_Query(328)) {
- if (Actor_Clue_Query(0, 93) && !Actor_Clue_Query(0, 64)) {
- Actor_Says(0, 40, 11);
- Actor_Says(29, 120, 14);
- Actor_Says(0, 45, 17);
- Actor_Says(29, 130, 14);
- Actor_Says(29, 140, 14);
- Actor_Says(0, 50, 13);
- Actor_Says(29, 150, 14);
- Actor_Clue_Acquire(0, 64, 1, 0);
- } else {
- if (Random_Query(1, 2) == 1) {
- Actor_Says(0, 30, 17);
- Actor_Says(29, 100, 14);
- Actor_Says(29, 110, 14);
- Actor_Says(0, 35, 13);
- } else {
- Actor_Says(0, 30, 17);
- Actor_Says(29, 220, 14);
- }
- }
- Actor_Set_Goal_Number(29, 1);
- } else {
- Actor_Says(0, 0, 18);
- Actor_Says(29, 0, 14);
- Actor_Says(29, 10, 14);
- Actor_Says(29, 20, 14);
- Actor_Says(29, 30, 14);
- Actor_Says(0, 5, 17);
- Actor_Says(29, 40, 14);
- Actor_Says(0, 10, 13);
- Actor_Says(29, 50, 14);
- Actor_Says(0, 15, 17);
- Actor_Says(29, 60, 14);
- Actor_Says(29, 70, 14);
- Actor_Says(29, 80, 14);
- Actor_Says(29, 90, 14);
- Actor_Says(0, 25, 13);
- Game_Flag_Set(328);
- Actor_Set_Goal_Number(29, 1);
- }
- return true;
- }
- }
- return false;
-}
-
-bool ScriptAR01::ClickedOnItem(int itemId, bool a2) {
- return false;
-}
-
-bool ScriptAR01::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(0, -358.0, 0.0, -149.0, 0, 1, false, 0)) {
- Loop_Actor_Walk_To_XYZ(0, -477.0, 0.0, -149.0, 0, 0, false, 0);
- Game_Flag_Set(322);
- Game_Flag_Set(464);
- Game_Flag_Reset(180);
- Game_Flag_Set(479);
- Set_Enter(8, 31);
- Actor_Set_Goal_Number(29, 3);
- }
- return true;
- }
- if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(0, -182.0, 0.0, -551.0, 0, 1, false, 0)) {
- Game_Flag_Set(320);
- Async_Actor_Walk_To_XYZ(0, -222.0, 0.0, -690.0, 0, false);
- Set_Enter(0, 1);
- Actor_Set_Goal_Number(29, 3);
- }
- return true;
- }
- if (exitId == 2) {
- if (Game_Flag_Query(486) == 1) {
- Spinner_Set_Selectable_Destination_Flag(6, 1);
- }
- int v1 = Loop_Actor_Walk_To_XYZ(0, -164.0f, 0.0f, 332.0f, 0, 1, false, 0);
- Actor_Face_Heading(0, 545, false);
- if (Actor_Query_Goal_Number(7) >= 2 && Actor_Query_Goal_Number(7) <= 103) {
- Player_Loses_Control();
- Actor_Put_In_Set(7, 0);
- Actor_Set_At_XYZ(7, -448.0, 0.0, 130.0, 0);
- Loop_Actor_Walk_To_XYZ(7, -323.0f, 0.64f, 101.74f, 48, 0, true, 0);
- Loop_Actor_Walk_To_Actor(7, 0, 48, 0, true);
- Actor_Face_Actor(7, 0, true);
- Actor_Change_Animation_Mode(7, 6);
- Actor_Says(0, 1800, 21);
- Actor_Change_Animation_Mode(0, 48);
- Player_Gains_Control();
- Actor_Retired_Here(0, 12, 48, 1, 7);
- } else if (!v1) {
- if (Game_Flag_Query(486) && !Game_Flag_Query(660)) {
- Actor_Voice_Over(4310, 99);
- Actor_Voice_Over(4320, 99);
- Actor_Voice_Over(4330, 99);
- Actor_Voice_Over(4340, 99);
- Actor_Voice_Over(4350, 99);
- Game_Flag_Set(660);
- }
- Game_Flag_Reset(176);
- Game_Flag_Reset(182);
- Game_Flag_Reset(179);
- Game_Flag_Reset(178);
- Game_Flag_Reset(258);
- Game_Flag_Reset(257);
- Game_Flag_Reset(180);
-
- int spinnerDest = Spinner_Interface_Choose_Dest(4, 0);
- Actor_Face_Heading(0, 545, 0);
-
- switch (spinnerDest) {
- case 0:
- Game_Flag_Set(178);
- Game_Flag_Reset(252);
- Game_Flag_Set(251);
- Set_Enter(61, 65);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 1:
- Game_Flag_Set(179);
- Game_Flag_Reset(252);
- Game_Flag_Set(250);
- Set_Enter(49, 48);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 2:
- Game_Flag_Set(182);
- Game_Flag_Reset(252);
- Game_Flag_Set(249);
- Set_Enter(69, 78);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 3:
- Game_Flag_Set(176);
- Game_Flag_Reset(252);
- Game_Flag_Set(248);
- Set_Enter(4, 13);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 5:
- Game_Flag_Set(261);
- Game_Flag_Reset(252);
- Game_Flag_Set(307);
- Set_Enter(17, 82);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 6:
- Game_Flag_Set(177);
- Game_Flag_Reset(252);
- Game_Flag_Set(253);
- Set_Enter(7, 25);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 7:
- Game_Flag_Set(258);
- Game_Flag_Reset(252);
- Game_Flag_Set(254);
- Set_Enter(20, 2);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 8:
- Game_Flag_Set(181);
- Game_Flag_Reset(252);
- Game_Flag_Set(255);
- Set_Enter(54, 54);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- case 9:
- Game_Flag_Set(257);
- Game_Flag_Reset(252);
- Game_Flag_Set(256);
- Set_Enter(37, 34);
- Scene_Loop_Start_Special(1, 5, 1);
- break;
- default:
- Game_Flag_Set(180);
- Actor_Set_Invisible(0, 0);
- break;
- }
- }
- return true;
- }
- return false;
-}
-
-bool ScriptAR01::ClickedOn2DRegion(int region) {
- return false;
-}
-
-void ScriptAR01::SceneFrameAdvanced(int frame) {
- if (frame == 16) {
- Ambient_Sounds_Play_Sound(118, 40, 0, 0, 99);
- }
- if (frame == 78 || frame == 199) {
- Ambient_Sounds_Play_Sound(116, 100, -50, -50, 99);
- }
- if (frame == 122 || frame == 242) {
- Ambient_Sounds_Play_Sound(119, 100, -50, -50, 99);
- }
- if (frame == 256) {
- Ambient_Sounds_Play_Sound(117, 40, -50, 80, 99);
- }
- if ((frame == 75 || frame == 196) && Game_Flag_Query(273)) {
- Actor_Face_Heading(0, 545, false);
- Actor_Change_Animation_Mode(0, 42);
- Game_Flag_Reset(273);
- } else if (frame == 196 && !Game_Flag_Query(273)) {
- Actor_Change_Animation_Mode(0, 41);
- }
-}
-
-void ScriptAR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
-}
-
-void ScriptAR01::PlayerWalkedIn() {
- if (!Game_Flag_Query(710)) {
- Game_Flag_Set(710);
- }
- if (Game_Flag_Query(323) == 1) {
- Loop_Actor_Walk_To_XYZ(0, -358.0f, 0.0f, -149.0f, 0, 1, false, 0);
- Game_Flag_Reset(323);
- }
- if (Actor_Query_Goal_Number(37) < 199) {
- Actor_Set_Goal_Number(37, 199);
- }
-}
-
-void ScriptAR01::PlayerWalkedOut() {
- Actor_Set_Invisible(0, 0);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- if (!Game_Flag_Query(479)) {
- Music_Stop(2);
- }
- if (!Game_Flag_Query(322) && !Game_Flag_Query(320)) {
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Outtake_Play(38, 1, -1);
- }
-}
-
-void ScriptAR01::DialogueQueueFlushed(int a1) {
-}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ar02.cpp b/engines/bladerunner/script/ar02.cpp
deleted file mode 100644
index 2204027..0000000
--- a/engines/bladerunner/script/ar02.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/* 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/script.h"
-
-namespace BladeRunner {
-
-void ScriptAR02::InitializeScene() {
- Music_Play(0, 22, 0, 2, -1, 1, 2);
- if (Game_Flag_Query(116)) {
- Setup_Scene_Information(-560.0f, 0.0f, -799.0f, 333);
- } else {
- Setup_Scene_Information(-182.0f, 0.0f, -551.0f, 973);
- }
- Scene_Exit_Add_2D_Exit(0, 0, 439, 212, 479, 2);
- Scene_Exit_Add_2D_Exit(1, 81, 202, 215, 406, 3);
- Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1);
- Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1);
- Ambient_Sounds_Add_Looping_Sound(241, 50, 1, 1);
- Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0);
- if (Game_Flag_Query(252) && Game_Flag_Query(320)) {
- Scene_Loop_Start_Special(0, 1, 0);
- Scene_Loop_Set_Default(2);
- Game_Flag_Reset(320);
- } else if (!Game_Flag_Query(252) && Game_Flag_Query(320)) {
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(2);
- Game_Flag_Reset(320);
- } else {
- Scene_Loop_Set_Default(2);
- }
-}
-
-void ScriptAR02::SceneLoaded() {
- Obstacle_Object("DF_BOOTH", true);
- if (!Game_Flag_Query(374)) {
- Item_Add_To_World(106, 976, 0, -442.84f, 36.77f, -1144.51f, 360, 36, 36, false, true, false, true);
- }
- if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(374)) {
- Game_Flag_Set(0);
- Item_Remove_From_World(106);
- }
-}
-
-bool ScriptAR02::MouseClick(int x, int y) {
- return Region_Check(250, 215, 325, 260);
-}
-
-bool ScriptAR02::ClickedOn3DObject(const char *objectName, bool a2) {
- return false;
-}
-
-bool ScriptAR02::ClickedOnActor(int actorId) {
- if (actorId == 16) {
- if (!Loop_Actor_Walk_To_XYZ(0, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) {
- Actor_Face_Actor(0, 16, true);
- Actor_Face_Actor(16, 0, true);
- if (Global_Variable_Query(1) == 2) {
- if (Game_Flag_Query(329) && !Game_Flag_Query(366)) {
- Game_Flag_Set(366);
- Player_Loses_Control();
- ADQ_Flush();
- ADQ_Add(16, 210, 14);
- Loop_Actor_Walk_To_XYZ(0, -350.66f, 0.0f, -1117.19f, 0, 0, false, 0);
- Actor_Face_Actor(0, 16,true);
- Actor_Says(0, 110, 18);
- Actor_Says(16, 230, 14);
- Actor_Says(0, 115, 18);
- Actor_Says(16, 240, 14);
- Item_Pickup_Spin_Effect(956, 288, 257);
- Actor_Says(16, 250, 14);
- Player_Gains_Control();
- sub_402AE0();
- } else if (Game_Flag_Query(329)) {
- Actor_Says(0, 75, 18);
- Actor_Says(16, 60, 12);
- Actor_Says(16, 70, 14);
- } else {
- sub_402694();
- }
- } else if (Global_Variable_Query(1) > 2) {
- if (Actor_Clue_Query(0, 56) && !Actor_Clue_Query(0, 90)) {
- Actor_Says(0, 205, 16);
- Actor_Says(16, 290, 12);
- Actor_Says(16, 300, 13);
- Actor_Says(0, 210, 15);
- Actor_Says(16, 310, 12);
- Actor_Says(0, 215, 13);
- if (Game_Flag_Query(374)) {
- Actor_Says(0, 220, 14);
- Actor_Says(16, 320, 12);
- Actor_Says(0, 225, 13);
- Actor_Says(16, 330, 14);
- Actor_Says(0, 230, 19);
- Actor_Says(16, 340, 13);
- Actor_Says(16, 350, 12);
- Actor_Says(0, 235, 16);
- Actor_Clue_Acquire(0, 79, 0, 16);
- }
- Actor_Clue_Acquire(0, 90, 0, 16);
- } else {
- Actor_Says(0, 240, 17);
- Actor_Says(16, 360, 13);
- Actor_Says(16, 370, 14);
- Actor_Says(0, 245, 13);
- }
- }
- return true;
- }
- }
- if (actorId == 20 && Global_Variable_Query(1) == 2) {
- if (!Loop_Actor_Walk_To_XYZ(0, -240.79f, 0.0f, -1328.89f, 12, 1, false, 0)) {
- Actor_Face_Actor(0, 20, true);
- Actor_Face_Actor(20, 0, true);
- if (Game_Flag_Query(330)) {
- sub_402CE4();
- return false;
- }
- Actor_Says(20, 0, 14);
- Actor_Says(0, 140, 18);
- Game_Flag_Set(330);
- return true;
- }
- }
- return false;
-}
-
-bool ScriptAR02::ClickedOnItem(int itemId, bool a2) {
- if (itemId == 106) {
- if (!Loop_Actor_Walk_To_XYZ(0, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) {
- Actor_Face_Actor(0, 16, true);
- if (!Game_Flag_Query(331)) {
- Actor_Says(16, 0, 14);
- Actor_Says(0, 55, 18);
- Actor_Says(16, 10, 14);
- Actor_Says(0, 60, 18);
- Actor_Says(16, 20, 14);
- Game_Flag_Set(331);
- } else if (Game_Flag_Query(331) && !Game_Flag_Query(367)) {
- Actor_Says(0, 65, 21);
- Actor_Says(16, 30, 14);
- Actor_Says(16, 40, 14);
- Actor_Says(0, 70, 18);
- Actor_Says(16, 50, 14);
- Game_Flag_Set(367);
- } else {
- Actor_Says(0, 8527, 14);
- }
- return true;
- }
- }
- return false;
-}
-
-bool ScriptAR02::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(0, -182.0f, 0.0f, -551.0f, 0, 1, false, 0)) {
- Game_Flag_Set(321);
- Async_Actor_Walk_To_XYZ(0, -182.0f, 0.0f, -407.0f, 0, false);
- Set_Enter(0, 0);
- }
- return true;
- }
- if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(0, -465.0f, 0.0f, -799.0f, 0, 1, false, 0)) {
- Loop_Actor_Walk_To_XYZ(0, -560.0f, 0.0f, -799.0f, 0, 0, false, 0);
- Game_Flag_Set(117);
- Game_Flag_Reset(180);
- Game_Flag_Set(182);
- Music_Stop(3);
- Set_Enter(70, 80);
- }
- return true;
- }
- return false;
-}
-
-bool ScriptAR02::ClickedOn2DRegion(int region) {
- return false;
-}
-
-void ScriptAR02::SceneFrameAdvanced(int frame) {
-}
-
-void ScriptAR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
-}
-
-void ScriptAR02::PlayerWalkedIn() {
- if (Game_Flag_Query(116) == 1) {
- Loop_Actor_Walk_To_XYZ(0, -465.0f, 0.0f, -799.0f, 0, 0, false, 0);
- Game_Flag_Reset(116);
- }
- Game_Flag_Set(726);
-}
-
-void ScriptAR02::PlayerWalkedOut() {
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
-}
-
-void ScriptAR02::DialogueQueueFlushed(int a1) {
-}
-
-void ScriptAR02::sub_402694() {
- Dialogue_Menu_Clear_List();
- if (Actor_Clue_Query(0, 44) || Actor_Clue_Query(0, 47)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(490, 3, 5, 5);
- }
- if (Actor_Clue_Query(0, 14) && !Actor_Clue_Query(0, 44) && !Actor_Clue_Query(0, 47)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(500, 3, 5, 5);
- }
- DM_Add_To_List_Never_Repeat_Once_Selected(510, 8, 3, -1);
- Dialogue_Menu_Add_DONE_To_List(520);
- Dialogue_Menu_Appear(320, 240);
- int answerValue = Dialogue_Menu_Query_Input();
- Dialogue_Menu_Disappear();
- switch (answerValue) {
- case 490:
- case 500:
- if (answerValue == 490) {
- Actor_Says(0, 145, 15);
- } else {
- Actor_Says(0, 150, 15);
- }
- Actor_Says(16, 80, 14);
- Actor_Says(0, 80, 16);
- Actor_Says(16, 90, 12);
- Actor_Says(0, 85, 17);
- Actor_Says(16, 100, 14);
- Actor_Says(16, 110, 12);
- Actor_Says(16, 120, 12);
- Actor_Says(0, 90, 13);
- Actor_Says(16, 130, 12);
- Actor_Says(16, 140, 14);
- Actor_Says(0, 95, 15);
- Actor_Says(16, 150, 12);
- Actor_Says(16, 160, 13);
- Actor_Says(16, 170, 14);
- Actor_Says(0, 100, 16);
- Actor_Says(16, 180, 13);
- Game_Flag_Set(329);
- Actor_Clue_Acquire(0, 56, 1, 16);
- break;
- case 510:
- Actor_Says(0, 8475, 12);
- Actor_Says(16, 190, 12);
- Actor_Says(0, 105, 15);
- Actor_Says(16, 200, 14);
- break;
- case 520:
- Actor_Says(0, 215, 16);
- break;
- }
-}
-
-void ScriptAR02::sub_402AE0() {
- Dialogue_Menu_Clear_List();
- if (Global_Variable_Query(2) >= 15 || Query_Difficulty_Level() == 0) {
- DM_Add_To_List_Never_Repeat_Once_Selected(530, 7, 5, 3);
- }
- DM_Add_To_List_Never_Repeat_Once_Selected(540, 3, 5, 7);
- Dialogue_Menu_Appear(320, 240);
- int answerValue = Dialogue_Menu_Query_Input();
- Dialogue_Menu_Disappear();
- if (answerValue == 530) {
- Actor_Says(0, 120, 12);
- if (Query_Difficulty_Level() != 0) {
- Global_Variable_Decrement(2, 15);
- }
- Actor_Clue_Acquire(0, 75, 1, 16);
- Actor_Modify_Friendliness_To_Other(16, 0, 5);
- } else if (answerValue == 540) {
- Actor_Says(0, 125, 13);
- Actor_Says(16, 260, 3);
- Actor_Says(0, 130, 15);
- Actor_Says(16, 270, 3);
- Actor_Says(16, 280, 3);
- Actor_Says(0, 135, 11);
- Actor_Modify_Friendliness_To_Other(16, 0, -5);
- }
-}
-
-void ScriptAR02::sub_402CE4() {
- Dialogue_Menu_Clear_List();
- if (Actor_Clue_Query(0, 93)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(550, 8, 5, 2);
- }
- if (Actor_Clue_Query(0, 44)) {
- DM_Add_To_List_Never_Repeat_Once_Selected(560, 6, 5, 7);
- }
- Dialogue_Menu_Add_DONE_To_List(570);
- Dialogue_Menu_Appear(320, 240);
- int answerValue = Dialogue_Menu_Query_Input();
- Dialogue_Menu_Disappear();
- switch (answerValue) {
- case 550:
- Actor_Says(0, 145, 11);
- Actor_Says(20, 30, 11);
- Actor_Says(0, 160, 11);
- Actor_Says(20, 40, 11);
- Actor_Says(0, 165, 11);
- Actor_Says(20, 50, 11);
- Actor_Says(0, 170, 11);
- Actor_Says(20, 60, 11);
- Actor_Says(0, 175, 11);
- Game_Flag_Set(370);
- break;
- case 560:
- Actor_Says(0, 150, 11);
- Actor_Says(20, 140, 11);
- Actor_Says(0, 185, 11);
- Actor_Says(20, 150, 11);
- Actor_Says(20, 160, 11);
- Actor_Says(0, 190, 11);
- Actor_Says(20, 170, 11);
- Actor_Says(0, 195, 11);
- Actor_Says(20, 180, 11);
- Actor_Says(20, 190, 11);
- Actor_Says(20, 200, 11);
- Actor_Says(0, 200, 11);
- Actor_Says(20, 210, 11);
- Actor_Says(20, 220, 11);
- Actor_Says(20, 230, 11);
- Game_Flag_Set(370);
- break;
- case 570:
- if (Actor_Clue_Query(0, 57)) {
- Actor_Says(0, 1315, 11);
- } else {
- Actor_Says(0, 940, 13);
- Actor_Says(20, 70, 12);
- Actor_Says(20, 90, 12);
- Actor_Says(0, 180, 15);
- Actor_Says(20, 100, 14);
- Actor_Says(20, 110, 12);
- Actor_Says(20, 120, 13);
- Actor_Modify_Friendliness_To_Other(20, 0, -1);
- Actor_Clue_Acquire(0, 57, 0, 20);
- }
- break;
- }
-}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/bb01.cpp b/engines/bladerunner/script/bb01.cpp
deleted file mode 100644
index 6024a42..0000000
--- a/engines/bladerunner/script/bb01.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/* 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/script.h"
-
-namespace BladeRunner {
-
-void ScriptBB01::InitializeScene() {
- if (Game_Flag_Query(265)) {
- Setup_Scene_Information(-253.0f, 9.0f, 715.0f, 266);
- } else if (Game_Flag_Query(263)) {
- Setup_Scene_Information(-128.0f, 9.0f, 342.0f, 266);
- } else {
- Setup_Scene_Information(43.0f, 0.0f, 1058.0f, 0);
- }
- Scene_Exit_Add_2D_Exit(0, 0, 0, 72, 299, 3);
- Scene_Exit_Add_2D_Exit(1, 151, 218, 322, 290, 3);
- if (Game_Flag_Query(254)) {
- Scene_Exit_Add_2D_Exit(2, 0, 311, 312, 479, 2);
- }
- Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(105, 25, -100, 0);
- Ambient_Sounds_Add_Sound(82, 5, 60, 40, 60, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(83, 5, 60, 40, 65, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(84, 5, 60, 40, 60, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(67, 5, 80, 20, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(66, 5, 80, 20, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(378, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(379, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(380, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
- if (Game_Flag_Query(254) && !Game_Flag_Query(265) && !Game_Flag_Query(263)) {
- Scene_Loop_Start_Special(0, 0, 0);
- Scene_Loop_Set_Default(1);
- } else if (Game_Flag_Query(254) && Game_Flag_Query(265)) {
- Scene_Loop_Set_Default(1);
- } else if (Game_Flag_Query(254) && Game_Flag_Query(263)) {
- Scene_Loop_Set_Default(1);
- } else {
- Scene_Loop_Set_Default(5);
- }
-}
-
-void ScriptBB01::SceneLoaded() {
- Obstacle_Object("COLUME", true);
-}
-
-bool ScriptBB01::MouseClick(int x, int y) {
- return false;
-}
-
-bool ScriptBB01::ClickedOn3DObject(const char *objectName, bool a2) {
- return false;
-}
-
-bool ScriptBB01::ClickedOnActor(int actorId) {
- return false;
-}
-
-bool ScriptBB01::ClickedOnItem(int itemId, bool a2) {
- return false;
-}
-
-bool ScriptBB01::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- Loop_Actor_Walk_To_XYZ(0, -140.0f, 9.0f, 818.0f, 0, 1, false, 0);
- if (!Loop_Actor_Walk_To_XYZ(0, -233.0f, 9.0f, 846.0f, 0, 1, false, 0)) {
- Game_Flag_Set(264);
- Game_Flag_Reset(258);
- Game_Flag_Set(177);
- Set_Enter(7, 26);
- }
- return true;
- }
- if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(0, -125.39f, 9.0f, 372.45f, 0, 1, false, 0)) {
- Game_Flag_Set(262);
- Set_Enter(1, 3);
- }
- return true;
- }
- if (exitId == 2) {
- if (!Loop_Actor_Walk_To_XYZ(0, 43.0f, 0.0f, 1062.0f, 0, 1, false, 0)) {
- Game_Flag_Reset(176);
- Game_Flag_Reset(182);
- Game_Flag_Reset(179);
- Game_Flag_Reset(178);
- Game_Flag_Reset(258);
- int spinnerDest = Spinner_Interface_Choose_Dest(3, 0);
- switch (spinnerDest) {
- case 0:
- Game_Flag_Set(178);
- Game_Flag_Reset(254);
- Game_Flag_Set(251);
- Set_Enter(61, 65);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 1:
- Game_Flag_Set(179);
- Game_Flag_Reset(254);
- Game_Flag_Set(250);
- Set_Enter(49, 48);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 2:
- Game_Flag_Set(182);
- Game_Flag_Reset(254);
- Game_Flag_Set(249);
- Set_Enter(69, 78);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 3:
- Game_Flag_Set(176);
- Game_Flag_Reset(254);
- Game_Flag_Set(248);
- Set_Enter(4, 13);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 5:
- Game_Flag_Set(261);
- Game_Flag_Reset(254);
- Game_Flag_Set(307);
- Set_Enter(17, 82);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 4:
- Game_Flag_Set(180);
- Game_Flag_Reset(254);
- Game_Flag_Set(252);
- Set_Enter(0, 0);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 6:
- Game_Flag_Set(177);
- Game_Flag_Reset(254);
- Game_Flag_Set(253);
- Set_Enter(7, 25);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 8:
- Game_Flag_Set(181);
- Game_Flag_Reset(254);
- Game_Flag_Set(255);
- Set_Enter(54, 54);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- case 9:
- Game_Flag_Set(257);
- Game_Flag_Reset(254);
- Game_Flag_Set(256);
- Set_Enter(37, 34);
- Scene_Loop_Start_Special(1, 4, 1);
- break;
- default:
- Game_Flag_Set(258);
- Scene_Loop_Start_Special(2, 3, 1);
- break;
- }
- }
- return true;
- }
- return false;
-}
-
-bool ScriptBB01::ClickedOn2DRegion(int region) {
- return false;
-}
-
-void ScriptBB01::SceneFrameAdvanced(int frame) {
- if (frame == 193) {
- Sound_Play(118, 40, 0, 0, 50);
- }
- if (frame == 241 || frame == 363) {
- Sound_Play(116, 100, -50, -50, 50);
- }
- if (frame == 286 || frame == 407) {
- Sound_Play(119, 100, -50, -50, 50);
- }
- if (frame == 433) {
- Sound_Play(117, 40, -50, 80, 50);
- }
- if (frame == 120) {
- Sound_Play(286, Random_Query(33, 33), 100, -100, 50);
- }
-}
-
-void ScriptBB01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
-}
-
-void ScriptBB01::PlayerWalkedIn() {
- Spinner_Set_Selectable_Destination_Flag(7, 1);
- if (Game_Flag_Query(265)) {
- Game_Flag_Reset(265);
- } else if (Game_Flag_Query(263)) {
- Game_Flag_Reset(263);
- } else {
- Loop_Actor_Walk_To_XYZ(0, 43.0f, 0.0f, 954.0f, 0, 0, false, 0);
- }
-}
-
-void ScriptBB01::PlayerWalkedOut() {
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
-}
-
-void ScriptBB01::DialogueQueueFlushed(int a1) {
-}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/bb02.cpp b/engines/bladerunner/script/bb02.cpp
deleted file mode 100644
index 0fa6b0c..0000000
--- a/engines/bladerunner/script/bb02.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* 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/script.h"
-
-namespace BladeRunner {
-
-void ScriptBB02::InitializeScene() {
- if (Game_Flag_Query(281)) {
- Setup_Scene_Information(179.0f, -415.06f, 274.0f, 904);
- } else if (Game_Flag_Query(333)) {
- Setup_Scene_Information(-12.0f, -415.06f, -27.0f, 264);
- Scene_Loop_Start_Special(0, 0, 0);
- } else {
- Setup_Scene_Information(98.0f, -415.06f, -593.0f, 530);
- Game_Flag_Reset(262);
- }
- Scene_Exit_Add_2D_Exit(0, 313, 137, 353, 173, 0);
- Scene_Exit_Add_2D_Exit(1, 207, 291, 275, 443, 3);
- Scene_Exit_Add_2D_Exit(2, 303, 422, 639, 479, 2);
- Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1);
- Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(82, 5, 60, 20, 40, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(83, 5, 60, 20, 45, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(84, 5, 60, 20, 40, 0, 0, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(72, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(73, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(74, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0);
- if (!Game_Flag_Query(494)) {
- Game_Flag_Set(493);
- Game_Flag_Set(494);
- }
- if (Game_Flag_Query(493)) {
- Scene_Loop_Set_Default(1);
- } else {
- Scene_Loop_Set_Default(4);
- }
-}
-
-void ScriptBB02::SceneLoaded() {
- Obstacle_Object("ELEVATOR01", true);
- Obstacle_Object("U2 DOOR", true);
-}
-
-bool ScriptBB02::MouseClick(int x, int y) {
- return false;
-}
-
-bool ScriptBB02::ClickedOn3DObject(const char *objectName, bool a2) {
- return false;
-}
-
-bool ScriptBB02::ClickedOnActor(int actorId) {
- return false;
-}
-
-bool ScriptBB02::ClickedOnItem(int itemId, bool a2) {
- return false;
-}
-
-bool ScriptBB02::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(0, 98.0f, -415.06f, -593.0f, 0, 1, false, 0)) {
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Game_Flag_Set(263);
- Set_Enter(20, 2);
- }
- return true;
- }
- if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(0, -12.0f, -415.06f, -27.0f, 0, 1, false, 0)) {
- Player_Loses_Control();
- if (!Game_Flag_Query(493)) {
- Scene_Loop_Start_Special(2, 0, 1);
- }
- Game_Flag_Set(332);
- Game_Flag_Reset(493);
- Set_Enter(1, 5);
- Scene_Loop_Start_Special(1, 3, 0);
- }
- return true;
- }
- if (exitId == 2) {
- if (!Loop_Actor_Walk_To_XYZ(0, 86.0f, -415.06f, 174.0f, 0, 1, false, 0)) {
- Loop_Actor_Walk_To_XYZ(0, 179.0f, -415.06f, 274.0f, 0, 0, false, 0);
- Game_Flag_Set(282);
- Game_Flag_Reset(493);
- Set_Enter(21, 4);
- }
- return true;
- }
- return false;
-}
-
-bool ScriptBB02::ClickedOn2DRegion(int region) {
- return false;
-}
-
-void ScriptBB02::SceneFrameAdvanced(int frame) {
- if (frame == 1) {
- Ambient_Sounds_Play_Sound(434, 40, -50, -50, 0);
- }
- if (frame == 124) {
- Ambient_Sounds_Play_Sound(434, 40, -50, -50, 0);
- }
-}
-
-void ScriptBB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
-}
-
-void ScriptBB02::PlayerWalkedIn() {
- if (Game_Flag_Query(281)) {
- Loop_Actor_Walk_To_XYZ(0, 86.0f, -415.06f, 174.0f, 0, 0, false, 0);
- Game_Flag_Reset(281);
- } else if (Game_Flag_Query(333)) {
- Loop_Actor_Walk_To_XYZ(0, 35.0f, -415.06f, -27.0f, 0, 0, false, 0);
- Player_Gains_Control();
- Game_Flag_Reset(333);
- }
-}
-
-void ScriptBB02::PlayerWalkedOut() {
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
-}
-
-void ScriptBB02::DialogueQueueFlushed(int a1) {
-}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/bb03.cpp b/engines/bladerunner/script/bb03.cpp
deleted file mode 100644
index 7307c5c..0000000
--- a/engines/bladerunner/script/bb03.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/* 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/script.h"
-
-namespace BladeRunner {
-
-void ScriptBB03::InitializeScene() {
- Setup_Scene_Information(20.0f, 60.16f, 0.0f, 0);
- Game_Flag_Reset(282);
- if (Game_Flag_Query(284)) {
- Setup_Scene_Information(176.0f, 60.16f, 0.0f, 900);
- }
- if (Game_Flag_Query(286)) {
- Setup_Scene_Information(204.0f, 60.16f, -164.0f, 740);
- }
- Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1);
- Scene_Exit_Add_2D_Exit(1, 167, 372, 439, 479, 2);
- Scene_Exit_Add_2D_Exit(2, 451, 115, 547, 320, 1);
- Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(105, 34, 100, 1);
- Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(72, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(73, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(74, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0);
-}
-
-void ScriptBB03::SceneLoaded() {
- Obstacle_Object("BACKWALL", true);
- Unobstacle_Object("BOX08", true);
-}
-
-bool ScriptBB03::MouseClick(int x, int y) {
- return false;
-}
-
-bool ScriptBB03::ClickedOn3DObject(const char *objectName, bool a2) {
- return false;
-}
-
-bool ScriptBB03::ClickedOnActor(int actorId) {
- return false;
-}
-
-bool ScriptBB03::ClickedOnItem(int itemId, bool a2) {
- return false;
-}
-
-bool ScriptBB03::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, -64.0f, 0, 1, false, 0)) {
- Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, 0.0f, 0, 0, false, 0);
- Game_Flag_Set(283);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Set_Enter(1, 5);
- }
- return true;
- }
- if (exitId == 1) {
- if (!Loop_Actor_Walk_To_XYZ(0, 20.0f, 60.16f, 0.0f, 0, 1, false, 0)) {
- Game_Flag_Set(281);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Set_Enter(1, 3);
- }
- return true;
- }
- if (exitId == 2) {
- if (!Loop_Actor_Walk_To_XYZ(0, 204.0f, 60.16f, -164.0f, 0, 1, false, 0)) {
- if (Global_Variable_Query(1) < 4) {
- if (Actor_Query_Goal_Number(56) == 200) {
- Actor_Says(56, 70, 3);
- Actor_Says(0, 7010, 13);
- Actor_Says(56, 80, 3);
- Actor_Says(0, 7015, 12);
- Actor_Says(56, 90, 3);
- Actor_Says(0, 7020, 14);
- Actor_Says(56, 100, 3);
- Actor_Says(0, 7025, 15);
- Actor_Says(56, 110, 3);
- Actor_Set_Targetable(54, false);
- Actor_Set_Targetable(58, false);
- }
- Game_Flag_Set(285);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Set_Enter(22, 6);
- } else {
- Actor_Says(0, 8522, 3);
- }
- }
- return true;
- }
- return false;
-}
-
-bool ScriptBB03::ClickedOn2DRegion(int region) {
- return false;
-}
-
-void ScriptBB03::SceneFrameAdvanced(int frame) {
-}
-
-void ScriptBB03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
-}
-
-void ScriptBB03::PlayerWalkedIn() {
- if (Game_Flag_Query(286)) {
- Loop_Actor_Walk_To_XYZ(0, 164.0f, 60.16f, -164.0f, 0, 0, false, 0);
- Game_Flag_Reset(286);
- }
- if (Game_Flag_Query(284)) {
- Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, -64.0f, 0, 0, false, 0);
- Game_Flag_Reset(284);
- }
-}
-
-void ScriptBB03::PlayerWalkedOut() {
-}
-
-void ScriptBB03::DialogueQueueFlushed(int a1) {
-}
-
-} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/bb04.cpp b/engines/bladerunner/script/bb04.cpp
deleted file mode 100644
index b99ea50..0000000
--- a/engines/bladerunner/script/bb04.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/* 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/script.h"
-
-namespace BladeRunner {
-
-void ScriptBB04::InitializeScene() {
- if (Game_Flag_Query(283)) {
- Setup_Scene_Information(-107.0f, -26.6f, 397.0f, 29);
- Game_Flag_Reset(283);
- } else {
- Setup_Scene_Information(-15.0f, -25.17f, 45.0f, 691);
- }
- Scene_Exit_Add_2D_Exit(0, 218, 102, 360, 254, 1);
- Scene_Exit_Add_2D_Exit(1, 0, 334, 639, 479, 2);
- Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1);
- Ambient_Sounds_Add_Looping_Sound(105, 44, -100, 1);
- Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(72, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(73, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0);
- Ambient_Sounds_Add_Sound(74, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0);
-}
-
-void ScriptBB04::SceneLoaded() {
- Obstacle_Object("DH TRASH", true);
-}
-
-bool ScriptBB04::MouseClick(int x, int y) {
- return false;
-}
-
-bool ScriptBB04::ClickedOn3DObject(const char *objectName, bool a2) {
- return false;
-}
-
-bool ScriptBB04::ClickedOnActor(int actorId) {
- return false;
-}
-
-bool ScriptBB04::ClickedOnItem(int itemId, bool a2) {
- return false;
-}
-
-bool ScriptBB04::ClickedOnExit(int exitId) {
- if (exitId == 0) {
- if (!Loop_Actor_Walk_To_XYZ(0, -92.0f, -26.6f, 45.0f, 0, 1, false, 0)) {
- Player_Loses_Control();
- Loop_Actor_Walk_To_XYZ(0, -15.0f, -25.17f, 45.0f, 0, 0, false, 0);
- Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
- Ambient_Sounds_Remove_All_Looping_Sounds(1);
- Game_Flag_Set(333);
More information about the Scummvm-git-logs
mailing list