本文整理汇总了C++中Obj_Character::GetHit方法的典型用法代码示例。如果您正苦于以下问题:C++ Obj_Character::GetHit方法的具体用法?C++ Obj_Character::GetHit怎么用?C++ Obj_Character::GetHit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_Character
的用法示例。
在下文中一共展示了Obj_Character::GetHit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalculateHitRate
INT CombatCore_T::CalculateHitRate(Obj_Character& rAttacker, Obj_Character& rTag)
{
__ENTER_FUNCTION
INT nHit = rAttacker.GetHit();
INT nMiss = rTag.GetMiss();
nHit = Attr_VerifyHitMiss(nHit);
nMiss = Attr_VerifyHitMiss(nMiss);
//INT iItemPointRefix = 0;
//INT iSkillPointRefix = 0;
//if( rAttacker.GetObjType() == Obj::OBJ_TYPE_HUMAN )
//{
// //装备对属性的点数影响
// iItemPointRefix = static_cast<Obj_Human&>(rAttacker).GetIattributeHit();
//}
//iSkillPointRefix = rAttacker.GetHitRefix();
//INT iItemPointRefixMiss = 0;
//INT iSkillPointRefixMiss = 0;
//if( rTag.GetObjType() == Obj::OBJ_TYPE_HUMAN )
//{
// //装备对属性的点数影响
// iItemPointRefixMiss = static_cast<Obj_Human&>(rTag).GetIattributeMiss();
//}
//iSkillPointRefixMiss = rTag.GetMissRefix();
INT iRateHit = 0;
if (Obj::OBJ_TYPE_HUMAN==rAttacker.GetObjType())
{
Obj_Human& rHuman = (Obj_Human&)rAttacker;
_ITEM_EFFECT* pIE=NULL;
pIE = rHuman.ItemEffect(IATTRIBUTE_RATE_HIT);
Assert( pIE );
if( pIE->IsActive() )
{
iRateHit = pIE->m_Attr.m_Value;
}
}
//总命中率=(75+攻击方总命中-受击方总闪避)/100+攻击方装备对命中率的影响+攻击方技能对命中率的影响-受击方装备对闪避率的影响-受击方技能对闪避率的影响
SkillInfo_T& oSkillInf = rAttacker.GetSkillInfo();
INT iRefix = oSkillInf.GetAccuracy();
if( iRefix < 0 )
{
iRefix = 0;
}
INT iFainlHitRate = ((75 + nHit - nMiss)/100.0 + iRateHit/100.0 + iRefix/100.0) * 100.0;
return iFainlHitRate;
__LEAVE_FUNCTION
return 0;
}