bool DrasculaEngine::pickupObject() { int obj = pickedObject; checkFlags = 1; updateRoom(); showMenu(); updateScreen(); // Objects with an ID smaller than 7 are the inventory verbs if (pickedObject >= 7) { int n = whichObject(); if (n != 0 && inventoryObjects[n] == 0) { inventoryObjects[n] = obj; takeObject = 0; checkFlags = 0; } } if (checkFlags == 1) { if (checkMenuFlags()) return true; } updateEvents(); if (takeObject == 0) selectVerb(kVerbNone); return false; }
bool DrasculaEngine::checkMenuFlags() { int n = whichObject(); if (n != 0) { if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n])) return true; } return false; }
bool DrasculaEngine::checkMenuFlags() { for (int n = 0; n < 43; n++) { if (whichObject() == n) { if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n])) return true; } } return false; }
/** * Remove an item from the inventory, namely the item in the slot * over which the mouse cursor currently hovers. */ void DrasculaEngine::removeObject() { int obj = 0, n; updateRoom(); n = whichObject(); if (n != 0) { obj = inventoryObjects[n]; inventoryObjects[n] = 0; if (obj != 0) takeObject = 1; } updateEvents(); if (takeObject == 1) chooseObject(obj); }
void DrasculaEngine::showMenu() { int h, n, x; char textIcon[13]; byte *srcSurface = (currentChapter == 6) ? tableSurface : frontSurface; x = whichObject(); strcpy(textIcon, iconName[x]); for (n = 1; n < ARRAYSIZE(inventoryObjects); n++) { h = inventoryObjects[n]; if (h != 0) { copyBackground(_polX[n], _polY[n], _itemLocations[n].x, _itemLocations[n].y, OBJWIDTH, OBJHEIGHT, srcSurface, screenSurface); } copyRect(_x1d_menu[h], _y1d_menu[h], _itemLocations[n].x, _itemLocations[n].y, OBJWIDTH, OBJHEIGHT, cursorSurface, screenSurface); } if (x < 7) print_abc(textIcon, _itemLocations[x].x - 2, _itemLocations[x].y - 7); }