MADS: Replace more verbs with friendly names and fix usages of isAction

This commit is contained in:
Filippos Karapetis 2014-05-20 04:50:35 +03:00
parent 7f8c1e9a48
commit 0d09060fa8
6 changed files with 67 additions and 57 deletions

View File

@ -39,8 +39,10 @@ enum {
};
enum Verb {
VERB_ACTIVATE = 0x00E,
VERB_CAST = 0x03D,
VERB_CLIMB_DOWN = 0x04E,
VERB_CLIMB_THROUGH = 0x04F,
VERB_CLIMB_UP = 0x050,
VERB_DIVE_INTO = 0x06D,
VERB_EAT = 0x075,
@ -57,6 +59,7 @@ enum Verb {
VERB_PEER_THROUGH = 0x103,
VERB_PLAY = 0x112,
VERB_PRESS = 0x11A,
VERB_PRY = 0x11C,
VERB_READ = 0x11F,
VERB_SHOOT = 0x13A,
VERB_SIT_IN = 0x13F,
@ -72,16 +75,22 @@ enum Verb {
VERB_WALK_THROUGH = 0x18B,
VERB_WALK_TOWARDS = 0x18C,
VERB_WALK_DOWN = 0x1AD,
VERB_LEAVE = 0x1CD,
VERB_EXIT_FROM = 0x1CE,
VERB_USE = 0x20C,
VERB_SIT_AT = 0x21F,
VERB_WALK_UP = 0x227,
VERB_WALK_INTO = 0x242,
VERB_EXIT = 0x298,
VERB_WALK_ONTO = 0x2B5,
VERB_RETURN_TO = 0x2D5,
VERB_CLIMB_INTO = 0x2F7,
VERB_STEP_INTO = 0x2F9,
VERB_CRAWL_TO = 0x2FB,
VERB_SIT_ON = 0x30B,
VERB_WALK_ALONG = 0x312,
VERB_WALK = 0x32F,
VERB_REFLECT = 0x365,
VERB_GET_INTO = 0x36A,
VERB_ENTER = 0x3B8,
VERB_INSTALL = 0x474,
@ -103,6 +112,7 @@ enum Noun {
NOUN_CONTROL_PANEL = 0x59,
NOUN_DEAD_FISH = 0x65,
NOUN_DOOR = 0x6E,
NOUN_DRAWER = 0x71,
NOUN_ENTER_KEY = 0x7A,
NOUN_FISHING_LINE = 0x87,
NOUN_FISHING_ROD = 0x88,
@ -121,7 +131,7 @@ enum Noun {
NOUN_OUTSIDE = 0x0F9,
NOUN_PIRANHA = 0x10D,
NOUN_PLANT_STALK = 0x10F,
NOUN_REFRIDGERATOR = 0x122,
NOUN_REFRIGERATOR = 0x122,
NOUN_ROBO_KITCHEN = 0x127,
NOUN_ROCK = 0x128,
NOUN_ROCKS = 0x129,

View File

@ -475,7 +475,7 @@ void Scene101::actions() {
return;
}
if ((_action.isAction(VERB_LOOK) || _action.isAction(VERB_PEER_THROUGH)) && (_action.isAction(0x8E) || _action.isAction(0xF9))) {
if ((_action.isAction(VERB_LOOK) || _action.isAction(VERB_PEER_THROUGH)) && (_action.isObject(NOUN_FRONT_WINDOW) || _action.isObject(NOUN_OUTSIDE))) {
_vm->_dialogs->show(10102);
_action._inProgress = false;
return;
@ -595,7 +595,7 @@ void Scene101::actions() {
return;
}
if ((_action.isAction(VERB_LOOK) || _action.isAction(VERB_PLAY)) && _action.isAction(0x17E)) {
if ((_action.isAction(VERB_LOOK) || _action.isAction(VERB_PLAY)) && _action.isObject(0x17E)) {
_vm->_dialogs->show(10124);
_action._inProgress = false;
return;
@ -758,10 +758,10 @@ void Scene102::step() {
}
void Scene102::preActions() {
if (_action.isAction(0x122) || _action.isAction(0x117))
if (_action.isObject(0x122) || _action.isObject(0x117))
_game._player._needToWalk = _game._player._readyToWalk;
if (_fridgeOpenedFl && !_action.isAction(0x122)) {
if (_fridgeOpenedFl && !_action.isObject(0x122)) {
switch (_game._trigger) {
case 0:
if (_game._player._needToWalk) {
@ -798,7 +798,7 @@ void Scene102::actions() {
return;
}
if (_action.isObject(0x122) && !_fridgeOpenedFl) {
if (_action.isObject(NOUN_REFRIGERATOR) && !_fridgeOpenedFl) {
switch (_game._trigger) {
case 0:
_globals._sequenceIndexes[7] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[7], false, 6, 1, 0, 0);
@ -838,7 +838,7 @@ void Scene102::actions() {
}
}
if (_action.isAction(VERB_LOOK, 0x122) || _action.isAction(VERB_OPEN, 0x122)) {
if (_action.isAction(VERB_LOOK, NOUN_REFRIGERATOR) || _action.isAction(VERB_OPEN, NOUN_REFRIGERATOR)) {
if (_game._objects.isInRoom(OBJ_BURGER))
_vm->_dialogs->show(10230);
else
@ -849,7 +849,7 @@ void Scene102::actions() {
return;
}
if (_action.isAction(VERB_WALKTO, 0x122) && justOpenedFl) {
if (_action.isAction(VERB_WALKTO, NOUN_REFRIGERATOR) && justOpenedFl) {
_fridgeFirstOpenFl = false;
int quoteId = _vm->getRandomNumber(59, 63);
Common::String curQuote = _game.getQuote(quoteId);
@ -863,13 +863,13 @@ void Scene102::actions() {
return;
}
if (_action.isAction(VERB_CLOSE, 0x122)) {
if (_action.isAction(VERB_CLOSE, NOUN_REFRIGERATOR)) {
_vm->_dialogs->show(10213);
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_TAKE, 0x122)) {
if (_action.isAction(VERB_TAKE, NOUN_REFRIGERATOR)) {
_vm->_dialogs->show(8);
_action._inProgress = false;
return;
@ -934,31 +934,31 @@ void Scene102::actions() {
return;
}
if (_action.isAction(VERB_LOOK, 0x127)) {
if (_action.isAction(VERB_LOOK, NOUN_ROBO_KITCHEN)) {
_vm->_dialogs->show(10215);
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_PUT, 0x35, 0x127) && _game._objects.isInInventory(OBJ_BURGER)) {
if (_action.isAction(VERB_PUT, NOUN_BURGER, NOUN_ROBO_KITCHEN) && _game._objects.isInInventory(OBJ_BURGER)) {
_vm->_dialogs->show(10216);
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_PUT, 0x122) && _game._objects.isInInventory(_game._objects.getIdFromDesc(_action._activeAction._objectNameId))) {
if (_action.isAction(VERB_PUT, NOUN_REFRIGERATOR) && _game._objects.isInInventory(_game._objects.getIdFromDesc(_action._activeAction._objectNameId))) {
_vm->_dialogs->show(10217);
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_PUT, 0x127) && (_action.isAction(0x65) || _action.isAction(0x157))) {
if (_action.isAction(VERB_PUT, NOUN_DEAD_FISH, NOUN_ROBO_KITCHEN) || _action.isAction(VERB_PUT, NOUN_STUFFED_FISH, NOUN_ROBO_KITCHEN)) {
_vm->_dialogs->show(10230);
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_OPEN, 0x127)) {
if (_action.isAction(VERB_OPEN, NOUN_ROBO_KITCHEN)) {
_vm->_dialogs->show(10218);
_action._inProgress = false;
return;
@ -970,9 +970,9 @@ void Scene102::actions() {
return;
}
if ((_action.isObject(0xC7) || _action.isObject(0xA3)) && (_action.isAction(VERB_LOOK) || _action.isAction(VERB_CLIMB_UP) || _action.isAction(0x4F))) {
if ((_action.isObject(NOUN_LADDER) || _action.isObject(0xA3)) && (_action.isAction(VERB_LOOK) || _action.isAction(VERB_CLIMB_UP) || _action.isAction(VERB_CLIMB_THROUGH))) {
if (_game._objects.isInInventory(OBJ_REBREATHER)) {
if (!_action.isAction(VERB_CLIMB_UP) && !_action.isAction(0x4F)) {
if (!_action.isAction(VERB_CLIMB_UP) && !_action.isAction(VERB_CLIMB_THROUGH)) {
_vm->_dialogs->show(10231);
_action._inProgress = false;
return;
@ -984,7 +984,7 @@ void Scene102::actions() {
}
}
if ((_action.isObject(0xC7) || _action.isObject(0xA3)) && (_action.isAction(VERB_CLIMB_UP) || _action.isAction(0x4F)) ) {
if ((_action.isObject(NOUN_LADDER) || _action.isObject(0xA3)) && (_action.isAction(VERB_CLIMB_UP) || _action.isAction(VERB_CLIMB_THROUGH)) ) {
switch (_game._trigger) {
case 0:
_scene->loadAnimation(formAnimName('A', -1), 1);
@ -1037,20 +1037,20 @@ void Scene102::actions() {
return;
}
if (_action.isAction(VERB_LOOK, 0x71) || ((_action.isAction(VERB_CLOSE, 0x71) || _action.isAction(VERB_PUSH, 0x71)) && !_drawerDescrFl)) {
if (_action.isAction(VERB_LOOK, NOUN_DRAWER) || ((_action.isAction(VERB_CLOSE, NOUN_DRAWER) || _action.isAction(VERB_PUSH, NOUN_DRAWER)) && !_drawerDescrFl)) {
_vm->_dialogs->show(10220);
_drawerDescrFl = true;
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_CLOSE, 0x71) || _action.isAction(VERB_PUSH, 0x71)) {
if (_action.isAction(VERB_CLOSE, NOUN_DRAWER) || _action.isAction(VERB_PUSH, NOUN_DRAWER)) {
_vm->_dialogs->show(10221);
_action._inProgress = false;
return;
}
if (_action.isAction(VERB_OPEN, 0x71)) {
if (_action.isAction(VERB_OPEN, NOUN_DRAWER)) {
_vm->_dialogs->show(10236);
_action._inProgress = false;
return;
@ -1177,7 +1177,7 @@ void Scene102::actions() {
return;
}
if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isAction(0x194)) {
if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(0x194)) {
_vm->_dialogs->show(10225);
_action._inProgress = false;
return;
@ -1849,7 +1849,7 @@ void Scene105::preActions() {
if (_action.isAction(VERB_SWIM_TOWARDS, 0xF5))
_game._player._walkOffScreenSceneId = 107;
if (_action.isAction(0xE0) && (_action.isAction(VERB_TALKTO) || _action.isAction(VERB_LOOK)))
if (_action.isObject(0xE0) && (_action.isAction(VERB_TALKTO) || _action.isAction(VERB_LOOK)))
_game._player._needToWalk = false;
}
@ -2085,7 +2085,7 @@ void Scene106::actions() {
_vm->_dialogs->show(10605);
else if (_action.isAction(VERB_LOOK, 0x109) || _action.isAction(VERB_LOOK_AT, 0x109))
_vm->_dialogs->show(10606);
else if (_action.isAction(0x109) && (_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL) || _action.isAction(VERB_TAKE)))
else if (_action.isObject(0x109) && (_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL) || _action.isAction(VERB_TAKE)))
_vm->_dialogs->show(10607);
else if (_action.isAction(VERB_LOOK, 0x139) || _action.isAction(VERB_LOOK_AT, 0x139))
_vm->_dialogs->show(10608);
@ -2692,7 +2692,7 @@ void Scene109::actions() {
_vm->_dialogs->show(10901);
else if (_action.isAction(VERB_LOOK, 0x5A))
_vm->_dialogs->show(10902);
else if ((_action.isAction(VERB_TAKE) || _action.isAction(VERB_PULL)) && _action.isAction(0x5A))
else if ((_action.isAction(VERB_TAKE) || _action.isAction(VERB_PULL)) && _action.isObject(0x5A))
_vm->_dialogs->show(10903);
else if (_action.isAction(VERB_LOOK, 0x129))
_vm->_dialogs->show(10904);
@ -2992,7 +2992,7 @@ void Scene111::actions() {
_vm->_dialogs->show(11104);
else if (_action.isAction(VERB_LOOK, 0xC8))
_vm->_dialogs->show(11105);
else if ((_action.isAction(VERB_PULL) || _action.isAction(VERB_TAKE)) && (_action.isAction(0x153) || _action.isAction(0xC8)))
else if ((_action.isAction(VERB_PULL) || _action.isAction(VERB_TAKE)) && (_action.isObject(0x153) || _action.isObject(0xC8)))
_vm->_dialogs->show(11106);
else
return;

View File

@ -884,7 +884,7 @@ void Scene307::actions() {
setDialogNode(node);
break;
}
} else if (_action.isAction(0x11C, 0x12C, 0x11)) {
} else if (_action.isAction(VERB_PRY, 0x12C, 0x11)) {
switch (_game._trigger) {
case 0:
_game._player._stepEnabled = false;
@ -1042,9 +1042,9 @@ void Scene307::actions() {
break;
}
}
} else if (_action.isAction(0x20C, 0x21B) && (_game._storyMode != STORYMODE_NAUGHTY))
} else if (_action.isAction(VERB_USE, 0x21B) && (_game._storyMode != STORYMODE_NAUGHTY))
_vm->_dialogs->show(30723);
else if (_action.isAction(0x20C, 0x21B)) {
else if (_action.isAction(VERB_USE, 0x21B)) {
if (!_afterPeeingFl) {
switch (_game._trigger) {
case 0:
@ -1696,7 +1696,7 @@ void Scene311::actions() {
_checkGuardFl = false;
_scene->_kernelMessages.reset();
_scene->_kernelMessages.addQuote(0xFA, 120, 0);
} else if (_action.isAction(0x21F, 0x1E4))
} else if (_action.isAction(VERB_SIT_AT, 0x1E4))
_scene->_nextSceneId = 320;
else if (_action.isAction(VERB_CLIMB_INTO, 0x11)) {
switch (_game._trigger) {
@ -1866,24 +1866,24 @@ void Scene313::enter() {
}
void Scene313::actions() {
if (_action.isAction(0x2FB, 0x2FC))
if (_action.isAction(VERB_CRAWL_TO, 0x2FC))
_scene->_nextSceneId = 387;
else if (_action.isAction(0x2FB, 0x2FD))
else if (_action.isAction(VERB_CRAWL_TO, 0x2FD))
_scene->_nextSceneId = 388;
else if (_action.isAction(0x2FB, 0x2FE)) {
else if (_action.isAction(VERB_CRAWL_TO, 0x2FE)) {
if (_globals[kAfterHavoc])
_scene->_nextSceneId = 399;
else
_scene->_nextSceneId = 389;
} else if (_action.isAction(0x2FB, 0x2FF))
} else if (_action.isAction(VERB_CRAWL_TO, 0x2FF))
_scene->_nextSceneId = 390;
else if (_action.isAction(0x2FB, 0x2EF)) {
else if (_action.isAction(VERB_CRAWL_TO, 0x2EF)) {
if (_globals[kSexOfRex] == REX_FEMALE) {
_globals[kSexOfRex] = REX_MALE;
_vm->_dialogs->show(31301);
}
_scene->_nextSceneId = 391;
} else if (_action.isAction(0x2FB, 0x300)) {
} else if (_action.isAction(VERB_CRAWL_TO, 0x300)) {
if (_globals[kSexOfRex] == REX_FEMALE) {
_globals[kSexOfRex] = REX_MALE;
_vm->_dialogs->show(31301);
@ -3642,10 +3642,10 @@ void Scene320::actions() {
if (_action._lookFlag)
_vm->_dialogs->show(32011);
else if ((_action.isAction(VERB_PRESS) || _action.isAction(VERB_PUSH)) &&
(_action.isAction(0x2E8) || _action.isAction(0x2E9) || _action.isAction(0x2EA) || _action.isAction(0x2EB) ||
_action.isAction(0x2DE) || _action.isAction(0x2DD) || _action.isAction(0x2E0) || _action.isAction(0x2E1) ||
_action.isAction(0x2E2) || _action.isAction(0x2E3) || _action.isAction(0x2E4) || _action.isAction(0x2E5) ||
_action.isAction(0x2E6) || _action.isAction(0x2E7)
(_action.isObject(0x2E8) || _action.isObject(0x2E9) || _action.isObject(0x2EA) || _action.isObject(0x2EB) ||
_action.isObject(0x2DE) || _action.isObject(0x2DD) || _action.isObject(0x2E0) || _action.isObject(0x2E1) ||
_action.isObject(0x2E2) || _action.isObject(0x2E3) || _action.isObject(0x2E4) || _action.isObject(0x2E5) ||
_action.isObject(0x2E6) || _action.isObject(0x2E7)
)) {
switch (_game._trigger) {
case 0:
@ -3709,7 +3709,7 @@ void Scene320::actions() {
default:
break;
}
} else if (_action.isAction(0x1CD, 0x2EF))
} else if (_action.isAction(VERB_LEAVE, 0x2EF))
_scene->_nextSceneId = 311;
else if (_action.isAction(VERB_LOOK, 0x2DC))
_vm->_dialogs->show(32001);
@ -5358,7 +5358,7 @@ void Scene361::preActions() {
void Scene361::actions() {
if (_action._lookFlag)
_vm->_dialogs->show(36119);
else if (_action.isAction(0x21F, 0x1E4)) {
else if (_action.isAction(VERB_SIT_AT, 0x1E4)) {
_scene->_kernelMessages.reset();
_scene->_kernelMessages.addQuote(0xFC, 120, 0);
} else if (_action.isAction(VERB_CLIMB_INTO, 0x11)) {
@ -5406,7 +5406,7 @@ void Scene366::enter() {
}
void Scene366::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 302;
else if (_action.isAction(VERB_OPEN, 0x2D3)) {
if (_game._visitedScenes.exists(316))
@ -5441,7 +5441,7 @@ void Scene387::enter() {
}
void Scene387::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 313;
else if (_action.isAction(VERB_LOOK_THROUGH, 0x2D3))
_vm->_dialogs->show(38710);
@ -5479,7 +5479,7 @@ void Scene388::enter() {
}
void Scene388::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 313;
else if (_action.isAction(VERB_TALKTO, 0x303)) {
switch (_game._trigger) {
@ -5556,7 +5556,7 @@ void Scene389::step() {
}
void Scene389::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 313;
else if (_action.isAction(VERB_TALKTO, 0x304)) {
switch (_game._trigger) {
@ -5617,7 +5617,7 @@ void Scene390::enter() {
}
void Scene390::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 313;
else if (_action.isAction(VERB_LOOK_THROUGH, 0x2D3))
_vm->_dialogs->show(39010);
@ -5643,7 +5643,7 @@ void Scene391::enter() {
}
void Scene391::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 313;
else if (_action.isAction(VERB_OPEN, 0x2D3)) {
if (_globals[kKickedIn391Grate])
@ -5682,7 +5682,7 @@ void Scene399::enter() {
}
void Scene399::actions() {
if (_action.isAction(0x2D5, 0x2D4))
if (_action.isAction(VERB_RETURN_TO, 0x2D4))
_scene->_nextSceneId = 313;
else if (_action.isAction(VERB_LOOK_THROUGH, 0x2D3)) {
if (_globals[kAfterHavoc]) {

View File

@ -274,7 +274,7 @@ void Scene501::step() {
}
void Scene501::preActions() {
if (_action.isAction(VERB_WALK_DOWN) && (_action.isAction(0x321) || _action.isAction(0x322)))
if (_action.isAction(VERB_WALK_DOWN) && (_action.isObject(0x321) || _action.isObject(0x322)))
_game._player._walkOffScreenSceneId = 551;
}
@ -745,7 +745,7 @@ void Scene504::actions() {
if (_action.isAction(VERB_EXIT_FROM, 0x324)) {
_vm->_sound->command(15);
_scene->_nextSceneId = _globals[kHoverCarLocation];
} else if (_action.isAction(0xE, 0x380)) {
} else if (_action.isAction(VERB_ACTIVATE, 0x380)) {
switch (_game._trigger) {
case 0:
_game._player._stepEnabled = false;
@ -1073,7 +1073,7 @@ void Scene505::step() {
void Scene505::actions() {
if (_action.isAction(VERB_PRESS))
_nextButtonId = _action._activeAction._objectNameId;
else if (_action.isAction(0x2D5, 0x38C))
else if (_action.isAction(VERB_RETURN_TO, 0x38C))
_scene->_nextSceneId = 504;
else if (_action.isAction(VERB_LOOK, 0x180))
_vm->_dialogs->show(50510);
@ -1651,10 +1651,10 @@ void Scene508::actions() {
} else {
_vm->_dialogs->show(50837);
}
} else if (_action.isAction(0x365, 0x120, 0x343) || _action.isAction(VERB_PUT, 0x120, 0x344) || _action.isAction(VERB_PUT, 0x120, 0x343)) {
} else if (_action.isAction(VERB_REFLECT, 0x120, 0x343) || _action.isAction(VERB_PUT, 0x120, 0x344) || _action.isAction(VERB_PUT, 0x120, 0x343)) {
_chosenObject = 1;
handlePedestral();
} else if (_action.isAction(VERB_PUT, 0x57, 0x344) || _action.isAction(VERB_PUT, 0x57, 0x343) || _action.isAction(0x365, 0x57, 0x343)) {
} else if (_action.isAction(VERB_PUT, 0x57, 0x344) || _action.isAction(VERB_PUT, 0x57, 0x343) || _action.isAction(VERB_REFLECT, 0x57, 0x343)) {
_chosenObject = 2;
handlePedestral();
} else if (_action._lookFlag)
@ -2681,7 +2681,7 @@ void Scene551::step() {
}
void Scene551::preActions() {
if (_action.isAction(VERB_WALK_DOWN) && (_action.isAction(0x360) || _action.isAction(0x361)))
if (_action.isAction(VERB_WALK_DOWN) && (_action.isObject(0x360) || _action.isObject(0x361)))
_game._player._walkOffScreenSceneId = 501;
}

View File

@ -402,7 +402,7 @@ void Scene602::actions() {
handleSafeActions();
}
} else if ((_action.isAction(VERB_PUT, 0x120, 0x343) || _action.isAction(VERB_PUT, 0x57, 0x343)
|| _action.isAction(0x365, 0x57, 0x343) || _action.isAction(0x365, 0x120, 0x343)) && (_globals[kSafeStatus] == 0)) {
|| _action.isAction(VERB_REFLECT, 0x57, 0x343) || _action.isAction(VERB_REFLECT, 0x120, 0x343)) && (_globals[kSafeStatus] == 0)) {
switch (_game._trigger) {
case 0:
_vm->_dialogs->show(60230);

View File

@ -1625,7 +1625,7 @@ void Scene705::actions() {
default:
break;
}
} else if (_action.isAction(0x4F, 0x197)) {
} else if (_action.isAction(VERB_CLIMB_THROUGH, 0x197)) {
switch (_game._trigger) {
case 0:
_game._player._stepEnabled = false;