Skip to content

Commit

Permalink
Blood: fixed messed up math in podAttack.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 9, 2024
1 parent f5d0841 commit f9e4ce8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/games/blood/src/aipod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,29 @@ void podAttack(int, DBloodActor* actor)
dv.X += Random2F(1000, 4);
dv.Y += Random2F(1000, 4);
double nDist = dv.XY().Length();
int nDist2 = int(nDist * 16) / 540; // truncation is important here.
DBloodActor* pMissile = nullptr;
switch (actor->spr.type)
{
case kDudePodGreen:
dv.Z += 31.25;
if (pDudeInfo->SeeDist() * 1.6 < nDist)
if (pDudeInfo->seeDist < nDist * 160)
{
if (Chance(0x8000))
sfxPlay3DSound(actor, 2474, -1, 0);
else
sfxPlay3DSound(actor, 2475, -1, 0);
pMissile = actFireThing(actor, 0., -500., dv.Z / 32768 - 0.22125, kThingPodGreenBall, nDist * (2048. / 64800));
pMissile = actFireThing(actor, 0., -31.25, dv.Z / 32768 - 0.22125, kThingPodGreenBall, nDist2 * (8. / 7.));
}
if (pMissile)
seqSpawn(68, pMissile, -1);
break;
case kDudePodFire:
dv.Z += 31.25;
if (pDudeInfo->SeeDist() * 1.6 < nDist)
if (pDudeInfo->seeDist < nDist * 160)
{
sfxPlay3DSound(actor, 2454, -1, 0);
pMissile = actFireThing(actor, 0., -500., dv.Z / 32768 - 0.22125, kThingPodFireBall, nDist * (2048. / 64800));
pMissile = actFireThing(actor, 0., -31.25, dv.Z / 32768 - 0.22125, kThingPodFireBall, nDist2 * (8. / 7.));
}
if (pMissile)
seqSpawn(22, pMissile, -1);
Expand Down

0 comments on commit f9e4ce8

Please sign in to comment.