本文整理汇总了C++中UnitPointer::GetAP方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitPointer::GetAP方法的具体用法?C++ UnitPointer::GetAP怎么用?C++ UnitPointer::GetAP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitPointer
的用法示例。
在下文中一共展示了UnitPointer::GetAP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalculateDamage
//.........这里部分代码省略.........
//MinD = AP(28AS-(WS/7))-MaxD
//starting from base attack power then we apply mods on it
//ap += pAttacker->GetAP();
ap += pVictim->APvModifier;
if(!pVictim->IsPlayer() && TO_CREATURE(pVictim)->GetCreatureName())
{
uint32 creatType = TO_CREATURE(pVictim)->GetCreatureName()->Type;
ap += (float)pAttacker->CreatureAttackPowerMod[creatType];
if(pAttacker->IsPlayer())
{
min_damage = (min_damage + TO_PLAYER(pAttacker)->IncreaseDamageByType[creatType]) * (1 + TO_PLAYER(pAttacker)->IncreaseDamageByTypePCT[creatType]);
max_damage = (max_damage + TO_PLAYER(pAttacker)->IncreaseDamageByType[creatType]) * (1 + TO_PLAYER(pAttacker)->IncreaseDamageByTypePCT[creatType]);
}
}
if(pAttacker->IsPlayer())
{
if(!pAttacker->disarmed)
{
ItemPointer it = TO_PLAYER(pAttacker)->GetItemInterface()->GetInventoryItem(EQUIPMENT_SLOT_MAINHAND);
if(it)
wspeed = (float)it->GetProto()->Delay;
else
wspeed = 2000;
}
else
wspeed = (float)pAttacker->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME);
if(ability && ability->SpellGroupType)
{
int32 apall = pAttacker->GetAP();
/* this spell modifier doesn't exist. also need to clear up how the AP is used here
int32 apb=0;
SM_FIValue(pAttacker->SM[SMT_ATTACK_POWER_BONUS][1],&apb,ability->SpellGroupType);
if(apb)
ap += apall*((float)apb/100);
else*/
ap = float(apall);
}
}
else
{
wspeed = (float)pAttacker->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME);
}
//Normalized weapon damage checks.
if(pAttacker->IsPlayer() && ability)
{
if(ability->Effect[0] == SPELL_EFFECT_DUMMYMELEE || ability->Effect[1] == SPELL_EFFECT_DUMMYMELEE || ability->Effect[2] == SPELL_EFFECT_DUMMYMELEE)
{
it = TO_PLAYER(pAttacker)->GetItemInterface()->GetInventoryItem(EQUIPMENT_SLOT_MAINHAND);
if(it)
{
if(it->GetProto()->Class == ITEM_CLASS_WEAPON) //weapon
{
if(it->GetProto()->InventoryType == INVTYPE_2HWEAPON) wspeed = 3300;
else if(it->GetProto()->SubClass == 15) wspeed = 1700;
else wspeed = 2400;
}
}
}