Skip to content

Commit

Permalink
Overhaul Recoils (#176)
Browse files Browse the repository at this point in the history
Co-authored-by: jonpas <[email protected]>
  • Loading branch information
Mike-MF and jonpas authored Sep 4, 2023
1 parent dd36d85 commit 6f2bbdf
Show file tree
Hide file tree
Showing 107 changed files with 1,805 additions and 2,089 deletions.
337 changes: 320 additions & 17 deletions addons/recoils/CfgRecoils.hpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,331 @@
class CfgRecoils {
/*
- Parameter muzzleOuter defines the possible area where the recoil would like to move the weapon's muzzle randomly at each shot. It is defined as ellipse with variables defining the
(x = horizontal axis position, y = vertical axis position, a = horizontal magnitude, b = vertical magnitude); or, translated to the weapon's recoil movement behavior
- Parameter muzzleOuter defines the possible area where the recoil would like to move the weapon's muzzle randomly at each shot.
It is defined as ellipse with variables defining the:
x = horizontal axis position (Kick Right)
y = vertical axis position (Kick Up)
a = horizontal magnitude (Kick Left)
b = vertical magnitude (Kick Up/Down)
(how far to the right, how high up, how much horizontal deviation, how much vertical deviation).
- Parameter kickBack defines the minimum and maximum of random interval for backward force applied over the arms and torso for each fired shot.
Remaining parameters define how much of the random muzzle displacement within the defined ellipse space is permanent (causing muzzle rise you should compensate for) and how much is temporary
(causing temporal weapon rise up and down, thus causing the weapon to shake in your hands).
- Parameter temporary defines how much shake the weapon has when fired.
- Parameter permanent defines how much your weapon climbs per shot.
- Recoil Naming:
Regular Rifles:
Caliber_Long - 16-18"
Caliber_Medium - 14-16"
Caliber_Short - < 14"
Foregrip or Grenade Launchers: Lessened horizontal recoil.
Caliber_Long_FG
Caliber_Medium_FG
Caliber_Short_FG
Bullpups: Lessened horizontal recoil, no FG variant, slightly better than FG for rifles.
Caliber_Long_BP
Caliber_Medium_BP
Caliber_Short_BP
LMGs: Different style of recoil pattern for manageability.
Caliber_Long_MG
*/

// Inherit into new classes.
class CLASS(Recoil_Default) {
kickBack[] = {0.03, 0.05};
// 12G - Operate differently from regular rifles, the barrel is either short or long.
class CLASS(12G_Long) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.25, 0.75, 0.4, 0.4};
permanent = 0.4;
temporary = 0.025;
};
class CLASS(12G_Long_FG) {
kickBack[] = {0.018, 0.038};
muzzleOuter[] = {0.22, 0.7, 0.37, 0.37};
permanent = 0.35;
temporary = 0.02;
};
class CLASS(12G_Short) {
kickBack[] = {0.025, 0.045};
muzzleOuter[] = {0.28, 0.85, 0.44, 0.44};
permanent = 0.44;
temporary = 0.03;
};
class CLASS(12G_Short_FG) {
kickBack[] = {0.023, 0.043};
muzzleOuter[] = {0.25, 0.8, 0.41, 0.41};
permanent = 0.39;
temporary = 0.025;
};

#include "recoils\545.hpp"
#include "recoils\556.hpp"
#include "recoils\65.hpp"
#include "recoils\68.hpp"
#include "recoils\762R.hpp"
#include "recoils\762N.hpp"
#include "recoils\12G.hpp"
#include "recoils\blackout.hpp"
#include "recoils\300wm.hpp"
#include "recoils\338.hpp"
// 6.5
class CLASS(65_Long) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.25, 0.6, 0.35, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(65_Medium) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.28, 0.64, 0.38, 0.3};
permanent = 0.15;
temporary = 0.017;
};
class CLASS(65_Short) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.31, 0.66, 0.41, 0.4};
permanent = 0.15;
temporary = 0.019;
};

class CLASS(65_Long_FG) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.22, 0.55, 0.32, 0.3};
permanent = 0.15;
temporary = 0.013;
};
class CLASS(65_Medium_FG) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.24, 0.59, 0.35, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(65_Short_FG) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.26, 0.61, 0.38, 0.4};
permanent = 0.15;
temporary = 0.017;
};

class CLASS(65_Long_BP) {
kickBack[] = {0.015, 0.035};
muzzleOuter[] = {0.22, 0.6, 0.35, 0.3};
permanent = 0.15;
temporary = 0.014;
};
class CLASS(65_Medium_BP) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.24, 0.64, 0.38, 0.4};
permanent = 0.15;
temporary = 0.016;
};

// 300WM
class CLASS(300WM_Long) {
kickBack[] = {0.3, 0.5};
muzzleOuter[] = {0.46, 0.76, 0.5, 0.5};
permanent = 0.2;
temporary = 0.02;
};

// 338 Lapua
class CLASS(338_Long) {
kickBack[] = {0.33, 0.53};
muzzleOuter[] = {0.5, 0.82, 0.55, 0.55};
permanent = 0.22;
temporary = 0.02;
};

// 5.45
class CLASS(545_Long) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.2, 0.45, 0.3, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(545_Medium) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.23, 0.49, 0.36, 0.3};
permanent = 0.15;
temporary = 0.017;
};
class CLASS(545_Short) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.26, 0.51, 0.39, 0.4};
permanent = 0.15;
temporary = 0.019;
};

