mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 02:44:56 +00:00
TITANIC: Added TTnpcScript getValue
This commit is contained in:
parent
07c1b2b23d
commit
3ad600439b
@ -32,7 +32,7 @@ namespace Titanic {
|
||||
|
||||
int CTrueTalkManager::_v1;
|
||||
int CTrueTalkManager::_v2;
|
||||
int CTrueTalkManager::_passengerClass;
|
||||
int CTrueTalkManager::_v3;
|
||||
bool CTrueTalkManager::_v4;
|
||||
bool CTrueTalkManager::_v5;
|
||||
int CTrueTalkManager::_v6;
|
||||
@ -102,7 +102,7 @@ void CTrueTalkManager::loadStatics(SimpleFile *file) {
|
||||
int count = file->readNumber();
|
||||
_v1 = file->readNumber();
|
||||
_v2 = file->readNumber();
|
||||
_passengerClass = file->readNumber();
|
||||
_v3 = file->readNumber();
|
||||
_v4 = file->readNumber() != 0;
|
||||
_v5 = file->readNumber() != 0;
|
||||
_v6 = file->readNumber();
|
||||
@ -126,7 +126,7 @@ void CTrueTalkManager::saveStatics(SimpleFile *file) {
|
||||
file->writeNumber(10);
|
||||
file->writeNumber(_v1);
|
||||
file->writeNumber(_v2);
|
||||
file->writeNumber(_passengerClass);
|
||||
file->writeNumber(_v3);
|
||||
file->writeNumber(_v4 ? 1 : 0);
|
||||
file->writeNumber(_v5 ? 1 : 0);
|
||||
file->writeNumber(_v6);
|
||||
@ -150,7 +150,7 @@ void CTrueTalkManager::setFlags(int index, int val) {
|
||||
switch (index) {
|
||||
case 1:
|
||||
if (val >= 1 && val <= 3)
|
||||
_passengerClass = val;
|
||||
_v3 = val;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -118,17 +118,10 @@ private:
|
||||
* Return the game state
|
||||
*/
|
||||
CGameState *getGameState() const;
|
||||
|
||||
/**
|
||||
* Get the player's passenger class
|
||||
*/
|
||||
int getPassengerClass() const;
|
||||
|
||||
int getState14() const;
|
||||
public:
|
||||
static int _v1;
|
||||
static int _v2;
|
||||
static int _passengerClass;
|
||||
static int _v3;
|
||||
static bool _v4;
|
||||
static bool _v5;
|
||||
static int _v6;
|
||||
@ -230,6 +223,13 @@ public:
|
||||
* Gets the script associated with a specific room
|
||||
*/
|
||||
TTroomScript *getRoomScript(int roomId) const;
|
||||
|
||||
/**
|
||||
* Get the player's passenger class
|
||||
*/
|
||||
int getPassengerClass() const;
|
||||
|
||||
int getState14() const;
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -235,5 +235,53 @@ int TTnpcScript::getRoom54(int roomId) {
|
||||
return room ? room->_field54 : 0;
|
||||
}
|
||||
|
||||
int TTnpcScript::getValue(int testNum) {
|
||||
switch (testNum) {
|
||||
case 0:
|
||||
return CTrueTalkManager::_v2;
|
||||
|
||||
case 1:
|
||||
if (g_vm->_trueTalkManager)
|
||||
CTrueTalkManager::_v3 = g_vm->_trueTalkManager->getPassengerClass();
|
||||
return CTrueTalkManager::_v3;
|
||||
|
||||
case 2:
|
||||
return CTrueTalkManager::_v4;
|
||||
|
||||
case 3:
|
||||
return CTrueTalkManager::_v5 != 0;
|
||||
|
||||
case 4:
|
||||
if (g_vm->_trueTalkManager) {
|
||||
switch (g_vm->_trueTalkManager->getState14()) {
|
||||
case 1:
|
||||
CTrueTalkManager::_v6 = 3;
|
||||
break;
|
||||
case 2:
|
||||
CTrueTalkManager::_v6 = 0;
|
||||
break;
|
||||
case 3:
|
||||
CTrueTalkManager::_v6 = 1;
|
||||
break;
|
||||
default:
|
||||
CTrueTalkManager::_v6 = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CTrueTalkManager::_v6;
|
||||
|
||||
case 5:
|
||||
return CTrueTalkManager::_v7;
|
||||
|
||||
case 6:
|
||||
return CTrueTalkManager::_v8 != 0;
|
||||
|
||||
case 7:
|
||||
return !!getRoom54(123);
|
||||
|
||||
default:
|
||||
return CTrueTalkManager::_v11[testNum];
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -77,6 +77,11 @@ protected:
|
||||
void randomizeFlags();
|
||||
|
||||
static int getRoom54(int roomId);
|
||||
|
||||
/**
|
||||
* Perform test on various state values
|
||||
*/
|
||||
int getValue(int testNum);
|
||||
public:
|
||||
TTnpcScript(int charId, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4,
|
||||
|
Loading…
x
Reference in New Issue
Block a user