Skip to content

Commit

Permalink
Update 17 Hotfix 1
Browse files Browse the repository at this point in the history
- Fixed "Chaos" effect crashes trying to call a non-existent variable (my mistake)
- Added in DLTX edits for 9x21 variants to fix incorrect AP values
- Juan's AXMC weapons are now able to use the .338 Federal variants (requires the weapons obviously)
- Slightly buffed 10mm AP to have more BR than base 9x19 AP (from 30 to 40)
- Slight re-write for better performance regarding getting an ammo's special effects
  • Loading branch information
ilrathCXV committed Jul 13, 2023
1 parent 084d412 commit 239f7ab
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 42 deletions.
2 changes: 2 additions & 0 deletions gamedata/configs/mod_system_zzz_9x21_variants.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ k_ap = 0.050
tier = 4

![ammo_9x21_sp11]
k_ap = 0.023
box_size = 18
!impair

Expand All @@ -42,6 +43,7 @@ k_impulse = 1.15
tier = 3

![ammo_9x21_sp12]
k_ap = 0.015
box_size = 18
!impair

Expand Down
2 changes: 1 addition & 1 deletion gamedata/configs/mod_system_zzzzz_20x70_variants.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ k_disp = 4.0
k_hit = 0.195
k_ap = 0.002
buck_shot = 17
wm_size = 0.022
wm_size = 0.014
k_cam_dispersion = 1.5
!impair

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ ammo_class = ammo_338_federal, ammo_338_federal_bad, ammo_338_federal_very

![wpn_l96a1m]
ammo_class = ammo_338_federal, ammo_338_federal_bad, ammo_338_federal_verybad

![wpn_axmc_black]
ammo_class = ammo_338_federal, ammo_338_federal_bad, ammo_338_federal_verybad

![wpn_axmc]
ammo_class = ammo_338_federal, ammo_338_federal_bad, ammo_338_federal_verybad
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ k_hit = 0.85
k_bullet_speed = 1

![ammo_10x25_ap]
cost = 3100
cost = 3200
!impair
k_hit = 0.68
k_ap = 0.03 ;
k_hit = 0.75
k_ap = 0.04 ;
k_bullet_speed = 1.2

![ammo_10x25_hydrashok]
Expand Down
81 changes: 43 additions & 38 deletions gamedata/scripts/grok_bo.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
-- EDITED BY ilrathCXV for .357 FMJ + 9x21 FMJ/HP (last edit: 11/26/22)
-- EDITED BY ilrathCXV for ArtiGrok Merge (last edit: 01/17/23)
-- EDITED BY ilrathCXV for ArtiGrok Merge (last edit: 06/25/23)
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -302,12 +301,15 @@ function monster_on_before_hit(monster,shit,bone_id)
------------------------- Arti's Bonuses ------------------------------
-----------------------------------------------------------------------

local special_effect = get_special(ammo_section) or 0
local special_effect_2 = get_special_2(ammo_section) or 0

------------------------
-- Varmageddon Rounds --
------------------------
-- Mult. damage bonus to mutants
local varma_mult = 1.0
if (get_special(ammo_section) == "varma") or (get_special_2(ammo_section) == "varma") then
if (special_effect == "varma") or (special_effect_2 == "varma") then
varma_mult = 1.60
end

Expand Down Expand Up @@ -438,7 +440,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Cover Piercing --
--------------------
-- Corrects ammo's AP to allow for cover piercing w/o going overkill in its AP/BR + mimic "piercing" mutant armor/skin
if (get_special(ammo_section) == "pierce") or (get_special_2(ammo_section) == "pierce") then
if (special_effect == "pierce") or (special_effect_2 == "pierce") then
k_ap = ini_ammo:r_float_ex(ammo_section, "k_ap") or k_ap
mutant_mult = 1.0
end
Expand Down Expand Up @@ -648,7 +650,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-------------------------
-- Grants 20% stacking mult. damage bonus to targets both hit and affected by the Cloud
cloudkill_mult = 1.0
if (get_special(ammo_section) == "toxic") or (get_special_2(ammo_section) == "toxic") or (chaos_effect == 10) then
if (special_effect == "toxic") or (special_effect_2 == "toxic") or (chaos_effect == 10) then
bas_handler.corrosive_cloud(monster, bone_id)
end