class CLASS(545_Long_FG) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.2, 0.44, 0.33, 0.3};
permanent = 0.15;
temporary = 0.013;
};
class CLASS(545_Medium_FG) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.22, 0.48, 0.36, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(545_Short_FG) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.24, 0.5, 0.39, 0.3};
permanent = 0.15;
temporary = 0.017;
};

class CLASS(545_Long_BP) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.18, 0.4, 0.3, 0.3};
permanent = 0.15;
temporary = 0.013;
};
class CLASS(545_Short_BP) {
kickBack[] = {0.03, 0.05};
muzzleOuter[] = {0.22, 0.44, 0.33, 0.3};
permanent = 0.15;
temporary = 0.015;
};

// 5.56
class CLASS(556_Long) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.225, 0.525, 0.325, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(556_Medium) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.255, 0.565, 0.37, 0.3};
permanent = 0.15;
temporary = 0.017;
};
class CLASS(556_Short) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.285, 0.585, 0.4, 0.4};
permanent = 0.15;
temporary = 0.019;
};

class CLASS(556_Long_FG) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.21, 0.495, 0.325, 0.3};
permanent = 0.15;
temporary = 0.013;
};
class CLASS(556_Medium_FG) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.23, 0.535, 0.355, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(556_Short_FG) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.025, 0.555, 0.385, 0.4};
permanent = 0.15;
temporary = 0.017;
};

class CLASS(556_Long_BP) {
kickBack[] = {0.015, 0.035};
muzzleOuter[] = {0.22, 0.6, 0.35, 0.3};
permanent = 0.15;
temporary = 0.014;
};
class CLASS(556_Medium_BP) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.24, 0.64, 0.38, 0.4};
permanent = 0.15;
temporary = 0.016;
};
class CLASS(556_Short_BP) {
kickBack[] = {0.025, 0.045};
muzzleOuter[] = {0.26, 0.68, 0.41, 0.4};
permanent = 0.15;
temporary = 0.018;
};

class CLASS(556_Long_MG) {
kickBack[] = {0.01, 0.03};
muzzleOuter[] = {0.15, 0.36, 0.25, 0.25};
permanent = 0.12;
temporary = 0.01;
};

// 7.62 NATO
class CLASS(762N_Long) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.31, 0.7, 0.41, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(762N_Medium) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.34, 0.74, 0.44, 0.3};
permanent = 0.015;
temporary = 0.017;
};
class CLASS(762N_Short) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.37, 0.78, 0.47, 0.4};
permanent = 0.015;
temporary = 0.019;
};

class CLASS(762N_Long_FG) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.28, 0.65, 0.38, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(762N_Medium_FG) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.3, 0.69, 0.41, 0.3};
permanent = 0.15;
temporary = 0.017;
};
class CLASS(762N_Short_FG) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.32, 0.73, 0.44, 0.4};
permanent = 0.15;
temporary = 0.019;
};

class CLASS(762N_Long_MG) {
kickBack[] = {0.01, 0.03};
muzzleOuter[] = {0.25, 0.45, 0.35, 0.35};
permanent = 0.15;
temporary = 0.015;
};

// 7.62 Russian
class CLASS(762R_Long) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.28, 0.65, 0.38, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(762R_Medium) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.31, 0.69, 0.41, 0.3};
permanent = 0.15;
temporary = 0.017;
};
class CLASS(762R_Short) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.34, 0.73, 0.43, 0.4};
permanent = 0.15;
temporary = 0.019;
};

class CLASS(762R_Long_FG) {
kickBack[] = {0.02, 0.04};
muzzleOuter[] = {0.25, 0.6, 0.35, 0.3};
permanent = 0.15;
temporary = 0.013;
};
class CLASS(762R_Medium_FG) {
kickBack[] = {0.025, 0.05};
muzzleOuter[] = {0.27, 0.64, 0.38, 0.3};
permanent = 0.15;
temporary = 0.015;
};
class CLASS(762R_Short_FG) {
kickBack[] = {0.03, 0.06};
muzzleOuter[] = {0.29, 0.68, 0.41, 0.4};
permanent = 0.15;
temporary = 0.017;
};
};
37 changes: 8 additions & 29 deletions addons/recoils/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
class CfgWeapons {
// Base classes
#include "baseclasses.hpp"

// 5.45
#include "bohemia\545\ak.hpp"

// 5.56
#include "bohemia\556\f2000.hpp"
#include "bohemia\556\hk416.hpp"
#include "bohemia\556\tar21.hpp"

// 6.5
#include "bohemia\65\katiba.hpp"
#include "bohemia\65\msbs.hpp"
#include "bohemia\65\mx.hpp"
#include "bohemia\65\qbu.hpp"
#include "bohemia\65\type115.hpp"

// 7.62x39
#include "bohemia\762R\ak.hpp"

// 7.62x51
#include "bohemia\762N\ebr.hpp"
#include "bohemia\762N\hk417.hpp"
#include "bohemia\762N\m14.hpp"
#include "bohemia\762N\sig.hpp"

// .338
#include "bohemia\338\mar10.hpp"
#include "bohemia\baseclasses.hpp"
#include "bohemia\12G.hpp"
#include "bohemia\65.hpp"
#include "bohemia\338.hpp"
#include "bohemia\545.hpp"
#include "bohemia\556.hpp"
#include "bohemia\762N.hpp"
#include "bohemia\762R.hpp"
};
Loading

0 comments on commit 6f2bbdf

Please sign in to comment.