本文整理汇总了C++中CGameObject::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameObject::getName方法的具体用法?C++ CGameObject::getName怎么用?C++ CGameObject::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameObject
的用法示例。
在下文中一共展示了CGameObject::getName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HoseConnectedMsg
bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) {
CPetControl *pet = getPetControl();
if (msg->_value == _field1DC)
return true;
if (mailExists(pet->getRoomFlags()))
return false;
_field1DC = msg->_value;
if (_field1DC) {
CGameObject *item = msg->_object;
_string3 = item->getName();
CHoseConnectedMsg hoseMsg(1, this);
hoseMsg.execute(msg->_object);
item->petMoveToHiddenRoom();
CPumpingMsg pumpingMsg(1, this);
pumpingMsg.execute(this);
_field1DC = 1;
if (_enabled) {
_enabled = false;
} else {
playMovie(_startFrame9, _endFrame9, 0);
playSound("z#26.wav");
}
playMovie(_field1C4, _field1C8, MOVIE_NOTIFY_OBJECT);
} else {
stopMovie();
stopSound(_field1EC);
playMovie(_field1F0, _field1F4, MOVIE_NOTIFY_OBJECT);
CPumpingMsg pumpingMsg(0, this);
pumpingMsg.execute(_string3);
CGameObject *obj = getHiddenObject(_string3);
if (obj) {
obj->petAddToInventory();
obj->setVisible(true);
}
_enabled = true;
CTurnOff offMsg;
offMsg.execute(this);
}
return true;
}
示例2: isBotInView
bool CPetControl::isBotInView(const CString &name) const {
CGameManager *gameManager = getGameManager();
if (!gameManager)
return false;
CViewItem *view = gameManager->getView();
if (!view)
return false;
// Iterate to find NPC
for (CTreeItem *child = view->getFirstChild(); child; child = child->scan(view)) {
CGameObject *gameObject = dynamic_cast<CGameObject *>(child);
if (gameObject) {
if (!gameObject->getName().compareToIgnoreCase(name))
return true;
}
}
return false;
}
示例3: TimerMsg
bool CChicken::TimerMsg(CTimerMsg *msg) {
CGameObject *obj = getMailManFirstObject();
while (obj && obj->getName() != "Chicken")
obj = getMailManNextObject(obj);
bool flag = false;
if (obj) {
flag = _v1;
} else if (_v1 > 0) {
--_v1;
flag = _v1;
}
if (flag) {
petInvChange();
stopTimer(_timerId);
}
return true;
}
示例4: dismissBot
bool CPetControl::dismissBot(const CString &name) {
CGameManager *gameManager = getGameManager();
if (!gameManager)
return false;
CViewItem *view = gameManager->getView();
if (!view)
return false;
bool result = false;
CDismissBotMsg dismissMsg;
for (CTreeItem *treeItem = view->getFirstChild(); treeItem;
treeItem = treeItem->scan(view)) {
CGameObject *obj = dynamic_cast<CGameObject *>(treeItem);
if (obj) {
if (!obj->getName().compareToIgnoreCase(name))
result = true;
else
dismissMsg.execute(treeItem);
}
}
return result;
}
示例5: UseWithOtherMsg
bool CPlugIn::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CGameObject *other = msg->_other;
CString otherName = other->getName();
if (otherName == "PET") {
return CCarry::UseWithOtherMsg(msg);
} else if (otherName == "DatasideTransporter") {
CString name = getName();
if (name == "DatasideTransporter") {
// TODO
if (name != "SendYourself") {
// TODO
}
} else {
// TODO
}
} else {
CShowTextMsg textMsg("This item is incorrectly calibrated.");
textMsg.execute("PET");
}
return true;
}
示例6: PETDeliverMsg
bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
CPetControl *pet = getPetControl();
if (!_enabled || !pet)
return true;
uint petRoomFlags = pet->getRoomFlags();
CGameObject *mailObject = findMail(petRoomFlags);
if (!mailObject) {
petDisplayMessage(2, NOTHING_IN_SUCCUBUS_TRAY);
return true;
}
_field19C = 0;
_mailP = mailObject;
uint roomFlags = _roomFlags;
if (!pet->testRooms5(roomFlags) ||
getPassengerClass() > pet->getMailDest(roomFlags)) {
roomFlags = pet->getSpecialRoomFlags("BilgeRoom");
_field19C = 1;
}
_isChicken = mailObject->getName() == "Chicken";
_isFeathers = mailObject->getName() == "Feathers";
_field158 = 0;
if (_v2) {
if (_isFeathers) {
startTalking(this, 230022);
_field158 = 1;
if (_startFrame3 >= 0)
playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT);
if (_bilgeStartFrame1 >= 0) {
playMovie(_startFrame12, _endFrame12, MOVIE_GAMESTATE);
playMovie(_bilgeStartFrame2, _bilgeEndFrame2, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
playMovie(_bilgeStartFrame1, _bilgeEndFrame1, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
incTransitions();
}
} else {
startTalking(this, 230012);
_field158 = 2;
if (_startFrame3 >= 0)
playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
if (_startFrame4 >= 0)
playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
if (_startFrame5 >= 0)
playMovie(_startFrame5, _endFrame5, MOVIE_GAMESTATE);
}
} else {
if (_isFeathers) {
startTalking(this, 230022);
_field158 = 3;
if (_startFrame3 >= 0)
playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
if (_startFrame4 >= 0)
playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
if (_startFrame5 >= 0)
playMovie(_startFrame5, _endFrame5, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
} else {
removeMail(petRoomFlags, roomFlags);
startTalking(this, 230012);
if (_startFrame3 >= 0) {
_field158 = 4;
playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
}
}
}
return true;
}
示例7: NPCPlayIdleAnimationMsg
bool CParrot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) {
static const char *const NAMES[] = {
"Idle0", "Idle1", "Peck At Feet", "Peck At Feet Left"
"Peck At Feet Right", nullptr
};
if (!(_npcFlags & (NPCFLAG_10000 | NPCFLAG_20000 | NPCFLAG_40000 | NPCFLAG_80000 | NPCFLAG_100000 | NPCFLAG_200000 | NPCFLAG_400000))
&& _visible && !_v4 && !compareViewNameTo("ParrotLobby.Node 1.N")) {
CGameObject *dragItem = getDraggingObject();
if (!dragItem || dragItem->getName() == "Chicken") {
if (!_v5 ||getRandomNumber(3) != 0) {
if (getRandomNumber(1)) {
startTalking(this, 280267, findView());
} else {
msg->_names = NAMES;
}
} else {
int id = -1;
switch (stateGet38()) {
case 0:
id = 280107;
break;
case 1:
id = 280106;
break;
case 2:
id = 280115;
break;
case 3:
id = 280114;
break;
case 4:
id = 280113;
break;
case 5:
id = 280112;
break;
case 6:
id = 280111;
break;
case 7:
id = 280110;
break;
case 8:
id = 280109;
break;
case 9:
id = 280108;
break;
case 10:
id = 280105;
break;
case 11:
id = 280000;
break;
default:
break;
}
if (id != -1)
startTalking(this, id, findView());
CActMsg actMsg("FlashCore");
actMsg.execute("PerchCoreHolder");
}
}
}
return true;
}
示例8: PETDeliverMsg
bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
CPetControl *pet = getPetControl();
if (!_isOn || !pet)
return true;
uint petRoomFlags = pet->getRoomFlags();
CGameObject *mailObject = findMail(petRoomFlags);
if (!mailObject) {
petDisplayMessage(2, NOTHING_IN_SUCCUBUS_TRAY);
return true;
}
_sendLost = false;
_mailP = mailObject;
uint roomFlags = _destRoomFlags;
if (!pet->isSuccUBusDest(roomFlags) || getPassengerClass() > pet->getMailDestClass(roomFlags)) {
roomFlags = pet->getSpecialRoomFlags("BilgeRoom");
_sendLost = true;
}
_isChicken = mailObject->getName() == "Chicken";
_isFeathers = mailObject->getName() == "Feathers";
_sendAction = SA_SENT;
if (_style) {
if (_isFeathers) {
startTalking(this, 230022);
_sendAction = SA_FEATHERS;
if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT);
if (_sneezing2StartFrame >= 0) {
playMovie(_trayOutStartFrame, _trayOutEndFrame, MOVIE_WAIT_FOR_FINISH);
playMovie(_sneezing1StartFrame, _sneezing1EndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
playMovie(_sneezing2StartFrame, _sneezing2EndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
incTransitions();
}
} else {
startTalking(this, 230012);
_sendAction = SA_EATEN;
if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
if (_receiveStartFrame >= 0)
playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
if (_afterReceiveStartFrame >= 0)
playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, MOVIE_WAIT_FOR_FINISH);
}
} else {
if (_isFeathers) {
startTalking(this, 230022);
_sendAction = SA_BILGE_FEATHERS;
if (_sendStartFrame >= 0)
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
if (_receiveStartFrame >= 0)
playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
if (_afterReceiveStartFrame >= 0)
playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
} else {
sendMail(petRoomFlags, roomFlags);
startTalking(this, 230012);
if (_sendStartFrame >= 0) {
_sendAction = SA_BILGE_SENT;
playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
}
}
}
return true;
}