Expand All @@ -675,7 +677,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Chaos Rounds --
------------------
-- bone_mult mult. and damage mult. ranging from -40% to +60% + small chance to pull from most special affects
if (get_special(ammo_section) == "chaos") or (get_special_2(ammo_section) == "chaos") then
if (special_effect == "chaos") or (special_effect_2 == "chaos") then
chaos_effect = arti_handlers.chaos_damage(monster,bone_id)

random = math.random(60, 160)
Expand All @@ -687,7 +689,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Acid Rounds --
-----------------
-- Changes hit to chemical damage + multiplies bone_mult by 75%
if (get_special(ammo_section) == "acid") or (get_special_2(ammo_section) == "acid") or (chaos_effect == 7) then
if (special_effect == "acid") or (special_effect_2 == "acid") or (chaos_effect == 7) then
shit.type = hit.chemical_burn
bone_mult = bone_mult * 1.75
end
Expand All @@ -696,7 +698,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- JHP/Headhunter Rounds --
---------------------------
-- Ignores mutant resistances + double bone_mult
if (get_special(ammo_section) == "head") or (get_special_2(ammo_section) == "head") or (chaos_effect == 6) then
if (special_effect == "head") or (special_effect_2 == "head") or (chaos_effect == 6) then
spec_monster_mult = 1.00
bone_mult = bone_mult * 2
end
Expand All @@ -705,7 +707,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Ambush Rounds --
-------------------
-- 20% mult. damag and bone_mult bonus on unaware targets
if (get_special(ammo_section) == "ambush") or (get_special_2(ammo_section) == "ambush") then
if (special_effect == "ambush") or (special_effect_2 == "ambush") then
if arti_handlers.ambush(monster,shit,wpn) then
ambush_mult = 1.20
bone_mult = bone_mult * 1.2
Expand All @@ -716,7 +718,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Dragon's Breath --
---------------------
-- Burns target for moderate damage + changes hit to Fire damage + standardizes bone_/ammo_mult
if (get_special(ammo_section) == "fire_melt") or (get_special_2(ammo_section) == "fire_melt") then
if (special_effect == "fire_melt") or (special_effect_2 == "fire_melt") then
spec_monster_mult = 1.00
bone_mult = 1.00
ammo_mult = 0.85
Expand All @@ -728,7 +730,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Mini Napalm --
-----------------
-- Burns target for moderate damage + changes hit to Fire damage + standardizes bone_/ammo_mult + spreads light burn to nearby targets
if (get_special(ammo_section) == "napalm") or (get_special_2(ammo_section) == "napalm") then
if (special_effect == "napalm") or (special_effect_2 == "napalm") then
spec_monster_mult = 1.00
bone_mult = 1.00
ammo_mult = 1.00
Expand All @@ -740,7 +742,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Lightning Rounds --
----------------------
-- Changes hit to Shock damage + standardizes bone_/ammo_mult
if (get_special(ammo_section) == "shock") or (get_special_2(ammo_section) == "shock") or (chaos_effect == 9) then
if (special_effect == "shock") or (special_effect_2 == "shock") or (chaos_effect == 9) then
spec_monster_mult = 1.00
bone_mult = 1.00
ammo_mult = 0.85
Expand All @@ -751,7 +753,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- [NEW] Armor Buster --
-------------------------
-- Multiplies bone_mult by 30%, increases ammo_mult by 0.3, and nullifies monster resistance
if (get_special(ammo_section) == "armorbuster") or (get_special_2(ammo_section) == "armorbuster") then
if (special_effect == "armorbuster") or (special_effect_2 == "armorbuster") then
spec_monster_mult = 1.00
bone_mult = bone_mult * 1.3
ammo_mult = ammo_mult + 0.30
Expand All @@ -761,7 +763,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Fragmentation Rounds --
--------------------------
-- Chance to deal 30% increased damage on hit
if (get_special(ammo_section) == "frag") or (get_special_2(ammo_section) == "frag") then
if (special_effect == "frag") or (special_effect_2 == "frag") then
frag_chance = ini_ammo:r_float_ex(ammo_section, "frag") or 0
if math.random(100) <= frag_chance then
fragment_mult = 1.3
Expand Down Expand Up @@ -789,7 +791,7 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Incendiary/API --
--------------------
-- Chance to burn target for slight damage
if (get_special(ammo_section) == "fire") or (get_special_2(ammo_section) == "fire") then
if (special_effect == "fire") or (special_effect_2 == "fire") then
local ignite_chance = ini_ammo:r_float_ex(ammo_section, "ignite") or 30
arti_handlers.fire_damage(monster,bone_id,ignite_chance)
end
Expand All @@ -798,31 +800,31 @@ function monster_on_before_hit(monster,shit,bone_id)
-- Explosive Rounds --
----------------------
-- Self-explanatory
if (get_special(ammo_section) == "explodes") or (get_special_2(ammo_section) == "explodes") then
if (special_effect == "explodes") or (special_effect_2 == "explodes") then
arti_handlers.explode_handler()
end

----------------
-- RIP Rounds --
----------------
-- Grants healing on successful hits
if (get_special(ammo_section) == "rip") or (get_special_2(ammo_section) == "rip") then
if (special_effect == "rip") or (special_effect_2 == "rip") then
arti_handlers.rip(monster,shit,false)
end

----------------
-- Soulripper --
----------------
-- Grants healing on "critical" hits
if (get_special(ammo_section) == "soulripper") or (get_special_2(ammo_section) == "soulripper") and (bone_mult > 1.00) then
if (special_effect == "soulripper") or (special_effect_2 == "soulripper") and (bone_mult > 1.00) then
arti_handlers.rip(monster,shit,true)
end

------------------------------------
-- Chaos Rounds (if healing proc) --
------------------------------------
if chaos_effect == 5 then
db.actor.health = clamp(db.actor.health + (0.1 * s_hit.power), 0, 1)
db.actor.health = clamp(db.actor.health + (0.1 * shit.power), 0, 1)
end

return
Expand Down Expand Up @@ -890,6 +892,9 @@ function npc_on_before_hit(npc,shit,bone_id)
------------------------- Arti's Bonuses ------------------------------
-----------------------------------------------------------------------

local special_effect = get_special(ammo_section) or 0
local special_effect_2 = get_special_2(ammo_section) or 0

armor_break_mult = 1.0
armor_break_bonus = 0

Expand Down Expand Up @@ -947,7 +952,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Cover Piercing --
--------------------
-- Corrects ammo's AP to allow for cover piercing w/o going overkill in its AP/BR
if (get_special(ammo_section) == "pierce") or (get_special_2(ammo_section) == "pierce") then
if (special_effect == "pierce") or (special_effect_2 == "pierce") then
k_ap = ini_ammo:r_float_ex(ammo_section, "k_ap") or k_ap
end

Expand Down Expand Up @@ -1196,7 +1201,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Chaos Rounds --
------------------
-- AP/BR mult. and damage mult. ranging from -40% to +60% + small chance to pull from most special affects
if (get_special(ammo_section) == "chaos") or (get_special_2(ammo_section) == "chaos") then
if (special_effect == "chaos") or (special_effect_2 == "chaos") then
chaos_effect = arti_handlers.chaos_damage(npc,bone_id)

