Mantis 0000973:

o Shotgun pellets now spread randomly -- five pellets in an outside 20degree cone, and five pellets within an 7degree cone.
o Shotgun falloff damage removed, shotgun pellets now have an unlimited range

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@84 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2005-04-21 18:09:58 +00:00
parent 4586c5ad9b
commit bef055e975
3 changed files with 23 additions and 11 deletions

View File

@ -1702,6 +1702,14 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD
// x * vecSpread.x * vecRight +
// y * vecSpread.y * vecUp;
// tankefugl: 0000973
// added inner cone for half of the shots
if (isShotgun && (iShot > (cShots/2)))
{
vecSpread = kSGInnerSpread;
}
// :tankefugl
Vector vecDir = UTIL_GetRandomSpreadDir(shared_rand, iShot, vecDirShooting, vecRight, vecUp, vecSpread);
Vector vecEnd;
@ -1730,16 +1738,19 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD
if(theAdjustedDamage)
{
if ( isShotgun && !( theEntityHit->pev->iuser3 & AVH_USER3_BREAKABLE) )
{
float distance=fabs((vecSrc - theEntityHit->pev->origin).Length());
if ( distance > BALANCE_VAR(kShotgunDamageRange) )
{
float fallOffDistance=distance-BALANCE_VAR(kShotgunDamageRange);
float fallOff=max(0.0, 1.0f-(fallOffDistance/(kSGRange/2)));
theAdjustedDamage*=fallOff;
}
}
// tankefugl: 0000973
// removed shotgun fallof
//if ( isShotgun && !( theEntityHit->pev->iuser3 & AVH_USER3_BREAKABLE) )
//{
// float distance=fabs((vecSrc - theEntityHit->pev->origin).Length());
// if ( distance > BALANCE_VAR(kShotgunDamageRange) )
// {
// float fallOffDistance=distance-BALANCE_VAR(kShotgunDamageRange);
// float fallOff=max(0.0, 1.0f-(fallOffDistance/(kSGRange/2)));
// theAdjustedDamage*=fallOff;
// }
//}
// :tankefugl
if ( theAdjustedDamage ) {
theEntityHit->TraceAttack(pevAttacker, theAdjustedDamage, vecDir, &tr, theDamageType | ((theAdjustedDamage > 16) ? DMG_ALWAYSGIB : DMG_NEVERGIB) );
}

View File

@ -169,6 +169,7 @@ const float kSGXPunch = .8f;
#define kSGDeploySound "weapons/sg-deploy.wav"
const int kSGBarrelLength = 25;
#define kSGSpread VECTOR_CONE_20DEGREES
#define kSGInnerSpread VECTOR_CONE_7DEGREES
// Heavy machine gun
const int kHMGRange = 6000;

View File

@ -210,7 +210,7 @@ void AvHSonicGun::FireProjectiles(void)
// Fire the bullets and apply damage
//this->m_pPlayer->FireBullets(kSGBulletsPerShot, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, 0, 0, theDamage);
this->m_pPlayer->FireBulletsPlayer(BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, theDamage);
this->m_pPlayer->FireBulletsPlayer(BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, theDamage, 0, this->m_pPlayer->random_seed);
}
bool AvHSonicGun::GetHasMuzzleFlash() const