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


C++ GetCreatePowers函數代碼示例

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


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

示例1: UnitMods

void Player::UpdateMaxPower(Powers power)
{
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    float bonusPower = (power == POWER_MANA && GetCreatePowers(power) > 0) ? GetManaBonusFromIntellect() : 0;

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) +  bonusPower;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:AnthoDevMoP,項目名稱:SkyFire_5xx,代碼行數:13,代碼來源:StatSystem.cpp

示例2: UnitMods

void Guardian::UpdateMaxPower(Powers power)
{
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    float addValue = (power == POWER_MANA) ? GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT) : 0.0f;

    float multiplicator = 15.0f;

    switch (GetEntry())
    {
        case ENTRY_IMP:         multiplicator = 4.95f;  break;
        case ENTRY_VOIDWALKER:
        case ENTRY_SUCCUBUS:
        case ENTRY_FELHUNTER:
        case ENTRY_FELGUARD:    multiplicator = 11.5f;  break;
        default:                multiplicator = 15.0f;  break;
    }

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + addValue * multiplicator;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:Blumfield,項目名稱:TBCPvP,代碼行數:25,代碼來源:StatSystem.cpp

示例3: UnitMods

void Pet::UpdateMaxPower(Powers power)
{
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    float addValue = (power == POWER_MANA) ? GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT) : 0.0f;
    float multiplicator;

    // nesocips warlock pet stats calculation
    switch(GetEntry())
    {
        case 416:   multiplicator = 4.95f; break; // imp
        case 1860:                                // voidwalker
        case 1863:                                // succubus
        case 417:                                 // felhunter
        case 17252: multiplicator = 11.5f; break; // felguard
        default:    multiplicator = 15.0f; break;
    }

    float value  = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + addValue * multiplicator;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:kero99,項目名稱:mangos_old,代碼行數:25,代碼來源:StatSystem.cpp

示例4: UpdateStats

bool Pet::UpdateAllStats()
{
    for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
        UpdateStats(Stats(i));

    for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); i++)
    {
        ChrPowerTypesEntry const* cEntry = sChrPowerTypesStore.LookupEntry(i);

        if (!cEntry)
            continue;

        if (getClass() != cEntry->classId)
            continue;

        if (cEntry->power == 10)
            continue;

        SetMaxPower(Powers(cEntry->power),  uint32(GetCreatePowers(Powers(cEntry->power))));
    }

    for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
        UpdateResistances(i);

    return true;
}
開發者ID:Shutok,項目名稱:StrawberryCore-501Beta,代碼行數:26,代碼來源:StatSystem.cpp

示例5: UnitMods

void Guardian::UpdateMaxPower(Powers power)
{ 
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

	float addValue = (power == POWER_MANA) ? std::max<float>(GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT), 0.0f) : 0.0f;
    float multiplicator = 15.0f;

    switch (GetEntry())
    {
        case NPC_IMP:         
		case NPC_WATER_ELEMENTAL_TEMP:
		case NPC_WATER_ELEMENTAL_PERM:
			multiplicator = 4.95f;
			break;
        case NPC_VOIDWALKER:
        case NPC_SUCCUBUS:
        case NPC_FELHUNTER:
        case NPC_FELGUARD:
			multiplicator = 11.5f;
			break;
        default:
			multiplicator = 15.0f;
			break;
    }

	// xinef: Do NOT add base mana TWICE
	float value = GetModifierValue(unitMod, BASE_VALUE) + (power != POWER_MANA ? GetCreatePowers(power) : 0);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + addValue * multiplicator;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:Cryostorm,項目名稱:SunwellCore,代碼行數:33,代碼來源:StatSystem.cpp

示例6: UpdateMaxHealth