printf("Old AP: %s", k_ap)
Expand Down Expand Up @@ -1227,7 +1232,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Acid Rounds --
-----------------
-- Changes hit to chemical damage + multiplies armor lost on hit by 75% + removes 5 BR/armor per hit
if (get_special(ammo_section) == "acid") or (get_special_2(ammo_section) == "acid") or (chaos_effect == 7) then
if (special_effect == "acid") or (special_effect_2 == "acid") or (chaos_effect == 7) then
shit.type = hit.chemical_burn
armor_break_mult = armor_break_mult * 1.75
armor_break_bonus = armor_break_bonus + 0.05
Expand All @@ -1237,7 +1242,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Ambush Rounds --
-------------------
-- Increases AP/BR by one level + 20% mult. damage bonus on unaware targets
if (get_special(ammo_section) == "ambush") or (get_special_2(ammo_section) == "ambush") then
if (special_effect == "ambush") or (special_effect_2 == "ambush") then
if arti_handlers.ambush(npc,shit,wpn) then
k_ap = k_ap + 0.1
ambush_mult = 1.20
Expand All @@ -1249,7 +1254,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-------------------------
-- Grants 20% mult. damage bonus targets both hit and affected by the Cloud
cloudkill_mult = 1.0
if (get_special(ammo_section) == "toxic") or (get_special_2(ammo_section) == "toxic") or (chaos_effect == 10) then
if (special_effect == "toxic") or (special_effect_2 == "toxic") or (chaos_effect == 10) then
bas_handler.corrosive_cloud(npc, bone_id)
end

Expand All @@ -1261,7 +1266,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- JHP/Headhunter Rounds --
---------------------------
-- Nullifies any armor + faction resistances & removes any damage penalty from overpenetration
if (get_special(ammo_section) == "head") or (get_special_2(ammo_section) == "head") then
if (special_effect == "head") or (special_effect_2 == "head") then
if (tonumber(bone_id) >= 14 and tonumber(bone_id) <= 19) then -- headshot
if k_ap < 1.0 then
k_ap = 1.0
Expand All @@ -1276,7 +1281,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Dragon's Breath --
---------------------
-- Burns target for moderate damage + changes hit to Fire damage + removes additional 2.5 BR/armor value on hit
if (get_special(ammo_section) == "fire_melt") or (get_special_2(ammo_section) == "fire_melt") then
if (special_effect == "fire_melt") or (special_effect_2 == "fire_melt") then
shit.type = hit.burn
armor_break_bonus = armor_break_bonus + 0.025
arti_handlers.dragonsbreath(npc,bone_id)
Expand All @@ -1286,7 +1291,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Mini Napalm --
-----------------
-- Burns target for moderate damage + changes hit to Fire damage + standardizes bone_/ammo_mult + spreads light burn to nearby targets
if (get_special(ammo_section) == "napalm") or (get_special_2(ammo_section) == "napalm") then
if (special_effect == "napalm") or (special_effect_2 == "napalm") then
shit.type = hit.burn
armor_break_bonus = armor_break_bonus + 0.025
arti_handlers.napalm_damage(npc,bone_id)
Expand All @@ -1296,7 +1301,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- [NEW] Armor Buster --
-------------------------
-- Multiplies armor lost on hit by 30% + removes 1.0 BR/armor on hit
if (get_special(ammo_section) == "armorbuster") or (get_special_2(ammo_section) == "armorbuster") then
if (special_effect == "armorbuster") or (special_effect_2 == "armorbuster") then
armor_break_mult = armor_break_mult * 1.3
armor_break_bonus = armor_break_bonus + 0.01
end
Expand All @@ -1305,7 +1310,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Lightning Rounds --
----------------------
-- Changes hit to Shock damage + deals AoE damage to other targets (includes balance for going against Eidelon + allows for AoE on headshots on low-armor targets)
if (get_special(ammo_section) == "shock") or (get_special_2(ammo_section) == "shock") or (chaos_effect == 9) then
if (special_effect == "shock") or (special_effect_2 == "shock") or (chaos_effect == 9) then
shit.type = hit.shock
if (custom_bone_armor == 4) then
arti_handlers.shock_damage(npc,bone_id, custom_bone_armor * 0.25)
Expand All @@ -1321,7 +1326,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-----------------------
-- Chance to force-stun target + increase in residual concussion damage based on chance (10% chance = 10% bonus to concussion damage)
flinch_stun_chance = 0
if (get_special(ammo_section) == "flinch") or (get_special_2(ammo_section) == "flinch") then
if (special_effect == "flinch") or (special_effect_2 == "flinch") then
flinch_stun_chance = ini_ammo:r_float_ex(ammo_section, "flinch") or 10
arti_handlers.stun_npc(npc,flinch_stun_chance)
flinch_stun_chance = flinch_stun_chance * 0.01
Expand All @@ -1332,7 +1337,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Fragmentation Rounds --
--------------------------
-- Chance to deal 30% increased damage on hit
if (get_special(ammo_section) == "frag") or (get_special_2(ammo_section) == "frag") then
if (special_effect == "frag") or (special_effect_2 == "frag") then
frag_chance = ini_ammo:r_float_ex(ammo_section, "frag") or 0
if math.random(100) <= frag_chance then
fragment_mult = 1.3
Expand Down Expand Up @@ -1360,8 +1365,8 @@ function npc_on_before_hit(npc,shit,bone_id)

