Skip to content

Commit

Permalink
Update 20 Hotfix 2 - Minor balance adjustments + synergy with RPG Perks
Browse files Browse the repository at this point in the history
- 12ga Flechettes have been adjusted:
o Now receives a concussion damage penalty when hits do not break armor
o Mutant expansion bonus increased from 11% to 30%
- 12.7x55 Explosive now has an AP value of 58 (previously was 38)
- Updated description of Explosive ammo types and Napalm ammo types
- Explosive ammo types (Chaos effect not included) will now multiply the explosion hits by the bullet's "k_hit" value
o if the "k_hit" value is less than 1, it will default to 1, resulting in no damage increase

- Fixed a crash that can occur when attacked by a target debuffed by "Cloudkill"
- Added a possible crash-failsafe when inspecting melee weapons for their stat tables
o This one came out of nowhere and shouldn't have occurred at all, but code does what it (doesn't) want

- Added synergy with my RPG Perks System mod (**not required to use ArtiGrok**)
o If RPG Perks are used, AoE hits from Lightning Rounds, enemies ignited by Napalm Rounds, and hits from Explosive Rounds now give a small increment to the hit counter for "On Your Mark"
  • Loading branch information
ilrathCXV committed Nov 19, 2023
1 parent 00a3465 commit b8074ce
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gamedata/configs/ammo/ammo_shotgun.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ name = ammo_new_12x70_flechette
k_hit = 0.7 ;0.28 - Arti
k_ap = 0.15
k_hp = 1.30
k_mp = 1.11
k_mp = 1.30
cost = 6500
special = armorbuster
dg_ammo = ammo_12x76_zhekan
Expand Down
2 changes: 1 addition & 1 deletion gamedata/configs/ammo/ammo_sniper.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ cost = 6900
name = ammo_new_12.7x55_exp
impact_h = arti_handlers.explode_handler
k_hit = 0.5 ;0.35 - Grok+
k_ap = 0.405 ;0.049 - Arti
k_ap = 0.58 ;0.049 - Arti
cost = 12000
special = explodes
dg_ammo = ammo_12.7x55_ap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ inv_name_short = ammo_new_12.7x55_fmjs_s
k_disp = 0.55
k_hit = 1.65
k_impulse = 3.3
k_ap = 0.038
k_ap = 0.058
wm_size = 0.133
k_air_resistance = 0.50
k_bullet_speed = 1.075
Expand Down
6 changes: 3 additions & 3 deletions gamedata/configs/text/eng/st_items_ammo_new.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@
<text>60% bonus damage vs. mutants</text>
</string>
<string id="st_ballistics_explodes">
<text>Explodes on impact</text>
<text>Explodes at impact site</text>
</string>
<string id="st_ballistics_chaos">
<text>60%-160% DMG/AP + random effects</text>
<text>60-160% DMG/AP + random effects</text>
</string>
<string id="st_ballistics_acid">
<text>Chemical hit, breaks armor much faster</text>
Expand Down Expand Up @@ -155,7 +155,7 @@
<text>Breaks armor more effectively</text>
</string>
<string id="st_ballistics_napalm">
<text>Fire hit, ignites initial target + light burn on surrounding targets</text>
<text>Ignites surrounding targets at impact site</text>
</string>
<string id="st_ballistics_basher">
<text>Melee hits to the head ignore armor (faction resistances still mitigate damage)</text>
Expand Down
56 changes: 55 additions & 1 deletion gamedata/scripts/arti_handlers.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
----------------------------------------------------
----- EDIT for ArtiGrok - ilrathCXV (01/17/23) -----
----- EDIT for ArtiGrok - ilrathCXV (11/17/23) -----
----------------------------------------------------

print_dbg = ballistics_mcm.print_dbg
Expand All @@ -13,6 +13,23 @@ head_bones = ballistics_utils.head_bones
ini_ammo = ballistics_utils.ini_ammo
ini_damage = ballistics_utils.ini_damage

local rpg_hit_perks = nil
local fourth_times = 0
local shock_hits = 0
local napalm_hits = 0
local explode_hits = 0

if z_cxv_experience_perk_weapon_reload_hit_effects then
rpg_hit_perks = z_cxv_experience_perk_weapon_reload_hit_effects

function experience_skill_on_update(id, data)
if (id == "perk_fourth_times") then
fourth_times = data["curr_level"]
end
end

end

local anims = {
"norm_2_critical_hit_torso_0", -- good
"norm_1_critical_hit_head_0", -- good
Expand Down Expand Up @@ -236,11 +253,20 @@ function shock_damage(npc, bone_id, wpn_id, armor_amount)
if obj and obj:alive() and obj:id() ~= AC_ID then
if IsStalker(obj) then
damage_npc_grok(obj, shock_power)
shock_hits = shock_hits + 1
else
obj:hit(h)
shock_hits = shock_hits + 1
end
end
end)

if rpg_hit_perks and fourth_times > 0 then
rpg_hit_perks.fourth_times_counter = rpg_hit_perks.fourth_times_counter + round_idp((shock_hits/armor_tier), 4)
printf("[RPG - Arti Handlers - Shock] On Your Mark stacks: %s of 8", rpg_hit_perks.fourth_times_counter)
end
shock_hits = 0

