Исходник WEAVE HandleBulletPenetration for LW

Пользователь
Статус
Оффлайн
Регистрация
12 Июн 2020
Сообщения
465
Реакции[?]
102
Поинты[?]
3K
Код:
bool autowall::handle_bullet_penetration(weapon_info_t* weaponData, CGameTrace& enterTrace, Vector& eyePosition, const Vector& direction, int& possibleHitsRemaining, float& currentDamage, float penetrationPower, float ff_damage_reduction_bullets, float ff_damage_bullet_penetration, bool draw_impact)
{
    CGameTrace trace_exit;
    surfacedata_t* enter_surface_data = m_physsurface()->GetSurfaceData(enterTrace.surface.surfaceProps);
    int enter_material = enter_surface_data->game.material;

    float enter_surf_penetration_modifier = enter_surface_data->game.flPenetrationModifier;
    float final_damage_modifier = 0.18f;
    float compined_penetration_modifier = 0.f;
    bool solid_surf = ((enterTrace.contents >> 3) & CONTENTS_SOLID);
    bool light_surf = ((enterTrace.surface.flags >> 7) & SURF_LIGHT);

    if
        (
            possibleHitsRemaining <= 0
            || (!possibleHitsRemaining && !light_surf && !solid_surf && enter_material != CHAR_TEX_GLASS && enter_material != CHAR_TEX_GRATE)
            || weaponData->flPenetration <= 0.f
            || !trace_to_exit(enterTrace, trace_exit, enterTrace.endpos, direction)
            && !(m_trace()->GetPointContents(enterTrace.endpos, MASK_SHOT_HULL | CONTENTS_HITBOX, NULL) & (MASK_SHOT_HULL | CONTENTS_HITBOX))
            )
    {
        return false;
    }

    surfacedata_t* exit_surface_data = m_physsurface()->GetSurfaceData(trace_exit.surface.surfaceProps);
    int exit_material = exit_surface_data->game.material;
    float exit_surf_penetration_modifier = exit_surface_data->game.flPenetrationModifier;

    if (enter_material == CHAR_TEX_GLASS || enter_material == CHAR_TEX_GRATE) {
        compined_penetration_modifier = 3.f;
        final_damage_modifier = 0.08f;
    }
    else if (light_surf || solid_surf)
    {
        compined_penetration_modifier = 1.f;
        final_damage_modifier = 0.18f;
    }
    else {
        compined_penetration_modifier = (enter_surf_penetration_modifier + exit_surf_penetration_modifier) * 0.5f;
        final_damage_modifier = 0.18f;
    }

    if (enter_material == exit_material)
    {
        if (exit_material == CHAR_TEX_CARDBOARD || exit_material == CHAR_TEX_WOOD)
            compined_penetration_modifier = 3.f;
        else if (exit_material == CHAR_TEX_PLASTIC)
            compined_penetration_modifier = 2.0f;
    }

    float thickness = (trace_exit.endpos - enterTrace.endpos).LengthSqr();
    float modifier = max(0.f, 1.f / compined_penetration_modifier);
    float lost_damage = fmax(((modifier * thickness) / 24.f) + ((currentDamage * final_damage_modifier) + (fmax(3.75f / weaponData->flPenetration, 0.f) * 3.f * modifier)), 0.f);

    if (lost_damage > currentDamage)
        return false;

    if (lost_damage > 0.f)
        currentDamage -= lost_damage;

    if (currentDamage < 1.f)
        return false;

    eyePosition = trace_exit.endpos;
    possibleHitsRemaining--;

    return true;
}
Короче скит тап ! :roflanEbalo:
 
Участник
Статус
Оффлайн
Регистрация
12 Мар 2019
Сообщения
756
Реакции[?]
248
Поинты[?]
1K
Нет слов, одни эмоции. Не лучший варик взять автовалл из мутини ?
 
