Skip to content

Commit

Permalink
VERSION 2.0.8 - Melee Fixes and Minor Adjustments
Browse files Browse the repository at this point in the history
- Fixed an issue where Melee hits were not going through the damage calculations
- Adjusted the logic to allow right-click/heavy attacks to be taken into account against Stalkers
- For users testing GAMMA's "Guns Have No Condition", using ammo with any special effect will - on "successful" roll - damage a random part in the gun rather than only the barrel
- Buffed the AP of 9x21 AP from 29 to 32 (better than 9x19 AP but less than 5.7 AP)
  • Loading branch information
ilrathCXV committed Oct 24, 2024
1 parent 1eeacc5 commit c2b990e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 31 deletions.
1 change: 1 addition & 0 deletions gamedata/configs/mod_system_zzz_new_ammo_and_variants.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions gamedata/scripts/arti_handlers.script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
63 changes: 37 additions & 26 deletions gamedata/scripts/cxv_artigrok_bo.script
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c2b990e

Please sign in to comment.