diff options
author | Eugene Sandulenko | 2018-03-12 20:54:39 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-12 20:54:39 +0100 |
commit | f16e054c3ad731cb66bca70df143707e719fd727 (patch) | |
tree | 10f1e3c977dfd387502e7ea2750d54e562ec9615 /engines/bladerunner/script/ai/taffy_patron.cpp | |
parent | e1cd47baef55e6a97935f7e3babc5a1b6d602054 (diff) | |
download | scummvm-rg350-f16e054c3ad731cb66bca70df143707e719fd727.tar.gz scummvm-rg350-f16e054c3ad731cb66bca70df143707e719fd727.tar.bz2 scummvm-rg350-f16e054c3ad731cb66bca70df143707e719fd727.zip |
BLADERUNNER: Added TaffyPatron actor
Diffstat (limited to 'engines/bladerunner/script/ai/taffy_patron.cpp')
-rw-r--r-- | engines/bladerunner/script/ai/taffy_patron.cpp | 191 |
1 files changed, 191 insertions, 0 deletions
diff --git a/engines/bladerunner/script/ai/taffy_patron.cpp b/engines/bladerunner/script/ai/taffy_patron.cpp new file mode 100644 index 0000000000..c7fa3a7165 --- /dev/null +++ b/engines/bladerunner/script/ai/taffy_patron.cpp @@ -0,0 +1,191 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/ai_script.h" + +namespace BladeRunner { + +AIScriptTaffyPatron::AIScriptTaffyPatron(BladeRunnerEngine *vm) : AIScriptBase(vm) { +} + +void AIScriptTaffyPatron::Initialize() { + _animationFrame = 0; + _animationState = 0; + _animationStateNext = 0; + _animationNext = 0; +} + +bool AIScriptTaffyPatron::Update() { + return false; +} + +void AIScriptTaffyPatron::TimerExpired(int timer) { + //return false; +} + +void AIScriptTaffyPatron::CompletedMovementTrack() { + //return false; +} + +void AIScriptTaffyPatron::ReceivedClue(int clueId, int fromActorId) { + //return false; +} + +void AIScriptTaffyPatron::ClickedByPlayer() { + //return false; +} + +void AIScriptTaffyPatron::EnteredScene(int sceneId) { + // return false; +} + +void AIScriptTaffyPatron::OtherAgentEnteredThisScene(int otherActorId) { + // return false; +} + +void AIScriptTaffyPatron::OtherAgentExitedThisScene(int otherActorId) { + // return false; +} + +void AIScriptTaffyPatron::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { + // return false; +} + +void AIScriptTaffyPatron::ShotAtAndMissed() { + // return false; +} + +bool AIScriptTaffyPatron::ShotAtAndHit() { + return false; +} + +void AIScriptTaffyPatron::Retired(int byActorId) { + // return false; +} + +int AIScriptTaffyPatron::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { + return 0; +} + +bool AIScriptTaffyPatron::GoalChanged(int currentGoalNumber, int newGoalNumber) { + switch (newGoalNumber) { + case 0: + Actor_Put_In_Set(kActorTaffyPatron, kSetFreeSlotH); + Actor_Set_At_Waypoint(kActorTaffyPatron, 40, 0); + return true; + + case 250: + Actor_Put_In_Set(kActorTaffyPatron, kSetNR01); + Actor_Set_At_XYZ(kActorTaffyPatron, -170.39999, 23.68, -850.0, 324); + Async_Actor_Walk_To_XYZ(kActorTaffyPatron, -390.0, 31.549999, -429.0, 24, 1); + return true; + + case 255: + Actor_Put_In_Set(kActorTaffyPatron, kSetNR01); + Actor_Set_At_XYZ(kActorTaffyPatron, -170.39999, 23.68, -850.0, 324); + Actor_Change_Animation_Mode(kActorTaffyPatron, 48); + return true; + + default: + break; + } + + return false; +} + +bool AIScriptTaffyPatron::UpdateAnimation(int *animation, int *frame) { + switch (_animationState) { + case 0: + *animation = 406; + _animationFrame = 0; + break; + + case 1: + *animation = 918; + _animationFrame++; + if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(918) - 1) { + _animationFrame = 0; + } + break; + + case 2: + *animation = 919; + if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(919) - 1) { + _animationFrame++; + } + break; + + default: + break; + } + *frame = _animationFrame; + + return true; +} + +bool AIScriptTaffyPatron::ChangeAnimationMode(int mode) { + switch (mode) { + case 0: + _animationState = 0; + _animationFrame = 0; + break; + + case 2: + _animationState = 1; + _animationFrame = 0; + break; + + case 48: + _animationState = 2; + _animationFrame = 0; + break; + + default: + break; + } + + return true; +} + +void AIScriptTaffyPatron::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) { + *animationState = _animationState; + *animationFrame = _animationFrame; + *animationStateNext = _animationStateNext; + *animationNext = _animationNext; +} + +void AIScriptTaffyPatron::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) { + _animationState = animationState; + _animationFrame = animationFrame; + _animationStateNext = animationStateNext; + _animationNext = animationNext; +} + +bool AIScriptTaffyPatron::ReachedMovementTrackWaypoint(int waypointId) { + return true; +} + +void AIScriptTaffyPatron::FledCombat() { + // return false; +} + +} // End of namespace BladeRunner |