Skip to content

Commit

Permalink
ArtiGrok VERSION 2.1.1 - ANOTHER GAMMA 0.9.3 Patch and Various Fixes
Browse files Browse the repository at this point in the history
- Changed how ammo stats are displayed code-wise, allowing this mod to now be run without Actual Accurate Stats
  - If you were using Actual Accurate Stats and didn't experience any crashes, feel free to still use it - this is mainly meant for users who are still having crashes despite recent updates to ArtiGrok
  - For those of you crashing, the mod no longer has the requirement of using Actual Accurate Stats, allowing you to freely disable/uninstall it in your modlist
- Removed some "prints" to console
- Buffed all Explosive ammo's number of explosive frags, their travel distance, and their hit power to increase their effectiveness by roughly 50%
- Included missing entries for suppressed weapons and snipers for AP calculations (credit to ATHI)
- Most LMGs now receive a +3 AP bonus in damage calculations (credit to ATHI)
- Fixed an issue that caused ammo with special effects from correctly introducing wear to the weapon's parts
  - Sometimes, it would cause the parts to revert to an older parts condition state, effectively resetting any damage it caused to the weapon parts previously
  - To balance this now working, more powerful ammo that degrades your parts by 3% will now only have a 5% chance on every shot to degrade a random part (previously was a 25% chance)
  - In turn, you will now want to keep a closer eye on your weapon's part conditions as you use special ammo - BRING REPAIR ITEMS!!!

 As reminder, all variant ammo has a chance to hurt weapon parts, with stronger ammo hurting condition more:
 - Any ammo with the following powerful effects have a 5% chance dealing 3% condition damage to a random part:
   - Explosive
   - "Grav"
   - Soulripper
   - RIP
   - Chaos
   - Lightning (not to be confused with Shock)
   - Dragon's Breath (not to be confused with Incendiary)
   - Napalm/Volcano
   - Acid
   - Headhunter
- All other variant ammo (non-normal ammo) have a 10% chance dealing 1% condition damage to a random part
  • Loading branch information
ilrathCXV committed Dec 26, 2024
1 parent 8bb48a3 commit 4f38bdc
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 72 deletions.
6 changes: 3 additions & 3 deletions gamedata/configs/items/items/items_explosives_new_mines2.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ blast = 3.14
blast_r = 1.2
blast_impulse = 60
blast_impulse_factor = 1
frags = 10
frags_r = 36
frag_hit = 0.04
frags = 15
frags_r = 60
frag_hit = 0.08
frag_hit_impulse = 2
hit_type_blast = explosion
hit_type_frag = fire_wound
Expand Down
36 changes: 23 additions & 13 deletions gamedata/scripts/arti_handlers.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---------------------------------------------------------------
----- EDIT for ArtiGrok - ilrathCXV (last edit: 03/16/24) -----
----- EDIT for ArtiGrok - ilrathCXV (last edit: 12/26/24) -----
---------------------------------------------------------------

play_particle = ballistics_utils.play_particle
Expand Down Expand Up @@ -148,7 +148,7 @@ function burn_tick_on_update()
play_particle(npc, 11, "damage_fx\\effects\\body_burn_01")

local burn_dmg = (v * 0.01) or 0.01
printf("[Arti Handlers - Burn Tick] NPC Being Burned : %s | Burn Damage: %s", npc:name(), burn_dmg)
-- printf("[Arti Handlers - Burn Tick] NPC Being Burned : %s | Burn Damage: %s", npc:name(), burn_dmg)

local h = hit()
h.type = hit.burn
Expand Down Expand Up @@ -313,9 +313,9 @@ function shock_npc(npc, bone_id, wpn_id, stack)
-- printf([Arti Handlers] "Shocked %s", npc:id())

shock_stack_list[npc_id] = (shock_stack_list[npc_id] and shock_stack_list[npc_id] + stack) or stack
printf("[Arti Handlers - Shock NPC] Shock Stacks: %s | NPC being shocked: %s", shock_stack_list[npc_id], npc:name())
-- printf("[Arti Handlers - Shock NPC] Shock Stacks: %s | NPC being shocked: %s", shock_stack_list[npc_id], npc:name())
if shock_stack_list[npc_id] > 19 then
printf("[Arti Handlers - Shock NPC] NPC about to be AoE'd: %s", npc:name())
-- printf("[Arti Handlers - Shock NPC] NPC about to be AoE'd: %s", npc:name())
shock_stack_list[npc_id] = shock_stack_list[npc_id] - 20

if shock_stack_list[npc_id] < 0 then
Expand All @@ -341,7 +341,7 @@ function acid_damage(npc, bone_id)