end
-- s_hit.power = tbl_reduce(calcs)
play_sound_on_location(snd, npc)
Expand Down Expand Up @@ -305,9 +331,17 @@ function napalm_handler(bullet)
level.iterate_nearest(bullet.position, 5, function(obj)
if obj and obj:alive() and obj:id() ~= AC_ID then
ignite_npc(obj,11,wpn_id,2,5)
napalm_hits = napalm_hits + 1
end
end)
play_sound_on_location("anomaly\\fireball_blow", npc)

if rpg_hit_perks and fourth_times > 0 then
rpg_hit_perks.fourth_times_counter = rpg_hit_perks.fourth_times_counter + (napalm_hits * 0.2) -- need at least 5 enemies burned to get one full stack
printf("[RPG - Arti Handlers - Napalm] On Your Mark stacks: %s of 8", rpg_hit_perks.fourth_times_counter)
end
napalm_hits = 0

end
end

Expand Down Expand Up @@ -350,19 +384,31 @@ function explode_handler(bullet)

printf("[ArtiGrok - Exp] %s is hit with %s fragments (blast damage mod.: %s)", _obj and _obj:name(), frag_hit_num, blast_div_factor)

local k_hit = ini_sys:r_float_ex(ammo_sec, "k_hit") or 1
if k_hit < 1 then k_hit = 1 end

local h = hit()
h.type = (is_frag_hit and blast_div_factor < 0.3 and hit.fire_wound) or hit.explosion
h.power = ((is_frag_hit and frag_power * frag_hit_num) or 0) + (blast_power * blast_div_factor)
h.power = h.power * k_hit
h.impulse = ((is_frag_hit and frag_impulse * frag_hit_num) or 0) + (blast_impulse * blast_div_factor)
h.direction = VEC_Y
h.bone = "bip01_spine"
h.draftsman = db.actor
h.weapon_id = explode_obj
_obj:hit(h)
explode_hits = explode_hits + 1
end
end
end)

if rpg_hit_perks and fourth_times > 0 then
rpg_hit_perks.fourth_times_counter = rpg_hit_perks.fourth_times_counter + round_idp((explode_hits / frags_temp), 4)
printf("[RPG - Arti Handlers - Explode] On Your Mark stacks: %s of 8", rpg_hit_perks.fourth_times_counter)
end

explode_hits = 0

CreateTimeEvent(explode_obj.id, explode_obj.id, 0,
function(id)
local explode_obj = get_object_by_id(id)
Expand Down Expand Up @@ -450,6 +496,14 @@ if enhanced_recoil then
end

function on_game_start()
if z_cxv_experience_perk_weapon_reload_hit_effects then
if experience_potions then
RegisterScriptCallback("experience_skill_on_update", experience_skill_on_update)
else
RegisterScriptCallback("experience_perk_on_update", experience_skill_on_update)
end
end

RegisterScriptCallback("actor_on_weapon_fired", actor_on_weapon_fired)
RegisterScriptCallback("on_enemy_eval", on_enemy_eval)
RegisterScriptCallback("npc_on_death_callback", npc_on_death_callback)
Expand Down
2 changes: 1 addition & 1 deletion gamedata/scripts/bas_handler.script
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function cloudkill_dmg_reduction(shit, bone_id)
if weakened[shit.draftsman:id()] and shit.draftsman:alive() then
local damage_reduction = round_idp(0.7 / weakened[shit.draftsman:id()], 4)
shit.power = shit.power * damage_reduction
display_reduction = tonumber(100 - (damage_mult * 100))
display_reduction = tonumber(100 - (damage_reduction * 100))
printf("[ArtiGrok - BaS Handler] Cloudkill DMG reduction: %s%", display_reduction)
end
end
Expand Down
4 changes: 2 additions & 2 deletions gamedata/scripts/grok_bo.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
-- EDITED BY ilrathCXV for ArtiGrok Merge (last edit: Nov. 14, '23)
-- EDITED BY ilrathCXV for ArtiGrok Merge (last edit: Oct. 22, '23)
-----------------------------------------------------------------------------------------------------

custom_bone_value = {} -- this a table with each identifier being npcid_boneid, these returns custom bonearmor value. It is filled, alongside the other custom tables, after every new bone hit
Expand Down Expand Up @@ -185,7 +185,7 @@ hp_rounds = {
["ammo_5.56x45_ss190_bad"] = 1.33,
["ammo_5.56x45_ss190_verybad"] = 1.33,
["ammo_12x76_zhekan"] = 3.5,
--["ammo_12x76_zhekan_bad"] = 3.5, -- Flechette (has Armorbuster)
["ammo_12x76_zhekan_bad"] = 3.5, -- Flechette (has Armorbuster)
["ammo_12x76_zhekan_verybad"] = 3.5,
["ammo_12x76_dart"] = 1.5,
--["ammo_12x76_dart_bad"] = 1.5, -- Dragon's Breath
Expand Down
2 changes: 1 addition & 1 deletion gamedata/scripts/momopate_knife_stats.script
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function prop_damage(obj, sec, name)
end

if powers ~= nil then
hit_power = powers[game_difficulties.get_game_factor("actor_immunities") or 3]
hit_power = powers[game_difficulties.get_game_factor("actor_immunities") or 3] or 0
end
end

Expand Down

0 comments on commit b8074ce

Please sign in to comment.