Skip to content

Commit

Permalink
minimum recoil for ballistics (#3330)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
gives a very small kick to all ballistics, not enough to affect your aim
but makes them feel alot better to use.
atomization of #3094
currently debating what the value should be..

0

https://github.com/user-attachments/assets/1630a089-bf9f-4ec5-8853-c2728f420f4e

.1

https://github.com/user-attachments/assets/2064b49b-37f5-4860-b273-1f28274724f7

.175

https://github.com/user-attachments/assets/6baba2ad-8100-403e-b6c4-d4e958ad21d6

.25

https://github.com/user-attachments/assets/ca3bdf37-bf30-493e-bb24-ae452cbc6481

a bit of an extreme case being a fast firing auto but it happens to be a
gun with a recoil of 0 rn so it will be affected by the change

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
without it, a surprising amount of ballistics get 0 recoil just but
wielding them which feels really jarring.

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Ballistics now have a minimum recoil, not enough to mess up your
shot!
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
FalloutFalcon authored Sep 25, 2024
1 parent af77144 commit 7e9752a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@
///this is how much deviation the gun recoil can have, recoil pushes the screen towards the reverse angle you shot + some deviation which this is the max.
var/recoil_deviation = 22.5

///Used if the guns recoil is lower then the min, it clamps the highest recoil
var/min_recoil = 0

var/gunslinger_recoil_bonus = 0
var/gunslinger_spread_bonus = 0

/// how many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst.
var/burst_size = 3
///The rate of fire when firing in a burst. Not the delay between bursts
Expand Down Expand Up @@ -318,9 +324,6 @@
///This prevents gun from firing until the coodown is done, affected by lag
var/current_cooldown = 0

var/gunslinger_recoil_bonus = 0
var/gunslinger_spread_bonus = 0

/obj/item/gun/Initialize()
. = ..()
RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield))
Expand Down Expand Up @@ -815,7 +818,7 @@
/obj/item/gun/proc/calculate_recoil(mob/user, recoil_bonus = 0)
if(HAS_TRAIT(user, TRAIT_GUNSLINGER))
recoil_bonus += gunslinger_recoil_bonus
return clamp(recoil_bonus, 0 , INFINITY)
return clamp(recoil_bonus, min_recoil , INFINITY)

/obj/item/gun/proc/calculate_spread(mob/user, bonus_spread)
var/final_spread = 0
Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
has_safety = TRUE
safety = TRUE

min_recoil = 0.1

valid_attachments = list(
/obj/item/attachment/silencer,
/obj/item/attachment/laser_sight,
Expand Down

0 comments on commit 7e9752a

Please sign in to comment.