Use hit_power * k_hit for weapon GetDamage()

Posts: 13
Joined: 11 Oct 2015, 09:47

Use hit_power * k_hit for weapon GetDamage()

Postby v1ld » 09 Oct 2016, 03:04

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

   return normalize(res, 0, 1)

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests