Skip to content

Commit a87902f

Browse files
committed
New cones: 50cal, Combat Rifle, PDW, P-Rifle
1 parent e1ac0e2 commit a87902f

10 files changed

Lines changed: 87 additions & 11 deletions

reactivedrop/resource/swarmopedia.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,10 @@
833833
"BulletSpread" {
834834
"Base" "3"
835835
}
836+
"Generic" {
837+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
838+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
839+
}
836840
"FireRate" {
837841
"Skill" "ASW_MARINE_SKILL_ENGINEERING"
838842
"SubSkill" "ASW_MARINE_SUBSKILL_ENGINEERING_FIRERATE"
@@ -967,6 +971,7 @@
967971
"StoppingPower" {}
968972
"BulletSpread" {
969973
"Base" "22"
974+
"Flattened" "1"
970975
}
971976
"Generic" {
972977
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
@@ -1350,6 +1355,7 @@
13501355
"StoppingPower" {}
13511356
"BulletSpread" {
13521357
"Base" "22"
1358+
"Flattened" "1"
13531359
}
13541360
"Generic" {
13551361
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
@@ -1542,6 +1548,10 @@
15421548
"BulletSpread" {
15431549
"Base" "3"
15441550
}
1551+
"Generic" {
1552+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
1553+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
1554+
}
15451555
"FireRate" {}
15461556
"Ammo" {}
15471557
"ReloadTime" {}
@@ -2210,6 +2220,13 @@
22102220
"SubSkill" "ASW_MARINE_SUBSKILL_ACCURACY_RIFLE_DMG"
22112221
}
22122222
"StoppingPower" {}
2223+
"BulletSpread" {
2224+
"Base" "3"
2225+
}
2226+
"Generic" {
2227+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
2228+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
2229+
}
22132230
"Ammo" {}
22142231
"ReloadTime" {}
22152232
"Secondary" {
@@ -2547,6 +2564,10 @@
25472564
"Base" "20"
25482565
"Flattened" "1"
25492566
}
2567+
"Generic" {
2568+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
2569+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
2570+
}
25502571
"FireRate" {}
25512572
"Ammo" {
25522573
"UseWeaponInfo" "0"

src/game/shared/swarm/asw_weapon_50calmg_shared.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ void CASW_Weapon_50CalMG::Precache()
7979
BaseClass::Precache();
8080
}
8181

82+
const Vector& CASW_Weapon_50CalMG::GetBulletSpread( void )
83+
{
84+
static const Vector cone( 0.17365, 0.17365, 0.02 ); // VECTOR_CONE_20DEGREES with flattened Z
85+
static const Vector cone_duck = Vector( 0.13053, 0.13053, 0.01 ); // VECTOR_CONE_15DEGREES with flattened Z
86+
87+
CASW_Marine* marine = GetMarine();
88+
89+
if ( marine )
90+
{
91+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
92+
return cone_duck;
93+
}
94+
return cone;
95+
}
96+
8297
// just dry fire by default
8398
void CASW_Weapon_50CalMG::SecondaryAttack()
8499
{

src/game/shared/swarm/asw_weapon_50calmg_shared.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ class CASW_Weapon_50CalMG : public CASW_Weapon_Rifle
3030
return cone;
3131
}
3232

33-
virtual const Vector& GetBulletSpread( void )
34-
{
35-
static const Vector cone( 0.17365, 0.17365, 0.02 ); // VECTOR_CONE_20DEGREES with flattened Z
36-
return cone;
37-
}
33+
virtual const Vector& GetBulletSpread( void );
3834

3935
#ifndef CLIENT_DLL
4036
DECLARE_DATADESC();

src/game/shared/swarm/asw_weapon_combat_rifle_shared.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,21 @@ void CASW_Weapon_CombatRifle::Precache()
8787
BaseClass::Precache();
8888
}
8989

90+
const Vector& CASW_Weapon_CombatRifle::GetBulletSpread( void )
91+
{
92+
static const Vector cone = VECTOR_CONE_3DEGREES;
93+
static const Vector cone_duck = VECTOR_CONE_1DEGREES;
94+
95+
CASW_Marine* marine = GetMarine();
96+
97+
if ( marine )
98+
{
99+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
100+
return cone_duck;
101+
}
102+
return cone;
103+
}
104+
90105
float CASW_Weapon_CombatRifle::GetWeaponBaseDamageOverride()
91106
{
92107
extern ConVar rd_combat_rifle_dmg_base;

src/game/shared/swarm/asw_weapon_combat_rifle_shared.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class CASW_Weapon_CombatRifle : public CASW_Weapon_Rifle
2424

2525
virtual void SecondaryAttack();
2626

27+
virtual const Vector& GetBulletSpread( void );
28+
2729
virtual const Vector& GetAngularBulletSpread()
2830
{
2931
static const Vector cone(60, 60, 10);

src/game/shared/swarm/asw_weapon_heavy_rifle_shared.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ float CASW_Weapon_Heavy_Rifle::GetFireRate()
154154
const Vector &CASW_Weapon_Heavy_Rifle::GetBulletSpread( void )
155155
{
156156
const static Vector vec15degrees = Vector( 0.13053, 0.02618, 0.13053 ); // VECTOR_CONE_15DEGREES with y as VECTOR_CONE_3DEGREES
157-
const static Vector vec6degrees = Vector( 0.05234, 0.02618, 0.05234 ); // VECTOR_CONE_6DEGREES with y as VECTOR_CONE_3DEGREES
157+
const static Vector vec6degrees = Vector( 0.05234, 0.02618, 0.05234 ); // VECTOR_CONE_6DEGREES with y as VECTOR_CONE_3DEGREES
158158

159159
CASW_Marine *marine = GetMarine();
160160

src/game/shared/swarm/asw_weapon_pdw_shared.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,21 @@ void CASW_Weapon_PDW::Precache()
173173
BaseClass::Precache();
174174
}
175175

176+
const Vector& CASW_Weapon_PDW::GetBulletSpread( void )
177+
{
178+
static const Vector cone = VECTOR_CONE_3DEGREES;
179+
static const Vector cone_duck = VECTOR_CONE_1DEGREES;
180+
181+
CASW_Marine* marine = GetMarine();
182+
183+
if ( marine )
184+
{
185+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
186+
return cone_duck;
187+
}
188+
return cone;
189+
}
190+
176191
void CASW_Weapon_PDW::PrimaryAttack()
177192
{
178193
// If my clip is empty (and I use clips) start reload

src/game/shared/swarm/asw_weapon_pdw_shared.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ class CASW_Weapon_PDW : public CASW_Weapon_Rifle
3030
virtual int GetWeaponSubSkillId();
3131

3232
virtual const float GetAutoAimAmount() { return AUTOAIM_2DEGREES; }
33-
virtual const Vector& GetBulletSpread( void )
34-
{
35-
static const Vector cone = VECTOR_CONE_3DEGREES; //VECTOR_CONE_20DEGREES;
33+
virtual const Vector& GetBulletSpread( void );
3634

37-
return cone;
38-
}
3935
virtual bool ShouldFlareAutoaim() { return true; }
4036

4137
virtual void PrimaryAttack();

src/game/shared/swarm/asw_weapon_prifle_shared.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ void CASW_Weapon_PRifle::Precache()
7878
BaseClass::Precache();
7979
}
8080

81+
const Vector& CASW_Weapon_PRifle::GetBulletSpread( void )
82+
{
83+
static const Vector cone = VECTOR_CONE_3DEGREES;
84+
static const Vector cone_duck = VECTOR_CONE_1DEGREES;
85+
86+
CASW_Marine* marine = GetMarine();
87+
88+
if ( marine )
89+
{
90+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
91+
return cone_duck;
92+
}
93+
return cone;
94+
}
95+
8196
float CASW_Weapon_PRifle::GetFireRate()
8297
{
8398
float flRate = BaseClass::GetFireRate();

src/game/shared/swarm/asw_weapon_prifle_shared.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class CASW_Weapon_PRifle : public CASW_Weapon_Rifle
2929
virtual int GetWeaponSkillId();
3030
virtual int GetWeaponSubSkillId();
3131
virtual void SecondaryAttack();
32+
virtual const Vector& GetBulletSpread( void );
3233

3334
#ifndef CLIENT_DLL
3435
DECLARE_DATADESC();

0 commit comments

Comments
 (0)