bool Creature::UpdateAllStats()
{
    UpdateMaxHealth();
    UpdateAttackPowerAndDamage();

    for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); i++)
    {
        ChrPowerTypesEntry const* cEntry = sChrPowerTypesStore.LookupEntry(i);

        if (!cEntry)
            continue;

        if (getClass() != cEntry->classId)
            continue;

        if (cEntry->power == 10)
            continue;

        SetMaxPower(Powers(cEntry->power),  uint32(GetCreatePowers(Powers(cEntry->power))));
    }

    for(int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
        UpdateResistances(i);

    return true;
}
開發者ID:Shutok,項目名稱:StrawberryCore-501Beta,代碼行數:26,代碼來源:StatSystem.cpp

示例7: UnitMods

void Player::UpdateMaxPower(Powers power)
{
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE);
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:AlucardVoss,項目名稱:Patchs,代碼行數:11,代碼來源:StatSystem.cpp

示例8: UnitMods

void Pet::UpdateMaxPower(Powers power)
{
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
    float addValue = (power == POWER_MANA) ? GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT) : 0.0f;

    float value  = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) +  addValue * 15.0f;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:Artea,項目名稱:mangos-svn,代碼行數:12,代碼來源:StatSystem.cpp

示例9: UnitMods

void Pet::UpdateMaxPower(Powers power)
{
    if (!CanModifyStats())
        return;

    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    float intellectBonus = (power == POWER_MANA) ? (GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT))*(CalculateScalingData()->powerScale / 100.0f) : 0.0f;

    float value  = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power) + intellectBonus;
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE);
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:MichaelFurth,項目名稱:RCore,代碼行數:16,代碼來源:StatSystem.cpp

示例10: UnitMods

void Player::UpdateMaxPower(Powers power)
{
    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    float bonusPower = (power == POWER_MANA) ? GetManaBonusFromIntellect() : 0;

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) +  bonusPower;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    if (HasAura(30422, 0)) // Netherspite's Green Beam - Serenity
        if (power == POWER_MANA)
            SetPower(power, uint32(value));

    SetMaxPower(power, uint32(value));
}
開發者ID:Looking4Group,項目名稱:L4G_Core,代碼行數:17,代碼來源:StatSystem.cpp

示例11: MANGOS_ASSERT

void Player::UpdateMaxPower(Powers power)
{
    MANGOS_ASSERT(power < MAX_POWERS);

    UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);

    uint32 create_power = GetCreatePowers(power);

    // ignore classes without mana
    float bonusPower = (power == POWER_MANA && create_power > 0) ? GetManaBonusFromIntellect() : 0;

    float value = GetModifierValue(unitMod, BASE_VALUE) + create_power;
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) +  bonusPower;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxPower(power, uint32(value));
}
開發者ID:SkyFire,項目名稱:server-1,代碼行數:18,代碼來源:StatSystem.cpp

示例12: GetTotalStatValue

bool Player::UpdateAllStats()
{
    for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
    {
        float value = GetTotalStatValue(Stats(i));
        SetStat(Stats(i), (int32)value);
    }

    UpdateArmor();
    // calls UpdateAttackPowerAndDamage() in UpdateArmor for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
    UpdateAttackPowerAndDamage(true);
    UpdateMaxHealth();

    for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); i++)
    {
        ChrPowerTypesEntry const* cEntry = sChrPowerTypesStore.LookupEntry(i);

        if (!cEntry)
            continue;

        if (getClass() != cEntry->classId)
            continue;

        if (cEntry->power == 10)
            continue;

        SetMaxPower(Powers(cEntry->power),  uint32(GetCreatePowers(Powers(cEntry->power))));
    }

    UpdateAllRatings();
    UpdateAllCritPercentages();
    UpdateAllSpellCritChances();
    UpdateDefenseBonusesMod();
    UpdateShieldBlockValue();
    UpdateArmorPenetration();
    UpdateSpellDamageAndHealingBonus();
    UpdateManaRegen();
    UpdateExpertise(BASE_ATTACK);
    UpdateExpertise(OFF_ATTACK);
    for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
        UpdateResistances(i);

    return true;
}
開發者ID:Shutok,項目名稱:StrawberryCore-501Beta,代碼行數:44,代碼來源:StatSystem.cpp


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