本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例8: return
Bag* Item::ToBag()
{
return (IsBag() ? dynamic_cast<Bag* >(this) : nullptr);
}