22 #ifndef MEDIASTATION_MINIGAMES_STALKINGZAZU_H 23 #define MEDIASTATION_MINIGAMES_STALKINGZAZU_H 25 #include "mediastation/statemachine.h" 26 #include "mediastation/actors/stage.h" 30 class StalkingZazuActor;
31 namespace StalkingZazuMinigame {
35 static const uint TOTAL_DIRECTIONS = 8;
53 operator Value()
const {
return _value; }
55 Direction counterClockwise()
const {
return rotate(1); }
56 Direction opposite()
const {
return rotate(TOTAL_DIRECTIONS / 2); }
74 static const uint SIZE = 18;
75 uint indexOf(
Direction direction,
bool isCrouched);
88 uint16 &at(
int row,
int column);
89 const uint16 &at(
int row,
int column)
const;
91 const uint16 &at(
const CellCoord &coord)
const;
92 bool isEmpty(
const CellCoord &coord) {
return at(coord) == 0; }
94 bool isInBounds(
int row,
int column)
const;
95 bool isInBounds(
const CellCoord &coord)
const;
97 int rowCount()
const {
return _rows; }
98 int columnCount()
const {
return _columns; }
108 bool addObstacleToRow(uint16 obstacleActorId, uint16 row);
112 bool obstacleCanBePlaced(
const CellCoord &coord);
122 kStalkingZazuStateStart = 0,
123 kStalkingZazuStateReset = 1,
124 kStalkingZazuStateCrouched = 2,
125 kStalkingZazuStateCanMove = 3,
126 kStalkingZazuStateProcessMove = 4,
127 kStalkingZazuStateDefeat = 5,
128 kStalkingZazuStateSuccess = 6
131 enum GameStateEvent {
132 kStalkingZazuResetStateEvent = 0,
133 kStalkingZazuCrouchStateEvent = 1,
134 kStalkingZazuUncrouchStateEvent = 2,
135 kStalkingZazuMoveStateEvent = 3,
136 kStalkingZazuLoseStateEvent = 4,
137 kStalkingZazuWinStateEvent = 5
142 uint obstaclesToShow = 0;
150 virtual void executeNextState(GameStateEvent eventType)
override;
155 kStalkingZazuExpiredTimerState = 0,
156 kStalkingZazuQueuedTimerState = 1,
157 kStalkingZazuExpiredInactiveTimerState = 2,
158 kStalkingZazuExpiredActiveTimerState = 3,
159 kStalkingZazuQueuedInactiveTimerState = 4
163 kStalkingZazuActivateTimerEvent = 0,
164 kStalkingZazuInactivateTimerEvent = 1,
165 kStalkingZazuExpireTimerEvent = 2,
166 kStalkingZazuQueueTimerEvent = 3
174 virtual void executeNextState(TimerEvent eventType)
override;
188 virtual void readParameter(
Chunk &chunk, ActorHeaderSectionType paramType)
override;
190 virtual bool isVisible()
const override;
192 virtual void loadIsComplete()
override;
194 virtual void onEvent(
const ActorEvent &event)
override;
199 void generateStalkingEvent(StalkingZazuMinigame::GameStateEvent event);
201 void generateTimerEvent(StalkingZazuMinigame::TimerEvent event);
203 void calcWhichObstaclesToShow(uint16 obstaclesToShow);
204 void calcObstaclePlacements();
205 void placeObstaclesOnStage();
206 void positionSimbaStartOnStage();
208 bool simbaIsInSuccessPosition();
209 void setSimbaCrouchClip(
bool isSimbaCrouching);
211 bool zazuSeesSimba();
212 bool simbaIsBehindRock();
214 void placeAndShowActor(uint obstacleActorId,
const Common::Point &pos);
215 void setClipOfMovie(uint spriteActorId, uint clipId);
225 void setZazuLook(
bool isLooking);
226 void setActive(
bool isActive);
228 void stalkingState_1_reset();
229 void stalkingState_2_crouched();
230 void stalkingState_3_canMove();
231 void stalkingState_4_processMove();
232 void stalkingState_5_defeat();
233 void stalkingState_6_success();
234 void timerState_0_expired();
235 void timerState_1_queued();
239 virtual bool interactsWithMouse()
const override {
return _isActive; }
240 virtual uint16 findActorToAcceptMouseEvents(
244 bool clipMouseEvents)
override;
246 void mouseDownEvent(
const MouseEvent &event)
override;
247 void mouseUpEvent(
const MouseEvent &event)
override;
248 void mouseEnteredEvent(
const MouseEvent &event)
override;
249 void mouseExitedEvent(
const MouseEvent &event)
override;
250 bool _mouseIsDown =
false;
251 bool _mouseIsInside =
false;
260 uint _cursorResourceId = 0;
261 uint _simbaActorId = 0;
262 int _obstaclesToShow = 0;
265 bool _isActive =
false;
266 bool _simbaIsCrouching =
false;
267 bool _crouchClipIsSet =
false;
268 bool _acceptingMouseEvents =
true;
269 bool _zazuIsLooking =
false;
271 double _timerDurationInSeconds = 0.10;
272 uint _scalingFactor = 10;
273 uint _successRadius = 20;
278 bool _soundEffectsEnabled =
false;
279 uint _soundEffectId1 = 0;
280 uint _soundEffectId2 = 0;
281 void setAudio(
bool isEnabled);
282 void startSound(uint soundActorId);
283 void stopSound(uint soundActorId);
Definition: graphics.h:122