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); } return true; } else { return CCarry::UseWithOtherMsg(msg); } }
bool CLiftbotHead::UseWithCharMsg(CUseWithCharMsg *msg) { CLift *lift = dynamic_cast<CLift *>(msg->_character); if (lift) { CPetControl *pet = getPetControl(); if (lift->isEquals("Well") && !CLift::_hasHead && pet->getRoomsElevatorNum() == 4) { _flag = true; CActMsg actMsg("AddRightHead"); actMsg.execute(lift); setVisible(false); return true; } } return CCarry::UseWithCharMsg(msg); }
bool CPETTransition::EnterViewMsg(CEnterViewMsg *msg) { CPetControl *pet = getPetControl(); if (compareRoomNameTo("1stClassLobby") && pet) { int elevatorNum = pet->getRoomsElevatorNum(); CString nodeView = msg->_newView->getNodeViewName(); if (nodeView == "Node 1.E") { pet->setRoomsElevatorNum((elevatorNum == 1 || elevatorNum == 2) ? 1 : 3); } else if (nodeView == "Node 1.W") { pet->setRoomsElevatorNum((elevatorNum == 1 || elevatorNum == 2) ? 2 : 4); } } return true; }