25 #include "common/str-array.h" 26 #include "common/util.h" 27 #include "queen/structs.h" 31 enum RoomDisplayMode {
46 JSO_OBJECT_DESCRIPTION = 0,
67 uint16 currentRoom()
const {
return _currentRoom; }
68 void currentRoom(uint16 room) {
73 uint16 oldRoom()
const {
return _oldRoom; }
74 void oldRoom(uint16 room) {
79 uint16 newRoom()
const {
return _newRoom; }
80 void newRoom(uint16 room) {
85 ObjectData *objectData(
int index)
const {
return &_objectData[index]; }
86 uint16 roomData(
int room)
const {
return _roomData[room]; }
87 GraphicData *graphicData(
int index)
const {
return &_graphicData[index]; }
89 uint16 itemDataCount()
const {
return _numItems; }
91 uint16 findBob(uint16 obj)
const;
92 uint16 findFrame(uint16 obj)
const;
93 uint16 objectForPerson(uint16 bobnum)
const;
94 WalkOffData *walkOffPointForObject(int16 obj)
const;
96 uint16 walkOffCount()
const {
return _numWalkOffs; }
98 uint16 currentRoomData()
const {
return _roomData[_currentRoom]; }
99 GraphicAnim *graphicAnim(
int index)
const {
return &_graphicAnim[index]; }
100 uint16 graphicAnimCount()
const {
return _numGraphicAnim; }
101 ObjectDescription *objectDescription(uint16 objNum)
const {
return &_objectDescription[objNum]; }
102 uint16 objectDescriptionCount()
const {
return _numObjDesc; }
103 uint16 currentRoomSfx()
const {
return _sfxName[_currentRoom]; }
105 uint16 joeFacing()
const {
return _joe.facing; }
106 uint16 joeX()
const {
return _joe.x; }
107 uint16 joeY()
const {
return _joe.y; }
108 JoeWalkMode joeWalk()
const {
return _joe.walk; }
109 uint16 joeScale()
const {
return _joe.scale; }
110 uint16 joeCutFacing()
const {
return _joe.cutFacing; }
111 uint16 joePrevFacing()
const {
return _joe.prevFacing; }
113 void joeFacing(uint16 dir) { _joe.facing = dir; }
114 void joePos(uint16 x, uint16 y) { _joe.x = x; _joe.y = y; }
115 void joeWalk(JoeWalkMode walking);
116 void joeScale(uint16 scale) { _joe.scale = scale; }
117 void joeCutFacing(uint16 dir) { _joe.cutFacing = dir; }
118 void joePrevFacing(uint16 dir) { _joe.prevFacing = dir; }
120 int16 gameState(
int index)
const;
121 void gameState(
int index, int16 newValue);
123 TalkSelected *talkSelected(
int index) {
return &_talkSelected[index]; }
125 const char *roomName(uint16 roomNum)
const;
126 const char *objectName(uint16 objNum)
const;
127 const char *objectTextualDescription(uint16 objNum)
const;
128 const char *joeResponse(
int i)
const;
129 const char *verbName(Verb v)
const;
130 const char *actorAnim(
int num)
const;
131 const char *actorName(
int num)
const;
132 const char *actorFile(
int num)
const;
135 void setupRoom(
const char *room,
int comPanel,
bool inCutaway);
136 void displayRoom(uint16 room, RoomDisplayMode mode, uint16 joeScale,
int comPanel,
bool inCutaway);
138 int16 entryObj()
const {
return _entryObj; }
139 void entryObj(int16 obj) {
_entryObj = obj; }
141 ActorData *findActor(uint16 noun,
const char *name = NULL)
const;
142 bool initPerson(uint16 noun,
const char *actorName,
bool loadBank,
Person *pp);
143 uint16 findPersonNumber(uint16 obj, uint16 room)
const;
146 void loadJoeBanks(
const char *animBank,
const char *standBank);
155 void joeGrab(int16 grabState);
166 void makeJoeSpeak(uint16 descNum,
bool objectType =
false);
167 void makePersonSpeak(
const char *sentence,
Person *person,
const char *voiceFilePrefix);
170 void startDialogue(
const char *dlgFile,
int personInRoom,
char *cutaway);
173 void playCutaway(
const char *cutFile,
char *next = NULL);
183 int16 previousInventoryItem(int16 first)
const;
184 int16 nextInventoryItem(int16 first)
const;
185 void removeDuplicateItems();
186 uint16 numItemsInventory()
const;
187 void inventoryInsertItem(uint16 itemNum,
bool refresh =
true);
188 void inventoryDeleteItem(uint16 itemNum,
bool refresh =
true);
189 void inventoryScroll(uint16 count,
bool up);
190 void removeHotelItemsFromInventory();
193 void objectCopy(
int dummyObjectIndex,
int objectIndex);
203 void saveState(byte *&ptr);
204 void loadState(uint32 ver, byte *&ptr);
226 void startCredits(
const char *filename);
232 JOE_RESPONSE_MAX = 40,
233 DEFAULT_TALK_SPEED = 7 * 3,
234 GAME_STATE_COUNT = 211,
235 TALK_SELECTED_COUNT = 86
238 typedef void (
Logic::*SpecialMoveProc)();
244 void asmMakeJoeUseDress();
245 void asmMakeJoeUseNormalClothes();
246 void asmMakeJoeUseUnderwear();
247 void asmSwitchToDressPalette();
248 void asmSwitchToNormalPalette();
249 void asmStartCarAnimation();
250 void asmStopCarAnimation();
251 void asmStartFightAnimation();
252 void asmWaitForFrankPosition();
253 void asmMakeFrankGrowing();
254 void asmMakeRobotGrowing();
255 void asmShrinkRobot();
257 void asmPutCameraOnDino();
258 void asmPutCameraOnJoe();
259 void asmAltIntroPanRight();
260 void asmAltIntroPanLeft();
261 void asmSetAzuraInLove();
262 void asmPanRightFromJoe();
263 void asmSetLightsOff();
264 void asmSetLightsOn();
265 void asmSetManequinAreaOn();
267 void asmTurnGuardOn();
268 void asmPanLeft320To144();
270 void asmSmoochNoScroll();
271 void asmMakeLightningHitPlane();
272 void asmScaleBlimp();
273 void asmScaleEnding();
274 void asmWaitForCarPosition();
275 void asmShakeScreen();
276 void asmAttemptPuzzle();
277 void asmScaleTitle();
278 void asmScrollTitle();
279 void asmPanRightToHugh();
280 void asmMakeWhiteFlash();
281 void asmPanRightToJoeAndRita();
282 void asmPanLeftToBomb();
284 void asmInterviewIntro();
285 void asmEndInterview();
287 virtual bool changeToSpecialRoom() = 0;
288 virtual void setupSpecialMoveTable() = 0;
328 uint16 _numFurniture;
331 uint16 _numGraphicAnim;
337 int _jasStringOffset[JSO_COUNT];
339 uint16 _numDescriptions;
347 uint16 facing, cutFacing, prevFacing;
352 int16 _gameState[GAME_STATE_COUNT];
365 SpecialMoveProc _specialMoves[40];
381 bool changeToSpecialRoom()
override;
382 void setupSpecialMoveTable()
override;
393 bool changeToSpecialRoom()
override;
394 void setupSpecialMoveTable()
override;
405 bool changeToSpecialRoom()
override;
406 void setupSpecialMoveTable()
override;
Definition: structs.h:543
uint8 _puzzleAttemptCount
puzzle counter for room T7
Definition: logic.h:360
WalkOffData * _walkOffData
walk off point for an object
Definition: logic.h:324
void handleSpecialArea(Direction facing, uint16 areaNum, uint16 walkDataNum)
handle a particular event when Joe walks on this area
uint16 _numRooms
total number of room in game
Definition: logic.h:296
void sceneReset()
ugly hack from original code
Definition: logic.h:210
Definition: structs.h:524
int16 _inventoryItem[4]
inventory items
Definition: logic.h:357
Box * _objectBox
bounding box of object
Definition: logic.h:305
Definition: structs.h:345
Definition: structs.h:265
virtual void useJournal()=0
enter the Journal (save/load, configuration)
void setupRestoredGame()
called after a save state has been loaded
Definition: structs.h:495
void objectCopy(int dummyObjectIndex, int objectIndex)
copy data from dummy object to object
void playCutaway(const char *cutFile, char *next=NULL)
play the specified cutaway
int16 _entryObj
actor initial position in room is _walkOffData[_entryObj]
Definition: logic.h:334
void joeUseDress(bool showCut)
change Joe clothes to dress
Definition: structs.h:315
void joeUseClothes(bool showCut)
restore Joe clothes
uint16 * _sfxName
background music to play in room
Definition: logic.h:302
void joeUseUnderwear()
change Joe clothes to underwear
void setupJoe()
load the various bobs needed to animate Joe
Definition: structs.h:147
Definition: structs.h:127
uint16 * _roomData
first object number in room
Definition: logic.h:299
ItemData * _itemData
inventory items
Definition: logic.h:308
void inventoryRefresh()
refresh inventory contents
void executeSpecialMove(uint16 sm)
execute a special move
void startDialogue(const char *dlgFile, int personInRoom, char *cutaway)
start the specified dialogue
void handlePinnacleRoom()
handle the pinnacle room (== room chooser in the jungle)
void inventorySetup()
initialize the inventory
Definition: structs.h:555
void sceneStop()
stop making a scene
Definition: structs.h:185
void setupJoeInRoom(bool autoPosition, uint16 scale)
setup Joe at the right place when entering a room
void loadJoeBanks(const char *animBank, const char *standBank)
load banks used for Joe animation
void sceneStart()
make a scene
int _scene
cutscene counter
Definition: logic.h:363
uint16 findInventoryItem(int invSlot) const
get the inventory item for the specified inventory slot