Skip to content

Commit 0ff41c3

Browse files
committed
Init: New cones: Vidicator, Shotgun, Autogun
1 parent 343ef6d commit 0ff41c3

4 files changed

Lines changed: 60 additions & 16 deletions

File tree

reactivedrop/resource/swarmopedia.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,11 @@
907907
"StoppingPower" {}
908908
"BulletSpread" {
909909
"Base" "7"
910+
"Flattened" "1"
911+
}
912+
"Generic" {
913+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
914+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
910915
}
911916
"FireRate" {}
912917
"Ammo" {}
@@ -963,6 +968,10 @@
963968
"BulletSpread" {
964969
"Base" "22"
965970
}
971+
"Generic" {
972+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
973+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
974+
}
966975
"FireRate" {}
967976
"Ammo" {}
968977
"ReloadTime" {}
@@ -1342,6 +1351,10 @@
13421351
"BulletSpread" {
13431352
"Base" "22"
13441353
}
1354+
"Generic" {
1355+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
1356+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
1357+
}
13451358
"FireRate" {}
13461359
"Ammo" {}
13471360
"ReloadTime" {}
@@ -2145,6 +2158,10 @@
21452158
"BulletSpread" {
21462159
"Base" "11"
21472160
}
2161+
"Generic" {
2162+
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
2163+
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
2164+
}
21482165
"Piercing" {
21492166
"Precision" "1"
21502167
"Skill" "ASW_MARINE_SKILL_STOPPING_POWER"
@@ -2153,10 +2170,6 @@
21532170
"FireRate" {}
21542171
"Ammo" {}
21552172
"ReloadTime" {}
2156-
"Generic" {
2157-
"Icon" "swarm/swarmopedia/fact/accurate_crouch"
2158-
"Caption" "#rd_weapon_fact_more_accurate_while_crouching"
2159-
}
21602173
"Generic" {
21612174
"Icon" "swarm/swarmopedia/fact/heavy"
21622175
"Caption" "#rd_weapon_fact_slow_movement_while_held"

src/game/shared/swarm/asw_weapon_autogun_shared.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,16 @@ int CASW_Weapon_Autogun::GetWeaponSubSkillId()
177177

178178
const Vector& CASW_Weapon_Autogun::GetBulletSpread( void )
179179
{
180-
static const Vector cone = VECTOR_CONE_7DEGREES;
180+
static const Vector cone = Vector( 0.06105, 0.06105, 0.02); // VECTOR_CONE_7DEGREES with flattened Z
181+
static const Vector cone_duck = Vector( 0.03490, 0.03490, 0.01 ); // VECTOR_CONE_4DEGREES with flattened Z
182+
183+
CASW_Marine *marine = GetMarine();
184+
185+
if ( marine )
186+
{
187+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
188+
return cone_duck;
189+
}
181190
return cone;
182191
}
183192

src/game/shared/swarm/asw_weapon_shotgun_shared.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,37 @@ CASW_Weapon_Shotgun::~CASW_Weapon_Shotgun()
138138

139139
}
140140

141+
142+
const Vector &CASW_Weapon_Shotgun::GetBulletSpread( void )
143+
{
144+
static const Vector cone = VECTOR_CONE_20DEGREES;
145+
static const Vector cone_duck = VECTOR_CONE_15DEGREES;
146+
147+
CASW_Marine *marine = GetMarine();
148+
149+
if ( marine )
150+
{
151+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
152+
return cone_duck;
153+
}
154+
return cone;
155+
}
156+
157+
const Vector &CASW_Weapon_Shotgun::GetAngularBulletSpread( void )
158+
{
159+
static const Vector cone( 22, 22, 12 );
160+
static const Vector cone_duck( 16, 16, 6 );
161+
162+
CASW_Marine *marine = GetMarine();
163+
164+
if ( marine )
165+
{
166+
if ( marine->GetLocalVelocity().IsZero() && marine->m_bWalking )
167+
return cone_duck;
168+
}
169+
return cone;
170+
}
171+
141172
Activity CASW_Weapon_Shotgun::GetPrimaryAttackActivity( void )
142173
{
143174
return ACT_VM_PRIMARYATTACK;

src/game/shared/swarm/asw_weapon_shotgun_shared.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,8 @@ class CASW_Weapon_Shotgun : public CASW_Weapon
5353
virtual bool ShouldFlareAutoaim() { return true; }
5454
virtual bool SupportsDamageModifiers() { return true; }
5555

56-
virtual const Vector& GetBulletSpread()
57-
{
58-
static const Vector cone = VECTOR_CONE_20DEGREES;
59-
return cone;
60-
}
61-
62-
virtual const Vector& GetAngularBulletSpread()
63-
{
64-
static const Vector cone(22,22,22);
65-
return cone;
66-
}
56+
virtual const Vector &GetBulletSpread( void );
57+
virtual const Vector &GetAngularBulletSpread( void );
6758

6859
#ifndef CLIENT_DLL
6960
DECLARE_DATADESC();

0 commit comments

Comments
 (0)