Skip to content

Commit

Permalink
Sniper Rifle & DMR rework & T4 Marksman rework
Browse files Browse the repository at this point in the history
reclassify semi-auto sniper rifles into 200 damage class, give them higher rof to compensate
stat tweaks for all snipers and their exclusive mods
give dmrs armor and enemy penetration
make enemy penetration reduce bullet's damage by 30%

deadeye rework into bullseye (welcome back lol)
basic version: same but removes the 30% damage reduction on piercing enemies
aced version: headshotting an enemy with a sniper rifle gives you 50 armor on a 3 second cooldown
  • Loading branch information
nikitawastaken committed Jul 22, 2024
1 parent d9dcc94 commit a456fe1
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 136 deletions.
6 changes: 4 additions & 2 deletions loc/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"bm_wp_upg_a_dragons_breath_desc": "Special type of Incendiary-effect rounds.\nOne shell contains 16 magnesium pellets.\nThis ammo type is harder to find.\nThe stronger the shotgun type, the more effective the burn and the range are.",
"bm_wp_upg_mk2_rare_desc": "This fuel is easier to find.",
"bm_wp_upg_mk2_welldone_desc": "This fuel is harder to find.",
"bm_w_dmr_penetration_desc": "PENETRATES BODY ARMOR AND ENEMIES.",
"bm_wp_dmr_kit_penetration_desc": "Armor and enemy piercing.",
"bm_w_hajk": "CR 805B Rifle",

"bm_menu_pickup": "Ammo Pickup",
Expand Down Expand Up @@ -48,8 +50,8 @@
"menu_rifleman_beta_desc": "BASIC: ##$basic##\nYou snap to zoom ##$multibasic## faster.\n\nACE: ##$pro##\nYou swap your weapons ##$multipro## faster.",
"menu_sharpshooter_beta_desc": "BASIC: ##$basic##\nYour weapons are ##$multibasic## more stable when you are aiming down sights.\n\nACE: ##$pro##\nYou gain ##$multipro## weapon accuracy while standing still.",
"menu_speedy_reload_beta_desc": "BASIC: ##$basic##\nYou reload your Sniper and Assault Rifles ##$multibasic## faster.\n\nACE: ##$pro##\nAny killing headshot will increase your reload speed by ##$multipro## for ##$multipro2## seconds. Can only be triggered by SMGs, Assault Rifles and Sniper Rifles fired in single shot fire mode.",
"menu_sniper_graze_damage": "Deadeye",
"menu_sniper_graze_damage_desc": "BASIC: ##$basic##\nYour piercing bullets no longer receive a ##$multibasic## damage penalty when going through walls and shields.\n\nACE: ##$pro##\nYour bullets now have the ability to magnetize to enemies' heads when passing near them.",
"menu_sniper_graze_damage": "Bullseye",
"menu_sniper_graze_damage_desc": "BASIC: ##$basic##\nYour piercing bullets no longer receive a ##$multibasic## damage penalty when passing through walls and shields or a ##$multibasic2## damage penalty when passing through enemies.\n\nACE: ##$pro##\nYou regenerate ##$multipro## armor for each succesful headshot with a Sniper Rifle. This can not occur more than once every ##$multipro2## seconds.",


"menu_from_the_hip_desc": "BASIC: ##$basic##\nYou deal ##$multibasic## more damage with Shotguns.\n\nACE: ##$pro##\nThe time it takes to draw and holster Shotguns is decreased by ##$multipro##.",
Expand Down
28 changes: 16 additions & 12 deletions lua/playermanager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function PlayerManager:on_headshot_dealt()
local player_unit = self:player_unit()
local damage_ext = player_unit:character_damage()
local has_hitman_ammo_refund = managers.player:has_enabled_cooldown_upgrade("cooldown", "hitman_ammo_refund")
local weapon_unit = self:equipped_weapon_unit()
local weapon = weapon_unit:base()
local regen_armor_bonus = managers.player:upgrade_value("player", "headshot_regen_armor_bonus", 0)
local meets_bullseye_conditions = weapon and weapon:is_category("snp") and regen_armor_bonus > 0

