cleanup
svn-id: r11108
This commit is contained in:
parent
6e60d7b827
commit
ca9638e4f6
5 changed files with 254 additions and 306 deletions
|
@ -96,6 +96,33 @@ bool CmdText::isEmpty() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CurrentCmdState::init() {
|
||||||
|
|
||||||
|
commandLevel = 1;
|
||||||
|
oldVerb = verb = action = Verb(VERB_NONE);
|
||||||
|
oldNoun = noun = subject1 = subject2 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CurrentCmdState::addObject(int16 objNum) {
|
||||||
|
|
||||||
|
switch (commandLevel) {
|
||||||
|
case 1:
|
||||||
|
subject1 = objNum;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
subject2 = objNum;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SelectedCmdState::init() {
|
||||||
|
|
||||||
|
action = defaultVerb = Verb(VERB_NONE);
|
||||||
|
noun = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Command::Command(Logic *l, Graphics *g, Input *i, Walk *w)
|
Command::Command(Logic *l, Graphics *g, Input *i, Walk *w)
|
||||||
: _logic(l), _graphics(g), _input(i), _walk(w) {
|
: _logic(l), _graphics(g), _input(i), _walk(w) {
|
||||||
|
@ -111,13 +138,8 @@ void Command::clear(bool clearTexts) {
|
||||||
_graphics->textClear(151, 151);
|
_graphics->textClear(151, 151);
|
||||||
}
|
}
|
||||||
_parse = false;
|
_parse = false;
|
||||||
|
_curCmd.init();
|
||||||
_curCmd.commandLevel = 1;
|
_selCmd.init();
|
||||||
_curCmd.oldVerb = _curCmd.verb = _curCmd.action = Verb(VERB_NONE);
|
|
||||||
_curCmd.oldNoun = _curCmd.noun = 0;
|
|
||||||
|
|
||||||
_selCmd.action = _selCmd.defaultVerb = Verb(VERB_NONE);
|
|
||||||
_selCmd.noun = _selCmd.subject1 = _selCmd.subject2 = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,11 +159,11 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
uint16 objMax = _logic->currentRoomObjMax();
|
uint16 objMax = _logic->currentRoomObjMax();
|
||||||
uint16 roomData = _logic->currentRoomData();
|
uint16 roomData = _logic->currentRoomData();
|
||||||
|
|
||||||
if (_mouseKey == Input::MOUSE_RBUTTON && _selCmd.subject1 != 0) {
|
if (_mouseKey == Input::MOUSE_RBUTTON && _curCmd.subject1 != 0) {
|
||||||
// check to see if selecting default command for object/item
|
// check to see if selecting default command for object/item
|
||||||
if (_selCmd.subject1 > 0) {
|
if (_curCmd.subject1 > 0) {
|
||||||
// an object
|
// an object
|
||||||
int16 i = _selCmd.subject1;
|
int16 i = _curCmd.subject1;
|
||||||
if (_curCmd.noun > objMax) {
|
if (_curCmd.noun > objMax) {
|
||||||
int16 aObj = _logic->currentRoomArea(_curCmd.noun - objMax)->object;
|
int16 aObj = _logic->currentRoomArea(_curCmd.noun - objMax)->object;
|
||||||
int16 aObjName = _logic->objectData(aObj)->name;
|
int16 aObjName = _logic->objectData(aObj)->name;
|
||||||
|
@ -173,7 +195,7 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// an item
|
// an item
|
||||||
int16 name = _logic->itemData(ABS(_selCmd.subject1))->name;
|
int16 name = _logic->itemData(ABS(_curCmd.subject1))->name;
|
||||||
obj1Name = _logic->objectName(name);
|
obj1Name = _logic->objectName(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,8 +209,8 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
// XXX SUBJECT[2]=0;
|
// XXX SUBJECT[2]=0;
|
||||||
|
|
||||||
// get objects names
|
// get objects names
|
||||||
obj1Name = _logic->objectOrItemName(_selCmd.subject1);
|
obj1Name = _logic->objectOrItemName(_curCmd.subject1);
|
||||||
obj2Name = _logic->objectOrItemName(_selCmd.subject2);
|
obj2Name = _logic->objectOrItemName(_curCmd.subject2);
|
||||||
|
|
||||||
if (handleBadCommand(walk)) {
|
if (handleBadCommand(walk)) {
|
||||||
cleanupCurrentAction();
|
cleanupCurrentAction();
|
||||||
|
@ -196,12 +218,12 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the number of commands associated with Object/Item
|
// get the number of commands associated with Object/Item
|
||||||
uint16 comMax = countAssociatedCommands(_selCmd.action, _selCmd.subject1, _selCmd.subject2);
|
uint16 comMax = countAssociatedCommands(_selCmd.action, _curCmd.subject1, _curCmd.subject2);
|
||||||
if (comMax == 0) {
|
if (comMax == 0) {
|
||||||
// no command match was found, so exit
|
// no command match was found, so exit
|
||||||
// pass ACTION2 as paramater, as a new Command (and a new ACTION2)
|
// pass ACTION2 as parameter, as a new Command (and a new ACTION2)
|
||||||
// can be constructed while Joe speaks
|
// can be constructed while Joe speaks
|
||||||
executeStandardStuff(_selCmd.action, _selCmd.subject1, _selCmd.subject2);
|
executeStandardStuff(_selCmd.action, _curCmd.subject1, _curCmd.subject2);
|
||||||
cleanupCurrentAction();
|
cleanupCurrentAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -209,7 +231,7 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
// process each associated command for the Object, until all done
|
// process each associated command for the Object, until all done
|
||||||
// or one of the Gamestate tests fails...
|
// or one of the Gamestate tests fails...
|
||||||
int16 cond = 0;
|
int16 cond = 0;
|
||||||
CmdListData *com = &_cmdList[0];
|
CmdListData *com = &_cmdList[1];
|
||||||
uint16 comId = 0;
|
uint16 comId = 0;
|
||||||
uint16 curCommand;
|
uint16 curCommand;
|
||||||
for (curCommand = 1; curCommand <= comMax; ++curCommand) {
|
for (curCommand = 1; curCommand <= comMax; ++curCommand) {
|
||||||
|
@ -217,7 +239,7 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
++comId;
|
++comId;
|
||||||
// try to find a match for the command in COM_LIST
|
// try to find a match for the command in COM_LIST
|
||||||
for (; comId <= _numCmdList; ++comId, ++com) {
|
for (; comId <= _numCmdList; ++comId, ++com) {
|
||||||
if (com->match(_selCmd.action, _selCmd.subject1, _selCmd.subject2)) {
|
if (com->match(_selCmd.action, _curCmd.subject1, _curCmd.subject2)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,11 +280,11 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
|
|
||||||
// Don't grab if action is TALK or WALK
|
// Don't grab if action is TALK or WALK
|
||||||
if (_selCmd.action.value() != VERB_TALK_TO && _selCmd.action.value() != VERB_WALK_TO) {
|
if (_selCmd.action.value() != VERB_TALK_TO && _selCmd.action.value() != VERB_WALK_TO) {
|
||||||
if (_selCmd.subject1 > 0) {
|
if (_curCmd.subject1 > 0) {
|
||||||
_logic->joeGrab(_logic->objectData(_selCmd.subject1)->state, 0);
|
_logic->joeGrab(_logic->objectData(_curCmd.subject1)->state, 0);
|
||||||
}
|
}
|
||||||
if (_selCmd.subject2 > 0) {
|
if (_curCmd.subject2 > 0) {
|
||||||
_logic->joeGrab(_logic->objectData(_selCmd.subject2)->state, 0);
|
_logic->joeGrab(_logic->objectData(_curCmd.subject2)->state, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,9 +317,9 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 oldImage = 0;
|
int16 oldImage = 0;
|
||||||
if (_selCmd.subject1 > 0) {
|
if (_curCmd.subject1 > 0) {
|
||||||
// an object (not an item)
|
// an object (not an item)
|
||||||
oldImage = _logic->objectData(_selCmd.subject1)->image;
|
oldImage = _logic->objectData(_curCmd.subject1)->image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (com->setObjects) {
|
if (com->setObjects) {
|
||||||
|
@ -308,7 +330,7 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (com->imageOrder != 0) {
|
if (com->imageOrder != 0) {
|
||||||
ObjectData* od = _logic->objectData(_selCmd.subject1);
|
ObjectData* od = _logic->objectData(_curCmd.subject1);
|
||||||
// we must update the graphic image of the object
|
// we must update the graphic image of the object
|
||||||
if (com->imageOrder < 0) {
|
if (com->imageOrder < 0) {
|
||||||
// instead of setting to -1 or -2, flag as negative
|
// instead of setting to -1 or -2, flag as negative
|
||||||
|
@ -320,15 +342,15 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
else {
|
else {
|
||||||
od->image = com->imageOrder;
|
od->image = com->imageOrder;
|
||||||
}
|
}
|
||||||
_logic->roomRefreshObject(_selCmd.subject1);
|
_logic->roomRefreshObject(_curCmd.subject1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// this object is not being updated by command list, see if
|
// this object is not being updated by command list, see if
|
||||||
// it has another image copied to it
|
// it has another image copied to it
|
||||||
if (_selCmd.subject1 > 0) {
|
if (_curCmd.subject1 > 0) {
|
||||||
// an object (not an item)
|
// an object (not an item)
|
||||||
if (_logic->objectData(_selCmd.subject1)->image != oldImage) {
|
if (_logic->objectData(_curCmd.subject1)->image != oldImage) {
|
||||||
_logic->roomRefreshObject(_selCmd.subject1);
|
_logic->roomRefreshObject(_curCmd.subject1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -361,7 +383,7 @@ void Command::executeCurrentAction(bool walk) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
changeObjectState(_selCmd.action, _selCmd.subject1, com->song, cutDone);
|
changeObjectState(_selCmd.action, _curCmd.subject1, com->song, cutDone);
|
||||||
|
|
||||||
if (_selCmd.action.value() == VERB_TALK_TO && cond > 0) {
|
if (_selCmd.action.value() == VERB_TALK_TO && cond > 0) {
|
||||||
if (executeIfDialog(_logic->objectTextualDescription(cond))) {
|
if (executeIfDialog(_logic->objectTextualDescription(cond))) {
|
||||||
|
@ -417,7 +439,7 @@ void Command::updatePlayer() {
|
||||||
|
|
||||||
if (_input->keyVerb().isJournal()) {
|
if (_input->keyVerb().isJournal()) {
|
||||||
// XXX queen.c l.348-365
|
// XXX queen.c l.348-365
|
||||||
warning("Command::updatePlayer() - Journal not implemented");
|
warning("Command::updatePlayer() - Journal not yet implemented");
|
||||||
}
|
}
|
||||||
else if (!_input->keyVerb().isSkipText()) {
|
else if (!_input->keyVerb().isSkipText()) {
|
||||||
_curCmd.verb = _input->keyVerb();
|
_curCmd.verb = _input->keyVerb();
|
||||||
|
@ -496,6 +518,56 @@ void Command::readCommandsFrom(byte *&ptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, const Verb &v, bool mustWalk) {
|
||||||
|
|
||||||
|
// Check to see if object is actually an exit to another
|
||||||
|
// room. If so, then set up new room
|
||||||
|
|
||||||
|
|
||||||
|
ObjectData *objData = _logic->objectData(objNum);
|
||||||
|
if (objData->x != 0 || objData->y != 0) {
|
||||||
|
x = objData->x;
|
||||||
|
y = objData->y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (v.value() == VERB_WALK_TO) {
|
||||||
|
_logic->entryObj(objData->entryObj);
|
||||||
|
if (_logic->entryObj() != 0) {
|
||||||
|
_logic->newRoom(_logic->objectData(_logic->entryObj())->room);
|
||||||
|
// because this is an exit object, see if there is
|
||||||
|
// a walk off point and set (x,y) accordingly
|
||||||
|
WalkOffData *wod = _logic->walkOffPointForObject(objNum);
|
||||||
|
if (wod != NULL) {
|
||||||
|
x = wod->x;
|
||||||
|
y = wod->y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_logic->entryObj(0);
|
||||||
|
_logic->newRoom(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int16 p = 0;
|
||||||
|
if (mustWalk) {
|
||||||
|
// determine which way for Joe to face Object
|
||||||
|
uint16 facing = State::findDirection(objData->state);
|
||||||
|
|
||||||
|
BobSlot *bobJoe = _graphics->bob(0);
|
||||||
|
if (x == bobJoe->x && y == bobJoe->y) {
|
||||||
|
_logic->joeFacing(facing);
|
||||||
|
_logic->joeFace();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
p = _walk->joeMove(facing, x, y, false); // XXX inCutaway parameter
|
||||||
|
// XXX if(P != 0) P = FIND_VERB
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Command::grabCurrentSelection() {
|
void Command::grabCurrentSelection() {
|
||||||
|
|
||||||
_selPosX = _input->mousePosX();
|
_selPosX = _input->mousePosX();
|
||||||
|
@ -525,6 +597,51 @@ void Command::grabCurrentSelection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Command::grabSelectedObject(int16 objNum, uint16 objState, uint16 objName) {
|
||||||
|
|
||||||
|
if (!_curCmd.action.isNone()) {
|
||||||
|
_cmdText.addObject(_logic->objectName(objName));
|
||||||
|
}
|
||||||
|
|
||||||
|
_curCmd.addObject(objNum);
|
||||||
|
|
||||||
|
// if first noun and it's a 2 level command then set up action word
|
||||||
|
if (_curCmd.action.value() == VERB_USE && _curCmd.commandLevel == 1) {
|
||||||
|
if (State::findUse(objState) == STATE_USE_ON) {
|
||||||
|
// object supports 2 levels
|
||||||
|
_curCmd.commandLevel = 2;
|
||||||
|
_cmdText.addLinkWord(Verb(VERB_PREP_WITH));
|
||||||
|
// command not fully constructed
|
||||||
|
_cmdText.display(INK_CMD_NORMAL);
|
||||||
|
_parse = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_cmdText.display(INK_CMD_SELECT);
|
||||||
|
_parse = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_curCmd.action.value() == VERB_GIVE && _curCmd.commandLevel == 1) {
|
||||||
|
_curCmd.commandLevel = 2;
|
||||||
|
_cmdText.addLinkWord(Verb(VERB_PREP_TO));
|
||||||
|
// command not fully constructed
|
||||||
|
_cmdText.display(INK_CMD_NORMAL);
|
||||||
|
_parse = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_cmdText.display(INK_CMD_SELECT);
|
||||||
|
_parse = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_parse) {
|
||||||
|
_curCmd.verb = Verb(VERB_NONE);
|
||||||
|
_logic->joeWalk(2); // set JOEWALK flag to perform EXECUTE_ACTION procedure
|
||||||
|
_selCmd.action = _curCmd.action;
|
||||||
|
_curCmd.action = Verb(VERB_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Command::grabSelectedItem() {
|
void Command::grabSelectedItem() {
|
||||||
|
|
||||||
// if the NOUN has been selected from screen then it is positive
|
// if the NOUN has been selected from screen then it is positive
|
||||||
|
@ -601,47 +718,7 @@ void Command::grabSelectedItem() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_curCmd.action.isTwoLevelsCommand() && _curCmd.commandLevel == 1) {
|
grabSelectedObject(-item, _logic->itemData(item)->state, _logic->itemData(item)->name);
|
||||||
_parse = false;
|
|
||||||
}
|
|
||||||
if (!_curCmd.action.isNone()) {
|
|
||||||
_cmdText.addObject(_logic->objectName(_logic->itemData(item)->name));
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (_curCmd.commandLevel) {
|
|
||||||
case 1:
|
|
||||||
_selCmd.subject1 = -item;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
_selCmd.subject2 = -item;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_curCmd.action.value() == VERB_USE && _curCmd.commandLevel == 1) {
|
|
||||||
if (State::findUse(_logic->itemData(item)->state) == STATE_USE_ON) {
|
|
||||||
_cmdText.addLinkWord(Verb(VERB_PREP_WITH));
|
|
||||||
_curCmd.commandLevel = 2;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_parse = true;
|
|
||||||
}
|
|
||||||
_cmdText.display(INK_CMD_NORMAL);
|
|
||||||
}
|
|
||||||
else if (_curCmd.action.value() == VERB_GIVE && _curCmd.commandLevel == 1) {
|
|
||||||
_cmdText.addLinkWord(Verb(VERB_PREP_TO));
|
|
||||||
_curCmd.commandLevel = 2;
|
|
||||||
_cmdText.display(INK_CMD_NORMAL);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_cmdText.display(INK_CMD_SELECT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_parse) {
|
|
||||||
_curCmd.verb = Verb(VERB_NONE);
|
|
||||||
_logic->joeWalk(2); // set JOEWALK flag to perform EXECUTE_ACTION procedure
|
|
||||||
_selCmd.action = _curCmd.action;
|
|
||||||
_curCmd.action = Verb(VERB_NONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -720,55 +797,7 @@ void Command::grabSelectedNoun() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_selCmd.noun = 0;
|
_selCmd.noun = 0;
|
||||||
|
grabSelectedObject(objNum, _logic->objectData(objNum)->state, objName);
|
||||||
if (_curCmd.action.isTwoLevelsCommand() && _curCmd.commandLevel == 1) {
|
|
||||||
// command not fully constructed
|
|
||||||
_parse = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_parse = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_curCmd.action.isNone()) {
|
|
||||||
_cmdText.addObject(_logic->objectName(objName));
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (_curCmd.commandLevel) {
|
|
||||||
case 1:
|
|
||||||
_selCmd.subject1 = objNum;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
_selCmd.subject2 = objNum;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if first noun and it's a 2 level command then set up action word
|
|
||||||
|
|
||||||
if (_curCmd.action.value() == VERB_USE && _curCmd.commandLevel == 1) {
|
|
||||||
if (State::findUse(_logic->objectData(objNum)->state) == STATE_USE_ON) {
|
|
||||||
_cmdText.addLinkWord(Verb(VERB_PREP_WITH));
|
|
||||||
_curCmd.commandLevel = 2;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// object does not support 2nd level
|
|
||||||
_parse = true;
|
|
||||||
}
|
|
||||||
_cmdText.display(INK_CMD_NORMAL);
|
|
||||||
}
|
|
||||||
else if (_curCmd.action.value() == VERB_GIVE && _curCmd.commandLevel == 1) {
|
|
||||||
_cmdText.addLinkWord(Verb(VERB_PREP_TO));
|
|
||||||
_cmdText.display(INK_CMD_NORMAL);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_cmdText.display(INK_CMD_SELECT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_parse) {
|
|
||||||
_curCmd.verb = Verb(VERB_NONE);
|
|
||||||
_logic->joeWalk(2); // set JOEWALK flag to perform EXECUTE_ACTION procedure
|
|
||||||
_selCmd.action = _curCmd.action;
|
|
||||||
_curCmd.action = Verb(VERB_NONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -781,8 +810,8 @@ void Command::grabSelectedVerb() {
|
||||||
}
|
}
|
||||||
else if (_curCmd.verb.isPanelCommand() || _curCmd.verb.value() == VERB_WALK_TO) {
|
else if (_curCmd.verb.isPanelCommand() || _curCmd.verb.value() == VERB_WALK_TO) {
|
||||||
_curCmd.action = _curCmd.verb;
|
_curCmd.action = _curCmd.verb;
|
||||||
_selCmd.subject1 = 0;
|
_curCmd.subject1 = 0;
|
||||||
_selCmd.subject2 = 0;
|
_curCmd.subject2 = 0;
|
||||||
|
|
||||||
// if right mouse key selected, then store command VERB
|
// if right mouse key selected, then store command VERB
|
||||||
if (_mouseKey == Input::MOUSE_RBUTTON) {
|
if (_mouseKey == Input::MOUSE_RBUTTON) {
|
||||||
|
@ -858,7 +887,7 @@ bool Command::handleBadCommand(bool walk) {
|
||||||
|
|
||||||
// l.96-141 execute.c
|
// l.96-141 execute.c
|
||||||
uint16 objMax = _logic->currentRoomObjMax();
|
uint16 objMax = _logic->currentRoomObjMax();
|
||||||
uint16 roomData = _logic->roomData(_logic->currentRoom());
|
uint16 roomData = _logic->currentRoomData();
|
||||||
|
|
||||||
// select without a command or WALK TO ; do a WALK
|
// select without a command or WALK TO ; do a WALK
|
||||||
if ((_selCmd.action.value() == VERB_WALK_TO || _selCmd.action.isNone()) &&
|
if ((_selCmd.action.value() == VERB_WALK_TO || _selCmd.action.isNone()) &&
|
||||||
|
@ -870,19 +899,21 @@ bool Command::handleBadCommand(bool walk) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// check to see if one of the objects is hidden
|
// check to see if one of the objects is hidden
|
||||||
if (_selCmd.subject1 > 0 && _logic->objectData(_selCmd.subject1)->name <= 0) {
|
if (_curCmd.subject1 > 0 && _logic->objectData(_curCmd.subject1)->name <= 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_selCmd.action.value() == VERB_GIVE && _selCmd.subject2 > 0 && _logic->objectData(_selCmd.subject2)->name <= 0) {
|
if (_selCmd.action.value() == VERB_GIVE &&
|
||||||
|
_curCmd.subject2 > 0 && _logic->objectData(_curCmd.subject2)->name <= 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// check for USE command on exists
|
// check for USE command on exists
|
||||||
if (_selCmd.action.value() == VERB_USE && _selCmd.subject1 > 0 && _logic->objectData(_selCmd.subject1)->entryObj > 0) {
|
if (_selCmd.action.value() == VERB_USE &&
|
||||||
|
_curCmd.subject1 > 0 && _logic->objectData(_curCmd.subject1)->entryObj > 0) {
|
||||||
_selCmd.action = Verb(VERB_WALK_TO);
|
_selCmd.action = Verb(VERB_WALK_TO);
|
||||||
}
|
}
|
||||||
if (_selCmd.noun > 0 && _selCmd.noun <= objMax) {
|
if (_selCmd.noun > 0 && _selCmd.noun <= objMax) {
|
||||||
int16 p = _logic->joeWalkTo(_selPosX, _selPosY, walk);
|
uint16 objNum = _logic->currentRoomData() + _selCmd.noun;
|
||||||
if (p != 0) {
|
if (makeJoeWalkTo(_selPosX, _selPosY, objNum, _selCmd.action, walk) != 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_selCmd.action.value() == VERB_WALK_TO && _logic->objectData(roomData + _selCmd.noun)->entryObj < 0) {
|
if (_selCmd.action.value() == VERB_WALK_TO && _logic->objectData(roomData + _selCmd.noun)->entryObj < 0) {
|
||||||
|
@ -911,7 +942,7 @@ void Command::executeStandardStuff(const Verb& action, int16 subj1, int16 subj2)
|
||||||
|
|
||||||
case VERB_USE:
|
case VERB_USE:
|
||||||
if (subj1 < 0) {
|
if (subj1 < 0) {
|
||||||
k = _logic->itemData(ABS(subj1))->sfxDescription;
|
k = _logic->itemData(-subj1)->sfxDescription;
|
||||||
if (k > 0) {
|
if (k > 0) {
|
||||||
_logic->joeSpeak(k, true);
|
_logic->joeSpeak(k, true);
|
||||||
}
|
}
|
||||||
|
@ -933,6 +964,7 @@ void Command::executeStandardStuff(const Verb& action, int16 subj1, int16 subj2)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: // weird, isn't it ? l.193 execute.c
|
case 4: // weird, isn't it ? l.193 execute.c
|
||||||
|
warning("Command::executeStandardStuff() - Use of verb 4");
|
||||||
case VERB_MOVE:
|
case VERB_MOVE:
|
||||||
// 'I can't move it'
|
// 'I can't move it'
|
||||||
if (subj1 > 0) {
|
if (subj1 > 0) {
|
||||||
|
@ -1128,10 +1160,10 @@ void Command::openOrCloseAssociatedObject(const Verb& action, int16 otherObj) {
|
||||||
if (cmdList->match(action, otherObj, 0)) {
|
if (cmdList->match(action, otherObj, 0)) {
|
||||||
if (cmdList->setConditions) {
|
if (cmdList->setConditions) {
|
||||||
CmdGameState *cmdGs = _cmdGameState;
|
CmdGameState *cmdGs = _cmdGameState;
|
||||||
// FIXME: weird loop...
|
|
||||||
uint16 j;
|
uint16 j;
|
||||||
for (j = 1; j <= _numCmdGameState; ++j) {
|
for (j = 1; j <= _numCmdGameState; ++j) {
|
||||||
if (cmdGs[j].id == i && cmdGs[i].gameStateSlot > 0) {
|
if (cmdGs[j].id == i && cmdGs[i].gameStateSlot > 0) {
|
||||||
|
// FIXME: weird, why using 'i' instead of 'j' ?
|
||||||
if (_logic->gameState(cmdGs[i].gameStateSlot) == cmdGs[i].gameStateValue) {
|
if (_logic->gameState(cmdGs[i].gameStateSlot) == cmdGs[i].gameStateValue) {
|
||||||
com = i;
|
com = i;
|
||||||
break;
|
break;
|
||||||
|
@ -1278,7 +1310,7 @@ void Command::setObjects(uint16 command) {
|
||||||
// turning off graphic image
|
// turning off graphic image
|
||||||
objData->name = 0;
|
objData->name = 0;
|
||||||
if (objData->room == _logic->currentRoom()) {
|
if (objData->room == _logic->currentRoom()) {
|
||||||
if (dstObj != _selCmd.subject1) {
|
if (dstObj != _curCmd.subject1) {
|
||||||
// if the new object we have updated is on screen and is not the
|
// if the new object we have updated is on screen and is not the
|
||||||
// current object, then we can update. This is because we turn
|
// current object, then we can update. This is because we turn
|
||||||
// current object off ourselves by COM_LIST(com, 8)
|
// current object off ourselves by COM_LIST(com, 8)
|
||||||
|
@ -1307,7 +1339,7 @@ void Command::setObjects(uint16 command) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dstObj != _selCmd.subject1) {
|
if (dstObj != _curCmd.subject1) {
|
||||||
// if the new object we have updated is on screen and
|
// if the new object we have updated is on screen and
|
||||||
// is not current object then update it
|
// is not current object then update it
|
||||||
_logic->roomRefreshObject(dstObj);
|
_logic->roomRefreshObject(dstObj);
|
||||||
|
@ -1416,9 +1448,9 @@ uint16 Command::nextObjectDescription(ObjectDescription* objDesc, uint16 firstDe
|
||||||
void Command::look() {
|
void Command::look() {
|
||||||
|
|
||||||
if (_selCmd.noun > 0 && _selCmd.noun <= _logic->currentRoomObjMax()) {
|
if (_selCmd.noun > 0 && _selCmd.noun <= _logic->currentRoomObjMax()) {
|
||||||
uint16 k = _logic->currentRoomData();
|
uint16 objNum = _logic->currentRoomData() + _selCmd.noun;
|
||||||
if (_logic->objectData(k + _selCmd.noun)->entryObj == 0) {
|
if (_logic->objectData(objNum)->entryObj == 0) {
|
||||||
if (_logic->joeWalkTo(_selPosX, _selPosY, true) == -2) {
|
if (makeJoeWalkTo(_selPosX, _selPosY, objNum, _selCmd.action, true) == -2) { // XXX inCutaway parameter
|
||||||
// 'I can't get close enough to have a look.'
|
// 'I can't get close enough to have a look.'
|
||||||
_logic->joeSpeak(13);
|
_logic->joeSpeak(13);
|
||||||
}
|
}
|
||||||
|
@ -1426,25 +1458,25 @@ void Command::look() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if object type and disabled, don't look
|
// if object type and disabled, don't look
|
||||||
if (_selCmd.subject1 > 0 && _logic->objectData(_selCmd.subject1)->name <= 0) {
|
if (_curCmd.subject1 > 0 && _logic->objectData(_curCmd.subject1)->name <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 desc;
|
uint16 desc;
|
||||||
if (_selCmd.subject1 < 0) {
|
if (_curCmd.subject1 < 0) {
|
||||||
desc = _logic->itemData(ABS(_selCmd.subject1))->description;
|
desc = _logic->itemData(-_curCmd.subject1)->description;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
desc = _logic->objectData(_selCmd.subject1)->description;
|
desc = _logic->objectData(_curCmd.subject1)->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(0, "Command::look() - desc = %X, _selCmd.subject1 = %X", desc, _selCmd.subject1);
|
debug(0, "Command::look() - desc = %X, _curCmd.subject1 = %X", desc, _curCmd.subject1);
|
||||||
|
|
||||||
// check to see if the object/item has a series of description
|
// check to see if the object/item has a series of description
|
||||||
ObjectDescription *objDesc = _logic->objectDescription(1);
|
ObjectDescription *objDesc = _logic->objectDescription(1);
|
||||||
uint16 i;
|
uint16 i;
|
||||||
for (i = 1; i <= _logic->objectDescriptionCount(); ++i, ++objDesc) {
|
for (i = 1; i <= _logic->objectDescriptionCount(); ++i, ++objDesc) {
|
||||||
if (objDesc->object == _selCmd.subject1) {
|
if (objDesc->object == _curCmd.subject1) {
|
||||||
desc = nextObjectDescription(objDesc, desc);
|
desc = nextObjectDescription(objDesc, desc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1479,7 +1511,6 @@ void Command::lookCurrentItem() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Command::lookCurrentRoom() {
|
void Command::lookCurrentRoom() {
|
||||||
|
|
||||||
_curCmd.noun = _logic->findObjectUnderCursor(_input->mousePosX(), _input->mousePosY());
|
_curCmd.noun = _logic->findObjectUnderCursor(_input->mousePosX(), _input->mousePosY());
|
||||||
|
|
|
@ -56,26 +56,61 @@ struct CmdText {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct CurrentCmdState {
|
||||||
|
|
||||||
|
void init();
|
||||||
|
void addObject(int16 objNum);
|
||||||
|
|
||||||
|
Verb oldVerb;
|
||||||
|
Verb verb;
|
||||||
|
Verb action;
|
||||||
|
int16 oldNoun;
|
||||||
|
int16 noun;
|
||||||
|
//! current level of the command (max=2 for GIVE and USE verbs)
|
||||||
|
int commandLevel;
|
||||||
|
int16 subject1;
|
||||||
|
int16 subject2;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct SelectedCmdState {
|
||||||
|
|
||||||
|
void init();
|
||||||
|
|
||||||
|
//! locked verb (using 2nd mouse button)
|
||||||
|
Verb defaultVerb;
|
||||||
|
Verb action;
|
||||||
|
int16 noun;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class Command {
|
class Command {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Command(Logic*, Graphics*, Input*, Walk*);
|
Command(Logic*, Graphics*, Input*, Walk*);
|
||||||
|
|
||||||
|
//! initialise command construction
|
||||||
void clear(bool clearTexts);
|
void clear(bool clearTexts);
|
||||||
|
|
||||||
|
//! execute last constructed command
|
||||||
void executeCurrentAction(bool walk);
|
void executeCurrentAction(bool walk);
|
||||||
|
|
||||||
|
//! get player input and construct command from it
|
||||||
void updatePlayer();
|
void updatePlayer();
|
||||||
|
|
||||||
|
//! read all command arrays from stream
|
||||||
void readCommandsFrom(byte *&ptr);
|
void readCommandsFrom(byte *&ptr);
|
||||||
|
|
||||||
Verb selectedAction() const { return _selCmd.action; }
|
//! return true if command is ready to be executed
|
||||||
int16 selectedNoun() const { return _selCmd.noun; }
|
|
||||||
bool parse() const { return _parse; }
|
bool parse() const { return _parse; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
int16 makeJoeWalkTo(int16 x, int16 y, int16 objNum, const Verb &v, bool mustWalk);
|
||||||
|
|
||||||
void grabCurrentSelection();
|
void grabCurrentSelection();
|
||||||
|
void grabSelectedObject(int16 objNum, uint16 objState, uint16 objName);
|
||||||
void grabSelectedItem();
|
void grabSelectedItem();
|
||||||
void grabSelectedNoun();
|
void grabSelectedNoun();
|
||||||
void grabSelectedVerb();
|
void grabSelectedVerb();
|
||||||
|
@ -89,27 +124,31 @@ private:
|
||||||
void changeObjectState(const Verb& action, int16 obj, int16 song, bool cutDone);
|
void changeObjectState(const Verb& action, int16 obj, int16 song, bool cutDone);
|
||||||
void cleanupCurrentAction();
|
void cleanupCurrentAction();
|
||||||
|
|
||||||
|
//! find default verb action for specified object
|
||||||
Verb findDefault(uint16 obj, bool itemType);
|
Verb findDefault(uint16 obj, bool itemType);
|
||||||
|
|
||||||
|
//! alter default verb action for specified object and update command display
|
||||||
void alterDefault(const Verb& def, bool itemType);
|
void alterDefault(const Verb& def, bool itemType);
|
||||||
|
|
||||||
//! Opens/closes the object associated with object - OPEN_CLOSE_OTHER(OBJECT_DATA[S][4])
|
//! OPEN_CLOSE_OTHER(OBJECT_DATA[S][4])
|
||||||
void openOrCloseAssociatedObject(const Verb& action, int16 obj);
|
void openOrCloseAssociatedObject(const Verb& action, int16 obj);
|
||||||
|
|
||||||
//! Update gamestates - P1_SET_CONDITIONS
|
//! update gamestates - P1_SET_CONDITIONS
|
||||||
int16 setConditions(uint16 command, bool lastCmd);
|
int16 setConditions(uint16 command, bool lastCmd);
|
||||||
|
|
||||||
//! Turn on/off areas - P2_SET_AREAS
|
//! turn on/off areas - P2_SET_AREAS
|
||||||
void setAreas(uint16 command);
|
void setAreas(uint16 command);
|
||||||
|
|
||||||
//! Hide/show objects, redisplay if in the same room as Joe - P3_SET_OBJECTS
|
//! hide/show objects, redisplay if in the same room as Joe - P3_SET_OBJECTS
|
||||||
void setObjects(uint16 command);
|
void setObjects(uint16 command);
|
||||||
|
|
||||||
//! Inserts/deletes items (inventory) - P4_SET_ITEMS
|
//! inserts/deletes items (inventory) - P4_SET_ITEMS
|
||||||
void setItems(uint16 command);
|
void setItems(uint16 command);
|
||||||
|
|
||||||
|
//! update description for object and returns description number to use
|
||||||
uint16 nextObjectDescription(ObjectDescription *objDesc, uint16 firstDesc);
|
uint16 nextObjectDescription(ObjectDescription *objDesc, uint16 firstDesc);
|
||||||
|
|
||||||
//! Look at Objects/Items and speak their description
|
//! look at current object / item and speak its description
|
||||||
void look();
|
void look();
|
||||||
void lookCurrentItem();
|
void lookCurrentItem();
|
||||||
void lookCurrentRoom();
|
void lookCurrentRoom();
|
||||||
|
@ -131,33 +170,18 @@ private:
|
||||||
CmdGameState *_cmdGameState;
|
CmdGameState *_cmdGameState;
|
||||||
uint16 _numCmdGameState;
|
uint16 _numCmdGameState;
|
||||||
|
|
||||||
//! Textual form of the command (displayed between room and panel areas)
|
//! textual form of the command (displayed between room and panel areas)
|
||||||
CmdText _cmdText;
|
CmdText _cmdText;
|
||||||
|
|
||||||
//! If true, command string is executed
|
//! flag indicating that the current command is fully constructed
|
||||||
bool _parse;
|
bool _parse;
|
||||||
|
|
||||||
struct {
|
CurrentCmdState _curCmd;
|
||||||
Verb oldVerb, verb;
|
|
||||||
Verb action;
|
|
||||||
int16 oldNoun, noun;
|
|
||||||
//! Current level of the command (max=2 for GIVE and USE verbs)
|
|
||||||
int commandLevel;
|
|
||||||
} _curCmd;
|
|
||||||
|
|
||||||
struct {
|
SelectedCmdState _selCmd;
|
||||||
//! Locked verb (using 2nd mouse button)
|
|
||||||
Verb defaultVerb;
|
|
||||||
Verb action;
|
|
||||||
int16 noun;
|
|
||||||
int16 subject1, subject2;
|
|
||||||
} _selCmd;
|
|
||||||
|
|
||||||
//! MKEY
|
//! last user selection
|
||||||
int _mouseKey;
|
int _mouseKey, _selPosX, _selPosY;
|
||||||
|
|
||||||
//! Position of last selection
|
|
||||||
int _selPosX, _selPosY;
|
|
||||||
|
|
||||||
Logic *_logic;
|
Logic *_logic;
|
||||||
Graphics *_graphics;
|
Graphics *_graphics;
|
||||||
|
|
108
queen/logic.cpp
108
queen/logic.cpp
|
@ -170,57 +170,6 @@ void State::alterDefaultVerb(uint16 *objState, Verb v) {
|
||||||
*objState = (*objState & ~0xF0) | (val << 4);
|
*objState = (*objState & ~0xF0) | (val << 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void Command_::readAllCommandsFrom(byte *&ptr) {
|
|
||||||
|
|
||||||
uint16 i;
|
|
||||||
|
|
||||||
// Command List Data
|
|
||||||
_numCmdList = READ_BE_UINT16(ptr); ptr += 2;
|
|
||||||
|
|
||||||
_cmdList = new CmdListData[_numCmdList + 1];
|
|
||||||
memset(&_cmdList[0], 0, sizeof(CmdListData));
|
|
||||||
for (i = 1; i <= _numCmdList; i++) {
|
|
||||||
_cmdList[i].readFrom(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Command AREA
|
|
||||||
_numCmdArea = READ_BE_UINT16(ptr); ptr += 2;
|
|
||||||
|
|
||||||
_cmdArea = new CmdArea[_numCmdArea + 1];
|
|
||||||
memset(&_cmdArea[0], 0, sizeof(CmdArea));
|
|
||||||
for (i = 1; i <= _numCmdArea; i++) {
|
|
||||||
_cmdArea[i].readFrom(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Command OBJECT
|
|
||||||
_numCmdObject = READ_BE_UINT16(ptr); ptr += 2;
|
|
||||||
|
|
||||||
_cmdObject = new CmdObject[_numCmdObject + 1];
|
|
||||||
memset(&_cmdObject[0], 0, sizeof(CmdObject));
|
|
||||||
for (i = 1; i <= _numCmdObject; i++) {
|
|
||||||
_cmdObject[i].readFrom(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Command INVENTORY
|
|
||||||
_numCmdInventory = READ_BE_UINT16(ptr); ptr += 2;
|
|
||||||
|
|
||||||
_cmdInventory = new CmdInventory[_numCmdInventory + 1];
|
|
||||||
memset(&_cmdInventory[0], 0, sizeof(CmdInventory));
|
|
||||||
for (i = 1; i <= _numCmdInventory; i++) {
|
|
||||||
_cmdInventory[i].readFrom(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Command GAMESTATE
|
|
||||||
_numCmdGameState = READ_BE_UINT16(ptr); ptr += 2;
|
|
||||||
_cmdGameState = new CmdGameState[_numCmdGameState + 1];
|
|
||||||
memset(&_cmdGameState[0], 0, sizeof(CmdGameState));
|
|
||||||
for (i = 1; i <= _numCmdGameState; i++) {
|
|
||||||
_cmdGameState[i].readFrom(ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
Common::RandomSource Logic::randomizer;
|
Common::RandomSource Logic::randomizer;
|
||||||
|
|
||||||
|
@ -659,7 +608,7 @@ uint16 Logic::findFrame(uint16 obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint16 Logic::objectForPerson(uint16 bobNum) {
|
uint16 Logic::objectForPerson(uint16 bobNum) const {
|
||||||
|
|
||||||
uint16 bobcur = 0;
|
uint16 bobcur = 0;
|
||||||
// first object number in the room
|
// first object number in the room
|
||||||
|
@ -681,7 +630,7 @@ uint16 Logic::objectForPerson(uint16 bobNum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WalkOffData *Logic::walkOffPointForObject(uint16 obj) {
|
WalkOffData *Logic::walkOffPointForObject(uint16 obj) const {
|
||||||
|
|
||||||
uint16 i;
|
uint16 i;
|
||||||
for (i = 1; i <= _numWalkOffs; ++i) {
|
for (i = 1; i <= _numWalkOffs; ++i) {
|
||||||
|
@ -1726,59 +1675,6 @@ uint16 Logic::joeFace() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int16 Logic::joeWalkTo(int16 x, int16 y, bool mustWalk) {
|
|
||||||
|
|
||||||
// Check to see if object is actually an exit to another
|
|
||||||
// room. If so, then set up new room
|
|
||||||
|
|
||||||
uint16 k = _roomData[_currentRoom];
|
|
||||||
|
|
||||||
ObjectData *objData = &_objectData[k + _cmd->selectedNoun()];
|
|
||||||
if (objData->x != 0 || objData->y != 0) {
|
|
||||||
x = objData->x;
|
|
||||||
y = objData->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_cmd->selectedAction().value() == VERB_WALK_TO) {
|
|
||||||
_entryObj = objData->entryObj;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_entryObj = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_newRoom = 0;
|
|
||||||
|
|
||||||
if (_entryObj != 0 && _cmd->selectedAction().value() != VERB_CLOSE) {
|
|
||||||
_newRoom = _objectData[_entryObj].room;
|
|
||||||
// because this is an exit object, see if there is
|
|
||||||
// a walk off point and set (x,y) accordingly
|
|
||||||
WalkOffData *wod = walkOffPointForObject(k + _cmd->selectedNoun());
|
|
||||||
if (wod != NULL) {
|
|
||||||
x = wod->x;
|
|
||||||
y = wod->y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// determine which way for Joe to face Object
|
|
||||||
uint16 facing = State::findDirection(objData->state);
|
|
||||||
|
|
||||||
int16 p = 0;
|
|
||||||
if (mustWalk) {
|
|
||||||
BobSlot *bobJoe = _graphics->bob(0);
|
|
||||||
if (x == bobJoe->x && y == bobJoe->y) {
|
|
||||||
joeFacing(facing);
|
|
||||||
joeFace();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// XXX inCutaway parameter
|
|
||||||
p = _walk->joeMove(facing, x, y, false);
|
|
||||||
// if(P != 0) P = FIND_VERB
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Logic::joeGrab(uint16 state, uint16 speed) {
|
void Logic::joeGrab(uint16 state, uint16 speed) {
|
||||||
|
|
||||||
StateGrab sg = State::findGrab(state);
|
StateGrab sg = State::findGrab(state);
|
||||||
|
|
|
@ -138,8 +138,8 @@ public:
|
||||||
|
|
||||||
uint16 findBob(uint16 obj);
|
uint16 findBob(uint16 obj);
|
||||||
uint16 findFrame(uint16 obj);
|
uint16 findFrame(uint16 obj);
|
||||||
uint16 objectForPerson(uint16 bobnum); // OBJ_PERSON
|
uint16 objectForPerson(uint16 bobnum) const; // OBJ_PERSON
|
||||||
WalkOffData *walkOffPointForObject(uint16 obj);
|
WalkOffData *walkOffPointForObject(uint16 obj) const;
|
||||||
|
|
||||||
Area *area(int room, int num);
|
Area *area(int room, int num);
|
||||||
Area *currentRoomArea(int num);
|
Area *currentRoomArea(int num);
|
||||||
|
@ -217,9 +217,6 @@ public:
|
||||||
//! FACE_JOE()
|
//! FACE_JOE()
|
||||||
uint16 joeFace();
|
uint16 joeFace();
|
||||||
|
|
||||||
//! WALK()
|
|
||||||
int16 joeWalkTo(int16 x, int16 y, bool mustWalk);
|
|
||||||
|
|
||||||
//! GRAB_JOE()
|
//! GRAB_JOE()
|
||||||
void joeGrab(uint16 state, uint16 speed);
|
void joeGrab(uint16 state, uint16 speed);
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,11 @@ SELECT() Command::grabCurrentSelection
|
||||||
SELECT_ITEM() Command::grabSelectedItem
|
SELECT_ITEM() Command::grabSelectedItem
|
||||||
SELECT_NOUN() Command::grabSelectedNoun
|
SELECT_NOUN() Command::grabSelectedNoun
|
||||||
SELECT_VERB() Command::grabSelectedVerb
|
SELECT_VERB() Command::grabSelectedVerb
|
||||||
|
WALK() Command::makeJoeWalkTo
|
||||||
-
|
-
|
||||||
ACTION Command::_currentAction
|
ACTION Command::_curCmd.action
|
||||||
ACTION2 Command::_selectedAction
|
ACTION2 Command::_selCmd.action
|
||||||
CLEVEL Command::_commandLevel
|
CLEVEL Command::_curCmd.commandLevel
|
||||||
COM_A Command::_cmdArea
|
COM_A Command::_cmdArea
|
||||||
COM_A_MAX Command::_numCmdArea
|
COM_A_MAX Command::_numCmdArea
|
||||||
COM_O Command::_cmdObject
|
COM_O Command::_cmdObject
|
||||||
|
@ -46,13 +47,13 @@ COM_I_MAX Command::_numCmdInventory
|
||||||
COM_LIST Command::_cmdList
|
COM_LIST Command::_cmdList
|
||||||
COM_LIST_MAX Command::_numCmdList
|
COM_LIST_MAX Command::_numCmdList
|
||||||
COMMANDstr Command::_command
|
COMMANDstr Command::_command
|
||||||
DEFCOMM Command::_defaultVerb
|
DEFCOMM Command::_selCmd.defaultVerb
|
||||||
MKEY Command::_mouseKey
|
MKEY Command::_mouseKey
|
||||||
OLDVERB,VERB Command::_*verb*
|
OLDVERB,VERB Command::_curCmd.*verb
|
||||||
OLDNOUN,NOUN Command::_*noun*
|
OLDNOUN,NOUN Command::_curCmd.*noun
|
||||||
NOUN2 Command::_selectedNoun
|
NOUN2 Command::_selCmd.noun
|
||||||
PARSE Command::_parse
|
PARSE Command::_parse
|
||||||
SUBJ1,SUBJ2,SUBJECT Command::_subject*
|
SUBJ1,SUBJ2,SUBJECT Command::_selCmd.subject*
|
||||||
|
|
||||||
|
|
||||||
CREDIT SCRIPTING SYSTEM
|
CREDIT SCRIPTING SYSTEM
|
||||||
|
@ -187,7 +188,6 @@ SETUP_JOE() Logic::joeSetup
|
||||||
USE_UNDERWEAR() Logic::joeUseUnderwear
|
USE_UNDERWEAR() Logic::joeUseUnderwear
|
||||||
USE_CLOTHES() Logic::joeUseClothes
|
USE_CLOTHES() Logic::joeUseClothes
|
||||||
USE_DRESS() Logic::joeUseDress
|
USE_DRESS() Logic::joeUseDress
|
||||||
WALK() Logic::joeWalkTo
|
|
||||||
-
|
-
|
||||||
JOE_RESPstr Logic::_joeResponse
|
JOE_RESPstr Logic::_joeResponse
|
||||||
JOEF,JX,JY,JDIR Logic::_joe.*
|
JOEF,JX,JY,JDIR Logic::_joe.*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue