mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 05:20:43 +00:00
- floatified SeqAttackCallback
This commit is contained in:
parent
37ca106417
commit
1c23a2aa32
3 changed files with 20 additions and 15 deletions
|
@ -77,14 +77,14 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
|
|||
}
|
||||
|
||||
auto target = actor->GetTarget();
|
||||
int dx = bcos(actor->int_ang());
|
||||
int dy = bsin(actor->int_ang());
|
||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
int height = (actor->spr.yrepeat * pDudeInfo->eyeHeight) << 2;
|
||||
int height2 = (target->spr.yrepeat * pDudeInfoT->eyeHeight) << 2;
|
||||
actFireVector(actor, 0, 0, dx, dy, height2 - height, kVectorBoneelBite);
|
||||
double height = (actor->spr.yrepeat * pDudeInfo->eyeHeight) * REPEAT_SCALE;
|
||||
double height2 = (target->spr.yrepeat * pDudeInfoT->eyeHeight) * REPEAT_SCALE;
|
||||
DVector3 vect(actor->spr.angle.ToVector() * 1024, height2 - height);
|
||||
|
||||
actFireVector(actor, 0., 0., vect, kVectorBoneelBite);
|
||||
}
|
||||
|
||||
static void eelThinkTarget(DBloodActor* actor)
|
||||
|
|
|
@ -59,18 +59,17 @@ AISTATE tinycaleb139698 = { kAiStateOther, 8, -1, 120, NULL, aiMoveTurn, NULL, &
|
|||
|
||||
void SeqAttackCallback(int, DBloodActor* actor)
|
||||
{
|
||||
int dx = bcos(actor->int_ang());
|
||||
int dy = bsin(actor->int_ang());
|
||||
int dz = actor->dudeSlope;
|
||||
dx += Random2(1500);
|
||||
dy += Random2(1500);
|
||||
dz += Random2(1500);
|
||||
DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope / 16384.);
|
||||
vect.X += Random2F(1500, 4);
|
||||
vect.Y += Random2F(1500, 4);
|
||||
vect.Z += Random2F(1500, 8);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int r1 = Random3(500);
|
||||
int r2 = Random3(1000);
|
||||
int r3 = Random3(1000);
|
||||
actFireVector(actor, 0, 0, dx + r3, dy + r2, dz + r1, kVectorShell);
|
||||
double r1 = Random3F(500, 4);
|
||||
double r2 = Random3F(1000, 4);
|
||||
double r3 = Random3F(1000, 8);
|
||||
actFireVector(actor, 0, 0, vect + DVector3(r1, r2, r3), kVectorShell);
|
||||
}
|
||||
if (Chance(0x8000))
|
||||
sfxPlay3DSound(actor, 10000 + Random(5), -1, 0);
|
||||
|
|
|
@ -585,6 +585,12 @@ inline int Random3(int a1)
|
|||
return MulScale(wrand() + wrand(), a1, 15) - a1;
|
||||
}
|
||||
|
||||
inline double Random3F(int a1, int scale = 16)
|
||||
{
|
||||
return FixedToFloat(Random3(a1), scale);
|
||||
}
|
||||
|
||||
|
||||
inline unsigned int QRandom(int a1)
|
||||
{
|
||||
return MulScale(qrand(), a1, 15);
|
||||
|
|
Loading…
Reference in a new issue