ahuyn / anomaly-wpo

Weapon Parts Overhaul addon for Anomaly
25 stars 6 forks source link

BaS 9x21mm ammunition classified as old ammunition by the WPO script #30

Closed Nerezza closed 1 year ago

Nerezza commented 2 years ago

The arti_jamming script's using_old_ammo function determines if the old ammunition penalties should apply to a weapon by checking if the ammunition's impair value is greater than 1.

The 9x21mm ammo in BaS has an impair value of 1.1 for some reason. This means WPO treats it as old ammunition even though it isn't, and with the old ammunition penalties enabled all 9x21 guns jam multiple times a magazine and rapdily lose condition.

Related script/config snippets:

-- returns true if using ammo with impair > 1
function using_old_ammo(wpn)
    if wpn:id() ~= cgd.id or not get_config("oldammo") then return false end
    local ammo_type = wpn:get_ammo_type() + 1
    local ammo = cgd.ammo_data[ammo_type]
    if ammo and SYS_GetParam(2, ammo, "impair") > 1 then
        return true
    else return false
    end
end
[ammo_9x21_sp10]:ammo_base ; 165 gr
GroupControlSection = spawn_group
discovery_dependency =
$spawn          = "weapons\ammo\ammo_9x21_sp10" ; option for Level Editor
class           = AMMO_S

~snip~

k_disp          = 0.66
k_hit           = 0.77 ;  1.25
k_impulse       = 0.8
k_ap            = 0.45
impair          = 1.1
tracer_color_ID = 0

~snip~
ahuyn commented 1 year ago

This should be brought up with BaS or updated manually. There is no better way I can make any distinctions via WPO.