mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
BLADERUNNER: added Runciter character (petshop owner)
This commit is contained in:
@@ -530,16 +530,16 @@ void Actor::setSetId(int setId) {
|
||||
if (_setId > 0) {
|
||||
for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) {
|
||||
if (_vm->_actors[i]->_id != _id && _vm->_actors[i]->_setId == _setId) {
|
||||
// TODO: _vm->_aiScripts->OtherAgentExitedThisScene( i, _id);
|
||||
_vm->_aiScripts->OtherAgentExitedThisScene(i, _id);
|
||||
}
|
||||
}
|
||||
}
|
||||
_setId = setId;
|
||||
// TODO: _vm->_aiScripts->EnteredScene(_id, set);
|
||||
_vm->_aiScripts->EnteredScene(_id, _setId);
|
||||
if (_setId > 0) {
|
||||
for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) {
|
||||
if (_vm->_actors[i]->_id != _id && _vm->_actors[i]->_setId == _setId) {
|
||||
// TODO: _vm->_aiScripts->OtherAgentEnteredThisScene(i, _id);
|
||||
_vm->_aiScripts->OtherAgentEnteredThisScene(i, _id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -851,11 +851,11 @@ int Actor::getAnimationMode() {
|
||||
}
|
||||
|
||||
void Actor::setGoal(int goalNumber) {
|
||||
if (goalNumber == _goalNumber)
|
||||
if (goalNumber == _goalNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO: _vm->actorScript->GoalChanged(_id, _goalNumber, goalNumber);
|
||||
|
||||
_vm->_aiScripts->GoalChanged(_id, _goalNumber, goalNumber);
|
||||
_vm->_script->ActorChangedGoal(_id, goalNumber, _goalNumber, _vm->_scene->getSetId() == _setId);
|
||||
}
|
||||
|
||||
@@ -943,6 +943,12 @@ int Actor::countdownTimerGetRemainingTime(int timerId) {
|
||||
return _timersRemain[timerId];
|
||||
}
|
||||
|
||||
void Actor::countdownTimersUpdate() {
|
||||
for (int i = 0; i <= 6; i++) {
|
||||
countdownTimerUpdate(i);
|
||||
}
|
||||
}
|
||||
|
||||
void Actor::countdownTimerUpdate(int timerId) {
|
||||
if (_timersRemain[timerId] == 0)
|
||||
return;
|
||||
@@ -959,7 +965,14 @@ void Actor::countdownTimerUpdate(int timerId) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
// AI timers, call AI dll
|
||||
if (!_vm->_aiScripts->IsInsideScript() && !_vm->_script->IsInsideScript()) {
|
||||
_vm->_aiScripts->TimerExpired(this->_id, timerId);
|
||||
this->_timersRemain[timerId] = 0;
|
||||
//return false;
|
||||
} else {
|
||||
this->_timersRemain[timerId] = 1;
|
||||
//return true;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// Movement track timer
|
||||
|
||||
@@ -136,6 +136,7 @@ public:
|
||||
void countdownTimerStart(int timerId, int interval);
|
||||
void countdownTimerReset(int timerId);
|
||||
int countdownTimerGetRemainingTime(int timerId);
|
||||
void countdownTimersUpdate();
|
||||
void countdownTimerUpdate(int timerId);
|
||||
|
||||
int getSetId();
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#include "engines/util.h"
|
||||
|
||||
#include "graphics/pixelformat.h"
|
||||
#include "suspects_database.h"
|
||||
#include "suspects_database.h"
|
||||
|
||||
namespace BladeRunner {
|
||||
|
||||
@@ -337,7 +337,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
|
||||
initScript.SCRIPT_Initialize_Game();
|
||||
|
||||
// TODO: Load AI-ACT1.DLL
|
||||
_aiScripts = new AIScripts(this);
|
||||
_aiScripts = new AIScripts(this, actorCount);
|
||||
|
||||
initChapterAndScene();
|
||||
|
||||
@@ -619,17 +619,20 @@ void BladeRunnerEngine::gameTick() {
|
||||
#endif
|
||||
|
||||
// TODO: Render overlays
|
||||
// TODO: Tick Actor AI and Timers
|
||||
|
||||
if (_settings->getNewScene() == -1 || _script->_inScriptCounter /* || in_ai */) {
|
||||
//if (!dialogueMenu)
|
||||
actorsUpdate();
|
||||
|
||||
if (_settings->getNewScene() == -1 || _script->IsInsideScript() || _aiScripts->IsInsideScript()) {
|
||||
_sliceRenderer->setView(*_view);
|
||||
|
||||
// Tick and draw all actors in current set
|
||||
//int setId = _scene->_setId;
|
||||
int setId = _scene->getSetId();
|
||||
for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) {
|
||||
//if (_actors[i]->getSetId() == setId) {
|
||||
if (i == 0 || i == 23) { // Currently limited to McCoy and Officer Leroy
|
||||
_actors[i]->tick(backgroundChanged);
|
||||
if (_actors[i]->getSetId() == setId) {
|
||||
if (i == 0 || i == 15 || i == 23) { // Currently limited to McCoy, Runciter and Officer Leroy
|
||||
_actors[i]->tick(backgroundChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,16 +727,30 @@ void BladeRunnerEngine::gameTick() {
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)_lights->_lights.size(); i++) {
|
||||
Light *light = _lights->_lights[i];
|
||||
Matrix4x3 m = light->_matrix;
|
||||
Vector3 pos = Vector3(m(0, 3), m(1, 3), m(2, 3));
|
||||
// for (int i = 0; i < (int)_lights->_lights.size(); i++) {
|
||||
// Light *light = _lights->_lights[i];
|
||||
// Matrix4x3 m = light->_matrix;
|
||||
// Vector3 pos = Vector3(m(0, 3), m(1, 3), m(2, 3));
|
||||
// Vector3 size = Vector3(5.0f, 5.0f, 5.0f);
|
||||
// int colorR = (light->_color.r * 31.0f);
|
||||
// int colorG = (light->_color.g * 31.0f);
|
||||
// int colorB = (light->_color.b * 31.0f);
|
||||
// int color = (colorR << 10) + (colorG << 5) + colorB;
|
||||
// drawBBox(pos - size, pos + size, _view, &_surface2, color);
|
||||
// }
|
||||
|
||||
for(int i = 0; i < _waypoints->_count; i++) {
|
||||
Waypoint *waypoint = &_waypoints->_waypoints[i];
|
||||
if(waypoint->_setId != _scene->getSetId())
|
||||
continue;
|
||||
Vector3 pos = waypoint->_position;
|
||||
Vector3 size = Vector3(5.0f, 5.0f, 5.0f);
|
||||
int colorR = (light->_color.r * 31.0f);
|
||||
int colorG = (light->_color.g * 31.0f);
|
||||
int colorB = (light->_color.b * 31.0f);
|
||||
int color = (colorR << 10) + (colorG << 5) + colorB;
|
||||
int color = 0b111111111111111;
|
||||
drawBBox(pos - size, pos + size, _view, &_surface2, color);
|
||||
Vector3 spos = _view->calculateScreenPosition(pos);
|
||||
char waypointText[40];
|
||||
sprintf(waypointText, "waypoint %i", i);
|
||||
_mainFont->drawColor(waypointText, _surface2, spos.x, spos.y, color);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -745,6 +762,22 @@ void BladeRunnerEngine::gameTick() {
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRunnerEngine::actorsUpdate() {
|
||||
int actorCount = (int)_gameInfo->getActorCount();
|
||||
int setId = _scene->getSetId();
|
||||
|
||||
//TODO: original game updates every non-visible characters by updating only one character in one frame
|
||||
if (setId != 89 || _gameVars[1] != 4 || _gameFlags->query(670) != 1 || !_aiScripts->IsInsideScript()) {
|
||||
for (int i = 0; i < actorCount; i++) {
|
||||
Actor *actor = _actors[i];
|
||||
if (actor->getSetId() == setId) {
|
||||
_aiScripts->Update(i);
|
||||
actor->countdownTimersUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRunnerEngine::handleEvents() {
|
||||
if (shouldQuit()) {
|
||||
_gameIsRunning = false;
|
||||
|
||||
@@ -155,6 +155,7 @@ public:
|
||||
|
||||
void gameLoop();
|
||||
void gameTick();
|
||||
void actorsUpdate();
|
||||
void handleEvents();
|
||||
void handleMouseClick(int x, int y);
|
||||
void handleMouseClickExit(int x, int y, int exitIndex);
|
||||
|
||||
@@ -39,6 +39,7 @@ MODULE_OBJS = \
|
||||
scene.o \
|
||||
scene_objects.o \
|
||||
script/ai_00_mccoy.o \
|
||||
script/ai_15_runciter.o \
|
||||
script/ai_23_officer_leroy.o \
|
||||
script/init.o \
|
||||
script/kia.o \
|
||||
|
||||
@@ -211,13 +211,13 @@ void AIScript_McCoy::ClickedByPlayer() {
|
||||
void AIScript_McCoy::EnteredScene(int sceneId) {
|
||||
}
|
||||
|
||||
void AIScript_McCoy::OtherAgentEnteredThisScene() {
|
||||
void AIScript_McCoy::OtherAgentEnteredThisScene(int otherActorId) {
|
||||
}
|
||||
|
||||
void AIScript_McCoy::OtherAgentExitedThisScene() {
|
||||
void AIScript_McCoy::OtherAgentExitedThisScene(int otherActorId) {
|
||||
}
|
||||
|
||||
void AIScript_McCoy::OtherAgentEnteredCombatMode() {
|
||||
void AIScript_McCoy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
|
||||
}
|
||||
|
||||
void AIScript_McCoy::ShotAtAndMissed() {
|
||||
|
||||
@@ -54,9 +54,9 @@ public:
|
||||
void ReceivedClue(int clueId, int fromActorId);
|
||||
void ClickedByPlayer();
|
||||
void EnteredScene(int sceneId);
|
||||
void OtherAgentEnteredThisScene();
|
||||
void OtherAgentExitedThisScene();
|
||||
void OtherAgentEnteredCombatMode();
|
||||
void OtherAgentEnteredThisScene(int otherActorId);
|
||||
void OtherAgentExitedThisScene(int otherActorId);
|
||||
void OtherAgentEnteredCombatMode(int otherActorId, int combatMode);
|
||||
void ShotAtAndMissed();
|
||||
void ShotAtAndHit();
|
||||
void Retired(int byActorId);
|
||||
|
||||
@@ -0,0 +1,656 @@
|
||||
/* 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 a1) {
|
||||
switch (a1) {
|
||||
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
|
||||
@@ -0,0 +1,65 @@
|
||||
/* 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
|
||||
@@ -203,11 +203,11 @@ void AIScript_Officer_Leroy::ClickedByPlayer() {}
|
||||
|
||||
void AIScript_Officer_Leroy::EnteredScene(int sceneId) {}
|
||||
|
||||
void AIScript_Officer_Leroy::OtherAgentEnteredThisScene() {}
|
||||
void AIScript_Officer_Leroy::OtherAgentEnteredThisScene(int otherActorId) {}
|
||||
|
||||
void AIScript_Officer_Leroy::OtherAgentExitedThisScene() {}
|
||||
void AIScript_Officer_Leroy::OtherAgentExitedThisScene(int otherActorId) {}
|
||||
|
||||
void AIScript_Officer_Leroy::OtherAgentEnteredCombatMode() {}
|
||||
void AIScript_Officer_Leroy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {}
|
||||
|
||||
void AIScript_Officer_Leroy::ShotAtAndMissed() {}
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ public:
|
||||
void ReceivedClue(int clueId, int fromActorId);
|
||||
void ClickedByPlayer();
|
||||
void EnteredScene(int sceneId);
|
||||
void OtherAgentEnteredThisScene();
|
||||
void OtherAgentExitedThisScene();
|
||||
void OtherAgentEnteredCombatMode();
|
||||
void OtherAgentEnteredThisScene(int otherActorId);
|
||||
void OtherAgentExitedThisScene(int otherActorId);
|
||||
void OtherAgentEnteredCombatMode(int otherActorId, int combatMode);
|
||||
void ShotAtAndMissed();
|
||||
void ShotAtAndHit();
|
||||
void Retired(int byActorId);
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "bladerunner/waypoints.h"
|
||||
|
||||
#include "bladerunner/script/ai_00_mccoy.h"
|
||||
#include "bladerunner/script/ai_15_runciter.h"
|
||||
#include "bladerunner/script/ai_23_officer_leroy.h"
|
||||
|
||||
namespace BladeRunner {
|
||||
@@ -190,7 +191,7 @@ void ScriptBase::Actor_Set_At_XYZ(int actorId, float x, float y, float z, int di
|
||||
}
|
||||
|
||||
void ScriptBase::Actor_Set_At_Waypoint(int actorId, int waypointId, int angle) {
|
||||
_vm->_actors[actorId]->setAtWaypoint(waypointId, angle, 0, 0);
|
||||
_vm->_actors[actorId]->setAtWaypoint(waypointId, angle, 0, false);
|
||||
}
|
||||
|
||||
bool ScriptBase::Region_Check(int left, int top, int right, int down) {
|
||||
@@ -1105,28 +1106,21 @@ void ScriptBase::Scene_2D_Region_Remove(int index) {
|
||||
_vm->_scene->_regions->remove(index);
|
||||
}
|
||||
|
||||
void ScriptBase::World_Waypoint_Set(int waypointId, int sceneId, float x, float y, float z) {
|
||||
//TODO
|
||||
warning("World_Waypoint_Set(%d, %d, %f, %f, %f)", waypointId, sceneId, x, y, z);
|
||||
void ScriptBase::World_Waypoint_Set(int waypointId, int setId, float x, float y, float z) {
|
||||
_vm->_waypoints->set(waypointId, setId, Vector3(x, y, z));
|
||||
}
|
||||
// ScriptBase::World_Waypoint_Reset
|
||||
|
||||
float ScriptBase::World_Waypoint_Query_X(int waypointId) {
|
||||
//TODO
|
||||
warning("World_Waypoint_Query_X(%d)", waypointId);
|
||||
return 0.0f;
|
||||
return _vm->_waypoints->getX(waypointId);
|
||||
}
|
||||
|
||||
float ScriptBase::World_Waypoint_Query_Y(int waypointId) {
|
||||
//TODO
|
||||
warning("World_Waypoint_Query_Y(%d)", waypointId);
|
||||
return 0.0f;
|
||||
return _vm->_waypoints->getY(waypointId);
|
||||
}
|
||||
|
||||
float ScriptBase::World_Waypoint_Query_Z(int waypointId) {
|
||||
//TODO
|
||||
warning("World_Waypoint_Query_Z(%d)", waypointId);
|
||||
return 0.0f;
|
||||
return _vm->_waypoints->getZ(waypointId);
|
||||
}
|
||||
|
||||
void ScriptBase::Combat_Cover_Waypoint_Set_Data(int combatCoverId, int a2, int sceneId, int a4, float x, float y, float z) {
|
||||
@@ -1458,27 +1452,89 @@ void ScriptBase::VK_Play_Speech_Line(int actorIndex, int a2, float a3) {
|
||||
warning("VK_Play_Speech_Line(%d, %d, %g)", actorIndex, a2, a3);
|
||||
}
|
||||
|
||||
AIScripts::AIScripts(BladeRunnerEngine *vm) : _vm(vm), _inScriptCounter(0) {
|
||||
for (int i = 0; i != 100; ++i)
|
||||
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 AIScript_McCoy(_vm);
|
||||
_AIScripts[15] = new AIScript_Runciter(_vm);
|
||||
_AIScripts[23] = new AIScript_Officer_Leroy(_vm);
|
||||
}
|
||||
|
||||
AIScripts::~AIScripts() {
|
||||
for (int i = 0; i != 100; ++i) {
|
||||
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::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::GoalChanged(int actor, int currentGoalNumber, int newGoalNumber) {
|
||||
assert(actor < _actorsCount);
|
||||
_inScriptCounter++;
|
||||
if (_AIScripts[actor])
|
||||
_AIScripts[actor]->GoalChanged(currentGoalNumber, newGoalNumber);
|
||||
_inScriptCounter--;
|
||||
}
|
||||
|
||||
void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) {
|
||||
assert(actor < _actorsCount);
|
||||
_inScriptCounter++;
|
||||
if (_AIScripts[actor])
|
||||
_AIScripts[actor]->UpdateAnimation(animation, frame);
|
||||
@@ -1486,6 +1542,7 @@ void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) {
|
||||
}
|
||||
|
||||
void AIScripts::ChangeAnimationMode(int actor, int mode) {
|
||||
assert(actor < _actorsCount);
|
||||
_inScriptCounter++;
|
||||
if (_AIScripts[actor])
|
||||
_AIScripts[actor]->ChangeAnimationMode(mode);
|
||||
|
||||
@@ -304,11 +304,12 @@ public:
|
||||
*/
|
||||
|
||||
class Script {
|
||||
public:
|
||||
protected:
|
||||
BladeRunnerEngine *_vm;
|
||||
int _inScriptCounter;
|
||||
SceneScriptBase *_currentScript;
|
||||
|
||||
public:
|
||||
Script(BladeRunnerEngine *vm)
|
||||
: _vm(vm),
|
||||
_inScriptCounter(0),
|
||||
@@ -331,6 +332,7 @@ public:
|
||||
void PlayerWalkedIn();
|
||||
void PlayerWalkedOut();
|
||||
void DialogueQueueFlushed(int a1);
|
||||
bool IsInsideScript() { return _inScriptCounter > 0; }
|
||||
};
|
||||
|
||||
#define DECLARE_SCRIPT(name) \
|
||||
@@ -820,10 +822,10 @@ public:
|
||||
virtual void CompletedMovementTrack() = 0;
|
||||
virtual void ReceivedClue(int clueId, int fromActorId) = 0;
|
||||
virtual void ClickedByPlayer() = 0;
|
||||
virtual void EnteredScene(int sceneId) = 0;
|
||||
virtual void OtherAgentEnteredThisScene() = 0;
|
||||
virtual void OtherAgentExitedThisScene() = 0;
|
||||
virtual void OtherAgentEnteredCombatMode() = 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;
|
||||
@@ -838,17 +840,27 @@ public:
|
||||
};
|
||||
|
||||
class AIScripts {
|
||||
public:
|
||||
private:
|
||||
BladeRunnerEngine *_vm;
|
||||
int _inScriptCounter;
|
||||
AIScriptBase *_AIScripts[100];
|
||||
|
||||
AIScripts(BladeRunnerEngine *vm);
|
||||
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 EnteredScene(int actor, int setId);
|
||||
void OtherAgentEnteredThisScene(int actor, int otherActorId);
|
||||
void OtherAgentExitedThisScene(int actor, int otherActorId);
|
||||
void GoalChanged(int actor, int currentGoalNumber, int newGoalNumber);
|
||||
void UpdateAnimation(int actor, int *animation, int *frame);
|
||||
void ChangeAnimationMode(int actor, int mode);
|
||||
|
||||
bool IsInsideScript() { return _inScriptCounter > 0; }
|
||||
};
|
||||
|
||||
} // End of namespace BladeRunner
|
||||
|
||||
Reference in New Issue
Block a user