2015-01-11 15:43:02 +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 XEEN_SCRIPTS_H
|
|
|
|
#define XEEN_SCRIPTS_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/system.h"
|
2015-01-11 19:21:57 +00:00
|
|
|
#include "common/serializer.h"
|
2015-01-24 02:25:58 +00:00
|
|
|
#include "common/stack.h"
|
2015-01-22 01:42:44 +00:00
|
|
|
#include "common/str-array.h"
|
2015-01-11 19:21:57 +00:00
|
|
|
#include "xeen/files.h"
|
2015-01-25 04:12:30 +00:00
|
|
|
#include "xeen/party.h"
|
2015-01-11 15:43:02 +00:00
|
|
|
|
|
|
|
namespace Xeen {
|
|
|
|
|
|
|
|
enum Opcode {
|
2017-12-18 23:10:50 +00:00
|
|
|
OP_None = 0x00,
|
|
|
|
OP_Display0x01 = 0x01,
|
|
|
|
OP_DoorTextSml = 0x02,
|
|
|
|
OP_DoorTextLrg = 0x03,
|
|
|
|
OP_SignText = 0x04,
|
|
|
|
OP_NPC = 0x05,
|
|
|
|
OP_PlayFX = 0x06,
|
|
|
|
OP_TeleportAndExit = 0x07,
|
|
|
|
OP_If1 = 0x08,
|
|
|
|
OP_If2 = 0x09,
|
|
|
|
OP_If3 = 0x0A,
|
|
|
|
OP_MoveObj = 0x0B,
|
|
|
|
OP_TakeOrGive = 0x0C,
|
|
|
|
OP_NoAction = 0x0D,
|
|
|
|
OP_Remove = 0x0E,
|
|
|
|
OP_SetChar = 0x0F,
|
|
|
|
OP_Spawn = 0x10,
|
|
|
|
OP_DoTownEvent = 0x11,
|
|
|
|
OP_Exit = 0x12,
|
|
|
|
OP_AfterMap = 0x13,
|
2017-12-29 21:08:11 +00:00
|
|
|
OP_GiveMulti = 0x14,
|
2017-12-18 23:10:50 +00:00
|
|
|
OP_ConfirmWord = 0x15,
|
|
|
|
OP_Damage = 0x16,
|
|
|
|
OP_JumpRnd = 0x17,
|
|
|
|
OP_AfterEvent = 0x18,
|
|
|
|
OP_CallEvent = 0x19,
|
|
|
|
OP_Return = 0x1A,
|
|
|
|
OP_SetVar = 0x1B,
|
|
|
|
OP_TakeOrGive_2 = 0x1C,
|
|
|
|
OP_TakeOrGive_3 = 0x1D,
|
|
|
|
OP_CutsceneEndClouds = 0x1E,
|
|
|
|
OP_TeleportAndContinue = 0x1F,
|
|
|
|
OP_WhoWill = 0x20,
|
|
|
|
OP_RndDamage = 0x21,
|
|
|
|
OP_MoveWallObj = 0x22,
|
|
|
|
OP_AlterCellFlag = 0x23,
|
|
|
|
OP_AlterHed = 0x24,
|
|
|
|
OP_DisplayStat = 0x25,
|
|
|
|
OP_TakeOrGive_4 = 0x26,
|
|
|
|
OP_SeatTextSml = 0x27,
|
|
|
|
OP_PlayEventVoc = 0x28,
|
|
|
|
OP_DisplayBottom = 0x29,
|
|
|
|
OP_IfMapFlag = 0x2A,
|
|
|
|
OP_SelectRandomChar = 0x2B,
|
|
|
|
OP_GiveEnchanted = 0x2C,
|
|
|
|
OP_ItemType = 0x2D,
|
|
|
|
OP_MakeNothingHere = 0x2E,
|
|
|
|
OP_NoAction_2 = 0x2F,
|
|
|
|
OP_ChooseNumeric = 0x30,
|
2015-01-11 15:43:02 +00:00
|
|
|
OP_DisplayBottomTwoLines = 0x31,
|
2017-12-18 23:10:50 +00:00
|
|
|
OP_DisplayLarge = 0x32,
|
|
|
|
OP_ExchObj = 0x33,
|
|
|
|
OP_FallToMap = 0x34,
|
|
|
|
OP_DisplayMain = 0x35,
|
|
|
|
OP_Goto = 0x36,
|
|
|
|
OP_ConfirmWord_2 = 0x37,
|
|
|
|
OP_GotoRandom = 0x38,
|
|
|
|
OP_CutsceneEndDarkside = 0x39,
|
|
|
|
OP_CutsceneEdWorld = 0x3A,
|
|
|
|
OP_FlipWorld = 0x3B,
|
|
|
|
OP_PlayCD = 0x3C
|
2015-01-11 15:43:02 +00:00
|
|
|
};
|
|
|
|
|
2018-02-23 23:26:23 +00:00
|
|
|
enum {
|
|
|
|
SCRIPT_ABORT = -1,
|
|
|
|
SCRIPT_RESET = -2
|
|
|
|
};
|
|
|
|
|
2015-01-19 16:32:57 +00:00
|
|
|
class XeenEngine;
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Encapsulates the parameters passed to script opcodes
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
class EventParameters : public Common::Array<byte> {
|
|
|
|
public:
|
|
|
|
class Iterator {
|
|
|
|
private:
|
|
|
|
uint _index;
|
|
|
|
const EventParameters &_data;
|
|
|
|
public:
|
|
|
|
Iterator(const EventParameters &owner) : _data(owner), _index(0) {}
|
|
|
|
Iterator(const Iterator &it) : _data(it._data), _index(0) {}
|
|
|
|
|
|
|
|
/**
|
2017-12-18 23:10:50 +00:00
|
|
|
* Return a byte
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
byte readByte();
|
|
|
|
|
|
|
|
/**
|
2017-12-18 23:10:50 +00:00
|
|
|
* Return a signed byte
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
int8 readShort() { return (int8)readByte(); }
|
|
|
|
|
|
|
|
/**
|
2017-12-18 23:10:50 +00:00
|
|
|
* Return a word
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
uint16 readUint16LE();
|
|
|
|
|
|
|
|
/**
|
2017-12-18 23:10:50 +00:00
|
|
|
* Return a 32-bit dword
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
uint32 readUint32LE();
|
|
|
|
};
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Return an iterator for getting parameters
|
|
|
|
*/
|
|
|
|
Iterator getIterator() const {
|
|
|
|
return Iterator(*this);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Represents a single event, an instruction of a script
|
|
|
|
*/
|
2015-01-11 15:43:02 +00:00
|
|
|
class MazeEvent {
|
|
|
|
public:
|
|
|
|
Common::Point _position;
|
|
|
|
int _direction;
|
|
|
|
int _line;
|
|
|
|
Opcode _opcode;
|
2017-11-22 02:36:19 +00:00
|
|
|
EventParameters _parameters;
|
2015-01-11 15:43:02 +00:00
|
|
|
public:
|
|
|
|
MazeEvent();
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Synchronizes the data for the item
|
|
|
|
*/
|
2015-01-11 19:21:57 +00:00
|
|
|
void synchronize(Common::Serializer &s);
|
2015-01-11 15:43:02 +00:00
|
|
|
};
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Represents an entire script that can be triggered within the maze
|
|
|
|
*/
|
2015-01-11 15:43:02 +00:00
|
|
|
class MazeEvents : public Common::Array<MazeEvent> {
|
|
|
|
public:
|
2015-01-22 01:42:44 +00:00
|
|
|
Common::StringArray _text;
|
2015-01-11 15:43:02 +00:00
|
|
|
public:
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Synchronizes the data for the item
|
|
|
|
*/
|
2015-01-11 19:21:57 +00:00
|
|
|
void synchronize(XeenSerializer &s);
|
2015-01-11 15:43:02 +00:00
|
|
|
};
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Holds a single entry in the stack of subroutine call return points
|
|
|
|
*/
|
2015-01-24 02:25:58 +00:00
|
|
|
struct StackEntry : public Common::Point {
|
|
|
|
int line;
|
|
|
|
|
|
|
|
StackEntry(const Common::Point &pt, int l) : Common::Point(pt), line(l) {}
|
|
|
|
};
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Holds a single destination that the mirror can send the player to
|
|
|
|
*/
|
2015-01-25 04:12:30 +00:00
|
|
|
struct MirrorEntry {
|
|
|
|
Common::String _name;
|
|
|
|
int _mapId;
|
|
|
|
Common::Point _position;
|
|
|
|
int _direction;
|
|
|
|
|
|
|
|
MirrorEntry() : _mapId(0), _direction(DIR_ALL) {}
|
2016-10-09 12:59:58 +00:00
|
|
|
|
2015-01-25 04:12:30 +00:00
|
|
|
bool synchronize(Common::SeekableReadStream &s);
|
|
|
|
};
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Overall scripts manager
|
|
|
|
*/
|
2015-01-19 16:32:57 +00:00
|
|
|
class Scripts {
|
|
|
|
private:
|
|
|
|
XeenEngine *_vm;
|
2015-01-22 01:42:44 +00:00
|
|
|
int _treasureItems;
|
2015-01-22 02:51:45 +00:00
|
|
|
int _lineNum;
|
2015-01-23 03:05:36 +00:00
|
|
|
int _charIndex;
|
2015-01-25 04:12:30 +00:00
|
|
|
int _mirrorId;
|
2015-01-25 14:01:21 +00:00
|
|
|
int _refreshIcons;
|
2015-01-26 02:19:59 +00:00
|
|
|
int _scriptResult;
|
|
|
|
bool _scriptExecuted;
|
2018-02-23 23:26:23 +00:00
|
|
|
bool _dirFlag;
|
2015-03-03 02:39:49 +00:00
|
|
|
int _windowIndex;
|
|
|
|
bool _redrawDone;
|
2015-01-22 12:53:33 +00:00
|
|
|
MazeEvent *_event;
|
2015-01-24 02:25:58 +00:00
|
|
|
Common::Point _currentPos;
|
|
|
|
Common::Stack<StackEntry> _stack;
|
2015-03-03 02:39:49 +00:00
|
|
|
Common::String _displayMessage;
|
2015-01-22 01:42:44 +00:00
|
|
|
|
2017-11-22 02:36:19 +00:00
|
|
|
typedef EventParameters::Iterator ParamsIterator;
|
|
|
|
|
2016-08-28 21:52:56 +00:00
|
|
|
/**
|
|
|
|
* Handles executing a given script command
|
|
|
|
*/
|
2017-11-19 18:31:15 +00:00
|
|
|
bool doOpcode(MazeEvent &event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Do nothing
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDoNothing(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Display a msesage on-screen
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDisplay1(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a door text message using the small font
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDoorTextSml(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a door text message using the large font
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDoorTextLrg(ParamsIterator ¶ms);
|
2016-10-09 12:59:58 +00:00
|
|
|
|
2016-08-28 21:52:56 +00:00
|
|
|
/**
|
|
|
|
* Show a sign text on-screen
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdSignText(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Show an NPC interaction message
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdNPC(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Play a sound FX
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdPlayFX(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles teleportation
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdTeleport(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Do a conditional check
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdIf(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the position of an object
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdMoveObj(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Take or give amounts from various character or party figures
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdTakeOrGive(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-19 18:31:15 +00:00
|
|
|
* Removes an object from the playfield
|
2016-08-28 21:52:56 +00:00
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdRemove(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the currently active character for other script operations
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdSetChar(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Spawn a monster
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdSpawn(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Does various things that can be done within towns, like visiting
|
|
|
|
* banks, guilds, etc.
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDoTownEvent(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stop executing the script
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdExit(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Changes the value for the wall on a given cell
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdAlterMap(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
2017-12-29 21:08:11 +00:00
|
|
|
* Gives up to three different item/amounts to various character and/or party properties
|
2017-11-19 18:31:15 +00:00
|
|
|
*/
|
2017-12-29 21:08:11 +00:00
|
|
|
bool cmdGiveMulti(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-25 23:09:03 +00:00
|
|
|
* Prompts the user to enter a word for passwords or mirror
|
|
|
|
* teleport destinations
|
2017-11-19 18:31:15 +00:00
|
|
|
*/
|
2017-11-25 23:09:03 +00:00
|
|
|
bool cmdConfirmWord(ParamsIterator ¶ms);
|
2017-11-19 18:31:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Deals damage to a character
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDamage(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Jump if a random number matches a given value
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdJumpRnd(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Alter an existing event
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdAlterEvent(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stores the current location and line for later resuming, and set up to execute
|
|
|
|
* a script at a given location
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdCallEvent(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return from executing a script to the script location that previously
|
|
|
|
* called the script
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdReturn(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets variables on characters like race, sex, and class
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdSetVar(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Play the Clouds endgame
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdCutsceneEndClouds(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Prompts the user for which character will do an action
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdWhoWill(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Deals a random amount of damage to a character
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdRndDamage(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the wall object to the given coordinates. Doesn't change it's orientation.
|
|
|
|
* Wall objects are only visible when viewed straight on, and were never intended
|
|
|
|
* to be anywhere but on squares directly facing walls
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdMoveWallObj(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the cell flag at the specified X/Y coordinate on the current map
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdAlterCellFlag(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the word value at the current X/Y location in the HED file
|
|
|
|
* in memory to the given two bytes
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdAlterHed(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a text string which includes some stat of the currently selected character
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDisplayStat(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays text in the scene window for various objects
|
|
|
|
* the user interacts with
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdSignTextSml(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An array of six VOC filenames are hard-coded into the game executable file.
|
|
|
|
* This function plays the VOC file at the specified index in this array
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdPlayEventVoc(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a large text message across the bottom of the screen
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDisplayBottom(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if a given map flag/monster has been set, and if so
|
|
|
|
* jumps to a given line
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdIfMapFlag(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Selects a random character for further other actions
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdSelectRandomChar(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gives an enchanted item to a character
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdGiveEnchanted(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the item category for used in character operations
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdItemType(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Disable all the scripts at the party's current position
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdMakeNothingHere(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Does a copy protection check
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdCheckProtection(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Given a number of options, and a list of line numbers associated with
|
|
|
|
* those options, jumps to whichever line for the option the user selects
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdChooseNumeric(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a two line message at the bottom of the screen
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDisplayBottomTwoLines(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a message
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDisplayLarge(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exchange the positions of two objects in the maze
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdExchObj(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles making the player fall down to the ground
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdFallToMap(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays a message
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdDisplayMain(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Jumps to a given line number if the surface at relative cell position 1 matches
|
|
|
|
* a specified surface.
|
|
|
|
* @remarks This opcode is apparently never actually used
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdGoto(ParamsIterator ¶ms);
|
2016-08-28 21:52:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Pick a random value from the parameter list and jump to that line number
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdGotoRandom(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plays the Dark Side of Xeen ending
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdCutsceneEndDarkside(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plays the World of Xeen ending
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdCutsceneEndWorld(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Switches the player between the Clouds and Dark Side
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdFlipWorld(ParamsIterator ¶ms);
|
2017-11-19 20:25:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plays a CD track
|
|
|
|
*/
|
2017-11-22 02:36:19 +00:00
|
|
|
bool cmdPlayCD(ParamsIterator ¶ms);
|
2015-01-24 01:44:02 +00:00
|
|
|
|
|
|
|
int whoWill(int v1, int v2, int v3);
|
|
|
|
|
2017-12-19 00:32:08 +00:00
|
|
|
/**
|
|
|
|
* Do the Clouds of Xeen ending
|
|
|
|
*/
|
|
|
|
void doCloudsEnding();
|
2015-01-24 01:44:02 +00:00
|
|
|
|
2017-12-19 00:32:08 +00:00
|
|
|
/**
|
|
|
|
* Do the Dark Side of Xeen ending
|
|
|
|
*/
|
|
|
|
void doDarkSideEnding();
|
2015-01-24 01:44:02 +00:00
|
|
|
|
2017-12-19 00:32:08 +00:00
|
|
|
/**
|
|
|
|
* Do the World of Xeen combined ending
|
2015-01-24 01:44:02 +00:00
|
|
|
|
2017-12-19 00:32:08 +00:00
|
|
|
*/
|
|
|
|
void doWorldEnding();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Triggers an ending sequence
|
|
|
|
*/
|
|
|
|
void doEnding(const Common::String &endStr);
|
2015-01-24 04:47:05 +00:00
|
|
|
|
2016-08-28 21:52:56 +00:00
|
|
|
/**
|
|
|
|
* This monstrosity handles doing the various types of If checks on various data
|
|
|
|
*/
|
2017-11-24 02:34:13 +00:00
|
|
|
bool ifProc(int action, uint32 val, int mode, int charIndex);
|
2015-01-25 00:38:58 +00:00
|
|
|
|
2017-11-19 20:25:12 +00:00
|
|
|
/**
|
|
|
|
* Prompts the user for a copy protection check
|
|
|
|
*/
|
2015-01-25 00:38:58 +00:00
|
|
|
bool copyProtectionCheck();
|
2015-03-03 02:39:49 +00:00
|
|
|
|
2017-11-19 20:25:12 +00:00
|
|
|
/**
|
|
|
|
* Displays a message
|
|
|
|
*/
|
2015-03-03 02:39:49 +00:00
|
|
|
void display(bool justifyFlag, int var46);
|
2018-05-05 21:14:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert a CD time from the World of Xeen playCD opcodes to ScummVM CD frame number (which is at 75Hz)
|
|
|
|
*/
|
|
|
|
uint convertCDTime(uint srcTime);
|
2015-01-22 01:42:44 +00:00
|
|
|
public:
|
|
|
|
int _animCounter;
|
|
|
|
bool _eventSkipped;
|
2015-01-23 03:05:36 +00:00
|
|
|
int _whoWill;
|
2017-11-12 01:25:20 +00:00
|
|
|
DamageType _nEdamageType;
|
2015-02-07 01:57:01 +00:00
|
|
|
int _itemType;
|
2015-01-25 04:12:30 +00:00
|
|
|
Common::Array<MirrorEntry> _mirror;
|
2018-04-03 01:06:01 +00:00
|
|
|
Common::String _message;
|
2015-01-19 16:32:57 +00:00
|
|
|
public:
|
|
|
|
Scripts(XeenEngine *vm);
|
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Checks the event list, triggering any scripts as needed. Also does a
|
|
|
|
* series of checks for updating party status
|
|
|
|
*/
|
2015-02-10 01:57:19 +00:00
|
|
|
int checkEvents();
|
2015-01-19 16:32:57 +00:00
|
|
|
|
2017-12-18 23:10:50 +00:00
|
|
|
/**
|
|
|
|
* Handles opening grates
|
2018-03-20 01:25:59 +00:00
|
|
|
* @returns If true, no further event checking should be done
|
2017-12-18 23:10:50 +00:00
|
|
|
*/
|
2018-03-20 01:25:59 +00:00
|
|
|
bool openGrate(int wallVal, int action);
|
2015-01-19 16:32:57 +00:00
|
|
|
};
|
|
|
|
|
2015-01-11 15:43:02 +00:00
|
|
|
} // End of namespace Xeen
|
|
|
|
|
|
|
|
#endif /* XEEN_SCRIPTS_H */
|