當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetDefenseSkillValue函數代碼示例

本文整理匯總了C++中GetDefenseSkillValue函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetDefenseSkillValue函數的具體用法?C++ GetDefenseSkillValue怎麽用?C++ GetDefenseSkillValue使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetDefenseSkillValue函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GetDodgeFromAgility

void Player::UpdateDodgePercentage()
{
    // Dodge from agility
    float value = GetDodgeFromAgility();
    // Modify value from defense skill
    value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f;
    // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura
    value += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT);

    value = value < 0.0f ? 0.0f : value;
    SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
}
開發者ID:mynew,項目名稱:TrinityCore-1,代碼行數:12,代碼來源:StatSystem.cpp

示例2: int32

void Player::UpdateParryPercentage()
{
    // Base parry
    float value  = 5.0f;
    // Modify value from defense skill
    value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f;
    // Parry from SPELL_AURA_MOD_PARRY_PERCENT aura
    value += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
    // Parry from rating
    value += GetRatingBonusValue(CR_PARRY);
    value = value < 0.0f ? 0.0f : value;
    SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
}
開發者ID:Artea,項目名稱:mangos-svn,代碼行數:13,代碼來源:StatSystem.cpp

示例3: GetDodgeFromAgility

void Player::UpdateDodgePercentage()
{
    // Base dodge
    float value = (getClass() < MAX_CLASSES) ? PLAYER_BASE_DODGE[getClass()] : 0.0f;
    // Dodge from agility
    value += GetDodgeFromAgility(GetStat(STAT_AGILITY));
    // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura
    value += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT);
    // Dodge from rating
    value += GetRatingBonusValue(CR_DODGE);
    // Set current dodge chance
    m_modDodgeChance = value;
    // Set UI display value: modify value from defense skill against same level target
    value += (int32(GetDefenseSkillValue()) - int32(GetSkillMaxForLevel())) * 0.04f;
    SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, std::max(0.0f, std::min(value, 100.0f)));
}
開發者ID:MantisLord,項目名稱:mangos-tbc,代碼行數:16,代碼來源:StatSystem.cpp

示例4: int32

void Player::UpdateBlockPercentage()
{
    // No block
    float value = 0.0f;
    if (CanBlock())
    {
        // Base value
        value = 5.0f;
        // Modify value from defense skill
        value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f;
        // Increase from SPELL_AURA_MOD_BLOCK_PERCENT aura
        value += GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_PERCENT);
        value = value < 0.0f ? 0.0f : value;
    }
    SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
}
開發者ID:Chuck5ta,項目名稱:server,代碼行數:16,代碼來源:StatSystem.cpp

示例5: GetTotalAuraModifier

void Player::UpdateBlockPercentage()
{
    float value = 0.0f;
    float real = 0.0f;
    if (CanBlock())
    {
        // Base value
        value = 5.0f;
        // Increase from SPELL_AURA_MOD_BLOCK_PERCENT aura
        value += GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_PERCENT);
        // Increase from rating
        value += GetRatingBonusValue(CR_BLOCK);
        real = value;
        // Set UI display value: modify value from defense skill against same level target
        value += (int32(GetDefenseSkillValue()) - int32(GetSkillMaxForLevel())) * 0.04f;
    }
    m_modBlockChance = real;
    SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, std::max(0.0f, std::min(value, 100.0f)));
}
開發者ID:MantisLord,項目名稱:mangos-tbc,代碼行數:19,代碼來源:StatSystem.cpp


注:本文中的GetDefenseSkillValue函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。