2011-02-23 11:37:16 +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 TSAGE_RINGWORLD_LOGIC_H
|
|
|
|
#define TSAGE_RINGWORLD_LOGIC_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "tsage/events.h"
|
|
|
|
#include "tsage/core.h"
|
|
|
|
#include "tsage/scenes.h"
|
|
|
|
#include "tsage/globals.h"
|
|
|
|
|
2011-08-15 10:47:59 +00:00
|
|
|
namespace TsAGE {
|
2011-08-15 09:26:15 +00:00
|
|
|
|
|
|
|
namespace Ringworld {
|
2011-08-14 10:18:32 +00:00
|
|
|
|
2011-08-15 10:47:59 +00:00
|
|
|
using namespace TsAGE;
|
2011-02-23 11:37:16 +00:00
|
|
|
|
|
|
|
class SceneFactory {
|
|
|
|
public:
|
|
|
|
static Scene *createScene(int sceneNumber);
|
|
|
|
};
|
|
|
|
|
2011-04-13 19:27:46 +00:00
|
|
|
class DisplayHotspot : public SceneObject {
|
2011-02-23 11:37:16 +00:00
|
|
|
private:
|
|
|
|
Common::Array<int> _actions;
|
|
|
|
bool performAction(int action);
|
|
|
|
public:
|
|
|
|
DisplayHotspot(int regionId, ...);
|
|
|
|
|
2011-04-13 19:27:46 +00:00
|
|
|
virtual void doAction(int action) {
|
2011-02-23 11:37:16 +00:00
|
|
|
if (!performAction(action))
|
|
|
|
SceneHotspot::doAction(action);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-04-13 19:27:46 +00:00
|
|
|
class DisplayObject : public SceneObject {
|
2011-02-23 11:37:16 +00:00
|
|
|
private:
|
|
|
|
Common::Array<int> _actions;
|
|
|
|
bool performAction(int action);
|
|
|
|
public:
|
|
|
|
DisplayObject(int firstAction, ...);
|
|
|
|
|
2011-04-13 19:27:46 +00:00
|
|
|
virtual void doAction(int action) {
|
2011-02-23 11:37:16 +00:00
|
|
|
if (!performAction(action))
|
|
|
|
SceneHotspot::doAction(action);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-08-26 09:07:43 +00:00
|
|
|
class SceneObjectExt : public SceneObject {
|
|
|
|
public:
|
|
|
|
int _state;
|
|
|
|
|
|
|
|
virtual void synchronize(Serializer &s) {
|
|
|
|
SceneObject::synchronize(s);
|
|
|
|
s.syncAsSint16LE(_state);
|
|
|
|
}
|
|
|
|
virtual Common::String getClassName() { return "SceneObjectExt"; }
|
|
|
|
};
|
|
|
|
|
2011-04-13 19:27:46 +00:00
|
|
|
class SceneArea : public SavedObject {
|
2011-03-07 11:04:39 +00:00
|
|
|
public:
|
|
|
|
GfxSurface _surface;
|
|
|
|
GfxSurface *_savedArea;
|
|
|
|
Common::Point _pt;
|
|
|
|
int _resNum;
|
|
|
|
int _rlbNum;
|
|
|
|
int _subNum;
|
|
|
|
int _actionId;
|
|
|
|
Rect _bounds;
|
|
|
|
public:
|
|
|
|
SceneArea();
|
|
|
|
~SceneArea();
|
|
|
|
|
|
|
|
void setup(int resNum, int rlbNum, int subNum, int actionId);
|
|
|
|
void draw2();
|
|
|
|
void display();
|
|
|
|
void restore();
|
|
|
|
|
2011-05-04 08:41:47 +00:00
|
|
|
virtual void synchronize(Serializer &s);
|
2011-03-07 11:04:39 +00:00
|
|
|
virtual void draw(bool flag);
|
|
|
|
virtual void wait();
|
|
|
|
};
|
|
|
|
|
2011-04-25 09:39:45 +00:00
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
class RingworldInvObjectList : public InvObjectList {
|
|
|
|
public:
|
|
|
|
InvObject _stunner;
|
|
|
|
InvObject _scanner;
|
|
|
|
InvObject _stasisBox;
|
|
|
|
InvObject _infoDisk;
|
|
|
|
InvObject _stasisNegator;
|
|
|
|
InvObject _keyDevice;
|
|
|
|
InvObject _medkit;
|
|
|
|
InvObject _ladder;
|
|
|
|
InvObject _rope;
|
|
|
|
InvObject _key;
|
|
|
|
InvObject _translator;
|
|
|
|
InvObject _ale;
|
|
|
|
InvObject _paper;
|
|
|
|
InvObject _waldos;
|
|
|
|
InvObject _stasisBox2;
|
|
|
|
InvObject _ring;
|
|
|
|
InvObject _cloak;
|
|
|
|
InvObject _tunic;
|
|
|
|
InvObject _candle;
|
|
|
|
InvObject _straw;
|
|
|
|
InvObject _scimitar;
|
|
|
|
InvObject _sword;
|
|
|
|
InvObject _helmet;
|
|
|
|
InvObject _items;
|
|
|
|
InvObject _concentrator;
|
|
|
|
InvObject _nullifier;
|
|
|
|
InvObject _peg;
|
|
|
|
InvObject _vial;
|
|
|
|
InvObject _jacket;
|
|
|
|
InvObject _tunic2;
|
|
|
|
InvObject _bone;
|
|
|
|
InvObject _jar;
|
|
|
|
InvObject _emptyJar;
|
|
|
|
public:
|
|
|
|
RingworldInvObjectList();
|
|
|
|
|
|
|
|
virtual Common::String getClassName() { return "RingworldInvObjectList"; }
|
|
|
|
};
|
|
|
|
|
2011-10-02 08:59:13 +00:00
|
|
|
#define RING_INVENTORY (*((::TsAGE::Ringworld::RingworldInvObjectList *)g_globals->_inventory))
|
2011-04-25 09:39:45 +00:00
|
|
|
|
|
|
|
class RingworldGame: public Game {
|
|
|
|
public:
|
|
|
|
virtual void start();
|
|
|
|
virtual void restart();
|
|
|
|
virtual void endGame(int resNum, int lineNum);
|
2011-05-14 08:20:56 +00:00
|
|
|
|
|
|
|
virtual Scene *createScene(int sceneNumber);
|
2011-05-16 11:09:05 +00:00
|
|
|
virtual void processEvent(Event &event);
|
2011-08-29 12:01:11 +00:00
|
|
|
virtual void rightClick();
|
2011-04-25 09:39:45 +00:00
|
|
|
};
|
|
|
|
|
2011-08-15 09:26:15 +00:00
|
|
|
} // End of namespace Ringworld
|
|
|
|
|
2011-08-15 10:47:59 +00:00
|
|
|
} // End of namespace TsAGE
|
2011-02-23 11:37:16 +00:00
|
|
|
|
|
|
|
#endif
|