From bef055e9751acdc6dc491945f3fc5dc541f260ba Mon Sep 17 00:00:00 2001 From: tankefugl Date: Thu, 21 Apr 2005 18:09:58 +0000 Subject: [PATCH] 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 --- dev/tankefugl/source/dlls/combat.cpp | 31 +++++++++++++------ .../source/mod/AvHMarineWeaponConstants.h | 1 + dev/tankefugl/source/mod/AvHSonicGun.cpp | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/dev/tankefugl/source/dlls/combat.cpp b/dev/tankefugl/source/dlls/combat.cpp index 8d20533..46ac8a6 100644 --- a/dev/tankefugl/source/dlls/combat.cpp +++ b/dev/tankefugl/source/dlls/combat.cpp @@ -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) ); } diff --git a/dev/tankefugl/source/mod/AvHMarineWeaponConstants.h b/dev/tankefugl/source/mod/AvHMarineWeaponConstants.h index de6d4bc..914ca07 100644 --- a/dev/tankefugl/source/mod/AvHMarineWeaponConstants.h +++ b/dev/tankefugl/source/mod/AvHMarineWeaponConstants.h @@ -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; diff --git a/dev/tankefugl/source/mod/AvHSonicGun.cpp b/dev/tankefugl/source/mod/AvHSonicGun.cpp index 931b77a..634b323 100644 --- a/dev/tankefugl/source/mod/AvHSonicGun.cpp +++ b/dev/tankefugl/source/mod/AvHSonicGun.cpp @@ -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