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 
AIScriptShoeshineMan(BladeRunnerEngine * vm)27 AIScriptShoeshineMan::AIScriptShoeshineMan(BladeRunnerEngine *vm) : AIScriptBase(vm) {
28 	_state = false;
29 }
30 
Initialize()31 void AIScriptShoeshineMan::Initialize() {
32 	_animationFrame = 0;
33 	_animationState = 0;
34 	_animationStateNext = 0;
35 	_animationNext = 0;
36 
37 	_state = false;
38 }
39 
Update()40 bool AIScriptShoeshineMan::Update() {
41 	return false;
42 }
43 
TimerExpired(int timer)44 void AIScriptShoeshineMan::TimerExpired(int timer) {
45 	//return false;
46 }
47 
CompletedMovementTrack()48 void AIScriptShoeshineMan::CompletedMovementTrack() {
49 	//return false;
50 }
51 
ReceivedClue(int clueId,int fromActorId)52 void AIScriptShoeshineMan::ReceivedClue(int clueId, int fromActorId) {
53 	//return false;
54 }
55 
ClickedByPlayer()56 void AIScriptShoeshineMan::ClickedByPlayer() {
57 	if (Actor_Query_Goal_Number(kActorShoeshineMan) != 100) {
58 		return;
59 	}
60 
61 	if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1098.15f, -0.04f, -201.53f, 0, true, false, false)) {
62 		Actor_Set_Goal_Number(kActorShoeshineMan, 102);
63 		Actor_Face_Actor(kActorMcCoy, kActorShoeshineMan, true);
64 		Actor_Says_With_Pause(kActorShoeshineMan, 0, 1.2f, 13);
65 		Actor_Says(kActorMcCoy, 730, 17);
66 		Actor_Says(kActorShoeshineMan, 10, 13);
67 		Actor_Says(kActorShoeshineMan, 20, 12);
68 		Actor_Says_With_Pause(kActorMcCoy, 735, 1.0f, 14);
69 		Actor_Change_Animation_Mode(kActorShoeshineMan, 29);
70 	}
71 }
72 
EnteredScene(int sceneId)73 void AIScriptShoeshineMan::EnteredScene(int sceneId) {
74 	// return false;
75 }
76 
OtherAgentEnteredThisScene(int otherActorId)77 void AIScriptShoeshineMan::OtherAgentEnteredThisScene(int otherActorId) {
78 	// return false;
79 }
80 
OtherAgentExitedThisScene(int otherActorId)81 void AIScriptShoeshineMan::OtherAgentExitedThisScene(int otherActorId) {
82 	// return false;
83 }
84 
OtherAgentEnteredCombatMode(int otherActorId,int combatMode)85 void AIScriptShoeshineMan::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
86 	// return false;
87 }
88 
ShotAtAndMissed()89 void AIScriptShoeshineMan::ShotAtAndMissed() {
90 	// return false;
91 }
92 
ShotAtAndHit()93 bool AIScriptShoeshineMan::ShotAtAndHit() {
94 	return false;
95 }
96 
Retired(int byActorId)97 void AIScriptShoeshineMan::Retired(int byActorId) {
98 	// return false;
99 }
100 
GetFriendlinessModifierIfGetsClue(int otherActorId,int clueId)101 int AIScriptShoeshineMan::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
102 	return 0;
103 }
104 
GoalChanged(int currentGoalNumber,int newGoalNumber)105 bool AIScriptShoeshineMan::GoalChanged(int currentGoalNumber, int newGoalNumber) {
106 	switch (newGoalNumber) {
107 	case 100:
108 		Actor_Put_In_Set(kActorShoeshineMan, kSetDR01_DR02_DR04);
109 		Actor_Set_At_XYZ(kActorShoeshineMan, -1160.0f, -0.04f, -235.0f, 524);
110 		break;
111 	case 101:
112 		AI_Movement_Track_Flush(kActorShoeshineMan);
113 		AI_Movement_Track_Append(kActorShoeshineMan, 281, 0);
114 		AI_Movement_Track_Append(kActorShoeshineMan, 40, 0);
115 		AI_Movement_Track_Repeat(kActorShoeshineMan);
116 		break;
117 	}
118 	return false;
119 }
120 
UpdateAnimation(int * animation,int * frame)121 bool AIScriptShoeshineMan::UpdateAnimation(int *animation, int *frame) {
122 	return true;
123 }
124 
ChangeAnimationMode(int mode)125 bool AIScriptShoeshineMan::ChangeAnimationMode(int mode) {
126 	switch (mode) {
127 	case 0:
128 		if (_animationState >= 2 && _animationState <= 4) {
129 			_state = true;
130 		} else {
131 			_animationState = 0;
132 			_animationFrame = 0;
133 		}
134 		break;
135 	case 1:
136 		_animationState = 1;
137 		_animationFrame = 0;
138 		break;
139 	case 3:
140 		_animationState = 2;
141 		_animationFrame = 0;
142 		_state = false;
143 		break;
144 	case 12:
145 		_animationState = 3;
146 		_animationFrame = 0;
147 		_state = false;
148 		break;
149 	case 13:
150 		_animationState = 4;
151 		_animationFrame = 0;
152 		_state = false;
153 		break;
154 	case 23:
155 		_animationState = 5;
156 		_animationFrame = 0;
157 		break;
158 	case 29:
159 		_animationState = 6;
160 		_animationFrame = 0;
161 		break;
162 	default:
163 		break;
164 	}
165 
166 	return true;
167 }
168 
QueryAnimationState(int * animationState,int * animationFrame,int * animationStateNext,int * animationNext)169 void AIScriptShoeshineMan::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
170 	*animationState     = _animationState;
171 	*animationFrame     = _animationFrame;
172 	*animationStateNext = _animationStateNext;
173 	*animationNext      = _animationNext;
174 }
175 
SetAnimationState(int animationState,int animationFrame,int animationStateNext,int animationNext)176 void AIScriptShoeshineMan::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
177 	_animationState     = animationState;
178 	_animationFrame     = animationFrame;
179 	_animationStateNext = animationStateNext;
180 	_animationNext      = animationNext;
181 }
182 
ReachedMovementTrackWaypoint(int waypointId)183 bool AIScriptShoeshineMan::ReachedMovementTrackWaypoint(int waypointId) {
184 	return true;
185 }
186 
FledCombat()187 void AIScriptShoeshineMan::FledCombat() {
188 	// return false;
189 }
190 
191 } // End of namespace BladeRunner
192