ASYLUM: Update ScriptManager
- Rename several opcodes - Add enumeration for script Opcodes - Rename some called actor methods
This commit is contained in:
parent
48f733baf0
commit
9bc78f83db
8 changed files with 204 additions and 99 deletions
|
@ -255,7 +255,7 @@ bool PuzzleVCR::mouseLeftUp(const AsylumEvent &) {
|
|||
&& _holesState[kRed] == kPluggedOnBlack
|
||||
&& _holesState[kYellow] == kPluggedOnRed) {
|
||||
getCursor()->hide();
|
||||
_vm->setGameFlag(kGameFlagSolveVCRBlowUpPuzzle);
|
||||
_vm->setGameFlag(kGameFlagSolveVCRPuzzle);
|
||||
_isAccomplished = true;
|
||||
}
|
||||
} else if (_buttonsState[kPlayButton] == kDownON) {
|
||||
|
|
|
@ -1405,7 +1405,7 @@ void Actor::move(ActorDirection actorDir, uint32 dist) {
|
|||
}
|
||||
}
|
||||
|
||||
void Actor::process_41BC00(int32 reactionIndex, int32 numberValue01Add) {
|
||||
void Actor::addReactionHive(int32 reactionIndex, int32 numberValue01Add) {
|
||||
if (reactionIndex > 16)
|
||||
return;
|
||||
|
||||
|
@ -1417,7 +1417,7 @@ void Actor::process_41BC00(int32 reactionIndex, int32 numberValue01Add) {
|
|||
if (count == 8)
|
||||
return;
|
||||
|
||||
if (!process_41BDB0(reactionIndex, false))
|
||||
if (!hasMoreReactions(reactionIndex, false))
|
||||
_reaction[count] = reactionIndex;
|
||||
|
||||
if (numberValue01Add)
|
||||
|
@ -1426,7 +1426,7 @@ void Actor::process_41BC00(int32 reactionIndex, int32 numberValue01Add) {
|
|||
getSound()->playSound(MAKE_RESOURCE(kResourcePackHive, 0));
|
||||
}
|
||||
|
||||
void Actor::process_41BCC0(int32 reactionIndex, int32 numberValue01Substract) {
|
||||
void Actor::removeReactionHive(int32 reactionIndex, int32 numberValue01Substract) {
|
||||
if (reactionIndex > 16)
|
||||
return;
|
||||
|
||||
|
@ -1455,7 +1455,7 @@ void Actor::process_41BCC0(int32 reactionIndex, int32 numberValue01Substract) {
|
|||
}
|
||||
}
|
||||
|
||||
bool Actor::process_41BDB0(int32 reactionIndex, int32 testNumberValue01) {
|
||||
bool Actor::hasMoreReactions(int32 reactionIndex, int32 testNumberValue01) {
|
||||
if (reactionIndex > 16)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -260,9 +260,9 @@ public:
|
|||
bool process_4069B0(int32 *x, int32 *y);
|
||||
bool canMove(Common::Point *point, ActorDirection direction, uint32 count, bool hasDelta);
|
||||
void move(ActorDirection dir, uint32 distance);
|
||||
void process_41BC00(int32 reactionIndex, int32 numberValue01Add);
|
||||
void process_41BCC0(int32 reactionIndex, int32 numberValue01Substract);
|
||||
bool process_41BDB0(int32 reactionIndex, int32 testNumberValue01);
|
||||
void addReactionHive(int32 reactionIndex, int32 numberValue01Add);
|
||||
void removeReactionHive(int32 reactionIndex, int32 numberValue01Substract);
|
||||
bool hasMoreReactions(int32 reactionIndex, int32 testNumberValue01);
|
||||
bool canMoveCheckActors(Common::Point *point, ActorDirection direction);
|
||||
void updateAndDraw();
|
||||
void update_409230();
|
||||
|
|
|
@ -1598,13 +1598,13 @@ void Encounter::runScript() {
|
|||
|
||||
case 18:
|
||||
if (entry.param1)
|
||||
getScene()->getActor()->process_41BCC0(getVariableInv(entry.param2), _scriptData.vars[1]);
|
||||
getScene()->getActor()->removeReactionHive(getVariableInv(entry.param2), _scriptData.vars[1]);
|
||||
else
|
||||
getScene()->getActor()->process_41BC00(getVariableInv(entry.param2), _scriptData.vars[1]);
|
||||
getScene()->getActor()->addReactionHive(getVariableInv(entry.param2), _scriptData.vars[1]);
|
||||
break;
|
||||
|
||||
case 21:
|
||||
_scriptData.counter = getScene()->getActor()->process_41BDB0(getVariableInv(entry.param2), _scriptData.vars[1]) ? 0 : 1;
|
||||
_scriptData.counter = getScene()->getActor()->hasMoreReactions(getVariableInv(entry.param2), _scriptData.vars[1]) ? 0 : 1;
|
||||
break;
|
||||
|
||||
case 23:
|
||||
|
|
|
@ -114,9 +114,9 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
|
|||
ADD_OPCODE(JumpIfActionTalk);
|
||||
ADD_OPCODE(SetActionTalk);
|
||||
ADD_OPCODE(ClearActionTalk);
|
||||
ADD_OPCODE(_unk22);
|
||||
ADD_OPCODE(_unk23);
|
||||
ADD_OPCODE(_unk24);
|
||||
ADD_OPCODE(AddReactionHive);
|
||||
ADD_OPCODE(RemoveReactionHive);
|
||||
ADD_OPCODE(HasMoreReaction);
|
||||
ADD_OPCODE(RunEncounter);
|
||||
ADD_OPCODE(JumpIfAction16);
|
||||
ADD_OPCODE(SetAction16);
|
||||
|
@ -124,7 +124,7 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
|
|||
ADD_OPCODE(SetActorField638);
|
||||
ADD_OPCODE(JumpIfActorField638);
|
||||
ADD_OPCODE(ChangeScene);
|
||||
ADD_OPCODE(_unk2C_ActorSub);
|
||||
ADD_OPCODE(UpdateActor);
|
||||
ADD_OPCODE(PlayMovie);
|
||||
ADD_OPCODE(StopAllObjectsSounds);
|
||||
ADD_OPCODE(StopProcessing);
|
||||
|
@ -132,14 +132,14 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
|
|||
ADD_OPCODE(ResetSceneRect);
|
||||
ADD_OPCODE(ChangeMusicById);
|
||||
ADD_OPCODE(StopMusic);
|
||||
ADD_OPCODE(_unk34_Status);
|
||||
ADD_OPCODE(IncrementParam1);
|
||||
ADD_OPCODE(SetVolume);
|
||||
ADD_OPCODE(Jump);
|
||||
ADD_OPCODE(RunBlowUpPuzzle);
|
||||
ADD_OPCODE(RunPuzzle);
|
||||
ADD_OPCODE(JumpIfAction8);
|
||||
ADD_OPCODE(SetAction8);
|
||||
ADD_OPCODE(ClearAction8);
|
||||
ADD_OPCODE(_unk3B_PALETTE_MOD);
|
||||
ADD_OPCODE(CreatePalette);
|
||||
ADD_OPCODE(IncrementParam2);
|
||||
ADD_OPCODE(WaitUntilFramePlayed);
|
||||
ADD_OPCODE(UpdateWideScreen);
|
||||
|
@ -150,12 +150,12 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
|
|||
ADD_OPCODE(MoveScenePositionFromActor);
|
||||
ADD_OPCODE(PaletteFade);
|
||||
ADD_OPCODE(StartPaletteFadeThread);
|
||||
ADD_OPCODE(_unk46);
|
||||
ADD_OPCODE(ActorFaceObject);
|
||||
ADD_OPCODE(_unk48_MATTE_01);
|
||||
ADD_OPCODE(_unk49_MATTE_90);
|
||||
ADD_OPCODE(PlaySoundUpdateObject);
|
||||
ADD_OPCODE(ActorFaceTarget);
|
||||
ADD_OPCODE(HideMatteBars);
|
||||
ADD_OPCODE(ShowMatteBars);
|
||||
ADD_OPCODE(JumpIfSoundPlaying);
|
||||
ADD_OPCODE(ChangePlayerActorIndex);
|
||||
ADD_OPCODE(ChangePlayer);
|
||||
ADD_OPCODE(ChangeActorStatus);
|
||||
ADD_OPCODE(StopSound);
|
||||
ADD_OPCODE(JumpRandom);
|
||||
|
@ -163,23 +163,23 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
|
|||
ADD_OPCODE(Quit);
|
||||
ADD_OPCODE(JumpObjectFrame);
|
||||
ADD_OPCODE(DeleteGraphics);
|
||||
ADD_OPCODE(DeleteGraphics);
|
||||
ADD_OPCODE(_unk54_SET_ACTIONLIST_6EC);
|
||||
ADD_OPCODE(_unk55);
|
||||
ADD_OPCODE(_unk56);
|
||||
ADD_OPCODE(SetActorField944);
|
||||
ADD_OPCODE(SetScriptField1BB0);
|
||||
ADD_OPCODE(OnScriptField1BB0);
|
||||
ADD_OPCODE(Interact);
|
||||
ADD_OPCODE(SetResourcePalette);
|
||||
ADD_OPCODE(SetObjectFrameIdxFlaged);
|
||||
ADD_OPCODE(_unk59);
|
||||
ADD_OPCODE(_unk5A);
|
||||
ADD_OPCODE(_unk5B);
|
||||
ADD_OPCODE(SetObjectFrameIndexAndFlags);
|
||||
ADD_OPCODE(SetObjectFlags);
|
||||
ADD_OPCODE(SetActorActionIndex2);
|
||||
ADD_OPCODE(UpdateObjectFields);
|
||||
ADD_OPCODE(QueueScript);
|
||||
ADD_OPCODE(_unk5D);
|
||||
ADD_OPCODE(ProcessActor);
|
||||
ADD_OPCODE(ClearActorFields);
|
||||
ADD_OPCODE(SetObjectLastFrameIdx);
|
||||
ADD_OPCODE(_unk60_SET_OR_CLR_ACTIONAREA_FLAG);
|
||||
ADD_OPCODE(_unk61);
|
||||
ADD_OPCODE(ShowOptionsScreen);
|
||||
ADD_OPCODE(_unk63);
|
||||
ADD_OPCODE(SetObjectLastFrameIndex);
|
||||
ADD_OPCODE(SetActionAreaFlags);
|
||||
ADD_OPCODE(UpdatePlayerChapter9);
|
||||
ADD_OPCODE(ShowMenu);
|
||||
ADD_OPCODE(UpdateGlobalFlags);
|
||||
|
||||
reset();
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ void ScriptManager::load(Common::SeekableReadStream *stream) {
|
|||
memset(&command, 0, sizeof(ScriptEntry));
|
||||
|
||||
command.numLines = stream->readSint32LE();
|
||||
command.opcode = stream->readSint32LE();
|
||||
command.opcode = (OpcodeType)stream->readSint32LE();
|
||||
command.param1 = stream->readSint32LE();
|
||||
command.param2 = stream->readSint32LE();
|
||||
command.param3 = stream->readSint32LE();
|
||||
|
@ -795,26 +795,26 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x22
|
||||
IMPLEMENT_OPCODE(_unk22)
|
||||
IMPLEMENT_OPCODE(AddReactionHive)
|
||||
Actor *actor = getScene()->getActor(cmd->param3 ? cmd->param3 : _currentQueueEntry->actorIndex);
|
||||
|
||||
actor->process_41BC00(cmd->param1, cmd->param2);
|
||||
actor->addReactionHive(cmd->param1, cmd->param2);
|
||||
END_OPCODE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x23
|
||||
IMPLEMENT_OPCODE(_unk23)
|
||||
IMPLEMENT_OPCODE(RemoveReactionHive)
|
||||
Actor *actor = getScene()->getActor(cmd->param3 ? cmd->param3 : _currentQueueEntry->actorIndex);
|
||||
|
||||
actor->process_41BCC0(cmd->param1, cmd->param2);
|
||||
actor->removeReactionHive(cmd->param1, cmd->param2);
|
||||
END_OPCODE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x24
|
||||
IMPLEMENT_OPCODE(_unk24)
|
||||
IMPLEMENT_OPCODE(HasMoreReaction)
|
||||
Actor *actor = getScene()->getActor(cmd->param4 ? cmd->param4 : _currentQueueEntry->actorIndex);
|
||||
|
||||
actor->process_41BDB0(cmd->param1, (bool)cmd->param3);
|
||||
actor->hasMoreReactions(cmd->param1, (bool)cmd->param3);
|
||||
END_OPCODE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -896,7 +896,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x2C
|
||||
IMPLEMENT_OPCODE(_unk2C_ActorSub)
|
||||
IMPLEMENT_OPCODE(UpdateActor)
|
||||
Actor *player = getScene()->getActor();
|
||||
Actor *actor = getScene()->getActor(_currentQueueEntry->actorIndex);
|
||||
Common::Point playerPoint((int16)(player->getPoint1()->x + player->getPoint2()->x), (int16)(player->getPoint1()->y + player->getPoint2()->y));
|
||||
|
@ -1060,7 +1060,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x34
|
||||
IMPLEMENT_OPCODE(_unk34_Status)
|
||||
IMPLEMENT_OPCODE(IncrementParam1)
|
||||
if (cmd->param1 >= 2) {
|
||||
cmd->param1 = 0;
|
||||
} else {
|
||||
|
@ -1095,7 +1095,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x37
|
||||
IMPLEMENT_OPCODE(RunBlowUpPuzzle)
|
||||
IMPLEMENT_OPCODE(RunPuzzle)
|
||||
getScreen()->clear();
|
||||
getScreen()->clearGraphicsInQueue();
|
||||
|
||||
|
@ -1126,7 +1126,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x3B
|
||||
IMPLEMENT_OPCODE(_unk3B_PALETTE_MOD)
|
||||
IMPLEMENT_OPCODE(CreatePalette)
|
||||
if (!cmd->param2) {
|
||||
getScreen()->makeGreyPalette();
|
||||
cmd->param2 = 1;
|
||||
|
@ -1408,7 +1408,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x46
|
||||
IMPLEMENT_OPCODE(_unk46)
|
||||
IMPLEMENT_OPCODE(PlaySoundUpdateObject)
|
||||
if (cmd->param6) {
|
||||
if (getSound()->isPlaying(getSpeech()->getSoundResourceId())) {
|
||||
_processNextEntry = 1;
|
||||
|
@ -1452,13 +1452,13 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x47
|
||||
IMPLEMENT_OPCODE(ActorFaceObject)
|
||||
IMPLEMENT_OPCODE(ActorFaceTarget)
|
||||
getScene()->getActor(cmd->param1)->faceTarget((ObjectId)cmd->param2, (DirectionFrom)cmd->param3);
|
||||
END_OPCODE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x48
|
||||
IMPLEMENT_OPCODE(_unk48_MATTE_01)
|
||||
IMPLEMENT_OPCODE(HideMatteBars)
|
||||
getSharedData()->matteVar1 = 0;
|
||||
getSharedData()->matteInitialized = true;
|
||||
|
||||
|
@ -1478,7 +1478,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x49
|
||||
IMPLEMENT_OPCODE(_unk49_MATTE_90)
|
||||
IMPLEMENT_OPCODE(ShowMatteBars)
|
||||
getSharedData()->matteVar1 = 0;
|
||||
getSharedData()->matteInitialized = true;
|
||||
getSharedData()->mattePlaySound = true;
|
||||
|
@ -1511,7 +1511,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x4B
|
||||
IMPLEMENT_OPCODE(ChangePlayerActorIndex)
|
||||
IMPLEMENT_OPCODE(ChangePlayer)
|
||||
getScene()->changePlayer(cmd->param1);
|
||||
END_OPCODE
|
||||
|
||||
|
@ -1611,7 +1611,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x54
|
||||
IMPLEMENT_OPCODE(_unk54_SET_ACTIONLIST_6EC)
|
||||
IMPLEMENT_OPCODE(SetScriptField1BB0)
|
||||
if (cmd->param2)
|
||||
_currentScript->field_1BB0 = _vm->getRandom((uint32)cmd->param1);
|
||||
else
|
||||
|
@ -1620,7 +1620,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x55
|
||||
IMPLEMENT_OPCODE(_unk55)
|
||||
IMPLEMENT_OPCODE(OnScriptField1BB0)
|
||||
|
||||
if (cmd->param2) {
|
||||
if (_currentScript->field_1BB0 == cmd->param1)
|
||||
|
@ -1652,7 +1652,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x56
|
||||
IMPLEMENT_OPCODE(_unk56)
|
||||
IMPLEMENT_OPCODE(Interact)
|
||||
Actor *actor = getScene()->getActor(cmd->param2 == 2 ? kActorInvalid : cmd->param1);
|
||||
|
||||
if (actor->getStatus() == kActorStatus2 || actor->getStatus() == kActorStatus13) {
|
||||
|
@ -1704,7 +1704,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x58
|
||||
IMPLEMENT_OPCODE(SetObjectFrameIdxFlaged)
|
||||
IMPLEMENT_OPCODE(SetObjectFrameIndexAndFlags)
|
||||
Object *object = getWorld()->getObjectById((ObjectId)cmd->param1);
|
||||
|
||||
if (cmd->param3)
|
||||
|
@ -1717,7 +1717,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x59
|
||||
IMPLEMENT_OPCODE(_unk59)
|
||||
IMPLEMENT_OPCODE(SetObjectFlags)
|
||||
Object *object = getWorld()->getObjectById((ObjectId)cmd->param1);
|
||||
|
||||
if (cmd->param2) {
|
||||
|
@ -1732,13 +1732,13 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x5A
|
||||
IMPLEMENT_OPCODE(_unk5A)
|
||||
IMPLEMENT_OPCODE(SetActorActionIndex2)
|
||||
getScene()->getActor(cmd->param1)->setActionIndex2(cmd->param2);
|
||||
END_OPCODE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x5B
|
||||
IMPLEMENT_OPCODE(_unk5B)
|
||||
IMPLEMENT_OPCODE(UpdateObjectFields)
|
||||
if (cmd->param2 >= 0 && cmd->param2 <= 3) {
|
||||
if (cmd->param1) {
|
||||
Object *object = getWorld()->getObjectById((ObjectId)cmd->param1);
|
||||
|
@ -1761,7 +1761,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x5D
|
||||
IMPLEMENT_OPCODE(_unk5D)
|
||||
IMPLEMENT_OPCODE(ProcessActor)
|
||||
Actor *actor = getScene()->getActor(cmd->param1);
|
||||
|
||||
actor->process_401830(cmd->param2, cmd->param3, cmd->param4, cmd->param5, cmd->param6, cmd->param7, cmd->param8, cmd->param9);
|
||||
|
@ -1778,7 +1778,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x5F
|
||||
IMPLEMENT_OPCODE(SetObjectLastFrameIdx)
|
||||
IMPLEMENT_OPCODE(SetObjectLastFrameIndex)
|
||||
Object *object = getWorld()->getObjectById((ObjectId)cmd->param1);
|
||||
|
||||
if (object->getFrameIndex() == object->getFrameCount() - 1) {
|
||||
|
@ -1791,7 +1791,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x60
|
||||
IMPLEMENT_OPCODE(_unk60_SET_OR_CLR_ACTIONAREA_FLAG)
|
||||
IMPLEMENT_OPCODE(SetActionAreaFlags)
|
||||
ActionArea *area = getWorld()->getActionAreaById(cmd->param1);
|
||||
|
||||
if (cmd->param2)
|
||||
|
@ -1802,7 +1802,7 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x61
|
||||
IMPLEMENT_OPCODE(_unk61)
|
||||
IMPLEMENT_OPCODE(UpdatePlayerChapter9)
|
||||
if (cmd->param2) {
|
||||
if (getWorld()->nextPlayer == kActorInvalid) {
|
||||
_processNextEntry = 0;
|
||||
|
@ -1819,13 +1819,13 @@ END_OPCODE
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x62
|
||||
IMPLEMENT_OPCODE(ShowOptionsScreen)
|
||||
IMPLEMENT_OPCODE(ShowMenu)
|
||||
_vm->menu()->show();
|
||||
END_OPCODE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x63
|
||||
IMPLEMENT_OPCODE(_unk63)
|
||||
IMPLEMENT_OPCODE(UpdateGlobalFlags)
|
||||
if (cmd->param1) {
|
||||
getSharedData()->setFlag(kFlag1, true);
|
||||
getSharedData()->setFlag(kFlag2, true);
|
||||
|
|
|
@ -36,10 +36,10 @@ namespace Asylum {
|
|||
#define MAX_ACTION_COMMANDS 161
|
||||
|
||||
#define DECLARE_OPCODE(name) \
|
||||
void k##name(ScriptEntry *cmd)
|
||||
void Op##name(ScriptEntry *cmd)
|
||||
|
||||
#define IMPLEMENT_OPCODE(name) \
|
||||
void ScriptManager::k##name(ScriptEntry *cmd) { \
|
||||
void ScriptManager::Op##name(ScriptEntry *cmd) { \
|
||||
if (!_currentScript) error("[" #name "] No current script set!"); \
|
||||
if (!cmd) error("[" #name "] Invalid command parameter!");
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace Asylum {
|
|||
|
||||
|
||||
#define ADD_OPCODE(name) { \
|
||||
Opcode *func = new Opcode(#name, new Common::Functor1Mem<ScriptEntry *, void, ScriptManager>(this, &ScriptManager::k##name)); \
|
||||
Opcode *func = new Opcode(#name, new Common::Functor1Mem<ScriptEntry *, void, ScriptManager>(this, &ScriptManager::Op##name)); \
|
||||
_opcodes.push_back(func); \
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ private:
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
struct ScriptEntry {
|
||||
int32 numLines; // Only set on the first line of each script
|
||||
int32 opcode;
|
||||
OpcodeType opcode;
|
||||
int32 param1;
|
||||
int32 param2;
|
||||
int32 param3;
|
||||
|
@ -228,7 +228,7 @@ private:
|
|||
|
||||
ScriptEntry() {
|
||||
numLines = 0;
|
||||
opcode = 0;
|
||||
opcode = kOpcodeReturn;
|
||||
param1 = 0;
|
||||
param2 = 0;
|
||||
param3 = 0;
|
||||
|
@ -333,9 +333,9 @@ private:
|
|||
DECLARE_OPCODE(JumpIfActionTalk);
|
||||
DECLARE_OPCODE(SetActionTalk);
|
||||
DECLARE_OPCODE(ClearActionTalk);
|
||||
DECLARE_OPCODE(_unk22);
|
||||
DECLARE_OPCODE(_unk23);
|
||||
DECLARE_OPCODE(_unk24);
|
||||
DECLARE_OPCODE(AddReactionHive);
|
||||
DECLARE_OPCODE(RemoveReactionHive);
|
||||
DECLARE_OPCODE(HasMoreReaction);
|
||||
DECLARE_OPCODE(RunEncounter);
|
||||
DECLARE_OPCODE(JumpIfAction16);
|
||||
DECLARE_OPCODE(SetAction16);
|
||||
|
@ -343,7 +343,7 @@ private:
|
|||
DECLARE_OPCODE(SetActorField638);
|
||||
DECLARE_OPCODE(JumpIfActorField638);
|
||||
DECLARE_OPCODE(ChangeScene);
|
||||
DECLARE_OPCODE(_unk2C_ActorSub);
|
||||
DECLARE_OPCODE(UpdateActor);
|
||||
DECLARE_OPCODE(PlayMovie);
|
||||
DECLARE_OPCODE(StopAllObjectsSounds);
|
||||
DECLARE_OPCODE(StopProcessing);
|
||||
|
@ -351,14 +351,14 @@ private:
|
|||
DECLARE_OPCODE(ResetSceneRect);
|
||||
DECLARE_OPCODE(ChangeMusicById);
|
||||
DECLARE_OPCODE(StopMusic);
|
||||
DECLARE_OPCODE(_unk34_Status);
|
||||
DECLARE_OPCODE(IncrementParam1);
|
||||
DECLARE_OPCODE(SetVolume);
|
||||
DECLARE_OPCODE(Jump);
|
||||
DECLARE_OPCODE(RunBlowUpPuzzle);
|
||||
DECLARE_OPCODE(RunPuzzle);
|
||||
DECLARE_OPCODE(JumpIfAction8);
|
||||
DECLARE_OPCODE(SetAction8);
|
||||
DECLARE_OPCODE(ClearAction8);
|
||||
DECLARE_OPCODE(_unk3B_PALETTE_MOD);
|
||||
DECLARE_OPCODE(CreatePalette);
|
||||
DECLARE_OPCODE(IncrementParam2);
|
||||
DECLARE_OPCODE(WaitUntilFramePlayed);
|
||||
DECLARE_OPCODE(UpdateWideScreen);
|
||||
|
@ -369,12 +369,12 @@ private:
|
|||
DECLARE_OPCODE(MoveScenePositionFromActor);
|
||||
DECLARE_OPCODE(PaletteFade);
|
||||
DECLARE_OPCODE(StartPaletteFadeThread);
|
||||
DECLARE_OPCODE(_unk46);
|
||||
DECLARE_OPCODE(ActorFaceObject);
|
||||
DECLARE_OPCODE(_unk48_MATTE_01);
|
||||
DECLARE_OPCODE(_unk49_MATTE_90);
|
||||
DECLARE_OPCODE(PlaySoundUpdateObject);
|
||||
DECLARE_OPCODE(ActorFaceTarget);
|
||||
DECLARE_OPCODE(HideMatteBars);
|
||||
DECLARE_OPCODE(ShowMatteBars);
|
||||
DECLARE_OPCODE(JumpIfSoundPlaying);
|
||||
DECLARE_OPCODE(ChangePlayerActorIndex);
|
||||
DECLARE_OPCODE(ChangePlayer);
|
||||
DECLARE_OPCODE(ChangeActorStatus);
|
||||
DECLARE_OPCODE(StopSound);
|
||||
DECLARE_OPCODE(JumpRandom);
|
||||
|
@ -383,22 +383,22 @@ private:
|
|||
DECLARE_OPCODE(JumpObjectFrame);
|
||||
DECLARE_OPCODE(DeleteGraphics);
|
||||
DECLARE_OPCODE(SetActorField944);
|
||||
DECLARE_OPCODE(_unk54_SET_ACTIONLIST_6EC);
|
||||
DECLARE_OPCODE(_unk55);
|
||||
DECLARE_OPCODE(_unk56);
|
||||
DECLARE_OPCODE(SetScriptField1BB0);
|
||||
DECLARE_OPCODE(OnScriptField1BB0);
|
||||
DECLARE_OPCODE(Interact);
|
||||
DECLARE_OPCODE(SetResourcePalette);
|
||||
DECLARE_OPCODE(SetObjectFrameIdxFlaged);
|
||||
DECLARE_OPCODE(_unk59);
|
||||
DECLARE_OPCODE(_unk5A);
|
||||
DECLARE_OPCODE(_unk5B);
|
||||
DECLARE_OPCODE(SetObjectFrameIndexAndFlags);
|
||||
DECLARE_OPCODE(SetObjectFlags);
|
||||
DECLARE_OPCODE(SetActorActionIndex2);
|
||||
DECLARE_OPCODE(UpdateObjectFields);
|
||||
DECLARE_OPCODE(QueueScript);
|
||||
DECLARE_OPCODE(_unk5D);
|
||||
DECLARE_OPCODE(ProcessActor);
|
||||
DECLARE_OPCODE(ClearActorFields);
|
||||
DECLARE_OPCODE(SetObjectLastFrameIdx);
|
||||
DECLARE_OPCODE(_unk60_SET_OR_CLR_ACTIONAREA_FLAG);
|
||||
DECLARE_OPCODE(_unk61);
|
||||
DECLARE_OPCODE(ShowOptionsScreen);
|
||||
DECLARE_OPCODE(_unk63);
|
||||
DECLARE_OPCODE(SetObjectLastFrameIndex);
|
||||
DECLARE_OPCODE(SetActionAreaFlags);
|
||||
DECLARE_OPCODE(UpdatePlayerChapter9);
|
||||
DECLARE_OPCODE(ShowMenu);
|
||||
DECLARE_OPCODE(UpdateGlobalFlags);
|
||||
|
||||
friend class Console;
|
||||
}; // end of class ActionList
|
||||
|
|
|
@ -543,7 +543,7 @@ void Special::chapter8(Object *object, ActorIndex actorIndex) {
|
|||
|
||||
if (object->getFrameIndex() == 23) {
|
||||
if (_vm->isGameFlagNotSet(kGameFlag815))
|
||||
actor0->process_41BC00(1, 0);
|
||||
actor0->addReactionHive(1, 0);
|
||||
|
||||
_vm->setGameFlag(kGameFlag815);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ enum GameFlag {
|
|||
kGameFlagCommentLeavingCell = 214,
|
||||
kGameFlag215 = 215,
|
||||
kGameFlag219 = 219,
|
||||
kGameFlagSolveVCRBlowUpPuzzle = 220,
|
||||
kGameFlagSolveVCRPuzzle = 220,
|
||||
kGameFlag235 = 235,
|
||||
kGameFlag238 = 238,
|
||||
kGameFlag239 = 239,
|
||||
|
@ -252,7 +252,6 @@ enum DrawFlags {
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
// Actions
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum ActionType {
|
||||
kActionTypeNone = 0,
|
||||
kActionTypeFind = 1,
|
||||
|
@ -262,6 +261,112 @@ enum ActionType {
|
|||
kActionType16 = 16
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Script
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
enum OpcodeType {
|
||||
kOpcodeReturn = 0,
|
||||
kOpcodeSetGameFlag,
|
||||
kOpcodeClearGameFlag,
|
||||
kOpcodeToggleGameFlag,
|
||||
kOpcodeJumpIfGameFlag,
|
||||
kOpcodeHideCursor, // 5
|
||||
kOpcodeShowCursor,
|
||||
kOpcodePlayAnimation,
|
||||
kOpcodeMoveScenePosition,
|
||||
kOpcodeHideActor,
|
||||
kOpcodeShowActor, // 10
|
||||
kOpcodeSetActorPosition,
|
||||
kOpcodeSetSceneMotionStatus,
|
||||
kOpcodeDisableActor,
|
||||
kOpcodeEnableActor,
|
||||
kOpcodeEnableObjects, // 15
|
||||
kOpcodeReturn1,
|
||||
kOpcodeRemoveObject,
|
||||
kOpcodeJumpActorSpeech,
|
||||
kOpcodeJumpAndSetDirection,
|
||||
kOpcodeJumpIfActorCoordinates, // 20
|
||||
kOpcodeNop,
|
||||
kOpcodeResetAnimation,
|
||||
kOpcodeDisableObject,
|
||||
kOpcodeJumpIfSoundPlayingAndPlaySound,
|
||||
kOpcodeJumpIfActionFind, // 25
|
||||
kOpcodeSetActionFind,
|
||||
kOpcodeClearActionFind,
|
||||
kOpcodeJumpIfActionGrab,
|
||||
kOpcodeSetActionGrab,
|
||||
kOpcodeClearActionGrab, // 30
|
||||
kOpcodeJumpIfActionTalk,
|
||||
kOpcodeSetActionTalk,
|
||||
kOpcodeClearActionTalk,
|
||||
kOpcodeAddReactionHive,
|
||||
kOpcodeRemoveReactionHive, // 35
|
||||
kOpcodeHasMoreReactions,
|
||||
kOpcodeRunEncounter,
|
||||
kOpcodeJumpIfAction16,
|
||||
kOpcodeSetAction16,
|
||||
kOpcodeClearAction16, // 40
|
||||
kOpcodeSetActorField638,
|
||||
kOpcodeJumpIfActorField638,
|
||||
kOpcodeChangeScene,
|
||||
kOpcodeUpdateActor,
|
||||
kOpcodePlayMovie, // 45
|
||||
kOpcodeStopAllObjectsSounds,
|
||||
kOpcodeStopProcessing,
|
||||
kOpcodeResumeProcessing,
|
||||
kOpcodeResetSceneRect,
|
||||
kOpcodeChangeMusicById, // 50
|
||||
kOpcodeStopMusic,
|
||||
kOpcodeIncrementParam1,
|
||||
kOpcodeSetVolume,
|
||||
kOpcodeJump,
|
||||
kOpcodeRunPuzzle, // 55
|
||||
kOpcodeJumpIfAction8,
|
||||
kOpcodeSetAction8,
|
||||
kOpcodeClearAction8,
|
||||
kOpcodeCreatePalette,
|
||||
kOpcodeIncrementParam2, // 60
|
||||
kOpcodeWaitUntilFramePlayed,
|
||||
kOpcodeUpdateWideScreen,
|
||||
kOpcodeJumpIfActor,
|
||||
kOpcodePlaySpeechScene,
|
||||
kOpcodePlaySpeech, // 65
|
||||
kOpcodePlaySpeechScene2,
|
||||
kOpcodeMoveScenePositionFromActor,
|
||||
kOpcodePaletteFade,
|
||||
kOpcodeStartPaletteFadeThread,
|
||||
kOpcodePlaySoundUpdateObject, // 70
|
||||
kOpcodeActorFaceTarget,
|
||||
kOpcodeHidMatteBars,
|
||||
kOpcodeShowMatteBars,
|
||||
kOpcodeJumpIfSoundPlaying,
|
||||
kOpcodeChangePlayer, // 75
|
||||
kOpcodeChangeActorStatus,
|
||||
kOpcodeStopSound,
|
||||
kOpcodeJumpRandom,
|
||||
kOpcodeClearScreen,
|
||||
kOpcodeQuit, // 80
|
||||
kOpcodeJumpObjectFrame,
|
||||
kOpcodeDeleteGraphics,
|
||||
kOpcodeSetPlayerField944,
|
||||
kOpcodeSetScriptField1BB0,
|
||||
kOpcodeOnScriptField1BB0, // 85
|
||||
kOpcodeInteract,
|
||||
kOpcodeSetResourcePalette,
|
||||
kOpcodeSetObjectFrameIndexAndFlags,
|
||||
kOpcodeSetObjectFlags,
|
||||
kOpcodeSetActorActionIndex2, // 90
|
||||
kOpcodeUpdateObjectFields,
|
||||
kOpcodeQueueScript,
|
||||
kOpcodeProcessActor,
|
||||
kOpcodeClearActorFields,
|
||||
kOpcodeSetObjectLastFrameIndex, // 95
|
||||
kOpcodeSetActionAreaFlags,
|
||||
kOpcodeUpdatePlayerChapter9,
|
||||
kOpcodeShowMenu,
|
||||
kOpcodeUpdateGlobalFlags
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Actor
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue