当前位置: 首页>>代码示例>>C++>>正文


C++ CItem::IsItem方法代码示例

本文整理汇总了C++中CItem::IsItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CItem::IsItem方法的具体用法?C++ CItem::IsItem怎么用?C++ CItem::IsItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CItem的用法示例。


在下文中一共展示了CItem::IsItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

BOOL CItem380System::ApplyFor380Option(LPOBJ lpObj)
{
	ITEMOPTION_FOR380ITEM_EFFECT * pItemEffect = &lpObj->m_ItemOptionExFor380;
	this->InitEffectValue(pItemEffect);
	int iItemIndex = 0;

	for ( iItemIndex = 0; iItemIndex < INVETORY_WEAR_SIZE ; iItemIndex++)
	{
		CItem * pItem = &lpObj->pInventory[iItemIndex];

		if ( pItem->IsItem() &&
			 pItem->m_IsValidItem &&
			 this->Is380OptionItem(pItem) == TRUE )
		{
			BYTE iOption1, iOption2;
			WORD iValue1, iValue2;

			iOption1 = this->m_itemOption[pItem->m_Type ].m_Option1;
			iValue1 = this->m_itemOption[pItem->m_Type ].m_Value1;
			iOption2 = this->m_itemOption[pItem->m_Type ].m_Option2;
			iValue2 = this->m_itemOption[pItem->m_Type ].m_Value2;
			BOOL bResult = FALSE;
			bResult = this->_CalcItemEffectValue(iOption1, iValue1, pItemEffect);
			bResult |= this->_CalcItemEffectValue(iOption2, iValue2, pItemEffect);
		}
	}

	lpObj->AddLife += pItemEffect->OpAddMaxHP;
	lpObj->iAddShield += pItemEffect->OpAddMaxSD;

	return TRUE;
}
开发者ID:ElBedeawi,项目名称:mu-server-ex,代码行数:32,代码来源:Item380System.cpp

示例2: ApplyElementDurability

BOOL TMonsterSkillElement::ApplyElementDurability(int iIndex, int iTargetIndex)
{
	LPOBJ lpObj = &gObj[iIndex];
	LPOBJ lpTargetObj = &gObj[iTargetIndex];

	if ( lpTargetObj->Type != OBJ_USER )
		return FALSE;

	int iEquipmentPos = rand()%6+2;	// Armors
	CItem * lpEquipment = &lpTargetObj->pInventory[iEquipmentPos];

	if ( lpEquipment == NULL || lpEquipment->IsItem() == FALSE )
		return FALSE;

	int iDurEquipment = (int)(lpEquipment->m_Durability);
	int iIncDecValue = 0;

	if ( this->m_iIncAndDecType != MSE_INCDEC_TYPE_NONE )
	{
		if ( this->m_iIncAndDecType < MSE_INCDEC_TYPE_CONSTANTINC )
		{
			iIncDecValue = iDurEquipment * this->m_iIncAndDecValue / 100;

			if ( this->m_iIncAndDecType == MSE_INCDEC_TYPE_PERCENTDEC )
				iIncDecValue = -iIncDecValue;
		}	

		if ( this->m_iIncAndDecType >= MSE_INCDEC_TYPE_CONSTANTINC )
		{
			iIncDecValue = this->m_iIncAndDecValue;

			if ( this->m_iIncAndDecType == MSE_INCDEC_TYPE_CONSTANTDEC )
				iIncDecValue = -iIncDecValue;
		}
	}

	iDurEquipment += iIncDecValue;

	if ( lpEquipment )
	{
		lpEquipment->m_Durability = (float)iDurEquipment;

		if ( lpEquipment->m_Durability < 0.0f )
			lpEquipment->m_Durability = 0;

		GCItemDurSend(lpTargetObj->m_Index, iEquipmentPos, (BYTE)lpEquipment->m_Durability, 0);
	}

	return FALSE;
}
开发者ID:ElBedeawi,项目名称:mu-server-ex,代码行数:50,代码来源:TMonsterSkillElement.cpp

示例3: GetAttackDamage

void ClassCalc::GetAttackDamage(LPOBJ lpUser)
{
#if (ENABLETEST_ZTLUA == 1)
    ZTLuaManager* LuaMng = new ZTLuaManager(FILE_LUA_CHARACTERBASICS);
    ZTLuaUnit::Bind(LuaMng->getLua());
    ZTLuaItem::Bind(LuaMng->getLua());
    LuaMng->Call("setAttackDamage", lpUser->m_Index);
    ZTLuaManager::Delete(LuaMng);
#else
    CItem* Right	= &lpUser->pInventory[0];
    CItem* Left		= &lpUser->pInventory[1];
    int Strength	= lpUser->Strength + lpUser->AddStrength;
    int Dexterity	= lpUser->Dexterity + lpUser->AddDexterity;
    int Vitality	= lpUser->Vitality + lpUser->AddVitality;
    int Energy		= lpUser->Energy + lpUser->AddEnergy;
    WORD Class		= lpUser->Class;
    // ----
    if( Class == CLASS_WIZARD || Class == CLASS_KNIGHT )
    {
        lpUser->m_AttackDamageMinRight	= Strength / this->m_Data[Class].AttackDamageMinRightDiv1;
        lpUser->m_AttackDamageMaxRight	= Strength / this->m_Data[Class].AttackDamageMaxRightDiv1;
        lpUser->m_AttackDamageMinLeft	= Strength / this->m_Data[Class].AttackDamageMinLeftDiv1;
        lpUser->m_AttackDamageMaxLeft	= Strength / this->m_Data[Class].AttackDamageMaxLeftDiv1;
    }
    else if( Class == CLASS_ELF )
    {
        if(		(Right->m_Type >= ITEMGET(4,8) && Right->m_Type < ITEMGET(4,15) )
                ||	(Left->m_Type >= ITEMGET(4,0) && Left->m_Type < ITEMGET(4,7))
                ||	Right->m_Type == ITEMGET(4,16)
                ||	Left->m_Type == ITEMGET(4,17)
                ||	Right->m_Type == ITEMGET(4,18)
                ||	Right->m_Type == ITEMGET(4,19)
                ||	Left->m_Type == ITEMGET(4,20)
                ||	Left->m_Type == ITEMGET(4,21)
                ||	Left->m_Type == ITEMGET(4,22)
                ||	Left->m_Type == ITEMGET(4,23)
                ||	Left->m_Type == ITEMGET(4,24)
                ||	Left->m_Type == ITEMGET(4,25)
                ||	Right->m_Type == ITEMGET(4,26)
                ||	Left->m_Type == ITEMGET(4,27))
        {
            if(		(Right->IsItem() && !Right->m_IsValidItem)
                    ||	(Left->IsItem() && !Left->m_IsValidItem) )
            {
                lpUser->m_AttackDamageMinRight	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMinRightDiv3;
                lpUser->m_AttackDamageMaxRight	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMaxRightDiv3;
                lpUser->m_AttackDamageMinLeft	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMinLeftDiv3;
                lpUser->m_AttackDamageMaxLeft	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMaxLeftDiv3;
            }
            else
            {
                lpUser->m_AttackDamageMinRight	= (Dexterity / this->m_Data[Class].AttackDamageMinRightDiv1) + (Strength / this->m_Data[Class].AttackDamageMinRightDiv2);
                lpUser->m_AttackDamageMaxRight	= (Dexterity / this->m_Data[Class].AttackDamageMaxRightDiv1) + (Strength / this->m_Data[Class].AttackDamageMaxRightDiv2);
                lpUser->m_AttackDamageMinLeft	= (Dexterity / this->m_Data[Class].AttackDamageMinLeftDiv1) + (Strength / this->m_Data[Class].AttackDamageMinLeftDiv2);
                lpUser->m_AttackDamageMaxLeft	= (Dexterity / this->m_Data[Class].AttackDamageMaxLeftDiv1) + (Strength / this->m_Data[Class].AttackDamageMaxLeftDiv2);
            }
        }
        else
        {
            lpUser->m_AttackDamageMinRight	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMinRightDiv3;
            lpUser->m_AttackDamageMaxRight	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMaxRightDiv3;
            lpUser->m_AttackDamageMinLeft	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMinLeftDiv3;
            lpUser->m_AttackDamageMaxLeft	= (Dexterity + Strength) / this->m_Data[Class].AttackDamageMaxLeftDiv3;
        }
    }
    else if( Class == CLASS_MAGUMSA || Class == CLASS_DARKLORD )
    {
        lpUser->m_AttackDamageMinRight	= (Strength / this->m_Data[Class].AttackDamageMinRightDiv1) + (Energy / this->m_Data[Class].AttackDamageMinRightDiv2);
        lpUser->m_AttackDamageMaxRight	= (Strength / this->m_Data[Class].AttackDamageMaxRightDiv1) + (Energy / this->m_Data[Class].AttackDamageMaxRightDiv2);
        lpUser->m_AttackDamageMinLeft	= (Strength / this->m_Data[Class].AttackDamageMinLeftDiv1) + (Energy / this->m_Data[Class].AttackDamageMinLeftDiv2);
        lpUser->m_AttackDamageMaxLeft	= (Strength / this->m_Data[Class].AttackDamageMaxLeftDiv1) + (Energy / this->m_Data[Class].AttackDamageMaxLeftDiv2);
    }
    else if( Class == CLASS_SUMMONER )
    {
        lpUser->m_AttackDamageMinRight	= ((Strength + Dexterity) / this->m_Data[Class].AttackDamageMinRightDiv1);
        lpUser->m_AttackDamageMaxRight	= ((Strength + Dexterity) / this->m_Data[Class].AttackDamageMaxRightDiv1);
        lpUser->m_AttackDamageMinLeft	= ((Strength + Dexterity) / this->m_Data[Class].AttackDamageMinLeftDiv1);
        lpUser->m_AttackDamageMaxLeft	= ((Strength + Dexterity) / this->m_Data[Class].AttackDamageMaxLeftDiv1);
    }
    else if( Class == CLASS_FIGHTER )
    {
        lpUser->m_AttackDamageMinRight	= Vitality / this->m_Data[Class].AttackDamageMinRightDiv1 + Strength / this->m_Data[Class].AttackDamageMinRightDiv2;
        lpUser->m_AttackDamageMaxRight	= Vitality / this->m_Data[Class].AttackDamageMaxRightDiv1 + Strength / this->m_Data[Class].AttackDamageMaxRightDiv2;
        lpUser->m_AttackDamageMinLeft	= Vitality / this->m_Data[Class].AttackDamageMinLeftDiv1 + Strength / this->m_Data[Class].AttackDamageMinLeftDiv2;
        lpUser->m_AttackDamageMaxLeft	= Vitality / this->m_Data[Class].AttackDamageMaxLeftDiv1 + Strength / this->m_Data[Class].AttackDamageMaxLeftDiv2;
    }
    else
    {
        lpUser->m_AttackDamageMinRight	= Strength / 8;
        lpUser->m_AttackDamageMaxRight	= Strength / 4;
        lpUser->m_AttackDamageMinLeft	= Strength / 8;
        lpUser->m_AttackDamageMaxLeft	= Strength / 4;
    }
#endif
}
开发者ID:stimpy76,项目名称:OpenMuS9,代码行数:95,代码来源:ClassCalc.cpp

示例4: gObjCalCharacter

void CCalCharacter::gObjCalCharacter(int aIndex)
{
	LPOBJ lpObj = &gObj[aIndex];
	int Strength = 0;
	int Dexterity = 0;
	int Vitality = 0;
	int Energy = 0;
	int Leadership = 0;
	// ----
	CItem * Right = &lpObj->pInventory[0];
	CItem * Left  = &lpObj->pInventory[1];
	CItem * Helm  = &lpObj->pInventory[2];
	CItem * Armor  = &lpObj->pInventory[3];
	CItem * Pants  = &lpObj->pInventory[4];
	CItem * Gloves = &lpObj->pInventory[5];
	CItem * Boots = &lpObj->pInventory[6];
	CItem * Wings = &lpObj->pInventory[7];
	CItem * Helper = &lpObj->pInventory[8];
	CItem * Amulet = &lpObj->pInventory[9];
	CItem * Ring01 = &lpObj->pInventory[10];
	CItem * Ring02 = &lpObj->pInventory[11];
	lpObj->HaveWeaponInHand = true;
	// -------------------------------------------------------
	// Check Weapon in hand
	// -------------------------------------------------------
	if ( Right->IsItem() == false && Left->IsItem() == false )
	{
		lpObj->HaveWeaponInHand = false;
	}
	else if ( Left->IsItem() == false && Right->m_Type == ITEMGET(4,15) ) // Arrow
	{
		lpObj->HaveWeaponInHand = false;
	}
	else if ( Right->IsItem() == false )
	{
		int iType = Left->m_Type / MAX_SUBTYPE_ITEMS;

		if ( Left->m_Type == ITEMGET(4,7) ) // Bolt
		{
			lpObj->HaveWeaponInHand = false;
		}
		else if ( iType == 6 ) // Shield
		{
			lpObj->HaveWeaponInHand = false;
		}
	}
	// -------------------------------------------------------
	lpObj->AddLife = 0;
	lpObj->AddMana = 0;
	lpObj->MonsterDieGetMoney = 0;
	lpObj->MonsterDieGetLife = 0;
	lpObj->MonsterDieGetMana = 0;
	lpObj->DamageReflect = 0;
	lpObj->DamageMinus = 0;
	lpObj->SkillLongSpearChange = false;

	if ( lpObj->m_iItemEffectValidTime > 0 )
	{
		g_ItemAddOption.PrevSetItemLastEffectForHallowin(lpObj);
	}

	int iItemIndex;
	BOOL bIsChangeItem;	// lc34

	for ( iItemIndex=0; iItemIndex<MAX_PLAYER_EQUIPMENT;iItemIndex++)
	{
		if ( lpObj->pInventory[iItemIndex].IsItem() != FALSE )
		{
			lpObj->pInventory[iItemIndex].m_IsValidItem = true;
		}
	}

	do
	{
		lpObj->SetOpAddMaxAttackDamage = 0;
		lpObj->SetOpAddMinAttackDamage = 0;
		lpObj->SetOpAddDamage = 0;
		lpObj->SetOpIncAGValue = 0;
		lpObj->SetOpAddCriticalDamageSuccessRate = 0;
		lpObj->SetOpAddCriticalDamage = 0;
		lpObj->SetOpAddExDamageSuccessRate = 0;
		lpObj->SetOpAddExDamage = 0;
		lpObj->SetOpAddSkillAttack = 0;
		lpObj->AddStrength = 0;
		lpObj->AddDexterity = 0;
		lpObj->AddVitality = 0;
		lpObj->AddEnergy = 0;
		lpObj->AddBP = 0;
		lpObj->iAddShield = 0;
		lpObj->SetOpAddAttackDamage = 0;
		lpObj->SetOpAddDefence = 0;
		lpObj->SetOpAddMagicPower = 0;
		lpObj->SetOpAddDefenceRate = 0;
		lpObj->SetOpIgnoreDefense = 0;
		lpObj->SetOpDoubleDamage = 0;
		lpObj->SetOpTwoHandSwordImproveDamage = 0;
		lpObj->SetOpImproveSuccessAttackRate = 0;
		lpObj->SetOpReflectionDamage = 0;
		lpObj->SetOpImproveSheldDefence = 0;
		lpObj->SetOpDecreaseAG = 0;
//.........这里部分代码省略.........
开发者ID:kelemeto76,项目名称:mu-bk-server-sourcecode,代码行数:101,代码来源:ObjCalCharacter.cpp

示例5: gObjCalCharacter

void gObjCalCharacter(int aIndex)
{
		LPOBJ lpObj = &gObj[aIndex];
	int Strength = 0;
	int Dexterity = 0;
	int Vitality = 0;
	int Energy = 0;
	CItem * Right = &lpObj->pInventory[0];
	CItem * Left  = &lpObj->pInventory[1];
	CItem * Gloves = &lpObj->pInventory[5];
	CItem * Amulet = &lpObj->pInventory[9];
	CItem * Helper = &lpObj->pInventory[8];
	lpObj->HaveWeaponInHand = true;

	if ( Right->IsItem() == FALSE && Left->IsItem() == FALSE )
	{
		lpObj->HaveWeaponInHand = false;
	}
	else if ( Left->IsItem() == FALSE && Right->m_Type == ITEMGET(4,15) )	// Arrow
	{
		lpObj->HaveWeaponInHand = false;
	}
	else if ( Right->IsItem() == FALSE )
	{
		int iType = Left->m_Type / MAX_SUBTYPE_ITEMS;

		if ( Left->m_Type == ITEMGET(4,7) ) // Bolt
		{
			lpObj->HaveWeaponInHand = false;
		}
		else if ( iType == 6 )
		{
			lpObj->HaveWeaponInHand = false;
		}
	}

	lpObj->AddLife = 0;
	lpObj->AddMana = 0;
	lpObj->MonsterDieGetMoney = 0;
	lpObj->MonsterDieGetLife = 0;
	lpObj->MonsterDieGetMana = 0;
	lpObj->DamageReflect = 0;
	lpObj->DamageMinus = 0;
	lpObj->SkillLongSpearChange = false;

	if ( lpObj->m_iItemEffectValidTime > 0 )
	{
		g_ItemAddOption.PrevSetItemLastEffectForHallowin(lpObj);
	}

	int iItemIndex;
	BOOL bIsChangeItem;	// lc34

	for ( iItemIndex=0; iItemIndex<MAX_PLAYER_EQUIPMENT;iItemIndex++)
	{
		if ( lpObj->pInventory[iItemIndex].IsItem() != FALSE )
		{
			lpObj->pInventory[iItemIndex].m_IsValidItem = true;
		}
	}

	do
	{
		lpObj->SetOpAddMaxAttackDamage = 0;
		lpObj->SetOpAddMinAttackDamage = 0;
		lpObj->SetOpAddDamage = 0;
		lpObj->SetOpIncAGValue = 0;
		lpObj->SetOpAddCriticalDamageSuccessRate = 0;
		lpObj->SetOpAddCriticalDamage = 0;
		lpObj->SetOpAddExDamageSuccessRate = 0;
		lpObj->SetOpAddExDamage = 0;
		lpObj->SetOpAddSkillAttack = 0;
		lpObj->AddStrength = 0;
		lpObj->AddDexterity = 0;
		lpObj->AddVitality = 0;
		lpObj->AddEnergy = 0;
		lpObj->AddBP = 0;
		lpObj->iAddShield = 0;
		lpObj->SetOpAddAttackDamage = 0;
		lpObj->SetOpAddDefence = 0;
		lpObj->SetOpAddMagicPower = 0;
		lpObj->SetOpAddDefenceRate = 0;
		lpObj->SetOpIgnoreDefense = 0;
		lpObj->SetOpDoubleDamage = 0;
		lpObj->SetOpTwoHandSwordImproveDamage = 0;
		lpObj->SetOpImproveSuccessAttackRate = 0;
		lpObj->SetOpReflectionDamage = 0;
		lpObj->SetOpImproveSheldDefence = 0;
		lpObj->SetOpDecreaseAG = 0;
		lpObj->SetOpImproveItemDropRate = 0;
		lpObj->IsFullSetItem = false;

		memset(lpObj->m_AddResistance, 0, sizeof(lpObj->m_AddResistance));
		bIsChangeItem = 0;
		gObjCalcSetItemStat(lpObj);
		gObjCalcSetItemOption(lpObj);

		for (iItemIndex=0;iItemIndex<MAX_PLAYER_EQUIPMENT;iItemIndex++)
		{
			if ( lpObj->pInventory[iItemIndex].IsItem() != FALSE && lpObj->pInventory[iItemIndex].m_IsValidItem != false )
//.........这里部分代码省略.........
开发者ID:Natzugen,项目名称:IGCN---Season-5,代码行数:101,代码来源:ObjCalCharacter.cpp


注:本文中的CItem::IsItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。