- added DavidÜH's explicit angle submission for A_CustomBulletAttack function.

SVN r2452 (trunk)
This commit is contained in:
Christoph Oelckers 2010-07-24 06:15:07 +00:00
parent bc47f7133b
commit 58be666c9c
2 changed files with 16 additions and 2 deletions

View file

@ -825,6 +825,7 @@ enum CBA_Flags
{
CBAF_AIMFACING = 1,
CBAF_NORANDOM = 2,
CBAF_EXPLICITANGLE = 4,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
@ -856,8 +857,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
for (i=0 ; i<NumBullets ; i++)
{
int angle = bangle + pr_cabullet.Random2() * (Spread_XY / 255);
int slope = bslope + pr_cabullet.Random2() * (Spread_Z / 255);
int angle = bangle;
int slope = bslope;
if (Flags & CBAF_EXPLICITANGLE)
{
angle += Spread_XY;
slope += Spread_Z;
}
else
{
angle += pr_cwbullet.Random2() * (Spread_XY / 255);
slope += pr_cwbullet.Random2() * (Spread_Z / 255);
}
int damage = DamagePerBullet;
if (!(Flags & CBAF_NORANDOM))

View file

@ -8,6 +8,7 @@ const int CMF_CHECKTARGETDEAD = 8;
// Flags for A_CustomBulletAttack
const int CBAF_AIMFACING = 1;
const int CBAF_NORANDOM = 2;
const int CBAF_EXPLICITANGLE = 4;
// Flags for A_FireBullets
const int FBF_USEAMMO = 1;