• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetCreateHealth函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetCreateHealth函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCreateHealth函数的具体用法?C++ GetCreateHealth怎么用?C++ GetCreateHealth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetCreateHealth函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetStat

void Guardian::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;
    float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA);

    float multiplicator;
    switch (GetEntry())
    {
        case ENTRY_IMP:
            multiplicator = 8.4f;
            break;
        case ENTRY_VOIDWALKER:
        case ENTRY_FELGUARD:
            multiplicator = 11.0f;
            break;
        case ENTRY_SUCCUBUS:
            multiplicator = 9.1f;
            break;
        case ENTRY_FELHUNTER:
            multiplicator = 14.46f;
            break;
        case ENTRY_GHOUL:
        case ENTRY_GARGOYLE:
            multiplicator = 15.0f;
            break;
        case ENTRY_WATER_ELEMENTAL:
            multiplicator = 1.0f;
            stamina = 0.0f;
            break;
        case ENTRY_BLOODWORM:
        case ENTRY_PSYFIEND:
            SetMaxHealth(GetCreateHealth());
            return;
        default:
            multiplicator = 10.0f;
            break;
    }

     if (isHunterPet())
    {
        if (gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry(getLevel()))
            multiplicator = hpBase->ratio;
    }

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:Exodius,项目名称:chuspi,代码行数:51,代码来源:StatSystem.cpp


示例2: GetStat

void Guardian::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;
    float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA);

    float multiplicator;
    switch (GetEntry())
    {
        case ENTRY_IMP:         multiplicator = 8.4f;   break;
        case ENTRY_VOIDWALKER:  multiplicator = 11.0f;  break;
        case ENTRY_SUCCUBUS:    multiplicator = 9.1f;   break;
        case ENTRY_FELHUNTER:   multiplicator = 9.5f;   break;
        case ENTRY_FELGUARD:    multiplicator = 11.0f;  break;
        case ENTRY_BLOODWORM:   multiplicator = 1.0f;   break;
        default:                multiplicator = 10.0f;  break;
    }

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value  *= GetModifierValue(unitMod, BASE_PCT);
    if (GetEntry()==ENTRY_GHOUL)
        value  += GetModifierValue(unitMod, TOTAL_VALUE) + (stamina+GetCreateStat(STAT_STAMINA)) * multiplicator;
    else
        value  += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
    value  *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:LORDofDOOM,项目名称:MMOCore,代码行数:27,代码来源:StatSystem.cpp


示例3: GetStat

void Guardian::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;
    float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA);

    float multiplicator;
    switch (GetEntry())
    {
        case ENTRY_IMP:         multiplicator = 8.4f;   break;
        case ENTRY_VOIDWALKER:  multiplicator = 11.0f;  break;
        case ENTRY_SUCCUBUS:    multiplicator = 9.0f;   break;
        case ENTRY_FELHUNTER:   multiplicator = 9.5f;   break;
        case ENTRY_FELGUARD:    multiplicator = 11.0f;  break;
        case ENTRY_BLOODWORM:   multiplicator = 1.0f;   break;
        default:                multiplicator = 10.0f;  break;
    }

    if (m_owner->GetTypeId() != TYPEID_PLAYER && !m_owner->isTotem())
        multiplicator = 0.0f;

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
    value *= GetModifierValue(unitMod, TOTAL_PCT);
    SetMaxHealth((uint32)value);
}
开发者ID:xIchigox,项目名称:SoDCore.434,代码行数:26,代码来源:StatSystem.cpp


示例4: GetModifierValue

void Player::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:AnthoDevMoP,项目名称:SkyFire_5xx,代码行数:11,代码来源:StatSystem.cpp


示例5: GetCreateStat

