1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "bladerunner/script/ai_script.h"
24 
25 namespace BladeRunner {
26 
AIScriptTaffyPatron(BladeRunnerEngine * vm)27 AIScriptTaffyPatron::AIScriptTaffyPatron(BladeRunnerEngine *vm) : AIScriptBase(vm) {
28 }
29 
Initialize()30 void AIScriptTaffyPatron::Initialize() {
31 	_animationFrame = 0;
32 	_animationState = 0;
33 	_animationStateNext = 0;
34 	_animationNext = 0;
35 }
36 
Update()37 bool AIScriptTaffyPatron::Update() {
38 	return false;
39 }
40 
TimerExpired(int timer)41 void AIScriptTaffyPatron::TimerExpired(int timer) {
42 	//return false;
43 }
44 
CompletedMovementTrack()45 void AIScriptTaffyPatron::CompletedMovementTrack() {
46 	//return false;
47 }
48 
ReceivedClue(int clueId,int fromActorId)49 void AIScriptTaffyPatron::ReceivedClue(int clueId, int fromActorId) {
50 	//return false;
51 }
52 
ClickedByPlayer()53 void AIScriptTaffyPatron::ClickedByPlayer() {
54 	//return false;
55 }
56 
EnteredSet(int setId)57 void AIScriptTaffyPatron::EnteredSet(int setId) {
58 	// return false;
59 }
60 
OtherAgentEnteredThisSet(int otherActorId)61 void AIScriptTaffyPatron::OtherAgentEnteredThisSet(int otherActorId) {
62 	// return false;
63 }
64 
OtherAgentExitedThisSet(int otherActorId)65 void AIScriptTaffyPatron::OtherAgentExitedThisSet(int otherActorId) {
66 	// return false;
67 }
68 
OtherAgentEnteredCombatMode(int otherActorId,int combatMode)69 void AIScriptTaffyPatron::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
70 	// return false;
71 }
72 
ShotAtAndMissed()73 void AIScriptTaffyPatron::ShotAtAndMissed() {
74 	// return false;
75 }
76 
ShotAtAndHit()77 bool AIScriptTaffyPatron::ShotAtAndHit() {
78 	return false;
79 }
80 
Retired(int byActorId)81 void AIScriptTaffyPatron::Retired(int byActorId) {
82 	// return false;
83 }
84 
GetFriendlinessModifierIfGetsClue(int otherActorId,int clueId)85 int AIScriptTaffyPatron::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
86 	return 0;
87 }
88 
GoalChanged(int currentGoalNumber,int newGoalNumber)89 bool AIScriptTaffyPatron::GoalChanged(int currentGoalNumber, int newGoalNumber) {
90 	switch (newGoalNumber) {
91 	case 0:
92 		Actor_Put_In_Set(kActorTaffyPatron, kSetFreeSlotH);
93 		Actor_Set_At_Waypoint(kActorTaffyPatron, 40, 0);
94 		return true;
95 
96 	case 250:
97 		Actor_Put_In_Set(kActorTaffyPatron, kSetNR01);
98 		Actor_Set_At_XYZ(kActorTaffyPatron, -170.4f, 23.68f, -850.0f, 324);
99 		Async_Actor_Walk_To_XYZ(kActorTaffyPatron, -390.0f, 31.55f, -429.0f, 24, true);
100 		return true;
101 
102 	case 255:
103 		Actor_Put_In_Set(kActorTaffyPatron, kSetNR01);
104 		Actor_Set_At_XYZ(kActorTaffyPatron, -170.4f, 23.68f, -850.0f, 324);
105 		Actor_Change_Animation_Mode(kActorTaffyPatron, 48);
106 		return true;
107 
108 	default:
109 		break;
110 	}
111 
112 	return false;
113 }
114 
UpdateAnimation(int * animation,int * frame)115 bool AIScriptTaffyPatron::UpdateAnimation(int *animation, int *frame) {
116 	switch (_animationState) {
117 	case 0:
118 		// Dummy placeholder, kModelAnimationZubenIdle (406) is a Zuben animation
119 		*animation = kModelAnimationZubenIdle;
120 		_animationFrame = 0;
121 		break;
122 
123 	case 1:
124 		*animation = kModelAnimationTaffyPatronRunning;
125 		++_animationFrame;
126 		if (_animationFrame > Slice_Animation_Query_Number_Of_Frames(kModelAnimationTaffyPatronRunning) - 1) {
127 			_animationFrame = 0;
128 		}
129 		break;
130 
131 	case 2:
132 		*animation = kModelAnimationTaffyPatronShotDead;
133 		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(kModelAnimationTaffyPatronShotDead) - 1) {
134 			++_animationFrame;
135 		}
136 		break;
137 
138 	default:
139 		break;
140 	}
141 	*frame = _animationFrame;
142 
143 	return true;
144 }
145 
ChangeAnimationMode(int mode)146 bool AIScriptTaffyPatron::ChangeAnimationMode(int mode) {
147 	switch (mode) {
148 	case 0:
149 		_animationState = 0;
150 		_animationFrame = 0;
151 		break;
152 
153 	case 2:
154 		_animationState = 1;
155 		_animationFrame = 0;
156 		break;
157 
158 	case kAnimationModeDie:
159 		_animationState = 2;
160 		_animationFrame = 0;
161 		break;
162 
163 	default:
164 		break;
165 	}
166 
167 	return true;
168 }
169 
QueryAnimationState(int * animationState,int * animationFrame,int * animationStateNext,int * animationNext)170 void AIScriptTaffyPatron::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
171 	*animationState     = _animationState;
172 	*animationFrame     = _animationFrame;
173 	*animationStateNext = _animationStateNext;
174 	*animationNext      = _animationNext;
175 }
176 
SetAnimationState(int animationState,int animationFrame,int animationStateNext,int animationNext)177 void AIScriptTaffyPatron::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
178 	_animationState     = animationState;
179 	_animationFrame     = animationFrame;
180 	_animationStateNext = animationStateNext;
181 	_animationNext      = animationNext;
182 }
183 
ReachedMovementTrackWaypoint(int waypointId)184 bool AIScriptTaffyPatron::ReachedMovementTrackWaypoint(int waypointId) {
185 	return true;
186 }
187 
FledCombat()188 void AIScriptTaffyPatron::FledCombat() {
189 	// return false;
190 }
191 
192 } // End of namespace BladeRunner
193