ima sippin lean
Забаненный
Статус
Оффлайн
Регистрация
6 Май 2020
Сообщения
495
Реакции[?]
380
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
ставь чайник, зажигай плиту
Эксперт
Статус
Оффлайн
Регистрация
22 Май 2020
Сообщения
1,444
Реакции[?]
1,092
Поинты[?]
10K
брух, из за ликнутой кски автоволл самому собрать никаких проблем не составит
так собери, а то уже устал от missed shot due to occlusion в твоей пасте :Jebaited:
в веаве хбп не лучше
 
Astty
Пользователь
Статус
Оффлайн
Регистрация
11 Окт 2020
Сообщения
435
Реакции[?]
56
Поинты[?]
0
Код:
bool autowall::handle_bullet_penetration(weapon_info_t* weaponData, CGameTrace& enterTrace, Vector& eyePosition, const Vector& direction, int& possibleHitsRemaining, float& currentDamage, float penetrationPower, float ff_damage_reduction_bullets, float ff_damage_bullet_penetration, bool draw_impact)
{
    CGameTrace trace_exit;
    surfacedata_t* enter_surface_data = m_physsurface()->GetSurfaceData(enterTrace.surface.surfaceProps);
    int enter_material = enter_surface_data->game.material;

    float enter_surf_penetration_modifier = enter_surface_data->game.flPenetrationModifier;
    float final_damage_modifier = 0.18f;
    float compined_penetration_modifier = 0.f;
    bool solid_surf = ((enterTrace.contents >> 3) & CONTENTS_SOLID);
    bool light_surf = ((enterTrace.surface.flags >> 7) & SURF_LIGHT);

    if
        (
            possibleHitsRemaining <= 0
            || (!possibleHitsRemaining && !light_surf && !solid_surf && enter_material != CHAR_TEX_GLASS && enter_material != CHAR_TEX_GRATE)
            || weaponData->flPenetration <= 0.f
            || !trace_to_exit(enterTrace, trace_exit, enterTrace.endpos, direction)
            && !(m_trace()->GetPointContents(enterTrace.endpos, MASK_SHOT_HULL | CONTENTS_HITBOX, NULL) & (MASK_SHOT_HULL | CONTENTS_HITBOX))
            )
    {
        return false;
    }

    surfacedata_t* exit_surface_data = m_physsurface()->GetSurfaceData(trace_exit.surface.surfaceProps);
    int exit_material = exit_surface_data->game.material;
    float exit_surf_penetration_modifier = exit_surface_data->game.flPenetrationModifier;

    if (enter_material == CHAR_TEX_GLASS || enter_material == CHAR_TEX_GRATE) {
        compined_penetration_modifier = 3.f;
        final_damage_modifier = 0.08f;
    }
    else if (light_surf || solid_surf)
    {
        compined_penetration_modifier = 1.f;
        final_damage_modifier = 0.18f;
    }
    else {
        compined_penetration_modifier = (enter_surf_penetration_modifier + exit_surf_penetration_modifier) * 0.5f;
        final_damage_modifier = 0.18f;
    }

    if (enter_material == exit_material)
    {
        if (exit_material == CHAR_TEX_CARDBOARD || exit_material == CHAR_TEX_WOOD)
            compined_penetration_modifier = 3.f;
        else if (exit_material == CHAR_TEX_PLASTIC)
            compined_penetration_modifier = 2.0f;
    }

    float thickness = (trace_exit.endpos - enterTrace.endpos).LengthSqr();
    float modifier = max(0.f, 1.f / compined_penetration_modifier);
    float lost_damage = fmax(((modifier * thickness) / 24.f) + ((currentDamage * final_damage_modifier) + (fmax(3.75f / weaponData->flPenetration, 0.f) * 3.f * modifier)), 0.f);

    if (lost_damage > currentDamage)
        return false;

    if (lost_damage > 0.f)
        currentDamage -= lost_damage;

    if (currentDamage < 1.f)
        return false;

    eyePosition = trace_exit.endpos;
    possibleHitsRemaining--;

    return true;
}
Короче скит тап ! :roflanEbalo:
1 BITCH
 
Сверху Снизу