Skip to content

Commit

Permalink
lol stingers
Browse files Browse the repository at this point in the history
Stinger grenades will no longer doo 400+ damage to targets they're directly under/on top of, instead being closer to 100. Stingers also have a higher damage_step comparable to eris stingers- this means the projectiles travel more and will bounce about more. These changes should hopefuly make stingers less of a crapshoot between 'literally a joke' and 'Stronger than a fragmentation grenade'. Stingers also can ricochet now

Additionally, implements a new variable that modifies how likely a bullet is to ricochet. This variable is a 1 by default and is negatively affected by armor pen. Lower cal rounds are more likely to bounce(about 3x as likely for 9mm vs .408 which has a net bonus of 1.15x). This also affects stingers, which have a comparable ricochet chance to 9mm, this is intended to make them more useful outside of point blank range.
  • Loading branch information
cdb-is-not-good committed Jan 29, 2024
1 parent f5b7267 commit 38b8bee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion code/game/objects/items/weapons/grenades/frag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
loadable = TRUE
num_fragments = 70
fragment_type = /obj/item/projectile/bullet/pellet/fragment/rubber
fragment_damage = 1 //+1 from the actual projectile itself. This mostly applies to instances where someone is directly on top of the grenade. Leaving this value at default was resulting in 400+ damage stiingers.
damage_step = 12

/obj/item/grenade/frag/pipebomb
name = "improvised pipebomb"
Expand Down Expand Up @@ -91,4 +93,4 @@
/obj/item/grenade/frag/white_phosphorous/Destroy()
qdel(smoke)
smoke = null
return ..()
return ..()
3 changes: 2 additions & 1 deletion code/game/turfs/simulated/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
return PROJECTILE_CONTINUE
src.ricochet_id = 0
var/proj_damage = Proj.get_structure_damage()
var/ricochet_mult = Proj.get_ricochet_modifier()
if(istype(Proj,/obj/item/projectile/beam))
if (!(Proj.testing))
burn(500)//TODO : fucking write these two procs not only for plasma (see plasma in materials.dm:283) ~
Expand All @@ -221,7 +222,7 @@
var/ricochetchance = 1
if(proj_damage <= 60)
ricochetchance = 2 + round((60 - proj_damage) / 5)
ricochetchance = min(ricochetchance * ricochetchance, 100)
ricochetchance = min(ricochetchance * ricochetchance * ricochet_mult, 100)
// here it is multiplied by 1/2 temporally, changes will be required when new wall system gets implemented
ricochetchance = round(ricochetchance * projectile_reflection(Proj, TRUE) / 2)
ricochetchance = min(max(ricochetchance, 0), 100)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
var/embed = 0 // whether or not the projectile can embed itself in the mob
var/knockback = 0
var/fire_stacks = 0 //Whether to apply fire stacks
var/ricochet_mod = 1 //How much we affect the likeliness of a round to bounce. This number is modified negatively by 10% of the projecties AP(thus, ricochet_mult = 1.5 on ap 10 gun is actually 1.4). high cal rubbers have lower mult than low cal rubbers and are further penalized by having AP and AP mod on their rounds/weapons more often.

var/shrapnel_type //Do we have a special thing to embed in the target? If this is null, it will embed a generic 'shrapnel' item.

Expand Down Expand Up @@ -226,6 +227,9 @@
/obj/item/projectile/proc/get_structure_damage()
return ((damage_types[BRUTE] + damage_types[BURN]) * structure_damage_factor)

/obj/item/projectile/proc/get_ricochet_modifier()
return (ricochet_mod - (armor_penetration * 0.01)) //Return ricochet mod(default 1) modified by AP. E.G 1 - (AP(10) * 0.01) = 0.1. Thus 10% less likely to bounce per 10ap.

//return 1 if the projectile should be allowed to pass through after all, 0 if not.
/obj/item/projectile/proc/check_penetrate(atom/A)
return TRUE
Expand Down
7 changes: 7 additions & 0 deletions code/modules/projectiles/projectile/bullettypes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
embed = FALSE //Prob should have a chance to embed, but makes close to no sense to do this for 9mm at least.
sharp = FALSE
can_ricochet = TRUE
ricochet_mod = 3 //lower cal rubbers are the most likely to ricochet.
recoil = 4

/obj/item/projectile/bullet/pistol_35/rubber/soporific
Expand Down Expand Up @@ -194,6 +195,7 @@
embed = TRUE //If you shoot someone with a rubber, it will take out an eye - or require surgery if it's high-velocity. Anything over 9mm should, realistically, fuck you up.
sharp = FALSE
can_ricochet = TRUE
ricochet_mod = 2.5
step_delay = 0.5
recoil = 6

Expand Down Expand Up @@ -280,6 +282,7 @@
check_armour = ARMOR_MELEE
armor_penetration = 10
can_ricochet = TRUE
ricochet_mod = 2 //including our AP mallus for bounce we are baseline about 1.9x as likely to bounce.
step_delay = 0.7
recoil = 10

Expand Down Expand Up @@ -350,6 +353,7 @@
armor_penetration = 15
penetrating = 1
can_ricochet = TRUE
ricochet_mod = 2.25
step_delay = 0.3
affective_damage_range = 7
affective_ap_range = 7
Expand Down Expand Up @@ -488,6 +492,7 @@
embed = TRUE //literally imagine a 7.62 rubber bullet hitting you - holy shit.
sharp = TRUE //there is literally no-fucking-way this would not act like a regular sharp round at this point.
can_ricochet = TRUE
ricochet_mod = 2 //including armor penalty ends up as closer to 1.85x as likely.
step_delay = 0.9
recoil = 6

Expand Down Expand Up @@ -564,6 +569,7 @@
embed = TRUE //imagine an effectively smaller .50 Cal marksman round hitting you. holy shit.
sharp = TRUE //there is literally no-fucking-way this would not act like a regular sharp round at this point.
can_ricochet = TRUE
ricochet_mod = 1.35 //after AP penalty to ricochet is factored in we have more like 15% more chance to ricochet.
step_delay = 0.9
recoil = 14

Expand Down Expand Up @@ -964,6 +970,7 @@
/obj/item/projectile/bullet/kurtz_50/rubber/railgun
hitscan = TRUE
can_ricochet = FALSE
ricochet_mod = 1.5
recoil = 9

/obj/item/projectile/bullet/kurtz_50/incendiary
Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/projectile/fragment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

/obj/item/projectile/bullet/pellet/fragment/rubber
damage_types = list(BRUTE = 1)
ricochet_mod = 3 // :3c
can_ricochet = TRUE
agony = 25 // 70 x 25 = 1750 pain, if all hit, rather then 32 x 150
embed = FALSE
sharp = FALSE
Expand Down

0 comments on commit 38b8bee

Please sign in to comment.