本文整理汇总了C++中Item::GetGemSlotMax方法的典型用法代码示例。如果您正苦于以下问题:C++ Item::GetGemSlotMax方法的具体用法?C++ Item::GetGemSlotMax怎么用?C++ Item::GetGemSlotMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::GetGemSlotMax方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsGemConflict
BOOL AbilityMachining::IsGemConflict(Obj_Human* pHuman, BYTE GemIndex, BYTE EquipIndex)
{
__ENTER_FUNCTION
Assert( pHuman );
//const _ITEM* pGem = pHuman->GetItem(GemIndex);
//const _ITEM* pEquip = pHuman->GetItem(EquipIndex);
Item* pGemItem = HumanItemLogic::GetBagItem(pHuman,GemIndex);
Item* pEquipItem = HumanItemLogic::GetBagItem(pHuman,EquipIndex);
UINT uGemSerialNumber = pGemItem->GetItemTableIndex();
LuaInterface* pLuaInterface;
pLuaInterface = pHuman->getScene()->GetLuaInterface();
_ITEM tmpGem;
for( INT i=0; i<pEquipItem->GetGemSlotMax(); ++i )
{
UINT idx;
idx = pEquipItem->GetEquipGemInfo(i).m_GemIndex;
if( idx < 1 )
continue;
if( pLuaInterface->ExeScript_DDD( ABILITY_LOGIC_SCRIPT,
"IsGemConflict",
(INT)pHuman->getScene()->SceneID(),
(INT)uGemSerialNumber,
(INT)idx )
)
{
return FALSE;
}
}
return TRUE;
__LEAVE_FUNCTION
return FALSE;
}
示例2: CanUseAbility
ORESULT AbilityMachining::CanUseAbility(Obj_Human* pHuman)
{
__ENTER_FUNCTION
Assert( pHuman );
AbilityOpera* pAbilityOpera;
pAbilityOpera = pHuman->GetAbilityOpera();
Assert( pAbilityOpera );
switch( pAbilityOpera->m_SubType )
{
case NORMAL_TYPE:
return AbilityCompound::CanUseAbility(pHuman);
case GEM_COMPOUND:
{
ORESULT res;
res = Ability::CanUseAbility(pHuman);
if( res != OR_OK )
{
return res;
}
if( (pAbilityOpera->m_BagPos[0] < 0) || (pAbilityOpera->m_BagPos[0] >= MAX_BAG_SIZE)
|| (pAbilityOpera->m_BagPos[1] < 0) || (pAbilityOpera->m_BagPos[1] >= MAX_BAG_SIZE)
)
{
Assert(FALSE);
return OR_ERROR;
}
//const _ITEM* pGem1 = pHuman->GetItem(pAbilityOpera->m_BagPos[0]);
//const _ITEM* pGem2 = pHuman->GetItem(pAbilityOpera->m_BagPos[1]);
Item* pGem1Item = HumanItemLogic::GetBagItem(pHuman,pAbilityOpera->m_BagPos[0]);
Item* pGem2Item = HumanItemLogic::GetBagItem(pHuman,pAbilityOpera->m_BagPos[1]);
Assert( (pGem1Item != NULL) && (pGem2Item != NULL) );
if( (pGem1Item->GetItemClass() != ICLASS_GEM) || (pGem2Item->GetItemClass() != ICLASS_GEM) )
{
return OR_STUFF_LACK;
}
if((pGem1Item->GetItemIndex() != pGem2Item->GetItemIndex())// (pGem1Item->GetItemQual() != pGem2Item->GetItemQual())
)
{
return OR_STUFF_LACK;
}
//if( >= MAX_GEM_QUALITY ) // pGem1Item->GetItemQual()没法再升了
//{
// return OR_CANNOT_UPGRADE;
//}
return OR_OK;
}
break;
case GEM_EMBED:
{
ORESULT res;
res = Ability::CanUseAbility(pHuman);
if( res != OR_OK )
{
return res;
}
if( (pAbilityOpera->m_BagPos[0] < 0) || (pAbilityOpera->m_BagPos[0] >= MAX_BAG_SIZE)
|| (pAbilityOpera->m_BagPos[1] < 0) || (pAbilityOpera->m_BagPos[1] >= MAX_BAG_SIZE)
)
{
Assert(FALSE);
return OR_ERROR;
}
//const _ITEM* pGem = pHuman->GetItem(pAbilityOpera->m_BagPos[0]);
//const _ITEM* pEquip = pHuman->GetItem(pAbilityOpera->m_BagPos[1]);
Item* pGemItem = HumanItemLogic::GetBagItem(pHuman,pAbilityOpera->m_BagPos[0]);
Item* pEquipItem = HumanItemLogic::GetBagItem(pHuman,pAbilityOpera->m_BagPos[1]);
Assert( (pGemItem != NULL) && (pEquipItem != NULL) );
if( (pGemItem->GetItemClass() != ICLASS_GEM) || (pEquipItem->GetItemClass() != ICLASS_EQUIP) )
{
return OR_STUFF_LACK;
}
if( IsGemConflict(pHuman, pAbilityOpera->m_BagPos[0], pAbilityOpera->m_BagPos[1]) == FALSE )
{
return OR_GEM_CONFLICT;
}
LuaInterface* pLuaInterface;
pLuaInterface = pHuman->getScene()->GetLuaInterface();
if( pEquipItem->GetGemSlotMax() <= pEquipItem->GetEquipGemCount()
|| pLuaInterface->ExeScript_DDD( ABILITY_LOGIC_SCRIPT,
"TooManyGems",
(INT)pHuman->getScene()->SceneID(),
//.........这里部分代码省略.........
示例3: CanUseAbility
ORESULT AbilityInlay::CanUseAbility(Obj_Human* pHuman)
{
__ENTER_FUNCTION
Assert( pHuman );
AbilityOpera* pAbilityOpera;
pAbilityOpera = pHuman->GetAbilityOpera();
Assert( pAbilityOpera );
ORESULT res;
res = Ability::CanUseAbility(pHuman);
if( res != OR_OK )
{
return res;
}
CHAR MaterialBagIndex1 = (CHAR)pAbilityOpera->m_BagPos[2];
CHAR MaterialBagIndex2 = (CHAR)pAbilityOpera->m_BagPos[3];
if( (pAbilityOpera->m_BagPos[0] < 0) || (pAbilityOpera->m_BagPos[0] >= MAX_BAG_SIZE)
|| (pAbilityOpera->m_BagPos[1] < 0) || (pAbilityOpera->m_BagPos[1] >= MAX_BAG_SIZE)
|| (MaterialBagIndex1>= MAX_BAG_SIZE)|| (MaterialBagIndex2>= MAX_BAG_SIZE)
)
{
Assert(FALSE);
return OR_ERROR;
}
Item* pGemItem = HumanItemLogic::GetBagItem( pHuman, pAbilityOpera->m_BagPos[0] );
Item* pEquipItem = HumanItemLogic::GetBagItem( pHuman, pAbilityOpera->m_BagPos[1] );
Item* pMaterialItem1 = NULL;
Item* pMaterialItem2 = NULL;
if( MaterialBagIndex1 != -1 )
{
pMaterialItem1 = HumanItemLogic::GetBagItem( pHuman, pAbilityOpera->m_BagPos[2] );
Assert( pMaterialItem1 != NULL );
}
if( MaterialBagIndex2 != -1 )
{
pMaterialItem2 = HumanItemLogic::GetBagItem( pHuman, pAbilityOpera->m_BagPos[3] );
Assert( pMaterialItem2 != NULL );
}
Assert( (pGemItem != NULL) && (pEquipItem != NULL) );
if( (pGemItem->IsLock())
|| (pEquipItem->IsLock())
|| (pGemItem->IsPWLock())
|| (pEquipItem->IsPWLock())
|| (pGemItem->GetItemClass() != ICLASS_GEM)
|| (pEquipItem->GetItemClass() != ICLASS_EQUIP)
)
{
return OR_STUFF_LACK;
}
//if( pHuman->__GetAbilityLevel(pAbilityOpera->m_AbilityID) < pGemItem->GetItemQual() )
//{
// return OR_NO_LEVEL;
//}
if( IsGemConflict(pHuman, pAbilityOpera->m_BagPos[0], pAbilityOpera->m_BagPos[1]) == FALSE )
{
return OR_GEM_CONFLICT;
}
LuaInterface* pLuaInterface;
pLuaInterface = pHuman->getScene()->GetLuaInterface();
if( pEquipItem->GetGemSlotMax() <= pEquipItem->GetEquipGemCount()
|| pLuaInterface->ExeScript_DDD( ABILITY_LOGIC_SCRIPT, DEF_GEM_COUNT_CHECK,
(INT)pHuman->getScene()->SceneID(),
(INT)pHuman->GetID(),
(INT)pAbilityOpera->m_BagPos[1] )
)
{
return OR_GEM_SLOT_LACK;
}
if( pLuaInterface->ExeScript_DDDD( ABILITY_LOGIC_SCRIPT, DEF_IS_GEM_FIT_EQUIP,
(INT)pHuman->getScene()->SceneID(),
(INT)pHuman->GetID(),
pGemItem->GetItemTableIndex(),
pAbilityOpera->m_BagPos[1] ) == 0
)
{ // 判断宝石和装备是否匹配
return OR_GEM_NOT_FIT_EQUIP;
}
return OR_OK;
__LEAVE_FUNCTION
return OR_ERROR;
}