void Pet::UpdateMaxHealth()
{
    if (!CanModifyStats())
        return;

    UnitMods unitMod = UNIT_MOD_HEALTH;
    float staminaBonus = (GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA)) * (CalculateScalingData()->healthScale / 100.0f);

    float value   = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth() + staminaBonus;
    value  *= GetModifierValue(unitMod, BASE_PCT);
    value  += GetModifierValue(unitMod, TOTAL_VALUE);
    value  *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:MichaelFurth,项目名称:RCore,代码行数:15,代码来源:StatSystem.cpp


示例6: GetModifierValue

void Player::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    if (HasAura(30421, 0)) // Netherspite's Red Beam - Perseverence
    {
        value += 30000;
        SetMaxHealth((uint32)value);
        SetHealth((uint32)value);
    }
    else
        SetMaxHealth((uint32)value);
}
开发者ID:Looking4Group,项目名称:L4G_Core,代码行数:18,代码来源:StatSystem.cpp


示例7: GetStat

void Guardian::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;
    float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA);

    float multiplicator;
    switch (GetEntry())
    {
        case ENTRY_BLOODWORM:       multiplicator = 1.0f;   break;
        case ENTRY_WATER_ELEMENTAL: multiplicator = 7.5;  break;
        default:                    multiplicator = 14.0f;  break;
    }

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:Jildor,项目名称:4.3.4-Core,代码行数:20,代码来源:StatSystem.cpp


示例8: GetStat

void Pet::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;
    float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA);
    float multiplicator;

    // nesocips warlock pet stats calculation
    switch(GetEntry())
    {
        case 416:   multiplicator = 8.4f;  break; // imp
        case 1860:                                // voidwalker
        case 17252: multiplicator = 11.0f; break; // felguard
        case 1863:  multiplicator = 9.1f;  break; // succubus
        case 417:   multiplicator = 9.5f;  break; // felhunter
        default:    multiplicator = 10.0f; break;
    }

    float value   = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value  *= GetModifierValue(unitMod, BASE_PCT);
    value  += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
    value  *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:kero99,项目名称:mangos_old,代码行数:24,代码来源:StatSystem.cpp


示例9: GetStat

void Guardian::UpdateMaxHealth()
{
    UnitMods unitMod = UNIT_MOD_HEALTH;
    //Ghouls have no base hp. only the one gained from stamina
    float stamina = GetStat(STAT_STAMINA) - (GetEntry()==ENTRY_GHOUL ? 0.0f : GetCreateStat(STAT_STAMINA));

    float multiplicator;
    switch(GetEntry())
    {
        case ENTRY_IMP:         multiplicator = 8.4f;   break;
        case ENTRY_VOIDWALKER:  multiplicator = 11.0f;  break;
        case ENTRY_SUCCUBUS:    multiplicator = 9.1f;   break;
        case ENTRY_FELHUNTER:   multiplicator = 9.5f;   break;
        case ENTRY_FELGUARD:    multiplicator = 11.0f;  break;
        case ENTRY_GHOUL:       multiplicator = 10.0f;   break;
		case ENTRY_FIRE_ELEMENTAL:       multiplicator = 1.0f;  break;
		case ENTRY_EARTH_ELEMENTAL:       multiplicator = 20.0f;  break;
		default:
			{
			if (isGuardian() || isTotem())
				multiplicator = 0.0f;                 // Guardians and Totems gain no hp from the owner
			else
			    multiplicator = 10.0f;                // Pets, and Minions do get health from stamina
			break;
			}
    }
	if (isHunterPet())
		multiplicator = 10.0f;
    
	//Ghouls have no base hp. only the one gained from stamina
	float value   = (GetEntry()==ENTRY_GHOUL ? 0 : GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth());
    value  *= GetModifierValue(unitMod, BASE_PCT);
    value  += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
    value  *= GetModifierValue(unitMod, TOTAL_PCT);

    SetMaxHealth((uint32)value);
}
开发者ID:Meandro,项目名称:wowcore,代码行数:37,代码来源:StatSystem.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCreatePowers函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCounter函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap