本文整理汇总了C++中Being::talkTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Being::talkTo方法的具体用法?C++ Being::talkTo怎么用?C++ Being::talkTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Being
的用法示例。
在下文中一共展示了Being::talkTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleLink
void PopupMenu::handleLink(const std::string &link)
{
Being *being = actorSpriteManager->findBeing(mBeingId);
// Talk To action
if (link == "talk" && being && being->canTalk())
{
being->talkTo();
}
// Trade action
else if (link == "trade" && being &&
being->getType() == ActorSprite::PLAYER)
{
Net::getTradeHandler()->request(being);
tradePartnerName = being->getName();
}
// Attack action
else if (link == "attack" && being)
{
player_node->attack(being, true);
}
else if (link == "whisper" && being)
{
chatWindow->addInputText("/w \"" + being->getName() + "\" ");
}
else if (link == "unignore" && being &&
being->getType() == ActorSprite::PLAYER)
{
player_relations.setRelation(being->getName(), PlayerRelation::NEUTRAL);
}
else if (link == "ignore" && being &&
being->getType() == ActorSprite::PLAYER)
{
player_relations.setRelation(being->getName(), PlayerRelation::IGNORED);
}
else if (link == "disregard" && being &&
being->getType() == ActorSprite::PLAYER)
{
player_relations.setRelation(being->getName(), PlayerRelation::DISREGARDED);
}
else if (link == "friend" && being &&
being->getType() == ActorSprite::PLAYER)
{
player_relations.setRelation(being->getName(), PlayerRelation::FRIEND);
}
// Guild action
else if (link == "guild" && being &&
being->getType() == ActorSprite::PLAYER)
{
player_node->inviteToGuild(being);
}
// Follow Player action
else if (link == "follow" && being)
{
player_node->setFollow(being->getName());
}
// Pick Up Floor Item action
else if ((link == "pickup") && mFloorItem)
{
player_node->pickUp(mFloorItem);
}
// Look To action
else if (link == "look")
{
}
else if (link == "use")
{
assert(mItem);
if (mItem->isEquipment())
{
if (mItem->isEquipped())
Net::getInventoryHandler()->unequipItem(mItem);
else
Net::getInventoryHandler()->equipItem(mItem);
}
else
{
Net::getInventoryHandler()->useItem(mItem);
}
}
else if (link == "chat")
{
if (mItem)
chatWindow->addItemText(mItem->getInfo().getName());
else if (mFloorItem)
chatWindow->addItemText(mFloorItem->getInfo().getName());
}
else if (link == "split")
{
ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit,
//.........这里部分代码省略.........