Exemplo n.º 1
0
bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	if (msg->_other->getName() == "Napkin") {
		if (_field12C || _string6 == "None") {
			CActMsg actMsg("Clean");
			actMsg.execute(this);
			petAddToInventory();
		} else {
			CShowTextMsg textMsg("The chicken is already clean.");
			textMsg.execute("PET");
		}

		petAddToInventory();
	} else {
		CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other);
		if (!dispensor || _string6 == "None") {
			return CCarry::UseWithOtherMsg(msg);
		} else {
			setVisible(false);
			CUse use(this);
			use.execute(msg->_other);
		}
	}

	return true;
}
Exemplo n.º 2
0
bool CGlass::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CSauceDispensor *dispensor = dynamic_cast<CSauceDispensor *>(msg->_other);
	CChicken *chicken = dynamic_cast<CChicken *>(msg->_other);

	if (dispensor && _condiment == "None") {
		CUse useMsg(this);
		useMsg.execute(dispensor);
	} else if (msg->_other->isEquals("Chicken") && _condiment == "None") {
		if (chicken->_condiment != "None") {
			if (!chicken->_greasy) {
				CActMsg actMsg(_condiment);
				actMsg.execute("Chicken");
			}

			_condiment = "None";
			loadFrame(0);
			_visibleFrame = 0;
		}

		petAddToInventory();
	} else if (msg->_other->isEquals("Napkin") && _condiment == "None") {
		petAddToInventory();
		_condiment = "None";
		loadFrame(0);
		_visibleFrame = 0;
	} else {
		petAddToInventory();
	}

	return true;
}
Exemplo n.º 3
0
bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CBrainSlot *slot = dynamic_cast<CBrainSlot *>(msg->_other);
	if (!slot)
		return CCarry::UseWithOtherMsg(msg);

	if (isEquals("CentralCore")) {
		setVisible(false);
		petMoveToHiddenRoom();
		CAddHeadPieceMsg headpieceMsg(getName());
		headpieceMsg.execute("CentralCoreSlot");
	} else if (!slot->_occupied && slot->getName() != "CentralCoreSlot") {
		// Brain card goes into vacant slot
		setVisible(false);
		petMoveToHiddenRoom();
		CAddHeadPieceMsg headpieceMsg(getName());
		headpieceMsg.execute(msg->_other);
		playSound(TRANSLATE("z#116.wav", "z#647.wav"));
		setPosition(Point(0, 0));
		setVisible(false);
		_pieceAdded = true;
	} else {
		// Trying to put brain card into an already occupied slot
		petAddToInventory();
	}

	return true;
}
Exemplo n.º 4
0
bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
	CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_character);
	if (succubus) {
		setPosition(Point(330, 300));
		CSubAcceptCCarryMsg acceptMsg;
		acceptMsg._item = this;
		acceptMsg.execute(succubus);
	} else {
		petAddToInventory();
	}

	return true;
}
Exemplo n.º 5
0
bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CChicken *chicken = dynamic_cast<CChicken *>(msg->_other);
	if (chicken) {
		if (chicken->_string6 == "None" || chicken->_field12C) {
			CActMsg actMsg("Clean");
			actMsg.execute("Chicken");
		} else {
			petDisplayMessage(CHICKEN_IS_CLEAN);
		}
	}

	petAddToInventory();
	return CCarry::UseWithOtherMsg(msg);
}
Exemplo n.º 6
0
bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CChicken *chicken = static_cast<CChicken *>(msg->_other);
	if (chicken) {
		if (chicken->_string6 == "None" || chicken->_field12C) {
			CActMsg actMsg("Clean");
			actMsg.execute("Chicken");
		} else {
			petDisplayMessage("The Chicken is already quite clean enough, thank you.");
		}
	}

	petAddToInventory();
	return CCarry::UseWithOtherMsg(msg);
}
Exemplo n.º 7
0
bool CGlass::MouseDragEndMsg(CMouseDragEndMsg *msg) {
	showMouse();
	if (msg->_dropTarget) {
		if (msg->_dropTarget->isPet()) {
			petAddToInventory();
		} else {
			CCharacter *npc = dynamic_cast<CCharacter *>(msg->_dropTarget);
			if (npc) {
				CUseWithCharMsg useMsg(npc);
				useMsg.execute(this);
			} else {
				CUseWithOtherMsg otherMsg(msg->_dropTarget);
				otherMsg.execute(this);
			}
		}
	} else if (compareViewNameTo(_fullViewName) && msg->_mousePos.y < 360) {
		setPosition(_origPos);
	} else {
		petAddToInventory();
	}

	return true;
}
Exemplo n.º 8
0
bool CGlass::UseWithCharMsg(CUseWithCharMsg *msg) {
	if (msg->_character->isEquals("Barbot") && msg->_character->_visible) {
		CActMsg actMsg(_condiment);
		setVisible(false);

		if (_condiment != "Bird")
			setPosition(_origPos);

		actMsg.execute(msg->_character);
	} else {
		petAddToInventory();
	}

	return true;
}
Exemplo n.º 9
0
bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
	stopMovie();

	if (msg->_mousePos.y >= 360) {
		petAddToInventory();
		return true;
	}

	if (compareViewNameTo("ParrotLobby.Node 1.N")) {
		if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
				!CParrot::_v2 && !CCage::_open) {
			setVisible(false);
			_fieldE0 = 0;
			CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot");
			detach();
			addUnder(perchedParrot);
			sound8(true);

			CPutParrotBackMsg backMsg(msg->_mousePos.x);
			backMsg.execute(perchedParrot);
		} else {
			setVisible(false);
			_fieldE0 = 0;
			CParrot::_v4 = 2;
			playSound("z#475.wav");
			sound8(true);
			moveUnder(findRoom());

			CActMsg actMsg("Shut");
			actMsg.execute("ParrotCage");
		}
	} else {
		CCharacter *character = dynamic_cast<CCharacter *>(msg->_dropTarget);
		if (character) {
			CUseWithCharMsg charMsg(character);
			charMsg.execute(this, nullptr, 0);
		} else {
			setVisible(false);
			_fieldE0 = 0;
			playSound("z#475.wav");
			sound8(true);
			moveUnder(findRoom());
		}
	}

	showMouse();
	return true;
}
Exemplo n.º 10
0
bool CLiftbotHead::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	if (msg->_other->getName() == "LiftbotWithoutHead") {
		CPetControl *pet = getPetControl();
		if (!CLift::_hasHead && pet->getRoomsElevatorNum() == 4) {
			_flag = true;
			CActMsg actMsg("AddRightHead");
			actMsg.execute("FaultyLiftbot");
			setVisible(false);
		} else {
			petAddToInventory();
		}

		return true;
	} else {
		return CCarry::UseWithOtherMsg(msg);
	}
}
Exemplo n.º 11
0
bool CChicken::ActMsg(CActMsg *msg) {
	if (msg->_action == "GoToPET") {
		setVisible(true);
		petAddToInventory();
	} else if (msg->_action == "Tomato") {
		_string6 = "Tomato";
		loadFrame(4);
		_visibleFrame = 4;
	} else if (msg->_action == "Mustard") {
		_string6 = "Mustard";
		loadFrame(5);
		_visibleFrame = 5;
	} else if (msg->_action == "Bird") {
		_string6 = "Bird";
		loadFrame(2);
		_visibleFrame = 2;
	} else if (msg->_action == "None") {
		setVisible(false);
	} else if (msg->_action == "Clean") {
		_string6 = "None";
		loadFrame(3);
		_field12C = 0;
		_visibleFrame = 3;
	}
	else if (msg->_action == "Dispense Chicken") {
		_string6 = "None";
		_field13C = 0;
		_field12C = 1;
		loadFrame(1);
		_visibleFrame = 1;
		_v1 = 120;
	} else if (msg->_action == "Hot") {
		_v1 = 120;
	} else if (msg->_action == "Eaten") {
		setVisible(false);
		petMoveToHiddenRoom();
		_field13C = 1;
	}

	return true;
}
Exemplo n.º 12
0
bool CGlass::ActMsg(CActMsg *msg) {
	if (msg->_action == "GoToPET") {
		setVisible(true);
		petAddToInventory();
	} else if (msg->_action == "Mustard") {
		_condiment = "Mustard";
		loadFrame(1);
		_visibleFrame = 1;
	} else if (msg->_action == "Tomato") {
		_condiment = "Tomato";
		loadFrame(2);
		_visibleFrame = 2;
	} else if (msg->_action == "Bird") {
		_condiment = "Bird";
		loadFrame(3);
		_visibleFrame = 3;
	} else if (msg->_action == "InTitilator") {
		_condiment = "None";
		loadFrame(0);
		_visibleFrame = 0;
	}

	return true;
}