Page 1 of 1

Use hit_power * k_hit for weapon GetDamage()

Posted: 09 Oct 2016, 03:04
by v1ld
OWR uses k_hit instead of hit_power to control damage, so all weapons look like they do the same damage when looked at in inventory. This will also affect NPC weapon selection as that uses ui_weapon_params:GetDamage() as well (in SoC). Would you please consider using this variant instead in base CoC?

Code: Select all

function GetDamage(wpn_section, upgr_sections) --' повреждение
   local res = read_float(wpn_section, upgr_sections, "hit_power")

   local ltx = system_ini()
   if ltx:line_exist(wpn_section, "ammo_class") then
      local ammo_list = ltx:r_string(wpn_section, "ammo_class")
      local pos = string.find(ammo_list, ",", 1)
      local ammo = (pos ~= nil) and string.sub(ammo_list, 1, pos-1) or ammo_list
      local k_hit = ltx:r_float_ex(ammo, "k_hit")

      res = (res ~= 0) and (k_hit * res) or k_hit
   end

   return normalize(res, 0, 1)
end