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


C++ SetArmor函数代码示例

本文整理汇总了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
}
开发者ID:TrueWoW,项目名称:TrinityCore,代码行数:26,代码来源:StatSystem.cpp

示例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
}
开发者ID:LabGod,项目名称:server,代码行数:29,代码来源:StatSystem.cpp

示例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));
}
开发者ID:Archives,项目名称:try,代码行数:25,代码来源:StatSystem.cpp

示例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
}
开发者ID:Cryostorm,项目名称:InfinityCore,代码行数:26,代码来源:StatSystem.cpp

示例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();
}
开发者ID:Looking4Group,项目名称:L4G_Core,代码行数:30,代码来源:StatSystem.cpp

示例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
}
开发者ID:xIchigox,项目名称:SoDCore.434,代码行数:25,代码来源:StatSystem.cpp

示例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));
}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:9,代码来源:StatSystem.cpp

示例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));
}
开发者ID:Exodius,项目名称:chuspi,代码行数:10,代码来源:StatSystem.cpp

示例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);
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:11,代码来源:CheatMgr.cpp

示例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);
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:11,代码来源:CheatMgr.cpp

示例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));
}
开发者ID:MichaelFurth,项目名称:RCore,代码行数:12,代码来源:StatSystem.cpp

示例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));
}
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:12,代码来源:StatSystem.cpp

示例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));
}
开发者ID:sacel,项目名称:StrawberryEMU,代码行数:17,代码来源:StatSystem.cpp

示例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));
}
开发者ID:Meandro,项目名称:wowcore,代码行数:18,代码来源:StatSystem.cpp

示例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());
	}
}
开发者ID:jsykes,项目名称:starkas,代码行数:18,代码来源:enemy.cpp


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