ghe ghe
-
Автор темы
- #1
I just post this because of this meme :-)
If you are pasting autowall at least paste from the legend sharklaser!! azazinc
If you are pasting autowall at least paste from the legend sharklaser!! azazinc
Код:
bool autowall::EntityHasArmor(player_t* e, int hitgroup)
{
if (e->m_ArmorValue() > 0)
{
if ((hitgroup == HITGROUP_HEAD && e->m_bHasHelmet()) || (hitgroup >= HITGROUP_CHEST && hitgroup <= HITGROUP_RIGHTARM))
return true;
}
return false;
}
void autowall::scale_damage(player_t* e, CGameTrace& enterTrace, weapon_info_t* weaponData, float& currentDamage)
{
auto bHasHeavyArmor = e->m_bHasHeavyArmor();
auto hitgroup = enterTrace.hitgroup;
switch (hitgroup)
{
case HITGROUP_HEAD:
if (!bHasHeavyArmor)
currentDamage *= 4.0f;
else
currentDamage = (currentDamage * 4.0f) * 0.5f;
break;
case HITGROUP_STOMACH:
currentDamage *= 1.25f;
break;
case HITGROUP_LEFTLEG:
case HITGROUP_RIGHTLEG:
currentDamage *= 0.75f;
break;
}
if (e && EntityHasArmor(e, hitgroup))
{
float flHeavyRatio = 1.0f;
float flBonusRatio = 0.5f;
float flRatio = weaponData->flArmorRatio * 0.5f;
float flNewDamage;
if (!bHasHeavyArmor)
{
flNewDamage = currentDamage * flRatio;
}
else
{
flBonusRatio = 0.33f;
flRatio = weaponData->flArmorRatio * 0.25f;
flHeavyRatio = 0.33f;
flNewDamage = (currentDamage * flRatio) * 0.85f;
}
int iArmor = e->m_ArmorValue();
if (((currentDamage - flNewDamage) * (flHeavyRatio * flBonusRatio)) > iArmor)
flNewDamage = currentDamage - (iArmor / flBonusRatio);
currentDamage = flNewDamage;
}
currentDamage = floorf(currentDamage);
}
Последнее редактирование: