本文整理汇总了C++中IsBag函数的典型用法代码示例。如果您正苦于以下问题:C++ IsBag函数的具体用法?C++ IsBag怎么用?C++ IsBag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsBag函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CanBeTraded
bool Item::CanBeTraded(bool mail) const
{
if (m_lootGenerated)
return false;
if(!mail && IsBoundAccountWide()) // Dirty hack, because trade window is closing
return false;
if ((!mail || !IsBoundAccountWide()) && IsSoulBound())
return false;
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()) )
return false;
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
return false;
if (owner->GetLootGUID()==GetGUID())
return false;
}
if (IsBoundByEnchant())
return false;
return true;
}
开发者ID:1ATOM,项目名称:mangos,代码行数:27,代码来源:Item.cpp
示例2: CanBeTraded
bool Item::CanBeTraded(bool mail, bool trade) const
{
// Xinef: little protection
if (m_lootGenerated)
return false;
if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE) || !trade)))
return false;
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
return false;
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
return false;
// Xinef: check if item is looted now
if (owner->GetLootGUID() == GetGUID())
return false;
}
if (IsBoundByTempEnchant()) // pussywizard
return false;
if ((!mail || !IsBoundAccountWide()) && IsBoundByEnchant())
return false;
return true;
}
开发者ID:AlexHjelm,项目名称:sunwell,代码行数:30,代码来源:Item.cpp
示例3: CanBeTraded
bool Item::CanBeTraded(bool mail, bool trade) const
{
if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_BOP_TRADEABLE) || !trade)))
return false;
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()) )
return false;
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
return false;
if (owner->GetLootGUID()==GetGUID())
return false;
}
if (HasGeneratedLoot())
return false;
if (IsBoundByEnchant())
return false;
return true;
}
开发者ID:SeTM,项目名称:mangos-1,代码行数:25,代码来源:Item.cpp
示例4: IdentifyItem
void Store::IdentifyItem(CREItem *item) const
{
if ((item->Flags & IE_INV_ITEM_IDENTIFIED) || IsBag()) {
return;
}
Item *itm = gamedata->GetItem(item->ItemResRef);
if (!itm) {
return;
}
if (itm->LoreToID <= Lore) {
item->Flags |= IE_INV_ITEM_IDENTIFIED;
}
gamedata->FreeItem(itm, item->ItemResRef, 0);
}
开发者ID:Tomsod,项目名称:gemrb,代码行数:16,代码来源:Store.cpp
示例5: CanBeTraded
bool Item::CanBeTraded() const
{
if (IsSoulBound())
return false;
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()) )
return false;
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
return false;
if (owner->GetLootGUID()==GetGUID())
return false;
}
if (IsBoundByEnchant())
return false;
return true;
}
开发者ID:Zekom,项目名称:NeoCore,代码行数:20,代码来源:Item.cpp
示例6: RechargeItem
//some stores can recharge items - in original engine apparently all stores
//did this. In gemrb there is a flag.
void Store::RechargeItem(CREItem *item)
{
Item *itm = gamedata->GetItem(item->ItemResRef);
if (!itm) {
return;
}
//gemrb extension, some shops won't recharge items
//containers' behaviour is inverted
//bag 0 1 0 1
//flag 0 0 1 1
//recharge 1 0 0 1
if (IsBag() != !(Flags&IE_STORE_RECHARGE)) {
bool feature = core->HasFeature(GF_SHOP_RECHARGE);
for (int i=0;i<CHARGE_COUNTERS;i++) {
ITMExtHeader *h = itm->GetExtHeader(i);
if (h && (feature || h->RechargeFlags&IE_ITEM_RECHARGE)
&& item->Usages[i] < h->Charges)
item->Usages[i] = h->Charges;
}
}
gamedata->FreeItem(itm, item->ItemResRef, 0);
}
开发者ID:Tomsod,项目名称:gemrb,代码行数:24,代码来源:Store.cpp
示例7: CanBeTraded
bool Item::CanBeTraded(bool mail) const
{
if ((!mail || !IsBoundAccountWide()) && IsSoulBound())
return false;
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
return false;
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
return false;
if (owner->GetLootGuid() == GetObjectGuid())
return false;
}
if (HasGeneratedLoot())
return false;
if (IsBoundByEnchant())
return false;
return true;
}
开发者ID:82cheyenne82,项目名称:MaNGOS-Core-4.3.4,代码行数:24,代码来源:Item.cpp
示例8: return
Bag* Item::ToBag()
{
return (IsBag() ? dynamic_cast<Bag* >(this) : nullptr);
}
开发者ID:calkut,项目名称:Warrior-of-Dreamworld,代码行数:4,代码来源:Item.cpp
注:本文中的IsBag函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论