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
91 uint _init, _look, _use, _canUse;
92 bool _imInit, _imLook, _imUse;
95 uint _lookX, _lookY, _useX, _useY;
96 SightDirection _lookDir, _useDir;
105 int getAnim(
int animID)
const;
107 int playingAnim()
const {
return _playingAnim; }
108 void playAnim(
int i);
111 void deleteAnimsFrom(
int index);
112 void load(uint objNum,
BArchive *archive);
123 uint _maxItemWidth, _maxItemHeight;
126 uint _numDialogueBlocks;
132 uint _init, _look, _use, _canUse;
133 bool _imInit, _imLook, _imUse;
139 void load(
int itemID,
BArchive *archive);
161 int _init, _look, _use, _canUse;
162 bool _imInit, _imLook, _imUse;
163 bool _mouseOn, _heroOn;
164 double _pers0, _persStep;
170 void load(
int roomNum,
BArchive *archive);
184 kInnerDuringDialogue,
195 void loop(LoopSubstatus substatus,
bool shouldExit);
198 int nextRoomNum()
const {
199 int n = _currentRoom._roomNum;
200 n = n < 37 ? n+1 : n;
205 int prevRoomNum()
const {
206 int n = _currentRoom._roomNum;
211 Common::Point findNearestWalkable(
int x,
int y)
const {
return _walkingMap.findNearestWalkable(x, y); }
212 void heroAnimationFinished() { _walkingState.heroAnimationFinished(); }
213 void stopWalking() { _walkingState.stopWalking(); }
214 void walkHero(
int x,
int y, SightDirection dir);
216 const Common::Point &getHeroPosition()
const {
return _hero; }
217 const Common::Point &getHeroLoadingPosition()
const {
return _heroLoading; }
218 void positionAnimAsHero(
Animation *anim);
219 void positionHeroAsAnim(
Animation *anim);
227 int playHeroAnimation(
int anim_index);
230 void loadWalkingMap(
int mapID);
231 void switchWalkingAnimations(
bool enabled);
233 uint getNumObjects()
const {
return _info._numObjects; }
234 GameObject *getObject(uint objNum) {
return _objects + objNum; }
236 void deleteObjectAnimations();
237 void deleteAnimationsAfterIndex(
int lastAnimIndex);
239 int getVariable(
int varNum)
const {
return _variables[varNum]; }
240 void setVariable(
int varNum,
int value) { _variables[varNum] = value; }
242 const Person *getPerson(
int personID)
const {
return &_persons[personID]; }
244 int getRoomNum()
const {
return _currentRoom._roomNum; }
245 void setRoomNum(
int num) { _currentRoom._roomNum = num; }
246 int getPreviousRoomNum()
const {
return _previousRoom; }
247 void rememberRoomNumAsPrevious() { _previousRoom = getRoomNum(); }
248 void scheduleEnteringRoomUsingGate(
int room,
int gate) { _newRoom = room; _newGate = gate; }
252 double getPers0()
const {
return _currentRoom._pers0; }
253 double getPersStep()
const {
return _currentRoom._persStep; }
254 int getMusicTrack()
const {
return _currentRoom._music; }
255 void setMusicTrack(
int num) { _currentRoom._music = num; }
257 int getItemStatus(
int itemID)
const {
return _itemStatus[itemID]; }
258 void setItemStatus(
int itemID,
int status) { _itemStatus[itemID] = status; }
259 GameItem *getItem(
int id) {
return id >= 0 &&
id < (int)_info._numItems ? &_items[
id] : NULL; }
260 GameItem *getCurrentItem()
const {
return _currentItem; }
261 void setCurrentItem(
GameItem *item) { _currentItem = item; }
262 int getPreviousItemPosition()
const {
return _previousItemPosition; }
263 void setPreviousItemPosition(
int pos) { _previousItemPosition = pos; }
265 void loadItemAnimation(
GameItem *item);
266 void putItem(
GameItem *item,
int position);
267 void addItem(
int itemID);
269 int getEscRoom()
const {
return _currentRoom._escRoom; }
270 int getMapRoom()
const {
return _info._mapRoom; }
271 int getMapID()
const {
return _currentRoom._mapID; }
280 void setMarkedAnimationIndex(
int index) { _markedAnimationIndex = index; }
282 void setLoopStatus(LoopStatus status) { _loopStatus = status; }
283 void setLoopSubstatus(LoopSubstatus status) { _loopSubstatus = status; }
284 LoopStatus getLoopStatus()
const {
return _loopStatus; }
285 LoopSubstatus getLoopSubstatus()
const {
return _loopSubstatus; }
287 bool gameShouldQuit()
const {
return _shouldQuit; }
288 void setQuit(
bool quit) { _shouldQuit = quit; }
289 bool shouldExitLoop()
const {
return _shouldExitLoop; }
290 void setExitLoop(
bool exit) { _shouldExitLoop = exit; }
291 bool isReloaded()
const {
return _isReloaded; }
292 void setIsReloaded(
bool value) { _isReloaded = value; }
293 bool isPositionLoaded() {
return _isPositionLoaded; }
294 void setPositionLoaded(
bool value) { _isPositionLoaded = value; }
296 void setSpeechTiming(uint tick, uint duration);
297 void shiftSpeechAndFadeTick(
int delta);
299 void inventoryInit();
300 void inventoryDraw();
301 void inventoryDone();
302 void inventoryReload();
303 void inventorySwitch(
int action);
305 void dialogueMenu(
int dialogueID);
307 void dialogueInit(
int dialogID);
310 bool isDialogueBegin()
const {
return _dialogueBegin; }
311 bool shouldExitDialogue()
const {
return _dialogueExit; }
312 void setDialogueExit(
bool exit) { _dialogueExit = exit; }
313 int getDialogueBlockNum()
const {
return _blockNum; }
314 int getDialogueVar(
int dialogueID)
const {
return _dialogueVars[dialogueID]; }
315 void setDialogueVar(
int dialogueID,
int value) { _dialogueVars[dialogueID] = value; }
316 int getCurrentDialogue()
const {
return _currentDialogue; }
317 int getDialogueCurrentBlock()
const {
return _currentBlock; }
318 int getDialogueLastBlock()
const {
return _lastBlock; }
319 int getDialogueLinesNum()
const {
return _dialogueLinesNum; }
320 int getCurrentDialogueOffset()
const {
return _dialogueOffsets[_currentDialogue]; }
322 void schedulePalette(
int paletteID) { _scheduledPalette = paletteID; }
323 int getScheduledPalette()
const {
return _scheduledPalette; }
324 void initializeFading(
int phases);
325 void setEnableQuickHero(
bool value) { _enableQuickHero = value; }
326 bool getEnableQuickHero()
const {
return _enableQuickHero; }
327 void setWantQuickHero(
bool value) { _wantQuickHero = value; }
328 bool getWantQuickHero()
const {
return _wantQuickHero; }
329 void setEnableSpeedText(
bool value) { _enableSpeedText = value; }
330 bool getEnableSpeedText()
const {
return _enableSpeedText; }
335 void updateOrdinaryCursor();
336 void updateInventoryCursor();
337 int inventoryPositionFromMouse()
const;
338 void handleOrdinaryLoop(
int x,
int y);
339 void handleInventoryLoop();
340 void handleDialogueLoop();
341 void updateTitle(
int x,
int y);
343 void fadePalette(
bool fading_out);
344 void advanceAnimationsAndTestLoopExit();
345 void handleStatusChangeByMouse();
348 void initWalkingOverlays();
349 void loadRoomObjects();
371 int _previousItemPosition;
373 GameItem *_inventory[kInventorySlots];
382 uint *_dialogueOffsets;
383 int _currentDialogue;
391 int _dialogueLinesNum;
393 int _lines[kDialogueLines];
394 Animation *_dialogueAnims[kDialogueLines];
396 LoopStatus _loopStatus;
397 LoopSubstatus _loopSubstatus;
400 bool _shouldExitLoop;
402 bool _isPositionLoaded;
405 uint _speechDuration;
410 int _markedAnimationIndex;
412 int _scheduledPalette;
417 int _mouseChangeTick;
419 bool _enableQuickHero;
421 bool _enableSpeedText;
435 #endif // DRACI_GAME_H
Definition: walking.h:103
Definition: animation.h:59
int getMarkedAnimationIndex() const
Definition: game.h:279
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