本文整理汇总了C++中SetArmor函数的典型用法代码示例。如果您正苦于以下问题:C++ SetArmor函数的具体用法?C++ SetArmor怎么用?C++ SetArmor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetArmor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModifierValue
void Player::UpdateArmor()
{
UnitMods unitMod = UNIT_MOD_ARMOR;
float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for (AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
{
if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
value += CalculatePct(GetStat(Stats((*i)->GetMiscValueB())), (*i)->GetAmount());
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
Pet* pet = GetPet();
if (pet)
pet->UpdateArmor();
UpdateAttackPowerAndDamage(); // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
}
示例2: GetModifierValue
void Player::UpdateArmor()
{
float value = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats
value += GetModifierValue(unitMod, TOTAL_VALUE);
// add dynamic flat mods
AuraList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for (AuraList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * mod->m_amount / 100.0f);
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
Pet* pet = GetPet();
if (pet)
pet->UpdateArmor();
UpdateAttackPowerAndDamage(); // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
}
示例3: GetOwner
void Pet::UpdateArmor()
{
float value = 0.0f;
float bonus_armor = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
Unit *owner = GetOwner();
// chained, use original owner instead
if (owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->GetEntry() == GetEntry())
if (Unit *creator = GetCreator())
owner = creator;
// hunter and warlock and shaman pets gain 35% of owner's armor value
if (owner && (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET
&& (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_SHAMAN))))
bonus_armor = 0.35f * float(owner->GetArmor());
value = GetModifierValue(unitMod, BASE_VALUE);
value *= GetModifierValue(unitMod, BASE_PCT);
value += GetStat(STAT_AGILITY);
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonus_armor;
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
}
示例4: GetModifierValue
void Player::UpdateArmor()
{
UnitMods unitMod = UNIT_MOD_ARMOR;
float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for (AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
{
if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
value += CalculatePct(GetStat(Stats((*i)->GetMiscValueB())), (*i)->GetAmount());
}
if (GetShapeshiftForm() == FORM_BEAR)
// Thick Hide
if (AuraEffect* thickHide = GetDummyAuraEffect(SPELLFAMILY_GENERIC, 1558, EFFECT_1))
AddPct(value, thickHide->GetAmount());
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
RecalculatePetsScalingResistance(SPELL_SCHOOL_NORMAL);
UpdateAttackPowerAndDamage(); // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
}
示例5: GetModifierValue
void Player::UpdateArmor()
{
float value = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats
value += GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
AuraList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for (AuraList::const_iterator i = mResbyIntellect.begin();i != mResbyIntellect.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetModifierValue() / 100.0f);
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
if (HasAura(5229,0))
value -= HasAura(9634,0) ? 0.16*value : 0.27*value;
SetArmor(int32(value));
Pet *pet = GetPet();
if (pet)
pet->UpdateArmor();
}
示例6: GetModifierValue
void Player::UpdateArmor()
{
float value = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetModifierValue(unitMod, TOTAL_VALUE);
// Custom MoP Script
// 77494 - Mastery : Nature's Guardian
if (GetTypeId() == TYPEID_PLAYER && HasAura(77494))
{
float Mastery = 1.0f + GetFloatValue(PLAYER_MASTERY) * 1.25f / 100.0f;
value *= Mastery;
}
//add dynamic flat mods
AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for (AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
{
if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
value += CalculatePct(GetStat(Stats((*i)->GetMiscValueB())), (*i)->GetAmount());
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
UpdateAttackPowerAndDamage(); // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
}
示例7: GetModifierValue
void Guardian::UpdateArmor()
{
float value = GetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE);
value *= GetModifierValue(UNIT_MOD_ARMOR, BASE_PCT);
value += std::max<float>(GetStat(STAT_AGILITY) - GetCreateStat(STAT_AGILITY), 0.0f) * 2.0f;
value += GetModifierValue(UNIT_MOD_ARMOR, TOTAL_VALUE);
value *= GetModifierValue(UNIT_MOD_ARMOR, TOTAL_PCT);
SetArmor(int32(value));
}
示例8: GetTotalAuraModValue
void Guardian::UpdateArmor()
{
float value = GetTotalAuraModValue(UNIT_MOD_ARMOR);
UnitMods unitMod = UNIT_MOD_ARMOR;
// All pets gain 100% of owner's armor value
value += float(CalculatePct(m_owner->GetArmor(), 70));
SetArmor(int32(value));
}
示例9: SetFullWeapons
void CCheatMgr::SetKFA()
{
s_CheatInfo[CHEAT_KFA].bActive = LTTRUE;
// Give us all weapons, ammo, armor, and health...
SetFullWeapons(); // Gives us all ammo too
SetHealth(LTFALSE);
SetArmor();
g_pChatMsgs->AddMessage("Knock em out the box Luke...",kMsgCheatConfirm);
}
示例10: SetFullWeapons
void CCheatMgr::SetKFA()
{
s_CheatInfo[CHEAT_KFA].bActive = true;
// Give us all weapons, ammo, armor, and health...
SetFullWeapons(); // Gives us all ammo too
SetHealth(false);
SetArmor();
// g_pGameMsgs->AddMessage(L"Knock em out the box Luke...",kMsgCheatConfirm);
}
示例11: GetModifierValue
void Pet::UpdateArmor()
{
float value = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
value = GetModifierValue(unitMod, BASE_VALUE) + GetStat(STAT_AGILITY) * 2.0f;
value *= GetModifierValue(unitMod, BASE_PCT);
value += GetModifierValue(unitMod, TOTAL_VALUE);
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
}
示例12: GetModifierValue
void Guardian::UpdateArmor()
{
float value = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
// All pets gain 100% of owner's armor value
value = m_owner->GetArmor();
value *= GetModifierValue(unitMod, BASE_PCT);
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
}
示例13: float
void Guardian::UpdateArmor()
{
float value = 0.0f;
float bonus_armor = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
// hunter and warlock pets gain 35% of owner's armor value
if (isPet())
bonus_armor = float(CalculatePctN(m_owner->GetArmor(), 35));
value = GetModifierValue(unitMod, BASE_VALUE);
value *= GetModifierValue(unitMod, BASE_PCT);
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonus_armor;
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
}
示例14: float
void Guardian::UpdateArmor()
{
float value = 0.0f;
float bonus_armor = 0.0f;
UnitMods unitMod = UNIT_MOD_ARMOR;
// hunter and warlock pets gain 35% of owner's armor value
if(isPet()&&!IsPetGhoul())
bonus_armor = 0.35f * float(m_owner->GetArmor());
value = GetModifierValue(unitMod, BASE_VALUE);
value *= GetModifierValue(unitMod, BASE_PCT);
value += GetStat(STAT_AGILITY) * 2.0f;
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonus_armor;
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetArmor(int32(value));
}
示例15: SetHull
void Enemy::Reset(int index, BulletManager * bulletManager)
{
//1 = enemy, 2 = boss
if (index == 1)
{
position.y = -32;
position.x = (rand()%150)+1;
}
if (index == 2)
{
position.x = (rand()%150)+1;
position.y = -64;
SetHull(GetMaxHull());
SetShields(GetMaxShields());
SetArmor(GetMaxArmor());
}
}