Skip to content

Commit

Permalink
TGS Test Merge (#6163)
Browse files Browse the repository at this point in the history
Probably overpowered
  • Loading branch information
cm13-github committed Apr 26, 2024
2 parents 71a6726 + 3a79ce5 commit 779dd4e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
59 changes: 55 additions & 4 deletions code/datums/ammo/bullet/sniper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,47 @@
accuracy = HIT_ACCURACY_TIER_8
damage = 125
shell_speed = AMMO_SPEED_TIER_6
penetration = ARMOR_PENETRATION_TIER_10 + ARMOR_PENETRATION_TIER_5

/datum/ammo/bullet/sniper/anti_materiel/proc/stopping_power_knockback(mob/living/living_mob, obj/projectile/fired_projectile)
var/stopping_power = min(CEILING((fired_projectile.damage/30), 1), 5) // This is from bullet damage, and does not take Aimed Shot into account.

if(!living_mob || living_mob == fired_projectile.firer)
return stopping_power

if(stopping_power > 2)
// If above 60 damage, screenshake. This maxes out at (3,4) like buckshot and heavy rounds. (1,2) (2,3) or (3,4)
shake_camera(living_mob, (stopping_power - 2), (stopping_power - 1))

// Depending on target size and damage, may apply a mini-stun to interrupt channels. Support your allies!
// For reference: Scout Impact stuns for up to 1s and slows for up to 10s, Shotgun stuns for 1.4s and slows for 4s
if(living_mob.mob_size >= MOB_SIZE_BIG)
if(stopping_power >= 4)
to_chat(living_mob, SPAN_XENOHIGHDANGER("You are knocked off-balance by the sudden massive impact!"))
living_mob.KnockDown(0.05) // Must deal more than 90 damage to mini-stun big mobs for 0.1s
// Can't interrupt a big mob unless it's completely alone with nothing blocking the shot.
else
to_chat(living_mob, SPAN_XENODANGER("You are shaken by the sudden heavy impact!"))
else
if(living_mob.body_position != LYING_DOWN)
to_chat(living_mob, SPAN_XENOHIGHDANGER("You are thrown back by the sudden massive force!"))
slam_back(living_mob, fired_projectile)
else
to_chat(living_mob, SPAN_XENODANGER("You are shaken by the sudden heavy impact!"))

if(isxeno(living_mob))
living_mob.KnockDown((stopping_power - 2)*0.05) // Up to 0.3s on a solo target.
else
living_mob.KnockDown((stopping_power - 2)*0.5) // Up to 3s on non-xenos.

return stopping_power

/datum/ammo/bullet/sniper/anti_materiel/on_hit_mob(mob/target_mob,obj/projectile/aimed_projectile)

var/mob/living/living_target = target_mob

var/stopping_power = stopping_power_knockback(living_target, aimed_projectile)

if((aimed_projectile.projectile_flags & PROJECTILE_BULLSEYE) && target_mob == aimed_projectile.original)

var/amr_counter = 0
Expand Down Expand Up @@ -150,36 +186,50 @@
var/size_damage_mod = 0.8 // 1.8x vs Non-Xenos (225)
var/size_current_health_damage = 0 // % Current Health calculation, only used for Xeno calculations at the moment.
var/focused_fire_active = 0 // Whether to try and use focused fire calculations or not, for that kind of target.
var/slow_duration = stopping_power // Based on damage dealt.

if(slow_duration <= 2) // Must be over 60 base damage.
slow_duration = 0

if(isxeno(target_mob))
var/mob/living/carbon/xenomorph/target = target_mob
size_damage_mod -= 0.2 // Down to 1.6x damage, 200.
size_current_health_damage = 0.1 // 1.6x Damage + 10% current health (200 + 10%, 223 vs Runners)

if(target.mob_size >= MOB_SIZE_XENO && (target.caste_type != XENO_CASTE_DEFENDER))
if(target.mob_size >= MOB_SIZE_XENO)
size_current_health_damage += 0.1 // 1.6x Damage + 20% current health
focused_fire_active = 1 // Focus Fire Required. Only deals 50% bonus damage on a first Aimed Shot, then 75%, then 100%. Resets with a successful aimed shot on another target.
slow_duration = max(slow_duration-1, 0)

if(target.mob_size >= MOB_SIZE_BIG && (target.caste_type != XENO_CASTE_DEFENDER))
if(target.mob_size >= MOB_SIZE_BIG)
size_damage_mod -= 0.6 // Down to 1x Damage.
size_current_health_damage += 0.1 // 1x Damage + 30% current health.
focused_fire_active = 1
slow_duration = max(slow_duration-1, 0)
// Most T3s have around 650 to 700 HP, meaning the health modifier grants a MAXIMUM of around 195-210 damage for a total max of 320-335. This is fully focused (3 shots) and at max HP.
// Queen takes around 275 at max health and unfocused, 425 fully focused. Defender only takes 200 damage, even while fortified, but still causes falloff like a Big Xeno.
// Queen takes around 275 at max health and unfocused, 425 fully focused.
// At low health, does little more than a normal shot. Does WORSE than a normal shot if unfocused and hitting through blockers, all of which stack to reduce it.

var/final_xeno_damage = ((damage * size_damage_mod) + ((target.health + damage) * size_current_health_damage))

if(focused_fire_active && amr_counter) // If this is a target that needs to be focus-fired and the gun supports it, reduce bonus damage to 50%, then 75%, then 100%
// If amr_counter is 0, then the gun likely doesn't have the tracker functions, so skip this and deal normal damage.
final_xeno_damage *= (0.25 + (0.25 * amr_counter))
slow_duration *= (0.25 + (0.25 * amr_counter)) // 0-3s slow on Big mobs, based on Focus and falloff.

living_target.apply_armoured_damage((final_xeno_damage), ARMOR_BULLET, BRUTE, null, penetration)

else
living_target.apply_armoured_damage((damage*size_damage_mod), ARMOR_BULLET, BRUTE, null, penetration)

// Base 1.8x damage to non-xeno targets (225), 1.6x + 10% current against Runners and Defenders (223), 1.6x + 20% current health against most non-Runner xenos, and +30% current health against Big xenos. -Kaga
if(slow_duration)
living_target.Slow((slow_duration / 2))
if(slow_duration >= 2)
living_target.Superslow((slow_duration / 4))
if(stopping_power > 3)
living_target.Daze(0.1) // Visual cue that you got hit by something HARD.

// Base 1.8x damage to non-xeno targets (225), 1.6x + 10% current against Runners (223), 1.6x + 20% current health against most non-Runner xenos, and 1x + 30% current health against Big xenos. -Kaga
// This applies after pen reductions. After hitting 1 other thing, it deals 80% damage, or 40% after hitting a dense wall or big xeno.

if((focused_fire_active || isxeno(target_mob)) && !(target_mob.is_dead()))
Expand Down Expand Up @@ -253,6 +303,7 @@
accuracy = HIT_ACCURACY_TIER_8
damage = 150
shell_speed = AMMO_SPEED_TIER_6 + AMMO_SPEED_TIER_2
penetration = ARMOR_PENETRATION_TIER_10 + ARMOR_PENETRATION_TIER_5

/datum/ammo/bullet/sniper/elite/set_bullet_traits()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_marines/equipment/kit_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

/obj/item/storage/box/spec/sniper/anti_materiel/fill_preset_inventory()
name = "\improper AMR equipment case"
desc = "A large case containing an experimental XM43E1, a set of M45 ghillie armor and helmet, a M42 scout sight, ammunition, spotter equipment, and additional pieces of equipment.\nDrag this sprite onto yourself to open it up! NOTE: You cannot put items back inside this case."
desc = "A large case containing an experimental XM43E1, a set of M45 ghillie armor and helmet, an M42 scout sight, ammunition, a set of spotter gear, and additional pieces of equipment.\nDrag this sprite onto yourself to open it up! NOTE: You cannot put items back inside this case."
new /obj/item/clothing/suit/storage/marine/ghillie(src)
new /obj/item/clothing/head/helmet/marine/ghillie(src)
new /obj/item/clothing/glasses/night/m42_night_goggles(src)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/specialist/sniper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@

/obj/item/weapon/gun/rifle/sniper/XM43E1
name = "\improper XM43E1 experimental anti-materiel rifle"
desc = "An experimental anti-materiel rifle produced by Armat Systems, recently reacquired from the deep storage of an abandoned prototyping facility. This one in particular is currently undergoing field testing. Chambered in 10x99mm Caseless.\nThis weapon can punch through thin metal plating and walls, though it'll lose most of its lethality in the process. It can even work for demolitions, with experienced users known to disassemble segments of solid, reinforced walls in the field with just a single standard magazine of 10x99mm. In lieu of explosives or an engineer, they instead use each of the 8 shots to break down vital structural supports, taking the wall apart in the process."
desc = "An experimental anti-materiel rifle produced by Armat Systems, recently reacquired from the deep storage of an abandoned prototyping facility. This one in particular is currently undergoing field testing. Chambered in 10x99mm Caseless.\n\nThis weapon can punch through thin metal plating and walls, though it'll lose most of its lethality in the process. It can even work for demolitions, with experienced users known to disassemble segments of solid, reinforced walls in the field with just a single standard magazine of 10x99mm. In lieu of explosives or an engineer, they instead use each of the 8 shots to break down vital structural supports, taking the wall apart in the process."
icon = 'icons/obj/items/weapons/guns/guns_by_faction/uscm.dmi'
icon_state = "xm43e1"
item_state = "xm43e1"
Expand Down

0 comments on commit 779dd4e

Please sign in to comment.