void DreamWebEngine::pickupOb(uint8 command, uint8 pos) { _lastInvPos = pos; _objectType = kFreeObjectType; _itemFrame = command; _command = command; //uint8 dummy; //getAnyAd(&dummy, &dummy); // was in the original source, seems useless here transferToEx(command); }
void DreamWebEngine::outOfOpen() { if (_openedOb == 255) return; // cannot use opened object ObjectRef objectId = findOpenPos(); if (objectId._index == 255) { blank(); return; } if (objectId != _oldSubject || _commandType != 228) { if (objectId == _oldSubject) _commandType = 228; _oldSubject = objectId; commandWithOb(36, objectId._type, objectId._index); } if (_mouseButton == _oldButton) return; // notletgo4 if (_mouseButton != 1) { if (_mouseButton == 2) reExFromOpen(); return; } delPointer(); _pickUp = 1; objectId = findOpenPos(); _objectType = objectId._type; _itemFrame = objectId._index; if (_objectType != kExObjectType) { assert(objectId._type == kFreeObjectType); _itemFrame = transferToEx(objectId._index); _objectType = kExObjectType; } DynObject *object = getEitherAd(); object->mapad[0] = 20; object->mapad[1] = 255; fillOpen(); underTextLine(); readMouse(); useOpened(); showPointer(); workToScreen(); delPointer(); }
void DreamWebEngine::setPickup() { if (_objectType != kSetObjectType1 && _objectType != kSetObjectType3) { // Object types 1 and 3 are excluded, so the resulting object is a DynObject uint8 dummy; DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); if (object->mapad[0] == 4) { blank(); return; } } else { blank(); return; } if (_commandType != 209) { _commandType = 209; commandWithOb(33, _objectType, _command); } if (_mouseButton != 1 || _mouseButton == _oldButton) return; createPanel(); showPanel(); showMan(); showExit(); examIcon(); _pickUp = 1; _invOpen = 2; if (_objectType != kExObjectType) { assert(_objectType == kFreeObjectType); _openedOb = 255; _itemFrame = transferToEx(_command); _objectType = kExObjectType; DynObject *object = getExAd(_itemFrame); object->mapad[0] = 20; object->mapad[1] = 255; } else { _itemFrame = _command; _openedOb = 255; } openInv(); workToScreenM(); }
void DreamWebEngine::swapWithOpen() { ObjectRef subject; subject._type = _objectType; subject._index = _itemFrame; if (subject != _oldSubject || _commandType != 242) { if (subject == _oldSubject) _commandType = 242; _oldSubject = subject; commandWithOb(34, subject._type, subject._index); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; if (isItWorn(getEitherAd())) { wornError(); return; } delPointer(); if (_itemFrame == _openedOb && _objectType == _openedType) { errorMessage1(); return; } if (!checkObjectSize()) return; byte prevType = _objectType; byte prevFrame = _itemFrame; ObjectRef objectId = findOpenPos(); _objectType = objectId._type; _itemFrame = objectId._index; if (_objectType != kExObjectType) { assert(objectId._type == kFreeObjectType); _itemFrame = transferToEx(objectId._index); _objectType = kExObjectType; } DynObject *object = getEitherAd(); object->mapad[0] = 20; object->mapad[1] = 255; byte prevType2 = _objectType; byte prevFrame2 = _itemFrame; _objectType = prevType; _itemFrame = prevFrame; object = getEitherAd(); object->mapad[0] = _openedType; object->mapad[1] = _openedOb; object->mapad[2] = _lastInvPos; object->mapad[3] = _realLocation; _objectType = prevType2; _itemFrame = prevFrame2; fillOpen(); fillRyan(); underTextLine(); readMouse(); useOpened(); showPointer(); workToScreen(); delPointer(); }