mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- Blood: Replace DBloodActor
zvel
with vel.Z
calls.
This commit is contained in:
parent
ce08fd4304
commit
22275a16f6
23 changed files with 186 additions and 187 deletions
|
@ -2387,7 +2387,7 @@ static void actInitThings()
|
|||
|
||||
act->spr.flags = thingInfo[nType].flags;
|
||||
if (act->spr.flags & kPhysGravity) act->spr.flags |= kPhysFalling;
|
||||
act->vel.X = act->vel.Y = act->zvel = 0;
|
||||
act->vel.X = act->vel.Y = act->vel.Z = 0;
|
||||
|
||||
switch (act->spr.type)
|
||||
{
|
||||
|
@ -2486,7 +2486,7 @@ static void actInitDudes()
|
|||
act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
||||
#endif
|
||||
|
||||
act->vel.X = act->vel.Y = act->zvel = 0;
|
||||
act->vel.X = act->vel.Y = act->vel.Z = 0;
|
||||
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
// add a way to set custom hp for every enemy - should work only if map just started and not loaded.
|
||||
|
@ -2576,7 +2576,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, int x, int y,
|
|||
int t = Scale(damage, size, mass);
|
||||
actor->vel.X += MulScale(t, dx, 16);
|
||||
actor->vel.Y += MulScale(t, dy, 16);
|
||||
actor->zvel += MulScale(t, dz, 16);
|
||||
actor->vel.Z += MulScale(t, dz, 16);
|
||||
}
|
||||
}
|
||||
actDamageSprite(source, actor, kDamageExplode, damage);
|
||||
|
@ -2724,7 +2724,7 @@ static void actNapalmMove(DBloodActor* actor)
|
|||
int ang = actor->spr.ang;
|
||||
actor->vel.X = 0;
|
||||
actor->vel.Y = 0;
|
||||
actor->zvel = 0;
|
||||
actor->vel.Z = 0;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int t1 = Random(0x33333) + 0x33333;
|
||||
|
@ -4100,7 +4100,7 @@ static void actKickObject(DBloodActor* kicker, DBloodActor* kicked)
|
|||
int nSpeed = ClipLow(approxDist(kicker->vel.X, kicker->vel.Y) * 2, 0xaaaaa);
|
||||
kicked->vel.X = MulScale(nSpeed, Cos(kicker->spr.ang + Random2(85)), 30);
|
||||
kicked->vel.Y = MulScale(nSpeed, Sin(kicker->spr.ang + Random2(85)), 30);
|
||||
kicked->zvel = MulScale(nSpeed, -0x2000, 14);
|
||||
kicked->vel.Z = MulScale(nSpeed, -0x2000, 14);
|
||||
kicked->spr.flags = 7;
|
||||
}
|
||||
|
||||
|
@ -4156,7 +4156,7 @@ static void checkCeilHit(DBloodActor* actor)
|
|||
auto actor2 = coll.actor();
|
||||
if (actor2 && actor2->hasX())
|
||||
{
|
||||
if ((actor2->spr.statnum == kStatThing || actor2->spr.statnum == kStatDude) && (actor->vel.X != 0 || actor->vel.Y != 0 || actor->zvel != 0))
|
||||
if ((actor2->spr.statnum == kStatThing || actor2->spr.statnum == kStatDude) && (actor->vel.X != 0 || actor->vel.Y != 0 || actor->vel.Z != 0))
|
||||
{
|
||||
if (actor2->spr.statnum == kStatThing)
|
||||
{
|
||||
|
@ -4516,7 +4516,7 @@ void actAirDrag(DBloodActor* actor, int a2)
|
|||
}
|
||||
actor->vel.X += MulScale(wind_x - actor->vel.X, a2, 16);
|
||||
actor->vel.Y += MulScale(wind_y - actor->vel.Y, a2, 16);
|
||||
actor->zvel -= MulScale(actor->zvel, a2, 16);
|
||||
actor->vel.Z -= MulScale(actor->vel.Z, a2, 16);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -4578,7 +4578,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
FindSector(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, &pSector);
|
||||
}
|
||||
|
||||
actor->spr.pos.Z += actor->zvel >> 8;
|
||||
actor->spr.pos.Z += actor->vel.Z >> 8;
|
||||
|
||||
int ceilZ, floorZ;
|
||||
Collision ceilColl, floorColl;
|
||||
|
@ -4588,7 +4588,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
if ((actor->spr.flags & 2) && bottom < floorZ)
|
||||
{
|
||||
actor->spr.pos.Z += 455;
|
||||
actor->zvel += 58254;
|
||||
actor->vel.Z += 58254;
|
||||
if (actor->spr.type == kThingZombieHead)
|
||||
{
|
||||
auto* fxActor = gFX.fxSpawnActor(FX_27, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
|
@ -4605,7 +4605,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
RotateVector(&v28, &v24, v34);
|
||||
fxActor->vel.X = actor->vel.X + v2c;
|
||||
fxActor->vel.Y = actor->vel.Y + v28;
|
||||
fxActor->zvel = actor->zvel + v24;
|
||||
fxActor->vel.Z = actor->vel.Z + v24;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4618,7 +4618,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
actor->hit.florhit = floorColl;
|
||||
actor->spr.pos.Z += floorZ - bottom;
|
||||
|
||||
int v20 = actor->zvel - actor->spr.sector()->velFloor;
|
||||
int v20 = actor->vel.Z - actor->spr.sector()->velFloor;
|
||||
if (v20 > 0)
|
||||
{
|
||||
|
||||
|
@ -4627,21 +4627,21 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
int nDamage = MulScale(vax, vax, 30) - pThingInfo->dmgResist;
|
||||
if (nDamage > 0) actDamageSprite(actor, actor, kDamageFall, nDamage);
|
||||
|
||||
actor->zvel = v20;
|
||||
if (actor->spr.sector()->velFloor == 0 && abs(actor->zvel) < 0x10000)
|
||||
actor->vel.Z = v20;
|
||||
if (actor->spr.sector()->velFloor == 0 && abs(actor->vel.Z) < 0x10000)
|
||||
{
|
||||
actor->zvel = 0;
|
||||
actor->vel.Z = 0;
|
||||
actor->spr.flags &= ~4;
|
||||
}
|
||||
|
||||
switch (actor->spr.type)
|
||||
{
|
||||
case kThingNapalmBall:
|
||||
if (actor->zvel == 0 || Chance(0xA000)) actNapalmMove(actor);
|
||||
if (actor->vel.Z == 0 || Chance(0xA000)) actNapalmMove(actor);
|
||||
break;
|
||||
|
||||
case kThingZombieHead:
|
||||
if (abs(actor->zvel) > 0x80000)
|
||||
if (abs(actor->vel.Z) > 0x80000)
|
||||
{
|
||||
sfxPlay3DSound(actor, 607, 0, 0);
|
||||
actDamageSprite(nullptr, actor, kDamageFall, 80);
|
||||
|
@ -4649,14 +4649,14 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
break;
|
||||
|
||||
case kThingKickablePail:
|
||||
if (abs(actor->zvel) > 0x80000)
|
||||
if (abs(actor->vel.Z) > 0x80000)
|
||||
sfxPlay3DSound(actor, 374, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
lhit.setSector(pSector);
|
||||
}
|
||||
else if (actor->zvel == 0)
|
||||
else if (actor->vel.Z == 0)
|
||||
|
||||
actor->spr.flags &= ~4;
|
||||
}
|
||||
|
@ -4672,16 +4672,16 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
{
|
||||
actor->hit.ceilhit = ceilColl;
|
||||
actor->spr.pos.Z += ClipLow(ceilZ - top, 0);
|
||||
if (actor->zvel < 0)
|
||||
if (actor->vel.Z < 0)
|
||||
{
|
||||
actor->vel.X = MulScale(actor->vel.X, 0xc000, 16);
|
||||
actor->vel.Y = MulScale(actor->vel.Y, 0xc000, 16);
|
||||
actor->zvel = MulScale(-actor->zvel, 0x4000, 16);
|
||||
actor->vel.Z = MulScale(-actor->vel.Z, 0x4000, 16);
|
||||
|
||||
switch (actor->spr.type)
|
||||
{
|
||||
case kThingZombieHead:
|
||||
if (abs(actor->zvel) > 0x80000)
|
||||
if (abs(actor->vel.Z) > 0x80000)
|
||||
{
|
||||
sfxPlay3DSound(actor, 607, 0, 0);
|
||||
actDamageSprite(nullptr, actor, kDamageFall, 80);
|
||||
|
@ -4689,7 +4689,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
break;
|
||||
|
||||
case kThingKickablePail:
|
||||
if (abs(actor->zvel) > 0x80000)
|
||||
if (abs(actor->vel.Z) > 0x80000)
|
||||
sfxPlay3DSound(actor, 374, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -4878,7 +4878,7 @@ void MoveDude(DBloodActor* actor)
|
|||
if (pUpperLink && (pUpperLink->spr.type == kMarkerUpWater || pUpperLink->spr.type == kMarkerUpGoo)) bDepth = 1;
|
||||
if (pLowerLink && (pLowerLink->spr.type == kMarkerLowWater || pLowerLink->spr.type == kMarkerLowGoo)) bDepth = 1;
|
||||
if (pPlayer) wd += 16;
|
||||
if (actor->zvel) actor->spr.pos.Z += actor->zvel >> 8;
|
||||
if (actor->vel.Z) actor->spr.pos.Z += actor->vel.Z >> 8;
|
||||
|
||||
int ceilZ, floorZ;
|
||||
Collision ceilColl, floorColl;
|
||||
|
@ -4915,10 +4915,10 @@ void MoveDude(DBloodActor* actor)
|
|||
if (vc)
|
||||
{
|
||||
actor->spr.pos.Z += ((vc * 4) / 2) >> 8;
|
||||
actor->zvel += vc;
|
||||
actor->vel.Z += vc;
|
||||
}
|
||||
}
|
||||
if (pPlayer && actor->zvel > 0x155555 && !pPlayer->fallScream && actor->xspr.height > 0)
|
||||
if (pPlayer && actor->vel.Z > 0x155555 && !pPlayer->fallScream && actor->xspr.height > 0)
|
||||
{
|
||||
const bool playerAlive = (actor->xspr.health > 0) || VanillaMode(); // only trigger falling scream if player is alive or vanilla mode
|
||||
if (playerAlive)
|
||||
|
@ -4953,7 +4953,7 @@ void MoveDude(DBloodActor* actor)
|
|||
pPlayer->bubbleTime = 0;
|
||||
if (!pPlayer->cantJump && (pPlayer->input.actions & SB_JUMP))
|
||||
{
|
||||
actor->zvel = -0x6aaaa;
|
||||
actor->vel.Z = -0x6aaaa;
|
||||
pPlayer->cantJump = 1;
|
||||
}
|
||||
sfxPlay3DSound(actor, 721, -1, 0);
|
||||
|
@ -5006,7 +5006,7 @@ void MoveDude(DBloodActor* actor)
|
|||
|
||||
pPlayer->posture = 1;
|
||||
actor->xspr.burnTime = 0;
|
||||
pPlayer->bubbleTime = abs(actor->zvel) >> 12;
|
||||
pPlayer->bubbleTime = abs(actor->vel.Z) >> 12;
|
||||
evPostActor(actor, 0, kCallbackPlayerBubble);
|
||||
sfxPlay3DSound(actor, 720, -1, 0);
|
||||
}
|
||||
|
@ -5106,7 +5106,7 @@ void MoveDude(DBloodActor* actor)
|
|||
{
|
||||
actor->hit.florhit = floorColl;
|
||||
actor->spr.pos.Z += floorZ - bottom;
|
||||
int v30 = actor->zvel - actor->spr.sector()->velFloor;
|
||||
int v30 = actor->vel.Z - actor->spr.sector()->velFloor;
|
||||
if (v30 > 0)
|
||||
{
|
||||
int vax = actFloorBounceVector((int*)&actor->vel.X, (int*)&actor->vel.Y, (int*)&v30, actor->spr.sector(), 0);
|
||||
|
@ -5123,10 +5123,10 @@ void MoveDude(DBloodActor* actor)
|
|||
nDamage -= 100 << 4;
|
||||
if (nDamage > 0)
|
||||
actDamageSprite(actor, actor, kDamageFall, nDamage);
|
||||
actor->zvel = v30;
|
||||
if (abs(actor->zvel) < 0x10000)
|
||||
actor->vel.Z = v30;
|
||||
if (abs(actor->vel.Z) < 0x10000)
|
||||
{
|
||||
actor->zvel = actor->spr.sector()->velFloor;
|
||||
actor->vel.Z = actor->spr.sector()->velFloor;
|
||||
actor->spr.flags &= ~4;
|
||||
}
|
||||
else
|
||||
|
@ -5149,7 +5149,7 @@ void MoveDude(DBloodActor* actor)
|
|||
{
|
||||
pFX2->vel.X = Random2(0x6aaaa);
|
||||
pFX2->vel.Y = Random2(0x6aaaa);
|
||||
pFX2->zvel = -(int)Random(0xd5555);
|
||||
pFX2->vel.Z = -(int)Random(0xd5555);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5157,7 +5157,7 @@ void MoveDude(DBloodActor* actor)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (actor->zvel == 0)
|
||||
else if (actor->vel.Z == 0)
|
||||
|
||||
actor->spr.flags &= ~4;
|
||||
}
|
||||
|
@ -5173,8 +5173,8 @@ void MoveDude(DBloodActor* actor)
|
|||
actor->hit.ceilhit = ceilColl;
|
||||
actor->spr.pos.Z += ClipLow(ceilZ - top, 0);
|
||||
|
||||
if (actor->zvel <= 0 && (actor->spr.flags & 4))
|
||||
actor->zvel = MulScale(-actor->zvel, 0x2000, 16);
|
||||
if (actor->vel.Z <= 0 && (actor->spr.flags & 4))
|
||||
actor->vel.Z = MulScale(-actor->vel.Z, 0x2000, 16);
|
||||
}
|
||||
else
|
||||
actor->hit.ceilhit.setNone();
|
||||
|
@ -5228,7 +5228,7 @@ int MoveMissile(DBloodActor* actor)
|
|||
gHitInfo.clearObj();
|
||||
if (actor->spr.type == kMissileFlameSpray) actAirDrag(actor, 0x1000);
|
||||
|
||||
if (actor->GetTarget() != nullptr && (actor->vel.X || actor->vel.Y || actor->zvel))
|
||||
if (actor->GetTarget() != nullptr && (actor->vel.X || actor->vel.Y || actor->vel.Z))
|
||||
{
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -5244,12 +5244,12 @@ int MoveMissile(DBloodActor* actor)
|
|||
|
||||
int deltaz = dz / 10;
|
||||
if (target->spr.pos.Z < actor->spr.pos.Z) deltaz = -deltaz;
|
||||
actor->zvel += deltaz;
|
||||
actor->vel.Z += deltaz;
|
||||
}
|
||||
}
|
||||
int vx = actor->vel.X >> 12;
|
||||
int vy = actor->vel.Y >> 12;
|
||||
int vz = actor->zvel >> 8;
|
||||
int vz = actor->vel.Z >> 8;
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
int i = 1;
|
||||
|
@ -5318,7 +5318,7 @@ int MoveMissile(DBloodActor* actor)
|
|||
pos.X -= MulScale(Cos(nAngle), 16, 30);
|
||||
pos.Y -= MulScale(Sin(nAngle), 16, 30);
|
||||
int nVel = approxDist(actor->vel.X, actor->vel.Y);
|
||||
vz -= Scale(0x100, actor->zvel, nVel);
|
||||
vz -= Scale(0x100, actor->vel.Z, nVel);
|
||||
updatesector(pos.X, pos.Y, &pSector);
|
||||
pSector2 = pSector;
|
||||
}
|
||||
|
@ -5499,7 +5499,7 @@ void actExplodeSprite(DBloodActor* actor)
|
|||
GibSprite(actor, GIBTYPE_5, nullptr, nullptr);
|
||||
break;
|
||||
}
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
actPostSprite(actor, kStatExplosion);
|
||||
actor->spr.xrepeat = actor->spr.yrepeat = explodeInfo[nType].repeat;
|
||||
|
||||
|
@ -5691,7 +5691,7 @@ static void actCheckThings()
|
|||
actAirDrag(actor, 128);
|
||||
|
||||
if (((actor->GetIndex() >> 8) & 15) == (gFrameCount & 15) && (actor->spr.flags & 2)) actor->spr.flags |= 4;
|
||||
if ((actor->spr.flags & 4) || actor->vel.X || actor->vel.Y || actor->zvel || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
|
||||
if ((actor->spr.flags & 4) || actor->vel.X || actor->vel.Y || actor->vel.Z || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
|
||||
{
|
||||
Collision hit = MoveThing(actor);
|
||||
if (hit.type)
|
||||
|
@ -5959,7 +5959,7 @@ static void actCheckTraps()
|
|||
{
|
||||
pFX->vel.X = dx + Random2(0x8888);
|
||||
pFX->vel.Y = dy + Random2(0x8888);
|
||||
pFX->zvel = Random2(0x8888);
|
||||
pFX->vel.Z = Random2(0x8888);
|
||||
}
|
||||
x += (dx / 2) >> 12;
|
||||
y += (dy / 2) >> 12;
|
||||
|
@ -6118,7 +6118,7 @@ static void actCheckDudes()
|
|||
if (pXSector && pXSector->Underwater) actAirDrag(actor, 5376);
|
||||
else actAirDrag(actor, 128);
|
||||
|
||||
if ((actor->spr.flags & 4) || actor->vel.X || actor->vel.Y || actor->zvel || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
|
||||
if ((actor->spr.flags & 4) || actor->vel.X || actor->vel.Y || actor->vel.Z || actor->spr.sector()->velFloor || actor->spr.sector()->velCeil)
|
||||
MoveDude(actor);
|
||||
}
|
||||
}
|
||||
|
@ -6154,7 +6154,7 @@ void actCheckFlares()
|
|||
SetActor(actor, &pos);
|
||||
actor->vel.X = target->vel.X;
|
||||
actor->vel.Y = target->vel.Y;
|
||||
actor->zvel = target->zvel;
|
||||
actor->vel.Z = target->vel.Z;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6225,7 +6225,7 @@ DBloodActor* actSpawnSprite(DBloodActor* source, int nStat)
|
|||
actor->spr.pos.Z = source->spr.pos.Z;
|
||||
actor->vel.X = source->vel.X;
|
||||
actor->vel.Y = source->vel.Y;
|
||||
actor->zvel = source->zvel;
|
||||
actor->vel.Z = source->vel.Z;
|
||||
actor->spr.flags = 0;
|
||||
actor->addX();
|
||||
actor->hit.florhit.setNone();
|
||||
|
@ -6421,10 +6421,10 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT
|
|||
fired->spr.ang = actor->spr.ang;
|
||||
fired->vel.X = MulScale(a6, Cos(fired->spr.ang), 30);
|
||||
fired->vel.Y = MulScale(a6, Sin(fired->spr.ang), 30);
|
||||
fired->zvel = MulScale(a6, a4, 14);
|
||||
fired->vel.Z = MulScale(a6, a4, 14);
|
||||
fired->vel.X += actor->vel.X / 2;
|
||||
fired->vel.Y += actor->vel.Y / 2;
|
||||
fired->zvel += actor->zvel / 2;
|
||||
fired->vel.Z += actor->vel.Z / 2;
|
||||
return fired;
|
||||
}
|
||||
|
||||
|
@ -6469,7 +6469,7 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
|
|||
seqSpawn(27, spawned, -1);
|
||||
spawned->vel.X += actor->vel.X / 2 + Random2(0x11111);
|
||||
spawned->vel.Y += actor->vel.Y / 2 + Random2(0x11111);
|
||||
spawned->zvel += actor->zvel / 2 + Random2(0x11111);
|
||||
spawned->vel.Z += actor->vel.Z / 2 + Random2(0x11111);
|
||||
break;
|
||||
case kMissileFireballCerberus:
|
||||
seqSpawn(61, spawned, dword_2192E0);
|
||||
|
@ -6479,14 +6479,14 @@ void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
|
|||
seqSpawn(23, spawned, dword_2192D8);
|
||||
spawned->vel.X += actor->vel.X / 2 + Random2(0x11111);
|
||||
spawned->vel.Y += actor->vel.Y / 2 + Random2(0x11111);
|
||||
spawned->zvel += actor->zvel / 2 + Random2(0x11111);
|
||||
spawned->vel.Z += actor->vel.Z / 2 + Random2(0x11111);
|
||||
break;
|
||||
case kMissileFlameSpray:
|
||||
if (Chance(0x8000)) seqSpawn(0, spawned, -1);
|
||||
else seqSpawn(1, spawned, -1);
|
||||
spawned->vel.X += actor->vel.X / 2 + Random2(0x11111);
|
||||
spawned->vel.Y += actor->vel.Y / 2 + Random2(0x11111);
|
||||
spawned->zvel += actor->zvel / 2 + Random2(0x11111);
|
||||
spawned->vel.Z += actor->vel.Z / 2 + Random2(0x11111);
|
||||
break;
|
||||
case kMissileFlareAlt:
|
||||
evPostActor(spawned, 30, kCallbackFXFlareBurst);
|
||||
|
@ -6553,7 +6553,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5,
|
|||
spawned->spr.ang = (actor->spr.ang + pMissileInfo->angleOfs) & 2047;
|
||||
spawned->vel.X = MulScale(pMissileInfo->velocity, a4, 14);
|
||||
spawned->vel.Y = MulScale(pMissileInfo->velocity, a5, 14);
|
||||
spawned->zvel = MulScale(pMissileInfo->velocity, a6, 14);
|
||||
spawned->vel.Z = MulScale(pMissileInfo->velocity, a6, 14);
|
||||
spawned->SetOwner(actor);
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK;
|
||||
spawned->SetTarget(nullptr);
|
||||
|
@ -6789,7 +6789,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
|
|||
int t2 = DivScale(pVectorData->impulse, t, 8);
|
||||
actor->vel.X += MulScale(a4, t2, 16);
|
||||
actor->vel.Y += MulScale(a5, t2, 16);
|
||||
actor->zvel += MulScale(a6, t2, 16);
|
||||
actor->vel.Z += MulScale(a6, t2, 16);
|
||||
}
|
||||
if (pVectorData->burnTime)
|
||||
{
|
||||
|
@ -6819,7 +6819,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
|
|||
int t2 = DivScale(pVectorData->impulse, t, 8);
|
||||
actor->vel.X += MulScale(a4, t2, 16);
|
||||
actor->vel.Y += MulScale(a5, t2, 16);
|
||||
actor->zvel += MulScale(a6, t2, 16);
|
||||
actor->vel.Z += MulScale(a6, t2, 16);
|
||||
}
|
||||
if (pVectorData->burnTime)
|
||||
{
|
||||
|
@ -6853,7 +6853,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
|
|||
else if (t3 > FX_NONE) pFX = gFX.fxSpawnActor(t3, pSector, x, y, z, 0);
|
||||
if (pFX)
|
||||
{
|
||||
pFX->zvel = 0x2222;
|
||||
pFX->vel.Z = 0x2222;
|
||||
pFX->spr.ang = (GetWallAngle(pWall) + 512) & 2047;
|
||||
pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
}
|
||||
|
@ -6877,7 +6877,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
|
|||
int impulse = DivScale(pVectorData->impulse, ClipLow(actor->spriteMass.mass, 10), 6);
|
||||
actor->vel.X += MulScale(a4, impulse, 16);
|
||||
actor->vel.Y += MulScale(a5, impulse, 16);
|
||||
actor->zvel += MulScale(a6, impulse, 16);
|
||||
actor->vel.Z += MulScale(a6, impulse, 16);
|
||||
|
||||
if (pVectorData->burnTime != 0) {
|
||||
if (!actor->xspr.burnTime) evPostActor(actor, 0, kCallbackFXFlameLick);
|
||||
|
@ -6946,7 +6946,7 @@ void FireballSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
pFX->vel.X = actor->vel.X;
|
||||
pFX->vel.Y = actor->vel.Y;
|
||||
pFX->zvel = actor->zvel;
|
||||
pFX->vel.Z = actor->vel.Z;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6957,7 +6957,7 @@ void NapalmSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
pFX->vel.X = actor->vel.X;
|
||||
pFX->vel.Y = actor->vel.Y;
|
||||
pFX->zvel = actor->zvel;
|
||||
pFX->vel.Z = actor->vel.Z;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6968,7 +6968,7 @@ void Fx32Callback(int, DBloodActor* actor)
|
|||
{
|
||||
pFX->vel.X = actor->vel.X;
|
||||
pFX->vel.Y = actor->vel.Y;
|
||||
pFX->zvel = actor->zvel;
|
||||
pFX->vel.Z = actor->vel.Z;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6979,7 +6979,7 @@ void Fx33Callback(int, DBloodActor* actor)
|
|||
{
|
||||
pFX->vel.X = actor->vel.X;
|
||||
pFX->vel.Y = actor->vel.Y;
|
||||
pFX->zvel = actor->zvel;
|
||||
pFX->vel.Z = actor->vel.Z;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ static void batMoveDodgeUp(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -0x52aaa;
|
||||
actor->vel.Z = -0x52aaa;
|
||||
}
|
||||
|
||||
static void batMoveDodgeDown(DBloodActor* actor)
|
||||
|
@ -245,7 +245,7 @@ static void batMoveDodgeDown(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
}
|
||||
|
||||
static void batThinkChase(DBloodActor* actor)
|
||||
|
@ -365,7 +365,7 @@ static void batMoveSwoop(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
}
|
||||
|
||||
static void batMoveFly(DBloodActor* actor)
|
||||
|
@ -395,7 +395,7 @@ static void batMoveFly(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -0x2d555;
|
||||
actor->vel.Z = -0x2d555;
|
||||
}
|
||||
|
||||
void batMoveToCeil(DBloodActor* actor)
|
||||
|
|
|
@ -475,7 +475,7 @@ static void sub_62AE0(DBloodActor* actor)
|
|||
t1 += nAccel;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -dz;
|
||||
actor->vel.Z = -dz;
|
||||
}
|
||||
|
||||
static void sub_62D7C(DBloodActor* actor)
|
||||
|
@ -510,7 +510,7 @@ static void sub_62D7C(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = dz;
|
||||
actor->vel.Z = dz;
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -234,7 +234,7 @@ static void eelMoveDodgeUp(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -0x8000;
|
||||
actor->vel.Z = -0x8000;
|
||||
}
|
||||
|
||||
static void eelMoveDodgeDown(DBloodActor* actor)
|
||||
|
@ -259,7 +259,7 @@ static void eelMoveDodgeDown(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
}
|
||||
|
||||
static void eelThinkChase(DBloodActor* actor)
|
||||
|
@ -372,7 +372,7 @@ static void eelMoveSwoop(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = 0x22222;
|
||||
actor->vel.Z = 0x22222;
|
||||
}
|
||||
|
||||
static void eelMoveAscend(DBloodActor* actor)
|
||||
|
@ -399,7 +399,7 @@ static void eelMoveAscend(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -0x8000;
|
||||
actor->vel.Z = -0x8000;
|
||||
}
|
||||
|
||||
void eelMoveToCeil(DBloodActor* actor)
|
||||
|
|
|
@ -334,7 +334,7 @@ static void sub_65F44(DBloodActor* actor)
|
|||
t1 += nAccel;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -dz;
|
||||
actor->vel.Z = -dz;
|
||||
}
|
||||
|
||||
static void sub_661E0(DBloodActor* actor)
|
||||
|
@ -370,7 +370,7 @@ static void sub_661E0(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = dz;
|
||||
actor->vel.Z = dz;
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -102,7 +102,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
int t = DivScale(nDist, tt1.at10, 12);
|
||||
x2 += (actor2->vel.X * t) >> 12;
|
||||
y2 += (actor2->vel.Y * t) >> 12;
|
||||
z2 += (actor2->zvel * t) >> 8;
|
||||
z2 += (actor2->vel.Z * t) >> 8;
|
||||
}
|
||||
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
|
||||
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
|
||||
|
@ -179,7 +179,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
|||
int t = DivScale(nDist, tt1.at10, 12);
|
||||
x2 += (actor->vel.X * t) >> 12;
|
||||
y2 += (actor->vel.Y * t) >> 12;
|
||||
z2 += (actor->zvel * t) >> 8;
|
||||
z2 += (actor->vel.Z * t) >> 8;
|
||||
}
|
||||
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
|
||||
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
|
||||
|
|
|
@ -131,7 +131,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
int t = DivScale(nDist, tt.at10, 12);
|
||||
x2 += (actor->vel.X * t) >> 12;
|
||||
y2 += (actor->vel.Y * t) >> 12;
|
||||
z2 += (actor->zvel * t) >> 8;
|
||||
z2 += (actor->vel.Z * t) >> 8;
|
||||
}
|
||||
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
|
||||
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
|
||||
|
@ -296,7 +296,7 @@ static void gargMoveDodgeUp(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -0x1d555;
|
||||
actor->vel.Z = -0x1d555;
|
||||
}
|
||||
|
||||
static void gargMoveDodgeDown(DBloodActor* actor)
|
||||
|
@ -324,7 +324,7 @@ static void gargMoveDodgeDown(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
}
|
||||
|
||||
static void gargThinkChase(DBloodActor* actor)
|
||||
|
@ -584,10 +584,10 @@ static void gargMoveSlow(DBloodActor* actor)
|
|||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
switch (actor->spr.type) {
|
||||
case kDudeGargoyleFlesh:
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
break;
|
||||
case kDudeGargoyleStone:
|
||||
actor->zvel = 0x35555;
|
||||
actor->vel.Z = 0x35555;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -624,10 +624,10 @@ static void gargMoveSwoop(DBloodActor* actor)
|
|||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
switch (actor->spr.type) {
|
||||
case kDudeGargoyleFlesh:
|
||||
actor->zvel = t1;
|
||||
actor->vel.Z = t1;
|
||||
break;
|
||||
case kDudeGargoyleStone:
|
||||
actor->zvel = t1;
|
||||
actor->vel.Z = t1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -664,10 +664,10 @@ static void gargMoveFly(DBloodActor* actor)
|
|||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
switch (actor->spr.type) {
|
||||
case kDudeGargoyleFlesh:
|
||||
actor->zvel = -t1;
|
||||
actor->vel.Z = -t1;
|
||||
break;
|
||||
case kDudeGargoyleStone:
|
||||
actor->zvel = -t1;
|
||||
actor->vel.Z = -t1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
int t = DivScale(nDist, tt.at10, 12);
|
||||
x2 += (actor->vel.X * t) >> 12;
|
||||
y2 += (actor->vel.Y * t) >> 12;
|
||||
z2 += (actor->zvel * t) >> 8;
|
||||
z2 += (actor->vel.Z * t) >> 8;
|
||||
}
|
||||
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
|
||||
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
|
||||
|
@ -275,7 +275,7 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -0x1d555;
|
||||
actor->vel.Z = -0x1d555;
|
||||
}
|
||||
|
||||
static void ghostMoveDodgeDown(DBloodActor* actor)
|
||||
|
@ -303,7 +303,7 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
|
|||
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
}
|
||||
|
||||
static void ghostThinkChase(DBloodActor* actor)
|
||||
|
@ -480,7 +480,7 @@ static void ghostMoveSlow(DBloodActor* actor)
|
|||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
switch (actor->spr.type) {
|
||||
case kDudePhantasm:
|
||||
actor->zvel = 0x44444;
|
||||
actor->vel.Z = 0x44444;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ static void ghostMoveSwoop(DBloodActor* actor)
|
|||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
switch (actor->spr.type) {
|
||||
case kDudePhantasm:
|
||||
actor->zvel = t1;
|
||||
actor->vel.Z = t1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -554,7 +554,7 @@ static void ghostMoveFly(DBloodActor* actor)
|
|||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
switch (actor->spr.type) {
|
||||
case kDudePhantasm:
|
||||
actor->zvel = -t1;
|
||||
actor->vel.Z = -t1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ static void sub_6CD74(DBloodActor* actor)
|
|||
t1 += nAccel;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = -dz;
|
||||
actor->vel.Z = -dz;
|
||||
}
|
||||
|
||||
static void sub_6D03C(DBloodActor* actor)
|
||||
|
@ -360,7 +360,7 @@ static void sub_6D03C(DBloodActor* actor)
|
|||
t1 += nAccel >> 1;
|
||||
actor->vel.X = DMulScale(t1, nCos, t2, nSin, 30);
|
||||
actor->vel.Y = DMulScale(t1, nSin, -t2, nCos, 30);
|
||||
actor->zvel = dz;
|
||||
actor->vel.Z = dz;
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -123,7 +123,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor)
|
|||
case kDudeSpiderBlack:
|
||||
actor->vel.X = IntToFixed(dx);
|
||||
actor->vel.Y = IntToFixed(dy);
|
||||
actor->zvel = IntToFixed(dz);
|
||||
actor->vel.Z = IntToFixed(dz);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ void sub_71BD4(int, DBloodActor* actor)
|
|||
int t = DivScale(nDist, tt.at10, 12);
|
||||
x2 += (actor->vel.X * t) >> 12;
|
||||
y2 += (actor->vel.Y * t) >> 12;
|
||||
z2 += (actor->zvel * t) >> 8;
|
||||
z2 += (actor->vel.Z * t) >> 8;
|
||||
}
|
||||
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
|
||||
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
|
||||
|
@ -158,7 +158,7 @@ void sub_720AC(int, DBloodActor* actor)
|
|||
int t = DivScale(nDist, tt.at10, 12);
|
||||
x2 += (actor->vel.X * t) >> 12;
|
||||
y2 += (actor->vel.Y * t) >> 12;
|
||||
z2 += (actor->zvel * t) >> 8;
|
||||
z2 += (actor->vel.Z * t) >> 8;
|
||||
}
|
||||
int tx = x + MulScale(Cos(actor->spr.ang), nDist, 30);
|
||||
int ty = y + MulScale(Sin(actor->spr.ang), nDist, 30);
|
||||
|
|
|
@ -728,7 +728,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
const EXPLOSION* pExpl = &explodeInfo[nType];
|
||||
if (CheckProximity(actor, target->spr.pos.X, target->spr.pos.Y, target->spr.pos.Z, target->spr.sector(), pExpl->radius >> 1))
|
||||
{
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
if (doExplosion(actor, nType) && actor->xspr.health > 0)
|
||||
actDamageSprite(actor, actor, kDamageExplode, 65535);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ class DBloodActor : public DCoreActor
|
|||
public:
|
||||
int dudeSlope;
|
||||
vec3_t vel;
|
||||
int zvel;
|
||||
bool hasx;
|
||||
XSPRITE xspr;
|
||||
SPRITEHIT hit;
|
||||
|
|
|
@ -55,7 +55,7 @@ void fxFlameLick(DBloodActor* actor, sectortype*) // 0
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(-dx);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(-dy);
|
||||
pFX->zvel = actor->zvel - Random(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z - Random(0x1aaaa);
|
||||
}
|
||||
}
|
||||
if (actor->xspr.burnTime > 0)
|
||||
|
@ -110,7 +110,7 @@ void FlareBurst(DBloodActor* actor, sectortype*) // 2
|
|||
RotateVector(&dx, &dy, nAngle);
|
||||
spawnedactor->vel.X += dx;
|
||||
spawnedactor->vel.Y += dy;
|
||||
spawnedactor->zvel += dz;
|
||||
spawnedactor->vel.Z += dz;
|
||||
evPostActor(spawnedactor, 960, kCallbackRemove);
|
||||
}
|
||||
evPostActor(actor, 0, kCallbackRemove);
|
||||
|
@ -130,7 +130,7 @@ void fxFlareSpark(DBloodActor* actor, sectortype*) // 3
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
|
||||
pFX->zvel = actor->zvel - Random(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z - Random(0x1aaaa);
|
||||
}
|
||||
evPostActor(actor, 4, kCallbackFXFlareSpark);
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ void fxFlareSparkLite(DBloodActor* actor, sectortype*) // 4
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
|
||||
pFX->zvel = actor->zvel - Random(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z - Random(0x1aaaa);
|
||||
}
|
||||
evPostActor(actor, 12, kCallbackFXFlareSparkLite);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ void fxZombieBloodSpurt(DBloodActor* actor, sectortype*) // 5
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x11111);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x11111);
|
||||
pFX->zvel = actor->zvel - 0x6aaaa;
|
||||
pFX->vel.Z = actor->vel.Z - 0x6aaaa;
|
||||
}
|
||||
if (actor->xspr.data1 > 0)
|
||||
{
|
||||
|
@ -201,7 +201,7 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6
|
|||
pFX->spr.ang = 0;
|
||||
pFX->vel.X = actor->vel.X >> 8;
|
||||
pFX->vel.Y = actor->vel.Y >> 8;
|
||||
pFX->zvel = actor->zvel >> 8;
|
||||
pFX->vel.Z = actor->vel.Z >> 8;
|
||||
}
|
||||
evPostActor(actor, 6, kCallbackFXBloodSpurt);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ void fxArcSpark(DBloodActor* actor, sectortype*) // 7
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x10000);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x10000);
|
||||
pFX->zvel = actor->zvel - Random(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z - Random(0x1aaaa);
|
||||
}
|
||||
evPostActor(actor, 3, kCallbackFXArcSpark);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void fxArcSpark(DBloodActor* actor, sectortype*) // 7
|
|||
void fxDynPuff(DBloodActor* actor, sectortype*) // 8
|
||||
{
|
||||
if (!actor) return;
|
||||
if (actor->zvel)
|
||||
if (actor->vel.Z)
|
||||
{
|
||||
int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 2;
|
||||
int x = actor->spr.pos.X + MulScale(nDist, Cos(actor->spr.ang - 512), 30);
|
||||
|
@ -245,7 +245,7 @@ void fxDynPuff(DBloodActor* actor, sectortype*) // 8
|
|||
{
|
||||
pFX->vel.X = actor->vel.X;
|
||||
pFX->vel.Y = actor->vel.Y;
|
||||
pFX->zvel = actor->zvel;
|
||||
pFX->vel.Z = actor->vel.Z;
|
||||
}
|
||||
}
|
||||
evPostActor(actor, 12, kCallbackFXDynPuff);
|
||||
|
@ -291,7 +291,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9
|
|||
actor->spr.type = actor->spr.inittype;
|
||||
actor->SetOwner(nullptr);
|
||||
actor->spr.flags &= ~kHitagRespawn;
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
actor->xspr.respawnPending = 0;
|
||||
actor->xspr.burnTime = 0;
|
||||
actor->xspr.isTriggered = 0;
|
||||
|
@ -369,7 +369,7 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
|
||||
pFX->zvel = actor->zvel + Random2(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z + Random2(0x1aaaa);
|
||||
}
|
||||
}
|
||||
evPostActor(actor, 4, kCallbackPlayerBubble);
|
||||
|
@ -387,7 +387,7 @@ void EnemyBubble(DBloodActor* actor, sectortype*) // 11
|
|||
if (!actor) return;
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
for (int i = 0; i < (abs(actor->zvel) >> 18); i++)
|
||||
for (int i = 0; i < (abs(actor->vel.Z) >> 18); i++)
|
||||
{
|
||||
int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 2;
|
||||
int nAngle = Random(2048);
|
||||
|
@ -399,7 +399,7 @@ void EnemyBubble(DBloodActor* actor, sectortype*) // 11
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
|
||||
pFX->zvel = actor->zvel + Random2(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z + Random2(0x1aaaa);
|
||||
}
|
||||
}
|
||||
evPostActor(actor, 4, kCallbackEnemeyBubble);
|
||||
|
@ -496,7 +496,7 @@ void fxTeslaAlt(DBloodActor* actor, sectortype*) // 15
|
|||
{
|
||||
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
|
||||
pFX->zvel = actor->zvel - Random(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z - Random(0x1aaaa);
|
||||
}
|
||||
evPostActor(actor, 3, kCallbackFXTeslaAlt);
|
||||
}
|
||||
|
@ -521,13 +521,13 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16
|
|||
int top, bottom; GetActorExtents(actor, &top, &bottom);
|
||||
actor->spr.pos.Z += floorZ - bottom;
|
||||
|
||||
int zv = actor->zvel - actor->spr.sector()->velFloor;
|
||||
int zv = actor->vel.Z - actor->spr.sector()->velFloor;
|
||||
|
||||
if (actor->zvel == 0) sleeveStopBouncing(actor);
|
||||
if (actor->vel.Z == 0) sleeveStopBouncing(actor);
|
||||
else if (zv > 0) {
|
||||
actFloorBounceVector((int*)&actor->vel.X, (int*)&actor->vel.Y, &zv, actor->spr.sector(), 0x9000);
|
||||
actor->zvel = zv;
|
||||
if (actor->spr.sector()->velFloor == 0 && abs(actor->zvel) < 0x20000) {
|
||||
actor->vel.Z = zv;
|
||||
if (actor->spr.sector()->velFloor == 0 && abs(actor->vel.Z) < 0x20000) {
|
||||
sleeveStopBouncing(actor);
|
||||
return;
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16
|
|||
|
||||
void sleeveStopBouncing(DBloodActor* actor)
|
||||
{
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
if (actor->hasX()) seqKill(actor);
|
||||
sfxKill3DSound(actor, -1, -1);
|
||||
|
||||
|
@ -628,7 +628,7 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18
|
|||
pFX->spr.ang = 0;
|
||||
pFX->vel.X = actor->vel.X >> 8;
|
||||
pFX->vel.Y = actor->vel.Y >> 8;
|
||||
pFX->zvel = actor->zvel >> 8;
|
||||
pFX->vel.Z = actor->vel.Z >> 8;
|
||||
}
|
||||
evPostActor(actor, 6, kCallbackFXPodBloodSpray);
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ???
|
|||
actor->spr.ang = actor2->spr.ang;
|
||||
ChangeActorSect(actor, actor2->spr.sector());
|
||||
sfxPlay3DSound(actor2, 201, -1, 0);
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
viewBackupSpriteLoc(actor);
|
||||
if (pPlayer)
|
||||
{
|
||||
|
|
|
@ -210,7 +210,7 @@ void CFX::fxProcess(void)
|
|||
actAirDrag(actor, pFXData->drag);
|
||||
actor->spr.pos.X += actor->vel.X >> 12;
|
||||
actor->spr.pos.Y += actor->vel.Y >> 12;
|
||||
actor->spr.pos.Z += actor->zvel >> 8;
|
||||
actor->spr.pos.Z += actor->vel.Z >> 8;
|
||||
// Weird...
|
||||
if (actor->vel.X || (actor->vel.Y && actor->spr.pos.Z >= actor->spr.sector()->floorz))
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ void CFX::fxProcess(void)
|
|||
ChangeActorSect(actor, pSector);
|
||||
}
|
||||
}
|
||||
if (actor->vel.X || actor->vel.Y || actor->zvel)
|
||||
if (actor->vel.X || actor->vel.Y || actor->vel.Z)
|
||||
{
|
||||
int32_t floorZ, ceilZ;
|
||||
getzsofslopeptr(pSector, actor->spr.pos.X, actor->spr.pos.Y, &ceilZ, &floorZ);
|
||||
|
@ -256,7 +256,7 @@ void CFX::fxProcess(void)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
actor->zvel += pFXData->gravity;
|
||||
actor->vel.Z += pFXData->gravity;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ void fxSpawnBlood(DBloodActor* actor, int)
|
|||
bloodactor->spr.ang = 1024;
|
||||
bloodactor->vel.X = Random2(0x6aaaa);
|
||||
bloodactor->vel.Y = Random2(0x6aaaa);
|
||||
bloodactor->zvel = -(int)Random(0x10aaaa) - 100;
|
||||
bloodactor->vel.Z = -(int)Random(0x10aaaa) - 100;
|
||||
evPostActor(bloodactor, 8, kCallbackFXBloodSpurt);
|
||||
}
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
|
|||
spawnactor->spr.ang = 1024;
|
||||
spawnactor->vel.X = Random2(0x6aaaa);
|
||||
spawnactor->vel.Y = Random2(0x6aaaa);
|
||||
spawnactor->zvel = -(int)Random(0x10aaaa) - 100;
|
||||
spawnactor->vel.Z = -(int)Random(0x10aaaa) - 100;
|
||||
evPostActor(spawnactor, 8, kCallbackFXPodBloodSpray);
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4)
|
|||
int nAngle = actor->spr.ang + Random2(56) + 512;
|
||||
pBrass->vel.X = MulScale(nDist, Cos(nAngle), 30);
|
||||
pBrass->vel.Y = MulScale(nDist, Sin(nAngle), 30);
|
||||
pBrass->zvel = actor->zvel - (0x20000 + (Random2(40) << 18) / 120);
|
||||
pBrass->vel.Z = actor->vel.Z - (0x20000 + (Random2(40) << 18) / 120);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@ void fxSpawnEjectingShell(DBloodActor* actor, int z, int a3, int a4)
|
|||
int nAngle = actor->spr.ang + Random2(56) + 512;
|
||||
pShell->vel.X = MulScale(nDist, Cos(nAngle), 30);
|
||||
pShell->vel.Y = MulScale(nDist, Sin(nAngle), 30);
|
||||
pShell->zvel = actor->zvel - (0x20000 + (Random2(20) << 18) / 120);
|
||||
pShell->vel.Z = actor->vel.Z - (0x20000 + (Random2(20) << 18) / 120);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ void GibFX(DBloodActor* actor, GIBFX* pGFX, CGibPosition* pPos, CGibVelocity* pV
|
|||
{
|
||||
pFX->vel.X = pVel->vx + Random2(pGFX->atd);
|
||||
pFX->vel.Y = pVel->vy + Random2(pGFX->atd);
|
||||
pFX->zvel = pVel->vz - Random(pGFX->at11);
|
||||
pFX->vel.Z = pVel->vz - Random(pGFX->at11);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -311,23 +311,23 @@ void GibFX(DBloodActor* actor, GIBFX* pGFX, CGibPosition* pPos, CGibVelocity* pV
|
|||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 16:
|
||||
pFX->zvel = Random2((pGFX->at11 << 18) / 120);
|
||||
pFX->vel.Z = Random2((pGFX->at11 << 18) / 120);
|
||||
break;
|
||||
default:
|
||||
if (dz2 < dz1 && dz2 < 0x4000)
|
||||
{
|
||||
pFX->zvel = 0;
|
||||
pFX->vel.Z = 0;
|
||||
}
|
||||
else if (dz2 > dz1 && dz1 < 0x4000)
|
||||
{
|
||||
pFX->zvel = -(int)Random((abs(pGFX->at11) << 18) / 120);
|
||||
pFX->vel.Z = -(int)Random((abs(pGFX->at11) << 18) / 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((pGFX->at11 << 18) / 120 < 0)
|
||||
pFX->zvel = -(int)Random((abs(pGFX->at11) << 18) / 120);
|
||||
pFX->vel.Z = -(int)Random((abs(pGFX->at11) << 18) / 120);
|
||||
else
|
||||
pFX->zvel = Random2((pGFX->at11 << 18) / 120);
|
||||
pFX->vel.Z = Random2((pGFX->at11 << 18) / 120);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ void GibThing(DBloodActor* actor, GIBTHING* pGThing, CGibPosition* pPos, CGibVel
|
|||
{
|
||||
gibactor->vel.X = pVel->vx + Random2(pGThing->atc);
|
||||
gibactor->vel.Y = pVel->vy + Random2(pGThing->atc);
|
||||
gibactor->zvel = pVel->vz - Random(pGThing->at10);
|
||||
gibactor->vel.Z = pVel->vz - Random(pGThing->at10);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -392,20 +392,20 @@ void GibThing(DBloodActor* actor, GIBTHING* pGThing, CGibPosition* pPos, CGibVel
|
|||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 16:
|
||||
gibactor->zvel = Random2((pGThing->at10 << 18) / 120);
|
||||
gibactor->vel.Z = Random2((pGThing->at10 << 18) / 120);
|
||||
break;
|
||||
default:
|
||||
if (dz2 < dz1 && dz2 < 0x4000)
|
||||
{
|
||||
gibactor->zvel = 0;
|
||||
gibactor->vel.Z = 0;
|
||||
}
|
||||
else if (dz2 > dz1 && dz1 < 0x4000)
|
||||
{
|
||||
gibactor->zvel = -(int)Random((pGThing->at10 << 18) / 120);
|
||||
gibactor->vel.Z = -(int)Random((pGThing->at10 << 18) / 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
gibactor->zvel = Random2((pGThing->at10 << 18) / 120);
|
||||
gibactor->vel.Z = Random2((pGThing->at10 << 18) / 120);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -466,13 +466,13 @@ void GibFX(walltype* pWall, GIBFX* pGFX, int a3, int a4, int a5, int a6, CGibVel
|
|||
{
|
||||
pGib->vel.X = Random2((pGFX->atd << 18) / 120);
|
||||
pGib->vel.Y = Random2((pGFX->atd << 18) / 120);
|
||||
pGib->zvel = -(int)Random((pGFX->at11 << 18) / 120);
|
||||
pGib->vel.Z = -(int)Random((pGFX->at11 << 18) / 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
pGib->vel.X = Random2((pVel->vx << 18) / 120);
|
||||
pGib->vel.Y = Random2((pVel->vy << 18) / 120);
|
||||
pGib->zvel = -(int)Random((pVel->vz << 18) / 120);
|
||||
pGib->vel.Z = -(int)Random((pVel->vz << 18) / 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -473,7 +473,7 @@ void DBloodActor::Serialize(FSerializer& arc)
|
|||
Super::Serialize(arc);
|
||||
arc("xvel", vel.X)
|
||||
("yvel", vel.Y)
|
||||
("zvel", zvel)
|
||||
("zvel", vel.Z)
|
||||
("hasx", hasx);
|
||||
|
||||
// The rest is only relevant if the actor has an xsprite.
|
||||
|
|
|
@ -1014,7 +1014,7 @@ static void windGenDoVerticalWind(int factor, sectortype* pSector)
|
|||
case kStatFree:
|
||||
continue;
|
||||
case kStatFX:
|
||||
if (actor->zvel) break;
|
||||
if (actor->vel.Z) break;
|
||||
continue;
|
||||
case kStatThing:
|
||||
case kStatDude:
|
||||
|
@ -1028,16 +1028,16 @@ static void windGenDoVerticalWind(int factor, sectortype* pSector)
|
|||
if (maxZfound && actor->spr.pos.Z <= maxZ)
|
||||
{
|
||||
zdiff = actor->spr.pos.Z - maxZ;
|
||||
if (actor->zvel < 0) actor->zvel += MulScale(actor->zvel >> 4, zdiff, 16);
|
||||
if (actor->vel.Z < 0) actor->vel.Z += MulScale(actor->vel.Z >> 4, zdiff, 16);
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
val = -MulScale(factor * 64, 0x10000, 16);
|
||||
if (actor->zvel >= 0) actor->zvel += val;
|
||||
else actor->zvel = val;
|
||||
if (actor->vel.Z >= 0) actor->vel.Z += val;
|
||||
else actor->vel.Z = val;
|
||||
|
||||
actor->spr.pos.Z += actor->zvel >> 12;
|
||||
actor->spr.pos.Z += actor->vel.Z >> 12;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1322,7 +1322,7 @@ void nnExtProcessSuperSprites()
|
|||
}
|
||||
|
||||
if (debrisactor->xspr.physAttr & kPhysGravity) debrisactor->xspr.physAttr |= kPhysFalling;
|
||||
if ((debrisactor->xspr.physAttr & kPhysFalling) || debrisactor->vel.X || debrisactor->vel.Y || debrisactor->zvel || debrisactor->spr.sector()->velFloor || debrisactor->spr.sector()->velCeil)
|
||||
if ((debrisactor->xspr.physAttr & kPhysFalling) || debrisactor->vel.X || debrisactor->vel.Y || debrisactor->vel.Z || debrisactor->spr.sector()->velFloor || debrisactor->spr.sector()->velCeil)
|
||||
debrisMove(i);
|
||||
|
||||
if (debrisactor->vel.X || debrisactor->vel.Y)
|
||||
|
@ -1332,7 +1332,7 @@ void nnExtProcessSuperSprites()
|
|||
if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble);
|
||||
else if (Chance(0x1000 - mass))
|
||||
{
|
||||
if (debrisactor->zvel > 0x100) debrisBubble(debrisactor);
|
||||
if (debrisactor->vel.Z > 0x100) debrisBubble(debrisactor);
|
||||
if (ang == debrisactor->xspr.goalAng)
|
||||
{
|
||||
debrisactor->xspr.goalAng = (debrisactor->spr.ang + Random3(kAng60)) & 2047;
|
||||
|
@ -1562,7 +1562,7 @@ void debrisConcuss(DBloodActor* owneractor, int listIndex, int x, int y, int z,
|
|||
|
||||
actor->vel.X += MulScale(t, dx, 16);
|
||||
actor->vel.Y += MulScale(t, dy, 16);
|
||||
actor->zvel += MulScale(t, dz, 16);
|
||||
actor->vel.Z += MulScale(t, dz, 16);
|
||||
}
|
||||
|
||||
if (thing)
|
||||
|
@ -1597,7 +1597,7 @@ void debrisBubble(DBloodActor* actor)
|
|||
if (pFX) {
|
||||
pFX->vel.X = actor->vel.X + Random2(0x1aaaa);
|
||||
pFX->vel.Y = actor->vel.Y + Random2(0x1aaaa);
|
||||
pFX->zvel = actor->zvel + Random2(0x1aaaa);
|
||||
pFX->vel.Z = actor->vel.Z + Random2(0x1aaaa);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1687,8 +1687,8 @@ void debrisMove(int listIndex)
|
|||
if (pSector->hasX())
|
||||
uwater = pSector->xs().Underwater;
|
||||
|
||||
if (actor->zvel)
|
||||
actor->spr.pos.Z += actor->zvel >> 8;
|
||||
if (actor->vel.Z)
|
||||
actor->spr.pos.Z += actor->vel.Z >> 8;
|
||||
|
||||
int ceilZ, floorZ;
|
||||
Collision ceilColl, floorColl;
|
||||
|
@ -1704,7 +1704,7 @@ void debrisMove(int listIndex)
|
|||
|
||||
if (pSector->lowerLink) cz += (cz < 0) ? 0x500 : -0x500;
|
||||
if (top > cz && (!(actor->xspr.physAttr & kPhysDebrisFloat) || fz <= bottom << 2))
|
||||
actor->zvel -= DivScale((bottom - ceilZ) >> 6, mass, 8);
|
||||
actor->vel.Z -= DivScale((bottom - ceilZ) >> 6, mass, 8);
|
||||
|
||||
if (fz < bottom)
|
||||
vc = 58254 + ((bottom - fz) * -80099) / div;
|
||||
|
@ -1712,14 +1712,14 @@ void debrisMove(int listIndex)
|
|||
if (vc)
|
||||
{
|
||||
actor->spr.pos.Z += ((vc << 2) >> 1) >> 8;
|
||||
actor->zvel += vc;
|
||||
actor->vel.Z += vc;
|
||||
}
|
||||
|
||||
}
|
||||
else if ((actor->xspr.physAttr & kPhysGravity) && bottom < floorZ)
|
||||
{
|
||||
actor->spr.pos.Z += 455;
|
||||
actor->zvel += 58254;
|
||||
actor->vel.Z += 58254;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1758,17 +1758,17 @@ void debrisMove(int listIndex)
|
|||
if (floorZ <= bottom) {
|
||||
|
||||
actor->hit.florhit = floorColl;
|
||||
int v30 = actor->zvel - actor->spr.sector()->velFloor;
|
||||
int v30 = actor->vel.Z - actor->spr.sector()->velFloor;
|
||||
|
||||
if (v30 > 0)
|
||||
{
|
||||
actor->xspr.physAttr |= kPhysFalling;
|
||||
actFloorBounceVector(&actor->vel.X, &actor->vel.Y, &v30, actor->spr.sector(), tmpFraction);
|
||||
actor->zvel = v30;
|
||||
actor->vel.Z = v30;
|
||||
|
||||
if (abs(actor->zvel) < 0x10000)
|
||||
if (abs(actor->vel.Z) < 0x10000)
|
||||
{
|
||||
actor->zvel = actor->spr.sector()->velFloor;
|
||||
actor->vel.Z = actor->spr.sector()->velFloor;
|
||||
actor->xspr.physAttr &= ~kPhysFalling;
|
||||
}
|
||||
|
||||
|
@ -1783,7 +1783,7 @@ void debrisMove(int listIndex)
|
|||
if ((pFX2 = gFX.fxSpawnActor(FX_14, pFX->spr.sector(), pFX->spr.pos.X, pFX->spr.pos.Y, pFX->spr.pos.Z, 0)) == NULL) continue;
|
||||
pFX2->vel.X = Random2(0x6aaaa);
|
||||
pFX2->vel.Y = Random2(0x6aaaa);
|
||||
pFX2->zvel = -(int)Random(0xd5555);
|
||||
pFX2->vel.Z = -(int)Random(0xd5555);
|
||||
}
|
||||
break;
|
||||
case kSurfWater:
|
||||
|
@ -1792,7 +1792,7 @@ void debrisMove(int listIndex)
|
|||
}
|
||||
|
||||
}
|
||||
else if (actor->zvel == 0)
|
||||
else if (actor->vel.Z == 0)
|
||||
{
|
||||
actor->xspr.physAttr &= ~kPhysFalling;
|
||||
}
|
||||
|
@ -1808,8 +1808,8 @@ void debrisMove(int listIndex)
|
|||
{
|
||||
actor->hit.ceilhit = moveHit = ceilColl;
|
||||
actor->spr.pos.Z += ClipLow(ceilZ - top, 0);
|
||||
if (actor->zvel <= 0 && (actor->xspr.physAttr & kPhysFalling))
|
||||
actor->zvel = MulScale(-actor->zvel, 0x2000, 16);
|
||||
if (actor->vel.Z <= 0 && (actor->xspr.physAttr & kPhysFalling))
|
||||
actor->vel.Z = MulScale(-actor->vel.Z, 0x2000, 16);
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -2594,7 +2594,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
|||
else flags &= ~(kPhysGravity | kPhysFalling);
|
||||
|
||||
targetactor->spr.flags &= ~(kPhysMove | kPhysGravity | kPhysFalling);
|
||||
targetactor->vel.X = targetactor->vel.Y = targetactor->zvel = 0;
|
||||
targetactor->vel.X = targetactor->vel.Y = targetactor->vel.Z = 0;
|
||||
targetactor->xspr.restState = targetactor->xspr.state;
|
||||
|
||||
}
|
||||
|
@ -2707,7 +2707,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
|||
{
|
||||
|
||||
if (oldFlags == 0)
|
||||
targetactor->vel.X = targetactor->vel.Y = targetactor->zvel = 0;
|
||||
targetactor->vel.X = targetactor->vel.Y = targetactor->vel.Z = 0;
|
||||
|
||||
if (nIndex != -1)
|
||||
{
|
||||
|
@ -2725,7 +2725,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
|||
if (targetactor->spr.statnum == kStatThing) ChangeActorStat(targetactor, 0);
|
||||
|
||||
// set random goal ang for swimming so they start turning
|
||||
if ((flags & kPhysDebrisSwim) && !targetactor->vel.X && !targetactor->vel.Y && !targetactor->zvel)
|
||||
if ((flags & kPhysDebrisSwim) && !targetactor->vel.X && !targetactor->vel.Y && !targetactor->vel.Z)
|
||||
targetactor->xspr.goalAng = (targetactor->spr.ang + Random3(kAng45)) & 2047;
|
||||
|
||||
if (targetactor->xspr.physAttr & kPhysDebrisVector)
|
||||
|
@ -2743,7 +2743,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
|||
{
|
||||
|
||||
targetactor->xspr.physAttr = flags;
|
||||
targetactor->vel.X = targetactor->vel.Y = targetactor->zvel = 0;
|
||||
targetactor->vel.X = targetactor->vel.Y = targetactor->vel.Z = 0;
|
||||
if (targetactor->spr.lotag >= kThingBase && targetactor->spr.lotag < kThingMax)
|
||||
ChangeActorStat(targetactor, kStatThing); // if it was a thing - restore statnum
|
||||
}
|
||||
|
@ -3037,7 +3037,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
}
|
||||
|
||||
if (sourceactor->xspr.data3 == 1)
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
|
||||
viewBackupSpriteLoc(actor);
|
||||
|
||||
|
@ -4329,10 +4329,10 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
case 25:
|
||||
switch (arg1)
|
||||
{
|
||||
case 0: return (objActor->vel.X || objActor->vel.Y || objActor->zvel);
|
||||
case 0: return (objActor->vel.X || objActor->vel.Y || objActor->vel.Z);
|
||||
case 1: return (objActor->vel.X);
|
||||
case 2: return (objActor->vel.Y);
|
||||
case 3: return (objActor->zvel);
|
||||
case 3: return (objActor->vel.Z);
|
||||
}
|
||||
break;
|
||||
case 30:
|
||||
|
@ -6216,7 +6216,7 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
int velocity = sourceactor->xspr.data2 << 12;
|
||||
missileactor->vel.X = MulScale(velocity, dx, 14);
|
||||
missileactor->vel.Y = MulScale(velocity, dy, 14);
|
||||
missileactor->zvel = MulScale(velocity, dz, 14);
|
||||
missileactor->vel.Z = MulScale(velocity, dz, 14);
|
||||
}
|
||||
|
||||
// add bursting for missiles
|
||||
|
@ -6442,12 +6442,12 @@ void useSlopeChanger(DBloodActor* sourceactor, int objType, sectortype* pSect, D
|
|||
if (iactor->hasX() && iactor->xspr.physAttr > 0)
|
||||
{
|
||||
iactor->xspr.physAttr |= kPhysFalling;
|
||||
iactor->zvel++;
|
||||
iactor->vel.Z++;
|
||||
}
|
||||
else if ((iactor->spr.statnum == kStatThing || iactor->spr.statnum == kStatDude) && (iactor->spr.flags & kPhysGravity))
|
||||
{
|
||||
iactor->spr.flags |= kPhysFalling;
|
||||
iactor->zvel++;
|
||||
iactor->vel.Z++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7795,7 +7795,7 @@ void aiPatrolMove(DBloodActor* actor)
|
|||
if (pExtra->flying || spriteIsUnderwater(actor))
|
||||
{
|
||||
goalAng >>= 1;
|
||||
actor->zvel = dz;
|
||||
actor->vel.Z = dz;
|
||||
if (actor->spr.flags & kPhysGravity)
|
||||
actor->spr.flags &= ~kPhysGravity;
|
||||
}
|
||||
|
@ -8176,8 +8176,8 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
{
|
||||
DBloodActor* act = pPlayer->actor;
|
||||
itCanHear = (!deaf && (nDist < hearDist || hearChance > 0));
|
||||
if (act && itCanHear && nDist < feelDist && (act->vel.X || act->vel.Y || act->zvel))
|
||||
hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->vel.X) + abs(act->vel.Y) + abs(act->zvel))) >> 6, 0)), 0);
|
||||
if (act && itCanHear && nDist < feelDist && (act->vel.X || act->vel.Y || act->vel.Z))
|
||||
hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->vel.X) + abs(act->vel.Y) + abs(act->vel.Z))) >> 6, 0)), 0);
|
||||
}
|
||||
|
||||
if (seeDist)
|
||||
|
@ -8416,7 +8416,7 @@ void aiPatrolThink(DBloodActor* actor)
|
|||
if (actor->xspr.stateTimer > 0 || markeractor->xspr.data1 == markeractor->xspr.data2)
|
||||
{
|
||||
if (pExtra->flying)
|
||||
actor->zvel = Random2(0x8000);
|
||||
actor->vel.Z = Random2(0x8000);
|
||||
|
||||
// turn while waiting
|
||||
if (markeractor->spr.flags & kModernTypeFlag16)
|
||||
|
@ -8832,7 +8832,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
|
|||
RotateVector(&dx, &dy, nAngle);
|
||||
burstactor->vel.X += dx;
|
||||
burstactor->vel.Y += dy;
|
||||
burstactor->zvel += dz;
|
||||
burstactor->vel.Z += dz;
|
||||
evPostActor(burstactor, 960, kCallbackRemove);
|
||||
}
|
||||
evPostActor(actor, 0, kCallbackRemove);
|
||||
|
|
|
@ -846,7 +846,7 @@ void playerStart(int nPlayer, int bNewLevel)
|
|||
pPlayer->throwPower = 0;
|
||||
pPlayer->deathTime = 0;
|
||||
pPlayer->nextWeapon = kWeapNone;
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
pInput->avel = 0;
|
||||
pInput->actions = 0;
|
||||
pInput->fvel = 0;
|
||||
|
@ -1446,7 +1446,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
|
|||
int t2 = DivScale(0xccccc, nMass, 8);
|
||||
hitactor->vel.X += MulScale(x, t2, 16);
|
||||
hitactor->vel.Y += MulScale(y, t2, 16);
|
||||
hitactor->zvel += MulScale(z, t2, 16);
|
||||
hitactor->vel.Z += MulScale(z, t2, 16);
|
||||
}
|
||||
if (hitactor->xspr.Push && !hitactor->xspr.state && !hitactor->xspr.isTriggered)
|
||||
trTriggerSprite(hitactor, kCmdSpritePush);
|
||||
|
@ -1649,9 +1649,9 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
switch (pPlayer->posture) {
|
||||
case 1:
|
||||
if (pInput->actions & SB_JUMP)
|
||||
actor->zvel -= pPosture->normalJumpZ;//0x5b05;
|
||||
actor->vel.Z -= pPosture->normalJumpZ;//0x5b05;
|
||||
if (pInput->actions & SB_CROUCH)
|
||||
actor->zvel += pPosture->normalJumpZ;//0x5b05;
|
||||
actor->vel.Z += pPosture->normalJumpZ;//0x5b05;
|
||||
break;
|
||||
case 2:
|
||||
if (!(pInput->actions & SB_CROUCH))
|
||||
|
@ -1664,8 +1664,8 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
#endif
|
||||
sfxPlay3DSound(actor, 700, 0, 0);
|
||||
|
||||
if (packItemActive(pPlayer, 4)) actor->zvel = pPosture->pwupJumpZ; //-0x175555;
|
||||
else actor->zvel = pPosture->normalJumpZ; //-0xbaaaa;
|
||||
if (packItemActive(pPlayer, 4)) actor->vel.Z = pPosture->pwupJumpZ; //-0x175555;
|
||||
else actor->vel.Z = pPosture->normalJumpZ; //-0xbaaaa;
|
||||
pPlayer->cantJump = 1;
|
||||
}
|
||||
|
||||
|
@ -1759,7 +1759,7 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
int y = bsin(pPlayer->actor->spr.ang);
|
||||
spawned->vel.X = pPlayer->actor->vel.X + MulScale(0x155555, x, 14);
|
||||
spawned->vel.Y = pPlayer->actor->vel.Y + MulScale(0x155555, y, 14);
|
||||
spawned->zvel = pPlayer->actor->zvel;
|
||||
spawned->vel.Z = pPlayer->actor->vel.Z;
|
||||
}
|
||||
pPlayer->hand = 0;
|
||||
}
|
||||
|
@ -1858,14 +1858,14 @@ void playerProcess(PLAYER* pPlayer)
|
|||
}
|
||||
ProcessInput(pPlayer);
|
||||
int nSpeed = approxDist(actor->vel.X, actor->vel.Y);
|
||||
pPlayer->zViewVel = interpolatedvalue(pPlayer->zViewVel, actor->zvel, 0x7000);
|
||||
pPlayer->zViewVel = interpolatedvalue(pPlayer->zViewVel, actor->vel.Z, 0x7000);
|
||||
int dz = pPlayer->actor->spr.pos.Z - pPosture->eyeAboveZ - pPlayer->zView;
|
||||
if (dz > 0)
|
||||
pPlayer->zViewVel += MulScale(dz << 8, 0xa000, 16);
|
||||
else
|
||||
pPlayer->zViewVel += MulScale(dz << 8, 0x1800, 16);
|
||||
pPlayer->zView += pPlayer->zViewVel >> 8;
|
||||
pPlayer->zWeaponVel = interpolatedvalue(pPlayer->zWeaponVel, actor->zvel, 0x5000);
|
||||
pPlayer->zWeaponVel = interpolatedvalue(pPlayer->zWeaponVel, actor->vel.Z, 0x5000);
|
||||
dz = pPlayer->actor->spr.pos.Z - pPosture->weaponAboveZ - pPlayer->zWeapon;
|
||||
if (dz > 0)
|
||||
pPlayer->zWeaponVel += MulScale(dz << 8, 0x8000, 16);
|
||||
|
|
|
@ -348,7 +348,7 @@ void SEQINST::Update()
|
|||
|
||||
|
||||
// by NoOne: add surfaceSound trigger feature
|
||||
if (!VanillaMode() && pSequence->frames[frameIndex].surfaceSound && actor->zvel == 0 && actor->vel.X != 0) {
|
||||
if (!VanillaMode() && pSequence->frames[frameIndex].surfaceSound && actor->vel.Z == 0 && actor->vel.X != 0) {
|
||||
|
||||
if (actor->spr.sector()->upperLink) break; // don't play surface sound for stacked sectors
|
||||
int surf = tileGetSurfType(actor->spr.sector()->floorpicnum);
|
||||
|
|
|
@ -92,7 +92,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
|
|||
auto actor = (DBloodActor*)source;
|
||||
|
||||
// Engine expects velocity in units per second, not units per tic.
|
||||
if (vel) *vel = { actor->vel.X * (30 / 65536.f), actor->zvel * (-30 / 65536.f), actor->vel.Y * (-30 / 65536.f) };
|
||||
if (vel) *vel = { actor->vel.X * (30 / 65536.f), actor->vel.Z * (-30 / 65536.f), actor->vel.Y * (-30 / 65536.f) };
|
||||
*pos = GetSoundPos(&actor->spr.pos);
|
||||
}
|
||||
else if (type == SOURCE_Ambient)
|
||||
|
|
|
@ -1547,7 +1547,7 @@ void OperateTeleport(sectortype* pSector)
|
|||
actor->spr.ang = destactor->spr.ang;
|
||||
ChangeActorSect(actor, destactor->spr.sector());
|
||||
sfxPlay3DSound(destactor, 201, -1, 0);
|
||||
actor->vel.X = actor->vel.Y = actor->zvel = 0;
|
||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
||||
actor->interpolated = false;
|
||||
viewBackupSpriteLoc(actor);
|
||||
if (pPlayer)
|
||||
|
|
|
@ -459,7 +459,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
int t = DivScale(nDist, pWeaponTrack->seeker, 12);
|
||||
x2 += (actor->vel.X * t) >> 12;
|
||||
y2 += (actor->vel.Y * t) >> 12;
|
||||
z2 += (actor->zvel * t) >> 8;
|
||||
z2 += (actor->vel.Z * t) >> 8;
|
||||
}
|
||||
int lx = x + MulScale(Cos(plActor->spr.ang), nDist, 30);
|
||||
int ly = y + MulScale(Sin(plActor->spr.ang), nDist, 30);
|
||||
|
|
Loading…
Reference in a new issue