2009-03-20 16:33:58 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCUMM_SCRIPT_V0_H
|
|
|
|
#define SCUMM_SCRIPT_V0_H
|
|
|
|
|
|
|
|
#include "scumm/scumm_v2.h"
|
|
|
|
|
|
|
|
namespace Scumm {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Engine for Apple II and Commodore 64 versions of Maniac Mansion
|
|
|
|
*/
|
|
|
|
class ScummEngine_v0 : public ScummEngine_v2 {
|
2012-01-03 21:10:50 +00:00
|
|
|
protected:
|
2012-01-07 19:06:26 +00:00
|
|
|
enum CurrentMode {
|
|
|
|
kModeCutscene = 0, // cutscene active
|
|
|
|
kModeKeypad = 1, // kid selection / dial pad / save-load dialog
|
|
|
|
kModeNoNewKid = 2, // verb "new kid" disabled (e.g. when entering lab)
|
2012-02-04 10:18:14 +00:00
|
|
|
kModeNormal = 3 // normal playing mode
|
2012-01-07 19:06:26 +00:00
|
|
|
};
|
|
|
|
|
2012-01-22 22:13:58 +00:00
|
|
|
enum WalkToObjectState {
|
|
|
|
kWalkToObjectStateDone = 0,
|
|
|
|
kWalkToObjectStateWalk = 1,
|
2012-02-04 10:18:14 +00:00
|
|
|
kWalkToObjectStateTurn = 2
|
2012-01-22 22:13:58 +00:00
|
|
|
};
|
|
|
|
|
2009-03-20 16:33:58 +00:00
|
|
|
protected:
|
2009-07-25 06:27:41 +00:00
|
|
|
byte _currentMode;
|
2012-02-04 14:40:36 +00:00
|
|
|
byte _currentLights;
|
2009-07-25 06:27:41 +00:00
|
|
|
|
2012-01-15 20:43:21 +00:00
|
|
|
int _activeVerb; // selected verb
|
2012-01-16 21:32:46 +00:00
|
|
|
int _activeObject; // 1st selected object (see OBJECT_V0())
|
|
|
|
int _activeObject2; // 2nd selected object or actor (see OBJECT_V0())
|
2009-07-25 06:27:41 +00:00
|
|
|
|
2012-01-15 20:43:21 +00:00
|
|
|
int _cmdVerb; // script verb
|
2012-01-16 21:32:46 +00:00
|
|
|
int _cmdObject; // 1st script object (see OBJECT_V0())
|
|
|
|
int _cmdObject2; // 2nd script object or actor (see OBJECT_V0())
|
2012-01-22 22:20:27 +00:00
|
|
|
int _sentenceNestedCount;
|
2012-01-08 22:51:13 +00:00
|
|
|
|
|
|
|
int _walkToObject;
|
2012-01-22 22:13:58 +00:00
|
|
|
int _walkToObjectState;
|
2012-01-21 13:06:19 +00:00
|
|
|
bool _redrawSentenceLine;
|
2009-07-25 06:27:41 +00:00
|
|
|
|
2009-03-20 16:33:58 +00:00
|
|
|
public:
|
|
|
|
ScummEngine_v0(OSystem *syst, const DetectorResult &dr);
|
|
|
|
|
|
|
|
virtual void resetScumm();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
|
|
|
|
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
|
|
|
|
virtual void setupScummVars();
|
|
|
|
virtual void resetScummVars();
|
2010-09-18 14:18:48 +00:00
|
|
|
virtual void scummLoop(int delta);
|
2009-03-20 16:33:58 +00:00
|
|
|
virtual void decodeParseString();
|
|
|
|
|
|
|
|
virtual void processInput();
|
|
|
|
|
|
|
|
virtual void saveOrLoad(Serializer *s);
|
|
|
|
|
2012-02-10 21:58:59 +00:00
|
|
|
virtual bool objIsActor(int obj);
|
|
|
|
virtual int objToActor(int obj);
|
|
|
|
virtual int actorToObj(int actor);
|
|
|
|
|
2009-07-25 06:27:41 +00:00
|
|
|
// V0 MM Verb commands
|
2012-01-07 15:08:55 +00:00
|
|
|
int getVerbPrepId();
|
|
|
|
int activeVerbPrep();
|
2012-01-08 22:51:13 +00:00
|
|
|
void walkToActorOrObject(int object);
|
|
|
|
void verbExec();
|
2009-07-25 06:27:41 +00:00
|
|
|
|
2012-01-08 22:51:13 +00:00
|
|
|
virtual void runSentenceScript();
|
|
|
|
virtual void checkAndRunSentenceScript();
|
2012-01-22 22:13:58 +00:00
|
|
|
bool checkPendingWalkAction();
|
2012-01-10 22:17:40 +00:00
|
|
|
bool checkSentenceComplete();
|
2009-03-20 16:33:58 +00:00
|
|
|
virtual void checkExecVerbs();
|
|
|
|
virtual void handleMouseOver(bool updateInventory);
|
2012-01-07 15:08:55 +00:00
|
|
|
int verbPrepIdType(int verbid);
|
2009-03-20 16:33:58 +00:00
|
|
|
void resetVerbs();
|
2009-07-25 06:27:41 +00:00
|
|
|
|
2012-01-10 18:43:24 +00:00
|
|
|
void clearSentenceLine();
|
|
|
|
void flushSentenceLine();
|
2012-01-07 19:25:01 +00:00
|
|
|
void drawSentenceObject(int object);
|
2012-01-10 18:43:24 +00:00
|
|
|
void drawSentenceLine();
|
2009-03-20 16:33:58 +00:00
|
|
|
|
2012-01-21 22:05:16 +00:00
|
|
|
void setMode(byte mode);
|
|
|
|
|
2009-03-20 16:33:58 +00:00
|
|
|
void switchActor(int slot);
|
|
|
|
|
|
|
|
virtual int getVarOrDirectWord(byte mask);
|
|
|
|
virtual uint fetchScriptWord();
|
|
|
|
|
2009-04-20 12:35:17 +00:00
|
|
|
virtual int getActiveObject();
|
2009-03-20 16:33:58 +00:00
|
|
|
|
2012-02-13 02:38:11 +00:00
|
|
|
void resetSentence();
|
2009-03-20 16:33:58 +00:00
|
|
|
|
2011-05-25 13:56:31 +00:00
|
|
|
virtual bool areBoxesNeighbors(int box1nr, int box2nr);
|
2009-10-27 11:32:33 +00:00
|
|
|
|
2012-01-15 22:51:28 +00:00
|
|
|
bool ifEqualActiveObject2Common(bool checkType);
|
2012-01-03 21:10:50 +00:00
|
|
|
|
2012-02-04 14:40:36 +00:00
|
|
|
virtual int getCurrentLights() const;
|
|
|
|
|
2012-02-04 17:34:08 +00:00
|
|
|
/* Version 0 script opcodes */
|
2009-03-20 16:33:58 +00:00
|
|
|
void o_stopCurrentScript();
|
2012-01-17 23:04:03 +00:00
|
|
|
void o_walkActorToObject();
|
2009-03-20 16:33:58 +00:00
|
|
|
void o_loadSound();
|
|
|
|
void o_getActorMoving();
|
|
|
|
void o_animateActor();
|
|
|
|
void o_putActorAtObject();
|
|
|
|
void o_pickupObject();
|
|
|
|
void o_setObjectName();
|
|
|
|
void o_lockSound();
|
|
|
|
void o_lockCostume();
|
|
|
|
void o_loadCostume();
|
|
|
|
void o_loadRoom();
|
|
|
|
void o_loadRoomWithEgo();
|
|
|
|
void o_lockScript();
|
|
|
|
void o_loadScript();
|
|
|
|
void o_lockRoom();
|
2012-01-21 22:05:16 +00:00
|
|
|
void o_setMode();
|
2009-03-20 16:33:58 +00:00
|
|
|
void o_lights();
|
|
|
|
void o_unlockCostume();
|
|
|
|
void o_unlockScript();
|
|
|
|
void o_decrement();
|
|
|
|
void o_nop();
|
2012-01-08 22:51:13 +00:00
|
|
|
void o_getObjectOwner();
|
2009-03-20 16:33:58 +00:00
|
|
|
void o_getActorBitVar();
|
|
|
|
void o_setActorBitVar();
|
|
|
|
void o_getBitVar();
|
|
|
|
void o_setBitVar();
|
|
|
|
void o_doSentence();
|
2012-01-03 21:10:50 +00:00
|
|
|
void o_ifEqualActiveObject2();
|
|
|
|
void o_ifNotEqualActiveObject2();
|
2012-01-22 21:58:10 +00:00
|
|
|
void o_getClosestActor();
|
2012-02-04 17:34:08 +00:00
|
|
|
void o_printEgo();
|
|
|
|
void o_print();
|
2009-03-20 16:33:58 +00:00
|
|
|
void o_unlockRoom();
|
|
|
|
void o_unlockSound();
|
|
|
|
void o_cutscene();
|
|
|
|
void o_endCutscene();
|
|
|
|
void o_setOwnerOf();
|
2010-09-18 14:18:48 +00:00
|
|
|
|
2012-01-09 22:21:08 +00:00
|
|
|
byte VAR_ACTIVE_OBJECT2;
|
2010-09-18 14:18:48 +00:00
|
|
|
byte VAR_IS_SOUND_RUNNING;
|
|
|
|
byte VAR_ACTIVE_VERB;
|
2009-03-20 16:33:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // End of namespace Scumm
|
|
|
|
|
|
|
|
#endif
|