diff options
author | Peter Kohaut | 2018-02-18 22:18:41 +0100 |
---|---|---|
committer | Peter Kohaut | 2018-02-18 22:20:16 +0100 |
commit | 7090841ccc43c64d5a1d9058071ebccaf6b52fc2 (patch) | |
tree | 44fb7798096b66646039a34c6d4756e091bc700b /engines/bladerunner/script | |
parent | 1d69120112e16a74a9d101a0d4d9de04196d29de (diff) | |
download | scummvm-rg350-7090841ccc43c64d5a1d9058071ebccaf6b52fc2.tar.gz scummvm-rg350-7090841ccc43c64d5a1d9058071ebccaf6b52fc2.tar.bz2 scummvm-rg350-7090841ccc43c64d5a1d9058071ebccaf6b52fc2.zip |
BLADERUNNER: Support for running
Fixed Runciter idle state
Fixed movement track delay
Basic combat support
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/ai/leon.cpp | 9 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/maggie.cpp | 9 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/mccoy.cpp | 21 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/officer_leary.cpp | 3 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/runciter.cpp | 27 | ||||
-rw-r--r-- | engines/bladerunner/script/ai_script.cpp | 29 | ||||
-rw-r--r-- | engines/bladerunner/script/ai_script.h | 7 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.cpp | 11 | ||||
-rw-r--r-- | engines/bladerunner/script/scene_script.h | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 76 |
10 files changed, 122 insertions, 76 deletions
diff --git a/engines/bladerunner/script/ai/leon.cpp b/engines/bladerunner/script/ai/leon.cpp index 9d82464708..3d136eea4e 100644 --- a/engines/bladerunner/script/ai/leon.cpp +++ b/engines/bladerunner/script/ai/leon.cpp @@ -128,10 +128,11 @@ void AIScriptLeon::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) void AIScriptLeon::ShotAtAndMissed() {} -void AIScriptLeon::ShotAtAndHit() { +bool AIScriptLeon::ShotAtAndHit() { if (Actor_Query_Goal_Number(kActorLeon) != 7) { Actor_Set_Goal_Number(kActorLeon, 7); } + return false; } void AIScriptLeon::Retired(int byActorId) {} @@ -351,7 +352,7 @@ bool AIScriptLeon::UpdateAnimation(int *animation, int *frame) { bool AIScriptLeon::ChangeAnimationMode(int mode) { switch (mode) { - case 0: + case kAnimationModeIdle: switch (_animationState) { case 2: case 3: @@ -370,7 +371,7 @@ bool AIScriptLeon::ChangeAnimationMode(int mode) { break; } break; - case 1: + case kAnimationModeWalk: _animationState = 1; _animationFrame = 0; break; @@ -379,7 +380,7 @@ bool AIScriptLeon::ChangeAnimationMode(int mode) { _animationFrame = 0; var_45EDAC = 0; break; - case 6: + case kAnimationModeCombatShoot: _animationState = 10; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/maggie.cpp b/engines/bladerunner/script/ai/maggie.cpp index 3fd213f1de..89dd651c01 100644 --- a/engines/bladerunner/script/ai/maggie.cpp +++ b/engines/bladerunner/script/ai/maggie.cpp @@ -139,7 +139,7 @@ void AIScriptMaggie::ClickedByPlayer() { Actor_Set_Targetable(kActorMaggie, true); AI_Movement_Track_Flush(kActorMaggie); Actor_Face_Actor(kActorMcCoy, kActorMaggie, true); - Actor_Says(kActorMcCoy, 2400, 52); + Actor_Says(kActorMcCoy, 2400, kAnimationModeFeeding); } return; // true } @@ -210,10 +210,11 @@ void AIScriptMaggie::OtherAgentEnteredCombatMode(int otherActorId, int combatMod void AIScriptMaggie::ShotAtAndMissed() { } -void AIScriptMaggie::ShotAtAndHit() { +bool AIScriptMaggie::ShotAtAndHit() { AI_Movement_Track_Flush(kActorMaggie); Actor_Set_Goal_Number(kActorMaggie, 414); Actor_Set_Targetable(kActorMaggie, false); + return false; } void AIScriptMaggie::Retired(int byActorId) { @@ -270,7 +271,7 @@ bool AIScriptMaggie::GoalChanged(int currentGoalNumber, int newGoalNumber) { Loop_Actor_Walk_To_Actor(kActorMaggie, kActorMcCoy, 48, false, false); Actor_Face_Actor(kActorMcCoy, kActorMaggie, true); Actor_Face_Actor(kActorMaggie, kActorMcCoy, false); - Actor_Says(kActorMcCoy, 2400, 52); + Actor_Says(kActorMcCoy, 2400, kAnimationModeFeeding); Actor_Set_Goal_Number(kActorMaggie, 8); Player_Gains_Control(); return true; @@ -593,7 +594,7 @@ bool AIScriptMaggie::ChangeAnimationMode(int mode) { } } break; - case 52: + case kAnimationModeFeeding: if (Game_Flag_Query(kFlagMaggieIsHurt)) { _animationState = kMaggieStateHurtJumping; _animationFrame = 0; diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index f84c9a9d52..3f3888f99f 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -219,7 +219,8 @@ void AIScriptMcCoy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode void AIScriptMcCoy::ShotAtAndMissed() { } -void AIScriptMcCoy::ShotAtAndHit() { +bool AIScriptMcCoy::ShotAtAndHit() { + return false; } void AIScriptMcCoy::Retired(int byActorId) { @@ -633,7 +634,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { *animation = 32; _animationFrame++; if (_animationFrame == 7) { - Actor_Change_Animation_Mode(kActorMaggie, 52); + Actor_Change_Animation_Mode(kActorMaggie, kAnimationModeFeeding); } if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { *animation = 19; @@ -1244,7 +1245,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationState = 70; } return true; - case 52: + case kAnimationModeFeeding: _animationState = 55; _animationFrame = 0; return true; @@ -1488,19 +1489,19 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { dword_45A0F4 = 21; } return true; - case 8: + case kAnimationModeCombatRun: if (_animationState != 27 && _animationState != 50) { _animationState = 37; _animationFrame = 0; } return true; - case 7: + case kAnimationModeCombatWalk: if (_animationState != 27 && _animationState != 50) { _animationState = 36; _animationFrame = 0; } return true; - case 6: + case kAnimationModeCombatShoot: _animationState = 21; _animationFrame = 0; return true; @@ -1524,7 +1525,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } return true; - case 4: + case kAnimationModeCombatIdle: switch (_animationState) { case 22: _animationState = 19; @@ -1586,7 +1587,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationNext = 20; } return true; - case 2: + case kAnimationModeRun: if (_animationState == 27 || _animationState == 50) { return true; } @@ -1598,7 +1599,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationState = 58; _animationFrame = 4; return true; - case 1: + case kAnimationModeWalk: if (_animationState == 27 || _animationState == 50) { return true; } @@ -1610,7 +1611,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { _animationState = 58; _animationFrame = 0; return true; - case 0: + case kAnimationModeIdle: if (Game_Flag_Query(550)) { if (_animationFrame > 6) { _animationState = 57; diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp index 86b3ace09c..c95ba202ca 100644 --- a/engines/bladerunner/script/ai/officer_leary.cpp +++ b/engines/bladerunner/script/ai/officer_leary.cpp @@ -209,10 +209,11 @@ void AIScriptOfficerLeary::OtherAgentEnteredCombatMode(int otherActorId, int com void AIScriptOfficerLeary::ShotAtAndMissed() {} -void AIScriptOfficerLeary::ShotAtAndHit() { +bool AIScriptOfficerLeary::ShotAtAndHit() { if (Actor_Query_Goal_Number(kActorOfficerLeary) == 307) { Actor_Set_Health(kActorOfficerLeary, 50, 50); } + return false; } void AIScriptOfficerLeary::Retired(int byActorId) { diff --git a/engines/bladerunner/script/ai/runciter.cpp b/engines/bladerunner/script/ai/runciter.cpp index c18dd2d5f0..d1d7a08182 100644 --- a/engines/bladerunner/script/ai/runciter.cpp +++ b/engines/bladerunner/script/ai/runciter.cpp @@ -139,7 +139,7 @@ void AIScriptRunciter::OtherAgentEnteredCombatMode(int otherActorId, int combatM void AIScriptRunciter::ShotAtAndMissed() {} -void AIScriptRunciter::ShotAtAndHit() { +bool AIScriptRunciter::ShotAtAndHit() { Actor_Set_Targetable(kActorRunciter, false); Actor_Change_Animation_Mode(kActorRunciter, 48); Actor_Set_Goal_Number(kActorRunciter, 599); @@ -153,6 +153,7 @@ void AIScriptRunciter::ShotAtAndHit() { Actor_Voice_Over(2090, kActorVoiceOver); } Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, 3); + return false; } void AIScriptRunciter::Retired(int byActorId) {} @@ -472,8 +473,8 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) { bool AIScriptRunciter::ChangeAnimationMode(int mode) { switch (mode) { - case kAnimationModeCombatIdle: - if (_animationState <= 11) { + case kAnimationModeIdle: + if (_animationState >= 2 && _animationState <= 11) { var_45CD88 = 1; } else { _animationState = 0; @@ -485,14 +486,14 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { if (_animationState > 1) { _animationState = 1; _animationFrame = 0; - } else if (!_animationState) { + } else if (_animationState == 0) { _animationState = 13; _animationStateNext = 1; _animationNext = 526; } break; case 3: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -503,7 +504,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 12: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -514,7 +515,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 13: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -525,7 +526,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 14: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -536,7 +537,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 15: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -547,7 +548,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 16: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -558,7 +559,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 17: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -569,7 +570,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 18: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { @@ -580,7 +581,7 @@ bool AIScriptRunciter::ChangeAnimationMode(int mode) { var_45CD88 = 0; break; case 19: - if (_animationState) { + if (_animationState != 0) { _animationState = 2; _animationFrame = 0; } else { diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp index 503fb733df..7b211aaa4c 100644 --- a/engines/bladerunner/script/ai_script.cpp +++ b/engines/bladerunner/script/ai_script.cpp @@ -144,6 +144,35 @@ void AIScripts::otherAgentExitedThisScene(int actor, int otherActorId) { _inScriptCounter--; } +void AIScripts::otherAgentEnteredCombatMode(int actorId, int otherActorId, int combatMode) { + assert(actorId < _actorCount); + _inScriptCounter++; + if (_AIScripts[actorId]) { + _AIScripts[actorId]->OtherAgentEnteredCombatMode(otherActorId, combatMode); + } + _inScriptCounter--; +} + +void AIScripts::shotAtAndMissed(int actorId) { + assert(actorId < _actorCount); + _inScriptCounter++; + if (_AIScripts[actorId]) { + _AIScripts[actorId]->ShotAtAndMissed(); + } + _inScriptCounter--; +} + +bool AIScripts::shotAtAndHit(int actorId) { + assert(actorId < _actorCount); + bool result = true; + _inScriptCounter++; + if (_AIScripts[actorId]) { + result = _AIScripts[actorId]->ShotAtAndHit(); + } + _inScriptCounter--; + return result; +} + void AIScripts::retired(int actor, int retiredByActorId) { assert(actor < _actorCount); _inScriptCounter++; diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h index 40df2fb0d8..4be79c650b 100644 --- a/engines/bladerunner/script/ai_script.h +++ b/engines/bladerunner/script/ai_script.h @@ -50,7 +50,7 @@ public: virtual void OtherAgentExitedThisScene(int otherActorId) = 0; virtual void OtherAgentEnteredCombatMode(int otherActorId, int combatMode) = 0; virtual void ShotAtAndMissed() = 0; - virtual void ShotAtAndHit() = 0; + virtual bool ShotAtAndHit() = 0; virtual void Retired(int byActorId) = 0; virtual int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) = 0; virtual bool GoalChanged(int currentGoalNumber, int newGoalNumber) = 0; @@ -79,7 +79,7 @@ public: \ void OtherAgentExitedThisScene(int otherActorId); \ void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); \ void ShotAtAndMissed(); \ - void ShotAtAndHit(); \ + bool ShotAtAndHit(); \ void Retired(int byActorId); \ int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); \ bool GoalChanged(int currentGoalNumber, int newGoalNumber); \ @@ -176,6 +176,9 @@ public: void enteredScene(int actor, int setId); void otherAgentEnteredThisScene(int actor, int otherActorId); void otherAgentExitedThisScene(int actor, int otherActorId); + void otherAgentEnteredCombatMode(int actorId, int otherActorId, int combatMode); + void shotAtAndMissed(int actorId); + bool shotAtAndHit(int actorId); void retired(int actor, int retiredByActorId); void goalChanged(int actor, int currentGoalNumber, int newGoalNumber); bool reachedMovementTrackWaypoint(int actor, int waypointId); diff --git a/engines/bladerunner/script/scene_script.cpp b/engines/bladerunner/script/scene_script.cpp index 639bca8c4e..01fe3e3b1e 100644 --- a/engines/bladerunner/script/scene_script.cpp +++ b/engines/bladerunner/script/scene_script.cpp @@ -174,20 +174,21 @@ bool SceneScript::mouseClick(int x, int y) { //MouseX = x; //MouseY = y; bool result = _currentScript->MouseClick(x, y); - //SelectedEntity = -1; + _vm->_runningActorId = -1; _inScriptCounter--; //MouseX = -1; //MouseY = -1; return result; } -bool SceneScript::clickedOn3DObject(const char *objectName, bool a2) { +bool SceneScript::clickedOn3DObject(const char *objectName, bool attack) { if (_inScriptCounter > 0) { return true; } _inScriptCounter++; - bool result = _currentScript->ClickedOn3DObject(objectName, a2); + bool result = _currentScript->ClickedOn3DObject(objectName, attack); + _vm->_runningActorId = -1; _inScriptCounter--; return result; } @@ -199,6 +200,7 @@ bool SceneScript::clickedOnActor(int actorId) { _inScriptCounter++; bool result = _currentScript->ClickedOnActor(actorId); + _vm->_runningActorId = -1; _inScriptCounter--; return result; } @@ -210,6 +212,7 @@ bool SceneScript::clickedOnItem(int itemId, bool a2) { _inScriptCounter++; bool result = _currentScript->ClickedOnItem(itemId, a2); + _vm->_runningActorId = -1; _inScriptCounter--; return result; } @@ -221,6 +224,7 @@ bool SceneScript::clickedOnExit(int exitId) { _inScriptCounter++; bool result = _currentScript->ClickedOnExit(exitId); + _vm->_runningActorId = -1; _inScriptCounter--; return result; } @@ -232,6 +236,7 @@ bool SceneScript::clickedOn2DRegion(int region) { _inScriptCounter++; bool result = _currentScript->ClickedOn2DRegion(region); + _vm->_runningActorId = -1; _inScriptCounter--; return result; } diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h index ece96690d3..086388c2d6 100644 --- a/engines/bladerunner/script/scene_script.h +++ b/engines/bladerunner/script/scene_script.h @@ -36,7 +36,7 @@ public: virtual void InitializeScene() = 0; virtual void SceneLoaded() = 0; virtual bool MouseClick(int x, int y) = 0; - virtual bool ClickedOn3DObject(const char *objectName, bool a2) = 0; + virtual bool ClickedOn3DObject(const char *objectName, bool attack) = 0; virtual bool ClickedOnActor(int actorId) = 0; virtual bool ClickedOnItem(int itemId, bool a2) = 0; virtual bool ClickedOnExit(int exitId) = 0; @@ -57,7 +57,7 @@ public: \ void InitializeScene(); \ void SceneLoaded(); \ bool MouseClick(int x, int y); \ - bool ClickedOn3DObject(const char *objectName, bool a2); \ + bool ClickedOn3DObject(const char *objectName, bool attack); \ bool ClickedOnActor(int actorId); \ bool ClickedOnItem(int itemId, bool a2); \ bool ClickedOnExit(int exitId); \ @@ -536,7 +536,7 @@ public: void initializeScene(); void sceneLoaded(); bool mouseClick(int x, int y); - bool clickedOn3DObject(const char *objectName, bool a2); + bool clickedOn3DObject(const char *objectName, bool attack); bool clickedOnActor(int actorId); bool clickedOnItem(int itemId, bool a2); bool clickedOnExit(int exitId); diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index c4b0de81d9..f88f330e2f 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -231,7 +231,7 @@ void ScriptBase::Actor_Set_Health(int actorId, int hp, int maxHp) { } void ScriptBase::Actor_Set_Targetable(int actorId, bool targetable) { - _vm->_actors[actorId]->setTargetable(targetable); + _vm->_actors[actorId]->setTarget(targetable); } @@ -258,7 +258,7 @@ void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause, if (actorId != kActorMcCoy) { actor->changeAnimationMode(animationMode, false); animationModeChanged = true; - } else if (_vm->_combat->isActive()) { + } else if (!_vm->_combat->isActive()) { actor->changeAnimationMode(animationMode, false); animationModeChanged = true; } @@ -364,11 +364,11 @@ bool ScriptBase::Actor_Query_In_Between_Two_Actors(int actorId, int otherActor1I float z1 = _vm->_actors[otherActor1Id]->getZ(); float x2 = _vm->_actors[otherActor2Id]->getX(); float z2 = _vm->_actors[otherActor2Id]->getZ(); - return _vm->_sceneObjects->isBetweenTwoXZ(actorId + kSceneObjectOffsetActors, x1, z1, x2, z1) - || _vm->_sceneObjects->isBetweenTwoXZ(actorId + kSceneObjectOffsetActors, x1 - 12.0f, z1 - 12.0f, x2 - 12.0f, z2 - 12.0f) - || _vm->_sceneObjects->isBetweenTwoXZ(actorId + kSceneObjectOffsetActors, x1 + 12.0f, z1 - 12.0f, x2 + 12.0f, z2 - 12.0f) - || _vm->_sceneObjects->isBetweenTwoXZ(actorId + kSceneObjectOffsetActors, x1 + 12.0f, z1 + 12.0f, x2 + 12.0f, z2 + 12.0f) - || _vm->_sceneObjects->isBetweenTwoXZ(actorId + kSceneObjectOffsetActors, x1 - 12.0f, z1 + 12.0f, x2 - 12.0f, z2 + 12.0f); + return _vm->_sceneObjects->isBetween(x1, z1, x2, z1, actorId + kSceneObjectOffsetActors) + || _vm->_sceneObjects->isBetween(x1 - 12.0f, z1 - 12.0f, x2 - 12.0f, z2 - 12.0f, actorId + kSceneObjectOffsetActors) + || _vm->_sceneObjects->isBetween(x1 + 12.0f, z1 - 12.0f, x2 + 12.0f, z2 - 12.0f, actorId + kSceneObjectOffsetActors) + || _vm->_sceneObjects->isBetween(x1 + 12.0f, z1 + 12.0f, x2 + 12.0f, z2 + 12.0f, actorId + kSceneObjectOffsetActors) + || _vm->_sceneObjects->isBetween(x1 - 12.0f, z1 + 12.0f, x2 - 12.0f, z2 + 12.0f, actorId + kSceneObjectOffsetActors); } void ScriptBase::Actor_Set_Goal_Number(int actorId, int goalNumber) { @@ -408,20 +408,21 @@ int ScriptBase::Actor_Query_Animation_Mode(int actorId) { bool ScriptBase::Loop_Actor_Walk_To_Actor(int actorId, int otherActorId, int distance, bool interruptible, bool run) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { run = true; } + _vm->_playerActorIdle = false; - bool isRunning; + bool isRunning; bool result = _vm->_actors[actorId]->loopWalkToActor(otherActorId, distance, interruptible, run, true, &isRunning); if (_vm->_playerActorIdle) { result = true; _vm->_playerActorIdle = false; } - if (isRunning == 1) { - _vm->_walkingActorId = actorId; + if (isRunning) { + _vm->_runningActorId = actorId; } Global_Variable_Set(kVariableWalkLoopActor, actorId); Global_Variable_Set(kVariableWalkLoopRun, isRunning); @@ -431,20 +432,21 @@ bool ScriptBase::Loop_Actor_Walk_To_Actor(int actorId, int otherActorId, int dis bool ScriptBase::Loop_Actor_Walk_To_Item(int actorId, int itemId, int destinationOffset, bool interruptible, bool run) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { run = true; } + _vm->_playerActorIdle = false; - bool isRunning; + bool isRunning; bool result = _vm->_actors[actorId]->loopWalkToItem(itemId, destinationOffset, interruptible, run, true, &isRunning); - if (_vm->_playerActorIdle == 1) { + if (_vm->_playerActorIdle) { result = true; _vm->_playerActorIdle = false; } - if (isRunning == 1) { - _vm->_walkingActorId = actorId; + if (isRunning) { + _vm->_runningActorId = actorId; } Global_Variable_Set(kVariableWalkLoopActor, actorId); Global_Variable_Set(kVariableWalkLoopRun, isRunning); @@ -454,20 +456,21 @@ bool ScriptBase::Loop_Actor_Walk_To_Item(int actorId, int itemId, int destinatio bool ScriptBase::Loop_Actor_Walk_To_Scene_Object(int actorId, const char *objectName, int destinationOffset, bool interruptible, bool run) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { run = true; } + _vm->_playerActorIdle = false; - bool isRunning; + bool isRunning; bool result = _vm->_actors[actorId]->loopWalkToSceneObject(objectName, destinationOffset, interruptible, run, true, &isRunning); if (_vm->_playerActorIdle) { result = true; _vm->_playerActorIdle = false; } - if (isRunning == 1) { - _vm->_walkingActorId = actorId; + if (isRunning) { + _vm->_runningActorId = actorId; } Global_Variable_Set(kVariableWalkLoopActor, actorId); Global_Variable_Set(kVariableWalkLoopRun, isRunning); @@ -477,20 +480,21 @@ bool ScriptBase::Loop_Actor_Walk_To_Scene_Object(int actorId, const char *object bool ScriptBase::Loop_Actor_Walk_To_Waypoint(int actorId, int waypointId, int destinationOffset, bool interruptible, bool run) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { run = true; } + _vm->_playerActorIdle = false; - bool isRunning; + bool isRunning; bool result = _vm->_actors[actorId]->loopWalkToWaypoint(waypointId, destinationOffset, interruptible, run, true, &isRunning); if (_vm->_playerActorIdle) { result = true; _vm->_playerActorIdle = false; } - if (isRunning == 1) { - _vm->_walkingActorId = actorId; + if (isRunning) { + _vm->_runningActorId = actorId; } Global_Variable_Set(kVariableWalkLoopActor, actorId); Global_Variable_Set(kVariableWalkLoopRun, isRunning); @@ -500,16 +504,16 @@ bool ScriptBase::Loop_Actor_Walk_To_Waypoint(int actorId, int waypointId, int de bool ScriptBase::Loop_Actor_Walk_To_XYZ(int actorId, float x, float y, float z, int destinationOffset, bool interruptible, bool run, int a7) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { if (a7) { - _vm->_walkingActorId = -1; + _vm->_runningActorId = -1; } else { run = true; } } _vm->_playerActorIdle = false; - bool isRunning; + bool isRunning; bool result = _vm->_actors[actorId]->loopWalkToXYZ(Vector3(x, y, z), destinationOffset, interruptible, run, true, &isRunning); if (_vm->_playerActorIdle) { @@ -517,7 +521,7 @@ bool ScriptBase::Loop_Actor_Walk_To_XYZ(int actorId, float x, float y, float z, _vm->_playerActorIdle = false; } if (isRunning) { - _vm->_walkingActorId = actorId; + _vm->_runningActorId = actorId; } Global_Variable_Set(kVariableWalkLoopActor, actorId); Global_Variable_Set(kVariableWalkLoopRun, isRunning); @@ -527,7 +531,7 @@ bool ScriptBase::Loop_Actor_Walk_To_XYZ(int actorId, float x, float y, float z, void ScriptBase::Async_Actor_Walk_To_Waypoint(int actorId, int waypointId, int destinationOffset, bool run) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { run = true; } @@ -537,7 +541,7 @@ void ScriptBase::Async_Actor_Walk_To_Waypoint(int actorId, int waypointId, int d void ScriptBase::Async_Actor_Walk_To_XYZ(int actorId, float x, float y, float z, int destinationOffset, bool run) { _vm->gameWaitForActive(); - if (_vm->_walkingActorId == actorId) { + if (_vm->_runningActorId == actorId) { run = true; } @@ -1234,13 +1238,13 @@ void ScriptBase::I_Sez(const char *str) { void ScriptBase::AI_Countdown_Timer_Start(int actorId, signed int timer, int seconds) { if (timer >= 0 && timer <= 2) { - _vm->_actors[actorId]->countdownTimerStart(timer, 1000 * seconds); + _vm->_actors[actorId]->timerStart(timer, 1000 * seconds); } } void ScriptBase::AI_Countdown_Timer_Reset(int actorId, int timer) { if (timer >= 0 && timer <= 2) { - _vm->_actors[actorId]->countdownTimerReset(timer); + _vm->_actors[actorId]->timerReset(timer); } } @@ -1258,19 +1262,19 @@ void ScriptBase::AI_Movement_Track_Repeat(int actorId) { } void ScriptBase::AI_Movement_Track_Append_Run_With_Facing(int actorId, int waypointId, int delay, int angle) { - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay, angle, 1); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, angle, true); } void ScriptBase::AI_Movement_Track_Append_With_Facing(int actorId, int waypointId, int delay, int angle) { - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay, angle, 0); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, angle, false); } void ScriptBase::AI_Movement_Track_Append_Run(int actorId, int waypointId, int delay) { - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay, 1); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, true); } void ScriptBase::AI_Movement_Track_Append(int actorId, int waypointId, int delay) { - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay, 0); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, false); } void ScriptBase::AI_Movement_Track_Flush(int actorId) { |