Beispiel #1
0
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;
}
Beispiel #2
0
bool DrasculaEngine::checkMenuFlags() {
	int n = whichObject();
	if (n != 0) {
		if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n]))
			return true;
	}

	return false;
}
Beispiel #3
0
bool DrasculaEngine::checkMenuFlags() {
	for (int n = 0; n < 43; n++) {
		if (whichObject() == n) {
			if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n]))
				return true;
		}
	}

	return false;
}
Beispiel #4
0
/**
 * 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);
}
Beispiel #5
0
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);
}