diff --git a/gamedata/configs/mod_system_zzz_new_ammo_and_variants.ltx b/gamedata/configs/mod_system_zzz_new_ammo_and_variants.ltx index 5e11edf..67c6f84 100644 --- a/gamedata/configs/mod_system_zzz_new_ammo_and_variants.ltx +++ b/gamedata/configs/mod_system_zzz_new_ammo_and_variants.ltx @@ -11,6 +11,7 @@ ![ammo_9x21_sp10] ; balance reasons impair = 1.0 +k_ap = 0.032 ; to be better than 9x19 AP but less than 5.7 AP box_size = 18 [ammo_9x21_sp10_bad]:ammo_9x21_sp10 diff --git a/gamedata/scripts/arti_handlers.script b/gamedata/scripts/arti_handlers.script index 79d0d80..5319829 100644 --- a/gamedata/scripts/arti_handlers.script +++ b/gamedata/scripts/arti_handlers.script @@ -515,13 +515,23 @@ function condition_degrade_on_fire(amount, wpn, chance) if grok_gun_condition_fixed then if arti_jamming.has_parts(wpn) then local parts = item_parts.get_parts_con(wpn, nil, true) - local has_parts = false + + local part_names = {} for k,v in pairs(parts) do - if arti_jamming.is_barrel(k) then - parts[k] = v - ((dura_rip == 0.0105 and 3) or (dura_rip == 0.0025 and 2) or 1) - break - end + table.insert(part_names, k) end + + local part_to_dmg = part_names[math_random(1, #part_names)] + + parts[part_to_dmg] = parts[part_to_dmg] - ((dura_rip == 0.0105 and 3) or (dura_rip == 0.0025 and 2) or 1) + + -- for k,v in pairs(parts) do + -- if arti_jamming.is_barrel(k) then + -- parts[k] = v - ((dura_rip == 0.0105 and 3) or (dura_rip == 0.0025 and 2) or 1) + -- break + -- end + -- end + end else weapon:set_condition(clamp(weapon:condition() - dura_rip, 0, 1)) -- Lose 0.25% condition when using variants diff --git a/gamedata/scripts/cxv_artigrok_bo.script b/gamedata/scripts/cxv_artigrok_bo.script index f6e856f..e72f675 100644 --- a/gamedata/scripts/cxv_artigrok_bo.script +++ b/gamedata/scripts/cxv_artigrok_bo.script @@ -310,7 +310,8 @@ function validate_hit(shit, bone_id, npc_id) return end - if IsItem("fake_ammo_wpn",sec) then return end + if ini_sys:r_string_ex(sec, "class") == "S_EXPLO" then return end + if IsItem("fake_ammo_wpn",sec) and not IsMelee(wpn) then return end return { ["wpn"] = wpn, @@ -403,11 +404,6 @@ function mutant_on_before_hit(monster, shit, bone_id) local ammo_type_number = wpn:get_ammo_type() local ammo_list = utils_item.get_ammo(sec, wpn_id) local ammo_section = ammo_list[ammo_type_number+1] - local wpn_hit_power = ui_wpn_params.read_float(sec, "", "hit_power") - - if string.find(sec, "wpn_toz106") then - wpn_hit_power = 0.8 - end if not ammo_section then return @@ -422,18 +418,18 @@ function mutant_on_before_hit(monster, shit, bone_id) local dist = (monster_pos:distance_to(shooter_pos)) local silencer_boost = 1 - - if true_falloff then - if sec and integrated_silencer[sec] then - silencer_boost = 1.03 - elseif is_actor then -- cannot access if NPC's weapon has a suppressor, so limit weapons not on the list to the player - if wpn and wpn:weapon_is_silencer() then + if not IsMelee(wpn) then + if true_falloff then + if sec and integrated_silencer[sec] then silencer_boost = 1.03 + elseif is_actor then -- cannot access if NPC's weapon has a suppressor, so limit weapons not on the list to the player + if wpn and wpn:weapon_is_silencer() then + silencer_boost = 1.03 + end end end end - local pellet_count = ini_sys:r_float_ex(ammo_section, "buck_shot") or 1 -- ilrathCXV (05/01/2023): testing 15% damage boost at less than 3 units/meters of a target with diminishing return until +15m @@ -808,7 +804,9 @@ function mutant_on_before_hit(monster, shit, bone_id) local damage_mod = ((is_actor and (difficulty_scaling_damage and difficulty_multiplier_damage[game_num] or 1)) or (difficulty_scaling_damage and npc_difficulty_multiplier_damage[game_num] or 1)) or 1 -- ilrathCXV (04/01/2024): True falloff calcs (credit to etapomom) - if true_falloff then + if IsMelee(wpn) then + falloff_modifier = 1 + elseif true_falloff then local weapon_speed = utils_item.get_param(sec, wpn and wpn:id(), "bullet_speed", "float", true) local ammo_speed = ini_sys:r_float_ex(ammo_section, "k_bullet_speed") or 1 local weapon_base_speed = SYS_GetParam(2, sec, "bullet_speed", 1) @@ -933,23 +931,34 @@ function npc_on_before_hit(npc, shit, bone_id) local ammo_list = utils_item.get_ammo(sec, wpn_id) local ammo_section = ammo_list[ammo_type_number+1] local wpn_hit_power = ui_wpn_params.read_float(sec, "", "hit_power") + local melee_hit_power = IsMelee(wpn) and shit.power or nil + local wpn_kind = nil + + if melee_hit_power then + printf("Stat Melee Hit Power (%s) vs Actual Melee Hit Power(%s)", wpn_hit_power, melee_hit_power) + if melee_hit_power > wpn_hit_power then + wpn_hit_power = melee_hit_power + end + end local silencer_boost = 1 - if true_falloff then - if sec and integrated_silencer[sec] then - silencer_boost = 1.03 - elseif is_actor then -- cannot access if NPC's weapon has a suppressor, so limit weapons not on the list to the player - if wpn and (wpn:weapon_silencer_status() == 1) or (wpn:weapon_silencer_status() == 2 and wpn:weapon_is_silencer()) then + if not IsMelee(wpn) then + if true_falloff then + if sec and integrated_silencer[sec] then silencer_boost = 1.03 + elseif is_actor then -- cannot access if NPC's weapon has a suppressor, so limit weapons not on the list to the player + if wpn and (wpn:weapon_silencer_status() == 1) or (wpn:weapon_silencer_status() == 2 and wpn:weapon_is_silencer()) then + silencer_boost = 1.03 + end end - end - else - if sec and integrated_silencer[sec] then - silencer_boost = 1.07 - elseif is_actor then -- cannot access if NPC's weapon has a suppressor, so limit weapons not on the list to the player - if wpn and (wpn:weapon_silencer_status() == 1) or (wpn:weapon_silencer_status() == 2 and wpn:weapon_is_silencer()) then + else + if sec and integrated_silencer[sec] then silencer_boost = 1.07 + elseif is_actor then -- cannot access if NPC's weapon has a suppressor, so limit weapons not on the list to the player + if wpn and (wpn:weapon_silencer_status() == 1) or (wpn:weapon_silencer_status() == 2 and wpn:weapon_is_silencer()) then + silencer_boost = 1.07 + end end end end @@ -1493,7 +1502,9 @@ function npc_on_before_hit(npc, shit, bone_id) local ap_mod = ((is_actor and (difficulty_scaling_ap and difficulty_multiplier_ap[game_num] or 1)) or (difficulty_scaling_ap and npc_difficulty_multiplier_ap[game_num] or 1)) or 1 local damage_mod = ((is_actor and (difficulty_scaling_damage and difficulty_multiplier_damage[game_num] or 1)) or (difficulty_scaling_damage and npc_difficulty_multiplier_damage[game_num] or 1)) or 1 - if true_falloff then + if IsMelee(wpn) then + falloff_modifier = 1 + elseif true_falloff then local weapon_speed = utils_item.get_param(sec, wpn and wpn:id(), "bullet_speed", "float", true) local ammo_speed = ini_sys:r_float_ex(ammo_section, "k_bullet_speed") or 1 local weapon_base_speed = SYS_GetParam(2, sec, "bullet_speed", 1)