OpenRaider
0.1.4-dev
Open Source Tomb Raider Game Engine implementation
|
#include <Script.h>
Public Member Functions | |
Script () | |
int | load (std::string file) |
unsigned int | levelCount () |
std::string | getLevelName (unsigned int i) |
std::string | getLevelFilename (unsigned int i) |
unsigned int | pictureCount () |
std::string | getPictureFilename (unsigned int i) |
unsigned int | cutsceneCount () |
std::string | getCutsceneFilename (unsigned int i) |
unsigned int | titleCount () |
std::string | getTitleFilename (unsigned int i) |
unsigned int | videoCount () |
std::string | getVideoFilename (unsigned int i) |
unsigned int | gameStringCount () |
std::string | getGameString (unsigned int i) |
unsigned int | pcStringCount () |
std::string | getPCString (unsigned int i) |
std::string | getPuzzleString (unsigned int i, unsigned int j) |
std::string | getPickupString (unsigned int i, unsigned int j) |
std::string | getKeyString (unsigned int i, unsigned int j) |
void | registerScriptHandler (ScriptOpCode op, std::function< int(bool, uint16_t)> func) |
int | runScript (unsigned int level) |
std::string | getDescription () |
std::string | getLanguage () |
Private Types | |
enum | ScriptFlag { S_DemoVersion = (1 << 0), S_TitleDisabled = (1 << 1), S_CheatModeCheckDisabled = (1 << 2), S_NoInputTimeout = (1 << 3), S_LoadSaveDisabled = (1 << 4), S_ScreenSizingDisabled = (1 << 5), S_LockOutOptionRing = (1 << 6), S_DOZYCheatEnabled = (1 << 7), S_UseSecurityTag = (1 << 8), S_Unknown = (1 << 9), S_SelectAnyLevel = (1 << 10), S_EnableCheatCode = (1 << 11) } |
Private Member Functions | |
void | readStringPackage (BinaryFile &f, std::vector< std::string > &v, unsigned int n) |
void | readScriptPackage (BinaryFile &f, std::vector< std::vector< uint16_t >> &v, unsigned int n) |
Private Attributes | |
uint32_t | version |
std::string | description |
uint32_t | firstOption |
int32_t | titleReplace |
uint32_t | onDeathDemoMode |
uint32_t | onDeathInGame |
uint32_t | noInputTime |
uint32_t | onDemoInterrupt |
uint32_t | onDemoEnd |
uint16_t | numLevels |
uint16_t | numPictures |
uint16_t | numTitles |
uint16_t | numFMVs |
uint16_t | numCutscenes |
uint16_t | numDemos |
uint16_t | titleTrack |
int16_t | singleLevel |
uint16_t | flags |
uint8_t | cypherCode |
uint8_t | language |
uint16_t | secretTrack |
uint16_t | numPCStrings |
uint16_t | numGameStrings |
std::vector< std::string > | levelNames |
std::vector< std::string > | pictureFilenames |
std::vector< std::string > | titleFilenames |
std::vector< std::string > | fmvFilenames |
std::vector< std::string > | levelFilenames |
std::vector< std::string > | cutsceneFilenames |
std::vector< std::vector< uint16_t > > | script |
std::vector< std::string > | gameStrings |
std::vector< std::string > | pcStrings |
std::vector< std::vector< std::string > > | puzzles |
std::vector< std::vector< std::string > > | pickups |
std::vector< std::vector< std::string > > | keys |
std::function< int(bool, uint16_t)> | scriptHandlers [OP_UNKNOWN] |
Static Private Attributes | |
static const bool | opcodeHasOperand [OP_UNKNOWN] |
enum Script::ScriptOpCode |
Enumerator | |
---|---|
OP_PICTURE |
Unused in TR2. Or PSX? Used in TR3. |
OP_PSX_TRACK |
Does not compile. PSX? |
OP_PSX_FMV |
Does not compile. PSX? |
OP_FMV |
Display FMV. |
OP_GAME |
Start a playable level. |
OP_CUT |
Display a cutscene. |
OP_COMPLETE |
Display level-completion stats. |
OP_DEMO |
Display demo sequence. |
OP_PSX_DEMO |
Does not compile. PSX? |
OP_END |
Closes script sequence. |
OP_TRACK |
Play soundtrack (precedes level opcode) |
OP_SUNSET |
Unknown, nothing changes in TR2. Start in Motorboat? |
OP_LOAD_PIC |
Does not compile. PSX? Used in TR3. |
OP_DEADLY_WATER |
Unknown, nothing changes in TR2. |
OP_REMOVE_WEAPONS |
Start level without weapons. |
OP_GAMECOMPLETE |
End of game. Show stats, start credits sequence, music ID 52 in TR2. |
OP_CUTANGLE |
Match N-S orientation of Room and animated characters. |
OP_NOFLOOR |
Lara dies when her feet reach given depth. |
OP_STARTINV |
Items given to Lara at level start (+1000), or at all secrets found (+0) |
OP_STARTANIM |
Special animation of Lara when level starts. |
OP_SECRETS |
If zero, level does not account for secrets. |
OP_KILLTOCOMPLETE |
Kill all enemies to finish the level. |
OP_REMOVE_AMMO |
Lara starts level without ammo or medi packs. |
OP_UNKNOWN |
enum Script::ScriptItem |
|
private |
Script::Script | ( | ) |
Definition at line 18 of file Script.cpp.
int Script::load | ( | std::string | file | ) |
Definition at line 43 of file Script.cpp.
unsigned int Script::levelCount | ( | ) |
Definition at line 229 of file Script.cpp.
std::string Script::getLevelName | ( | unsigned int | i | ) |
Definition at line 233 of file Script.cpp.
std::string Script::getLevelFilename | ( | unsigned int | i | ) |
Definition at line 238 of file Script.cpp.
unsigned int Script::pictureCount | ( | ) |
Definition at line 243 of file Script.cpp.
std::string Script::getPictureFilename | ( | unsigned int | i | ) |
Definition at line 247 of file Script.cpp.
unsigned int Script::cutsceneCount | ( | ) |
Definition at line 252 of file Script.cpp.
std::string Script::getCutsceneFilename | ( | unsigned int | i | ) |
Definition at line 256 of file Script.cpp.
unsigned int Script::titleCount | ( | ) |
Definition at line 261 of file Script.cpp.
std::string Script::getTitleFilename | ( | unsigned int | i | ) |
Definition at line 265 of file Script.cpp.
unsigned int Script::videoCount | ( | ) |
Definition at line 270 of file Script.cpp.
std::string Script::getVideoFilename | ( | unsigned int | i | ) |
Definition at line 274 of file Script.cpp.
unsigned int Script::gameStringCount | ( | ) |
Definition at line 279 of file Script.cpp.
std::string Script::getGameString | ( | unsigned int | i | ) |
Definition at line 283 of file Script.cpp.
unsigned int Script::pcStringCount | ( | ) |
Definition at line 288 of file Script.cpp.
std::string Script::getPCString | ( | unsigned int | i | ) |
Definition at line 292 of file Script.cpp.
std::string Script::getPuzzleString | ( | unsigned int | i, |
unsigned int | j | ||
) |
Definition at line 297 of file Script.cpp.
std::string Script::getPickupString | ( | unsigned int | i, |
unsigned int | j | ||
) |
Definition at line 303 of file Script.cpp.
std::string Script::getKeyString | ( | unsigned int | i, |
unsigned int | j | ||
) |
Definition at line 309 of file Script.cpp.
void Script::registerScriptHandler | ( | ScriptOpCode | op, |
std::function< int(bool, uint16_t)> | func | ||
) |
Definition at line 315 of file Script.cpp.
int Script::runScript | ( | unsigned int | level | ) |
Definition at line 320 of file Script.cpp.
std::string Script::getLanguage | ( | ) |
Definition at line 350 of file Script.cpp.
|
private |
Definition at line 124 of file Script.cpp.
|
private |
Definition at line 148 of file Script.cpp.
|
staticprivate |
|
private |
|
private |
|
private |
|
private |