25 #include "common/str.h" 26 #include "draci/script.h" 27 #include "draci/walking.h" 51 kMouseEnableSwitching = -1,
52 kMouseDoNotSwitch = -2
58 enum SpeechConstants {
59 kBaseSpeechDuration = 12000,
60 kSpeechTimeUnit = 2640,
68 kBlackFadingIterations = 15,
69 kBlackFadingTimeUnit = 7
72 enum AnimationConstants {
78 kInventoryItemWidth = 25,
79 kInventoryItemHeight = 25,
80 kInventoryColumns = 7,
84 kInventorySlots = kInventoryLines * kInventoryColumns,
85 kStatusChangeTimeout = 500
88 static const int kCreditsMapID = 46;
93 uint _init, _look, _use, _canUse;
94 bool _imInit, _imLook, _imUse;
97 uint _lookX, _lookY, _useX, _useY;
98 SightDirection _lookDir, _useDir;
107 int getAnim(
int animID)
const;
109 int playingAnim()
const {
return _playingAnim; }
110 void playAnim(
int i);
113 void deleteAnimsFrom(
int index);
114 void load(uint objNum,
BArchive *archive);
125 uint _maxItemWidth, _maxItemHeight;
128 uint _numDialogueBlocks;
134 uint _init, _look, _use, _canUse;
135 bool _imInit, _imLook, _imUse;
141 void load(
int itemID,
BArchive *archive);
163 int _init, _look, _use, _canUse;
164 bool _imInit, _imLook, _imUse;
165 bool _mouseOn, _heroOn;
166 double _pers0, _persStep;
172 void load(
int roomNum,
BArchive *archive);
186 kInnerDuringDialogue,
197 void loop(LoopSubstatus substatus,
bool shouldExit);
200 int nextRoomNum()
const {
201 int n = _currentRoom._roomNum;
202 n = n < 37 ? n+1 : n;
207 int prevRoomNum()
const {
208 int n = _currentRoom._roomNum;
213 Common::Point findNearestWalkable(
int x,
int y)
const {
return _walkingMap.findNearestWalkable(x, y); }
214 void heroAnimationFinished() { _walkingState.heroAnimationFinished(); }
215 void stopWalking() { _walkingState.stopWalking(); }
216 void walkHero(
int x,
int y, SightDirection dir);
218 const Common::Point &getHeroPosition()
const {
return _hero; }
219 const Common::Point &getHeroLoadingPosition()
const {
return _heroLoading; }
220 void positionAnimAsHero(
Animation *anim);
221 void positionHeroAsAnim(
Animation *anim);
229 int playHeroAnimation(
int anim_index);
232 void loadWalkingMap(
int mapID);
233 void switchWalkingAnimations(
bool enabled);
235 uint getNumObjects()
const {
return _info._numObjects; }
236 GameObject *getObject(uint objNum) {
return _objects + objNum; }
238 void deleteObjectAnimations();
239 void deleteAnimationsAfterIndex(
int lastAnimIndex);
241 int getVariable(
int varNum)
const {
return _variables[varNum]; }
242 void setVariable(
int varNum,
int value) { _variables[varNum] = value; }
244 const Person *getPerson(
int personID)
const {
return &_persons[personID]; }
246 int getRoomNum()
const {
return _currentRoom._roomNum; }
247 void setRoomNum(
int num) { _currentRoom._roomNum = num; }
248 int getPreviousRoomNum()
const {
return _previousRoom; }
249 void rememberRoomNumAsPrevious() { _previousRoom = getRoomNum(); }
250 void scheduleEnteringRoomUsingGate(
int room,
int gate) { _newRoom = room; _newGate = gate; }
254 double getPers0()
const {
return _currentRoom._pers0; }
255 double getPersStep()
const {
return _currentRoom._persStep; }
256 int getMusicTrack()
const {
return _currentRoom._music; }
257 void setMusicTrack(
int num) { _currentRoom._music = num; }
259 int getItemStatus(
int itemID)
const {
return _itemStatus[itemID]; }
260 void setItemStatus(
int itemID,
int status) { _itemStatus[itemID] = status; }
261 GameItem *getItem(
int id) {
return id >= 0 &&
id < (int)_info._numItems ? &_items[
id] : NULL; }
262 GameItem *getCurrentItem()
const {
return _currentItem; }
263 void setCurrentItem(
GameItem *item) { _currentItem = item; }
264 int getPreviousItemPosition()
const {
return _previousItemPosition; }
265 void setPreviousItemPosition(
int pos) { _previousItemPosition = pos; }
267 void loadItemAnimation(
GameItem *item);
268 void putItem(
GameItem *item,
int position);
269 void addItem(
int itemID);
271 int getEscRoom()
const {
return _currentRoom._escRoom; }
272 int getMapRoom()
const {
return _info._mapRoom; }
273 int getMapID()
const {
return _currentRoom._mapID; }
282 void setMarkedAnimationIndex(
int index) { _markedAnimationIndex = index; }
284 void setLoopStatus(LoopStatus status) { _loopStatus = status; }
285 void setLoopSubstatus(LoopSubstatus status) { _loopSubstatus = status; }
286 LoopStatus getLoopStatus()
const {
return _loopStatus; }
287 LoopSubstatus getLoopSubstatus()
const {
return _loopSubstatus; }
289 bool gameShouldQuit()
const {
return _shouldQuit; }
290 void setQuit(
bool quit) { _shouldQuit = quit; }
291 bool shouldExitLoop()
const {
return _shouldExitLoop; }
292 void setExitLoop(
bool exit) { _shouldExitLoop = exit; }
293 bool isReloaded()
const {
return _isReloaded; }
294 void setIsReloaded(
bool value) { _isReloaded = value; }
295 bool isPositionLoaded() {
return _isPositionLoaded; }
296 void setPositionLoaded(
bool value) { _isPositionLoaded = value; }
298 void setSpeechTiming(uint tick, uint duration);
299 void shiftSpeechAndFadeTick(
int delta);
301 void inventoryInit();
302 void inventoryDraw();
303 void inventoryDone();
304 void inventoryReload();
305 void inventorySwitch(
int action);
307 void dialogueMenu(
int dialogueID);
309 void dialogueInit(
int dialogID);
312 bool isDialogueBegin()
const {
return _dialogueBegin; }
313 bool shouldExitDialogue()
const {
return _dialogueExit; }
314 void setDialogueExit(
bool exit) { _dialogueExit = exit; }
315 int getDialogueBlockNum()
const {
return _blockNum; }
316 int getDialogueVar(
int dialogueID)
const {
return _dialogueVars[dialogueID]; }
317 void setDialogueVar(
int dialogueID,
int value) { _dialogueVars[dialogueID] = value; }
318 int getCurrentDialogue()
const {
return _currentDialogue; }
319 int getDialogueCurrentBlock()
const {
return _currentBlock; }
320 int getDialogueLastBlock()
const {
return _lastBlock; }
321 int getDialogueLinesNum()
const {
return _dialogueLinesNum; }
322 int getCurrentDialogueOffset()
const {
return _dialogueOffsets[_currentDialogue]; }
324 void schedulePalette(
int paletteID) { _scheduledPalette = paletteID; }
325 int getScheduledPalette()
const {
return _scheduledPalette; }
326 void initializeFading(
int phases);
327 void setEnableQuickHero(
bool value) { _enableQuickHero = value; }
328 bool getEnableQuickHero()
const {
return _enableQuickHero; }
329 void setWantQuickHero(
bool value) { _wantQuickHero = value; }
330 bool getWantQuickHero()
const {
return _wantQuickHero; }
331 void setEnableSpeedText(
bool value) { _enableSpeedText = value; }
332 bool getEnableSpeedText()
const {
return _enableSpeedText; }
337 void updateOrdinaryCursor();
338 void updateInventoryCursor();
339 int inventoryPositionFromMouse()
const;
340 void handleOrdinaryLoop(
int x,
int y);
341 void handleInventoryLoop();
342 void handleDialogueLoop();
343 void updateTitle(
int x,
int y);
345 void fadePalette(
bool fading_out);
346 void advanceAnimationsAndTestLoopExit();
347 void handleStatusChangeByMouse();
350 void initWalkingOverlays();
351 void loadRoomObjects();
373 int _previousItemPosition;
375 GameItem *_inventory[kInventorySlots];
384 uint *_dialogueOffsets;
385 int _currentDialogue;
393 int _dialogueLinesNum;
395 int _lines[kDialogueLines];
396 Animation *_dialogueAnims[kDialogueLines];
398 LoopStatus _loopStatus;
399 LoopSubstatus _loopSubstatus;
402 bool _shouldExitLoop;
404 bool _isPositionLoaded;
407 uint _speechDuration;
412 int _markedAnimationIndex;
414 int _scheduledPalette;
419 int _mouseChangeTick;
421 bool _enableQuickHero;
423 bool _enableSpeedText;
437 #endif // DRACI_GAME_H
Definition: walking.h:103
Definition: animation.h:59
int getMarkedAnimationIndex() const
Definition: game.h:281
InventoryConstants
Definition: game.h:77
Definition: serializer.h:79
Used for positioning of the inventory sprite on the X axis.
Definition: game.h:82
Definition: algorithm.h:29
Definition: barchive.h:48
Definition: animation.h:30
Used for positioning of the inventory sprite on the Y axis.
Definition: game.h:83