if k_ap < custom_bone_armor then

--local new_bone_armor = tonumber( tonumber(custom_bone_armor) - tonumber(armor_loss_increment) )-- armor reduce
--custom_bone_value[custom_bone_id] = new_bone_armor
local new_bone_armor = tonumber( tonumber(custom_bone_armor) - tonumber(armor_loss_increment) )-- armor reduce
custom_bone_value[custom_bone_id] = new_bone_armor

if k_ap > new_bone_armor then -- if bullet damaged armor enough and pen with reduced power
shit.power = shit.power * custom_bone_hitfraction
Expand Down Expand Up @@ -1414,7 +1419,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Incendiary/API --
--------------------
-- Chance to burn target for slight damage
if (get_special(ammo_section) == "fire") or (get_special_2(ammo_section) == "fire") then
if (special_effect == "fire") or (special_effect_2 == "fire") then
local ignite_chance = ini_ammo:r_float_ex(ammo_section, "ignite") or 0.3
-- printf("Ignite Chance: %s", ignite_chance)
arti_handlers.fire_damage(npc,bone_id,ignite_chance)
Expand All @@ -1424,23 +1429,23 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Explosive Rounds --
----------------------
-- Self-explanatory
if (get_special(ammo_section) == "explodes") or (get_special_2(ammo_section) == "explodes") then
if (special_effect == "explodes") or (special_effect_2 == "explodes") then
arti_handlers.explode_handler()
end

----------------
-- RIP Rounds --
----------------
-- Grants healing on successful hits
if (get_special(ammo_section) == "rip") or (get_special_2(ammo_section) == "rip") then
if (special_effect == "rip") or (special_effect_2 == "rip") then
arti_handlers.rip(npc,shit,false)
end

----------------
-- Soulripper --
----------------
-- Grants healing on headshots
if (get_special(ammo_section) == "soulripper") or (get_special_2(ammo_section) == "soulripper") then
if (special_effect == "soulripper") or (special_effect_2 == "soulripper") then
if (tonumber(bone_id) >= 14 and tonumber(bone_id) <= 19) then -- headshot
arti_handlers.rip(npc,shit,true)
end
Expand All @@ -1450,7 +1455,7 @@ function npc_on_before_hit(npc,shit,bone_id)
-- Chaos Rounds --
------------------
if chaos_effect == 5 then
db.actor.health = clamp(db.actor.health + (0.1 * s_hit.power), 0, 1)
db.actor.health = clamp(db.actor.health + (0.1 * shit.power), 0, 1)
end

if surrender_bonus == 1 then
Expand Down

0 comments on commit 239f7ab

Please sign in to comment.