if not player_unit then
return
Expand All @@ -60,20 +64,20 @@ function PlayerManager:on_headshot_dealt()
managers.player:disable_cooldown_upgrade("cooldown", "hitman_ammo_refund")
end

-- make headshot regen check for maxed out armor
if damage_ext and damage_ext:armor_ratio() == 1 then
self._on_headshot_dealt_t = 0
else
if self._on_headshot_dealt_t and t < self._on_headshot_dealt_t then
return
-- make bullseye only work with sniper rifles, also make it work with non max armor
if meets_bullseye_conditions then
if damage_ext and damage_ext:armor_ratio() == 1 then
self._on_headshot_dealt_t = 0
else
if self._on_headshot_dealt_t and t < self._on_headshot_dealt_t then
return
end
self._on_headshot_dealt_t = t + (tweak_data.upgrades.on_headshot_dealt_cooldown or 0)
end
self._on_headshot_dealt_t = t + (tweak_data.upgrades.on_headshot_dealt_cooldown or 0)
end

local regen_armor_bonus = managers.player:upgrade_value("player", "headshot_regen_armor_bonus", 0)

if damage_ext and regen_armor_bonus > 0 then
damage_ext:restore_armor(regen_armor_bonus)
if damage_ext then
damage_ext:restore_armor(regen_armor_bonus)
end
end
end

Expand Down
3 changes: 3 additions & 0 deletions lua/raycastweaponbase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul
elseif hit.unit:in_slot(managers.slot:get_mask("enemy_shield_check")) then
hit_through_shield = hit_through_shield or alive(hit.unit:parent())
damage = damage * (managers.player:has_category_upgrade("weapon", "no_pen_damage_penalty") and 1 or 0.4)
elseif hit.unit:in_slot(managers.slot:get_mask("enemies")) then
hit_through_shield = hit_through_shield or alive(hit.unit:parent())
damage = damage * (managers.player:has_category_upgrade("weapon", "no_pen_damage_penalty") and 1 or 0.7)
end

if dmg > 0 then
Expand Down
3 changes: 2 additions & 1 deletion lua/skilltreetweakdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function SkillTreeTweakData:init(tweak_data)

-- Deadeye
self.skills.single_shot_ammo_return[1].upgrades = { "weapon_no_pen_damage_penalty" }
self.skills.single_shot_ammo_return[2].upgrades = { "weapon_magnetizing_bullets" }
self.skills.single_shot_ammo_return[2].upgrades = { "player_headshot_regen_armor_bonus_1" }
self.skills.single_shot_ammo_return.icon_xy = { 6, 11 }

-- ENFORCER --

Expand Down
12 changes: 6 additions & 6 deletions lua/upgradestweakdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ function UpgradesTweakData:_init_pd2_values(tweak_data)
-- ictv nerf
self.values.player.body_armor.armor[7] = 18

-- bullseye nerf
self.on_headshot_dealt_cooldown = 5

-- make sna less cancer
self.values.player.shield_knock_bullet.chance = 0.7

Expand Down Expand Up @@ -301,10 +298,13 @@ function UpgradesTweakData:init(tweak_data)
category = "weapon",
},
}

self.values.player.headshot_regen_armor_bonus[1] = 5
self.on_headshot_dealt_cooldown = 3
self.skill_descs.single_shot_ammo_return.multibasic = "60%"
self.skill_descs.single_shot_ammo_return.multibasic2 = "2m"
self.skill_descs.single_shot_ammo_return.multipro = "3m"
self.skill_descs.single_shot_ammo_return.multipro2 = "100%"
self.skill_descs.single_shot_ammo_return.multibasic2 = "30%"
self.skill_descs.single_shot_ammo_return.multipro = "50"
self.skill_descs.single_shot_ammo_return.multipro2 = "3"

-- Enforcer --

Expand Down
Loading

0 comments on commit a456fe1

Please sign in to comment.