-- [Acid Stacking Effect] If hit enemy has taken 3 Acid hits, they apply the "Armorbuster" effect to any enemy within 8m
if (acid_stack_list[npc:id()] and acid_stack_list[npc:id()] > 2) then
printf("[Arti Handlers] Acid Stacking proc'd!!!")
-- printf("[Arti Handlers] Acid Stacking proc'd!!!")
level.iterate_nearest(npc:position(), 8, function(obj)
if obj and obj:id() ~= AC_ID and obj:id() ~= 65535 then
if string.find(obj:name(), "legs") then return end -- Avoid First-person legs from being checked (remove error spam)
Expand Down Expand Up @@ -461,7 +461,7 @@ function lightning_damage(npc, bone_id, wpn_id, armor_amount)
end

function damage_npc_grok(npc, power)
printf("[Arti Handlers - DMG NPC Grok] Special Damage: %s | NPC being hit: %s", power, npc:name())
-- printf("[Arti Handlers - DMG NPC Grok] Special Damage: %s | NPC being hit: %s", power, npc:name())
npc:set_health_ex(npc.health - power)
if npc.health <= 0 then -- double-check in case burn or alternate manual damage kills
SendScriptCallback("npc_on_death_callback", npc, db.actor)
Expand All @@ -480,7 +480,7 @@ end
-- Graze: Spreads 30% of original damage on headshots in a 8m radius OR 5% of original damage on non-headshots in a 5m radius
function graze_handler(npc, new_hit, radius) -- new_hit = new s_hit (handled in grok_bo; needs shit.power to be adjusted)

printf("[Arti Handlers - Graze] Starting Graze...")
-- printf("[Arti Handlers - Graze] Starting Graze...")

level.iterate_nearest(npc:position(), radius, function(obj)
if obj and obj:id() ~= AC_ID and obj:id() ~= 65535 and obj:id() ~= npc:id() then
Expand All @@ -489,7 +489,7 @@ function graze_handler(npc, new_hit, radius) -- new_hit = new s_hit (handled in
if not obj:alive() then return end
if obj:has_info("npcx_is_companion") then return end

printf("[Arti Handlers - Graze] Graze Target: %s", obj:name())
-- printf("[Arti Handlers - Graze] Graze Target: %s", obj:name())

obj:hit(new_hit)
graze_hits = graze_hits + 1
Expand All @@ -514,24 +514,34 @@ function condition_degrade_on_fire(amount, wpn, chance)
if weapon and rand == 1 then
if grok_gun_condition_fixed then
if arti_jamming.has_parts(wpn) then
local parts = item_parts.get_parts_con(wpn, nil, true)
local parts = se_load_var(wpn:id(), nil, "parts")

local part_names = {}
for k,v in pairs(parts) do
table.insert(part_names, k)
end

local part_to_dmg = part_names[math_random(1, #part_names)]
local part_to_dmg
local total_part_names = #part_names
for i = 1, total_part_names do
part_index = math_random(1, #part_names)
part_to_dmg = part_names[part_index]
printf("Part to damage: %s", part_to_dmg)
if arti_jamming.is_part(part_to_dmg) then break end
table.remove(part_names, part_index)
end

parts[part_to_dmg] = parts[part_to_dmg] - ((dura_rip == 0.0105 and 3) or (dura_rip == 0.0025 and 2) or 1)
parts[part_to_dmg] = clamp(parts[part_to_dmg] - ((dura_rip == 0.0105 and 3) or (dura_rip == 0.0025 and 2) or 1), 1, parts[part_to_dmg])

-- 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


item_parts.set_parts_con(wpn:id(), parts)

end
else
weapon:set_condition(clamp(weapon:condition() - dura_rip, 0, 1)) -- Lose 0.25% condition when using variants
Expand Down Expand Up @@ -591,7 +601,7 @@ function custom_impair_special_effects(obj, wpn, ammo_elapsed, grenade_elapsed,

if ammo_table[ammo_type + 1] and
(custom_proj_table[ini_ammo:r_string_ex(ammo_table[ammo_type + 1], "special")] or custom_proj_table[ini_ammo:r_string_ex(ammo_table[ammo_type + 1], "special_2")]) then
condition_degrade_on_fire(0.0105, wpn, 4) -- Lose 1.05% durability when firing these rounds on a 25% (un)lucky roll
condition_degrade_on_fire(0.0105, wpn, 20) -- Lose 1.05% durability when firing these rounds on a 5% (un)lucky roll
elseif ammo_table[ammo_type + 1] and string.find(ammo_table[ammo_type + 1], "_bad") or string.find(ammo_table[ammo_type + 1], "_eco") then
condition_degrade_on_fire(0.0025, wpn, 10) -- Lose 0.25% durability when firing these rounds on a 10% (un)lucky roll
end
Expand Down
96 changes: 41 additions & 55 deletions gamedata/scripts/cxv_ammo_stats_tbl.script
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local difficulty_scaling = ballistics_mcm.get_config("difficulty_scaling") or fa
function inject_stats()
utils_ui.stats_table["ammo"] = {
["damage"] = {
index= 10, typ= "float", name= "st_prop_k_hit", icon_p= "ui_wp_prop_damage", icon_n= "", track= false, magnitude= 1, unit= "st_perc", compare= false, sign=false, sign_inverse = true, show_always= true, value_functor= {"cxv_ammo_stats_tbl","prop_damage"} },
index= 10, typ= "float", name= "st_prop_k_hit", icon_p= "ui_wp_prop_damage", icon_n= "", track= false, magnitude= 1, unit= "st_perc", compare= false, sign=false, sign_inverse = false, show_always= true, value_functor= {"cxv_ammo_stats_tbl","prop_damage"} },
["ap"] = {
index= 20, typ= "string", name= "st_prop_k_ap", icon_p= "ui_wp_propery_04", icon_n= "", track= false, magnitude= 1, unit= "", compare= false, sign=false, sign_inverse = false, show_always= true, value_functor= {"cxv_ammo_stats_tbl","prop_ap"} },
["mutant_mod"] = {
Expand All @@ -26,17 +26,17 @@ function inject_stats()
index= 60, typ= "float", name= "st_prop_projectiles", icon_p= "ui_wp_prop_skorostrelnost", icon_n= "", track= false, magnitude= 1, unit= "", compare= false, sign= false, sign_inverse = false, show_always= true, value_functor= {"cxv_ammo_stats_tbl","prop_projectiles"} },

["accuracy"] ={
index= 70, typ= "float", name= "st_prop_k_disp", icon_p= "ui_wp_prop_tochnost", icon_n= "", track= false, magnitude= 1, unit= "st_perc", compare= false, sign= false, sign_inverse = true, show_always= false, value_functor= {"cxv_ammo_stats_tbl","prop_accuracy"} } ,
index= 70, typ= "float", name= "st_prop_k_disp", icon_p= "ui_wp_prop_tochnost", icon_n= "", track= false, magnitude= 1, unit= "st_perc", compare= false, sign= true, sign_inverse = true, show_always= false, value_functor= {"cxv_ammo_stats_tbl","prop_spread"} } ,
["velocity"]={
index= 80, typ= "float", name= "st_prop_k_vel", icon_p= "ui_wp_prop_nastilnost", icon_n= "", track= false, magnitude= 1, unit= "st_perc", compare= false, sign= false, sign_inverse = true, show_always= false, value_functor= {"cxv_ammo_stats_tbl","prop_flatness"} } ,
index= 80, typ= "float", name= "st_prop_k_vel", icon_p= "ui_wp_prop_nastilnost", icon_n= "", track= false, magnitude= 1, unit= "st_perc", compare= false, sign= true, sign_inverse = false, show_always= false, value_functor= {"cxv_ammo_stats_tbl","prop_flatness"} } ,

-- Momopate's Accurate Stats Addons
["range"]={
index = 90, typ = "float", name = "st_mp_a_dist", icon_p = "ui_wp_propery_13", icon_n = "", track = false, magnitude = 1, unit = "st_perc", compare = false, sign = false, sign_inverse = true, show_always = false, value_functor = { "cxv_ammo_stats_tbl", "prop_range" } },
["falloff"]={
index = 100, typ = "float", name = "st_cxv_airres", icon_p = "ui_wp_propery_05", icon_n = "", track = false, magnitude = 1, unit = "st_perc", compare = false, sign = false, sign_inverse = true, show_always = true, value_functor = { "cxv_ammo_stats_tbl", "prop_falloff" } },
index = 90, typ = "float", name = "st_mp_a_dist", icon_p = "ui_wp_propery_13", icon_n = "", track = false, magnitude = 1, unit = "st_perc", compare = false, sign = true, sign_inverse = false, show_always = false, value_functor = { "cxv_ammo_stats_tbl", "prop_range" } },
-- ["falloff"]={
-- index = 100, typ = "float", name = "st_cxv_airres", icon_p = "ui_wp_propery_05", icon_n = "", track = false, magnitude = 1, unit = "st_perc", compare = false, sign = false, sign_inverse = true, show_always = true, value_functor = { "cxv_ammo_stats_tbl", "prop_falloff" } },
["penalty"]={
index = 110 ,typ = "float", name = "st_prop_nopen", icon_p = "ui_wp_propery_12", icon_n = "", track = false, magnitude = 1, unit = "st_perc", compare = false, sign = false, sign_inverse = true, show_always = false, value_functor = { "cxv_ammo_stats_tbl", "prop_nopen" } },
index = 110 ,typ = "float", name = "st_prop_nopen", icon_p = "ui_wp_propery_12", icon_n = "", track = false, magnitude = 1, unit = "st_perc", compare = false, sign = true, sign_inverse = false, show_always = false, value_functor = { "cxv_ammo_stats_tbl", "prop_nopen" } },
-- Addons end

["special"]={
Expand Down Expand Up @@ -152,6 +152,26 @@ function utils_ui.UIInfoItem:Sync_Finale(cond, ele_syncer, ele_resizer, ele_adap
str = armor_to_class(ap) .. " (" .. armor_to_number(ap) ..")"
self.stats[i].txt:SetText(str)
end

-- Now to hard-code turning harmful stats to be red text
-- Damage (val < 1.0)
if self.stats[i].cap:GetText() == game.translate_string("st_prop_k_hit") then
local str
local k_hit = ini_sys:r_float_ex(is_knife and knife_ammo_sec or sec, "k_hit") or 0
if k_hit < 1 then
self.stats[i].txt:SetTextColor(GetARGB(255, 255, 50, 50)) -- turn the stat red to signify that it is decreasing your damage
end
end
-- Air res/drag (val > 1.0)
if self.stats[i].cap:GetText() == game.translate_string("st_cxv_airres") then
local str
local k_airres = ini_sys:r_float_ex(is_knife and knife_ammo_sec or sec, "k_air_resistance") or 0
if k_airres > 1 then
self.stats[i].txt:SetTextColor(GetARGB(255, 255, 50, 50)) -- turn the stat red to signify that it is increasing your drag
end
end


if self.stats[i].cap:GetText() == game.translate_string("st_prop_special") then
local str_spec = ini_ammo:r_string_ex(is_knife and knife_ammo_sec or sec, "special")
if str_spec then
Expand Down Expand Up @@ -200,11 +220,7 @@ end
function prop_damage(obj, sec)
local val = SYS_GetParam(2, obj and obj:section() or sec, "k_hit") or 1

if val >= 1 then
val = val * -1
end

if (val < 0.1) and (val > -0.1) then
if (val < 0.1) then
return (round_idp(val * 100, 2))
else
return (round_idp(val * 100, 1))
Expand All @@ -223,17 +239,13 @@ function prop_projectiles(obj, sec)
return proj > 1 and proj or 0
end

function prop_accuracy(obj, sec)
function prop_spread(obj, sec)
local val = (SYS_GetParam(2, obj and obj:section() or sec, "k_disp") or 1)

if val < 1 then
val = val * -1
end

if (val < 0.1) and (val > -0.1) then
return (round_idp(val * 100, 2))
if (val < 0.1) then
return (round_idp((val - 1) * 100, 2))
else
return (round_idp(val * 100, 1))
return (round_idp((val - 1) * 100, 1))
end

return 0
Expand All @@ -243,14 +255,10 @@ end
function prop_flatness(obj, sec)
local val = (SYS_GetParam(2, obj and obj:section() or sec, "k_bullet_speed") or 1)

if val >= 1 then
val = val * -1
end

if (val < 0.1) and (val > -0.1) then
return (round_idp(val * 100, 2))
return (round_idp((val - 1) * 100, 2))
else
return (round_idp(val * 100, 1))
return (round_idp((val - 1) * 100, 1))
end
return 0
end
Expand Down Expand Up @@ -291,35 +299,29 @@ function prop_nopen(obj, sec)
if val == 0 then return 0 end

if val ~= 1 then
return round_idp((1 - val) * 100, 2)
return round_idp((val - 1) * 100, 2)
end

return 0
end

function prop_falloff(obj, sec)
local perc = round_idp((SYS_GetParam(2, obj and obj:section() or sec, "k_air_resistance") or 0), 2)
if perc < 1 then
perc = perc * -1
end
local val = round_idp((SYS_GetParam(2, obj and obj:section() or sec, "k_air_resistance") or 0), 2)

if (perc < 0.1) and (perc > -0.1) then
return (round_idp(perc * 100, 2))
if (val < 0.1) then
return (round_idp((val - 1) * 100, 2))
else
return (round_idp(perc * 100, 1))
return (round_idp((val - 1) * 100, 1))
end
end

function prop_range(obj, sec)
local val = (SYS_GetParam(2, obj and obj:section() or sec, "k_dist") or 1)
if val >= 1 then
val = val * -1
end

if (val < 0.1) and (val > -0.1) then
return (round_idp(val * 100, 2))
return (round_idp((val - 1) * 100, 2))
else
return (round_idp(val * 100, 1))
return (round_idp((val - 1) * 100, 1))
end
return 0
end
Expand Down Expand Up @@ -352,22 +354,6 @@ function prop_stalker_mod(obj, sec)
end
end

function prop_degr(obj, sec)
local val = (SYS_GetParam(2, obj and obj:section() or sec, "impair") or 1)
if val < 1 then
val = val * -1
end
if val == 1 then
return 0
end
if (val < 0.1) then
return (round_idp(val * 100, 2))
else
return (round_idp(val * 100, 1))
end
return 0
end

function on_option_change()
if ui_mcm and ballistics_mcm then
difficulty_scaling = ballistics_mcm.get_config("difficulty_scaling") or false
Expand Down
34 changes: 33 additions & 1 deletion gamedata/scripts/cxv_artigrok_bo.script
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ leg_meta_sniper_null = 1
sniper_bad_bone_shit_reduce = 1

integrated_silencer = {
["wpn_amb17"] = true,
["wpn_dvl10_m1"] = true,
["wpn_vssk"] = true,
["wpn_val_tac"] = true,
Expand All @@ -48,7 +49,7 @@ integrated_silencer = {
["wpn_mp5sd"] = true,
["wpn_mp5sd_custom"] = true,
["wpn_mp5sd_new"] = true,

["wpn_sig_spear_cqb"] = true,
["wpn_pb"] = true,
["wpn_pb_bas"] = true,
["wpn_pb_custom"] = true,
Expand All @@ -60,12 +61,18 @@ integrated_silencer = {
["wpn_vintorez_nimble"] = true,
["wpn_vsk94"] = true,
["wpn_arbiter_bushmaster"] = true,
["wpn_delisle"] = true,
["wpn_700black"] = true,
}

snipers = {
["wpn_dvl10_m1"] = true,
["wpn_dvl10"] = true,
["wpn_steyr_scout"] = true,
["wpn_steyr_scout_big"] = true,
["wpn_axmc"] = true,
["wpn_axmc_black"] = true,
["wpn_hecate_2"] = true,
["wpn_l96a1"] = true,
["wpn_l96a1m"] = true,
["wpn_m98b"] = true,
Expand All @@ -76,14 +83,36 @@ snipers = {
["wpn_remington700_magpul_pro"] = true,
["wpn_remington700_mod_x_gen3"] = true,
["wpn_remington700_steyr_scout_big"] = true,
["wpn_rem700_aics"] = true,
["wpn_rem700_mcmillan"] = true,
["wpn_sv98"] = true,
["wpn_sv98_custom"] = true,
["wpn_k98_mod"] = true,
["wpn_k98_mod_silen98"] = true,
["wpn_kar98_retrotac"] = true,
["wpn_wa2000"] = true,
["wpn_mctac50"] = true,
["wpn_trg"] = true,
["wpn_rem7615"] = true,
["wpn_mosin"] = true,
}

lmgs = {
["wpn_pk_siber"] = true,
["wpn_pkm_siber"] = true,
["wpn_pkm_zenit_siber"] = true,
["wpn_pkp_siber"] = true,
["wpn_rpd"] = true,
["wpn_m134"] = true,
["wpn_m249"] = true,
["wpn_pkm_zenit_shorty"] = true,
["wpn_pkp_tac_siber"] = true,
["wpn_rpd_custom"] = true,
["wpn_rpk74_16_drum"] = true,
["wpn_rpk74_16"] = true,
["wpn_rpk"] = true,
["wpn_l86_lsw"] = true,
}
-- ilrathCXV (10/07/24): Players will now be able to decide if they want to enable/disable difficulty scaling for damage and/or AP power
local difficulty_multiplier_damage = {
[1] = (difficulty_scaling_damage and 1.3) or 1.0,
Expand Down Expand Up @@ -1321,6 +1350,9 @@ function npc_on_before_hit(npc, shit, bone_id)
if snipers[wpn:section()] then
k_ap = k_ap + 0.05
end
if lmgs[wpn:section()] then
k_ap = k_ap + 0.03
end

k_ap = k_ap * custom_bone_ap_scale * barrel_condition_corrected -- reduce bullet ap following npc ap scale and barrel condition

Expand Down

0 comments on commit 4f38bdc

Please sign in to comment.