mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- added a wrapper for VECTORDATA::maxDist
This commit is contained in:
parent
f0b9509503
commit
e52c311592
4 changed files with 14 additions and 11 deletions
|
@ -5908,7 +5908,7 @@ static void actCheckTraps()
|
|||
}
|
||||
pos += vec / 2;
|
||||
}
|
||||
gVectorData[kVectorTchernobogBurn].maxDist = actor->xspr.data1 << 9;
|
||||
gVectorData[kVectorTchernobogBurn].maxDist = actor->xspr.data1 << 9; // hacking static game data should be prohibited...
|
||||
actFireVector(actor, 0., 0., DVector3(actor->spr.angle.ToVector(), Random2F(0x8888) * 4), kVectorTchernobogBurn);
|
||||
}
|
||||
break;
|
||||
|
@ -6614,7 +6614,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
|||
dv /= dv.XY().Length();
|
||||
assert(vectorType >= 0 && vectorType < kVectorMax);
|
||||
const VECTORDATA* pVectorData = &gVectorData[vectorType];
|
||||
double nRange = pVectorData->maxDist * inttoworld;
|
||||
double nRange = pVectorData->fMaxDist();
|
||||
// The vector for hitscan must be longer than what we got here as long as it works with integers.
|
||||
int hit = VectorScan(shooter, offset, zoffset, dv, nRange, 1);
|
||||
if (hit == 3)
|
||||
|
@ -6742,7 +6742,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
|||
}
|
||||
if (Chance(pVectorData->fxChance))
|
||||
{
|
||||
double tt = gVectorData[19].maxDist * inttoworld;
|
||||
double tt = gVectorData[19].fMaxDist();
|
||||
dv.X += FixedToFloat<14>(Random3(4000)); // random messiness...
|
||||
dv.Y += FixedToFloat<14>(Random3(4000));
|
||||
dv.Z += FixedToFloat<14>(Random3(4000));
|
||||
|
|
|
@ -168,6 +168,8 @@ struct VECTORDATA {
|
|||
int bloodSplats; // blood splats
|
||||
int splatChance; // blood splat chance
|
||||
SURFHIT surfHit[15];
|
||||
|
||||
double fMaxDist() const { return maxDist * maptoworld; }
|
||||
};
|
||||
|
||||
extern const AMMOITEMDATA gAmmoItemData[];
|
||||
|
|
|
@ -608,7 +608,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
|
||||
}
|
||||
else if (dist <= meleeVector->maxDist * inttoworld)
|
||||
else if (dist <= meleeVector->fMaxDist())
|
||||
{
|
||||
|
||||
if (spriteIsUnderwater(actor, false))
|
||||
|
@ -645,7 +645,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
|
||||
if (weaponType == kGenDudeWeaponHitscan)
|
||||
{
|
||||
if ((vdist = gVectorData[curWeapon].maxDist * inttoworld) <= 0)
|
||||
if ((vdist = gVectorData[curWeapon].fMaxDist()) <= 0)
|
||||
vdist = mdist;
|
||||
|
||||
}
|
||||
|
@ -657,9 +657,9 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
aiSetTarget(actor, actor->spr.pos);
|
||||
return;
|
||||
}
|
||||
else if (actor->genDudeExtra.slaveCount > gGameOptions.nDifficulty || dist < meleeVector->maxDist * inttoworld)
|
||||
else if (actor->genDudeExtra.slaveCount > gGameOptions.nDifficulty || dist < meleeVector->fMaxDist())
|
||||
{
|
||||
if (dist <= meleeVector->maxDist * inttoworld)
|
||||
if (dist <= meleeVector->fMaxDist())
|
||||
{
|
||||
aiGenDudeNewState(actor, &genDudePunch);
|
||||
return;
|
||||
|
@ -696,7 +696,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
case kMissileFireballTchernobog:
|
||||
if (mdist == defDist) mdist = 3000/16.;
|
||||
if (dist > mdist || actor->xspr.locked == 1) break;
|
||||
else if (dist <= meleeVector->maxDist * inttoworld && Chance(0x9000))
|
||||
else if (dist <= meleeVector->fMaxDist() && Chance(0x9000))
|
||||
aiGenDudeNewState(actor, &genDudePunch);
|
||||
else if (state == 1) aiGenDudeNewState(actor, &genDudeChaseW);
|
||||
else if (state == 2) aiGenDudeNewState(actor, &genDudeChaseD);
|
||||
|
@ -708,14 +708,14 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
//viewSetSystemMessage("%d", target->xspr.burnTime);
|
||||
if (spriteIsUnderwater(actor, false))
|
||||
{
|
||||
if (dist > meleeVector->maxDist * inttoworld) aiGenDudeNewState(actor, &genDudeChaseW);
|
||||
if (dist > meleeVector->fMaxDist()) aiGenDudeNewState(actor, &genDudeChaseW);
|
||||
else if (Chance(0x8000)) aiGenDudeNewState(actor, &genDudePunch);
|
||||
else aiGenDudeNewState(actor, &genDudeDodgeShortW);
|
||||
return;
|
||||
}
|
||||
else if (dist <= 250 && target->xspr.burnTime >= 2000 && target->GetBurnSource() == actor)
|
||||
{
|
||||
if (dist > meleeVector->maxDist * inttoworld) aiGenDudeNewState(actor, &genDudeChaseL);
|
||||
if (dist > meleeVector->fMaxDist()) aiGenDudeNewState(actor, &genDudeChaseL);
|
||||
else aiGenDudeNewState(actor, &genDudePunch);
|
||||
return;
|
||||
}
|
||||
|
@ -2291,7 +2291,7 @@ bool genDudePrepare(DBloodActor* actor, int propId)
|
|||
pExtra->isMelee = false;
|
||||
if (pExtra->weaponType == kGenDudeWeaponKamikaze) pExtra->isMelee = true;
|
||||
else if (pExtra->weaponType == kGenDudeWeaponHitscan) {
|
||||
if (gVectorData[pExtra->curWeapon].maxDist > 0 && gVectorData[pExtra->curWeapon].maxDist <= kGenDudeMaxMeleeDist)
|
||||
if (gVectorData[pExtra->curWeapon].fMaxDist() > 0 && gVectorData[pExtra->curWeapon].fMaxDist() <= kGenDudeMaxMeleeDistf)
|
||||
pExtra->isMelee = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ enum
|
|||
kGenDudeTransformStatus = -222,
|
||||
kGenDudeUpdTimeRate = 10,
|
||||
kGenDudeMaxMeleeDist = 2048,
|
||||
kGenDudeMaxMeleeDistf = 128,
|
||||
kGenDudeMinDispesion = 200,
|
||||
kGenDudeMaxDispersion = 3500,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue