mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +00:00
- added ZeroVelocity function to DBloodActor.
This commit is contained in:
parent
a5a3669238
commit
18a445aee5
8 changed files with 23 additions and 24 deletions
|
@ -2387,7 +2387,7 @@ static void actInitThings()
|
||||||
|
|
||||||
act->spr.flags = thingInfo[nType].flags;
|
act->spr.flags = thingInfo[nType].flags;
|
||||||
if (act->spr.flags & kPhysGravity) act->spr.flags |= kPhysFalling;
|
if (act->spr.flags & kPhysGravity) act->spr.flags |= kPhysFalling;
|
||||||
act->vel.X = act->vel.Y = act->vel.Z = 0;
|
act->ZeroVelocity();
|
||||||
|
|
||||||
switch (act->spr.type)
|
switch (act->spr.type)
|
||||||
{
|
{
|
||||||
|
@ -2489,7 +2489,7 @@ static void actInitDudes()
|
||||||
act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
act->vel.X = act->vel.Y = act->vel.Z = 0;
|
act->ZeroVelocity();
|
||||||
|
|
||||||
#ifdef NOONE_EXTENSIONS
|
#ifdef NOONE_EXTENSIONS
|
||||||
// add a way to set custom hp for every enemy - should work only if map just started and not loaded.
|
// add a way to set custom hp for every enemy - should work only if map just started and not loaded.
|
||||||
|
@ -2718,9 +2718,7 @@ static void actNapalmMove(DBloodActor* actor)
|
||||||
spawnparam[0] = actor->xspr.data4 >> 1;
|
spawnparam[0] = actor->xspr.data4 >> 1;
|
||||||
spawnparam[1] = actor->xspr.data4 - spawnparam[0];
|
spawnparam[1] = actor->xspr.data4 - spawnparam[0];
|
||||||
int ang = actor->int_ang();
|
int ang = actor->int_ang();
|
||||||
actor->vel.X = 0;
|
actor->ZeroVelocity();
|
||||||
actor->vel.Y = 0;
|
|
||||||
actor->vel.Z = 0;
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
int t1 = Random(0x33333) + 0x33333;
|
int t1 = Random(0x33333) + 0x33333;
|
||||||
|
@ -5493,7 +5491,7 @@ void actExplodeSprite(DBloodActor* actor)
|
||||||
GibSprite(actor, GIBTYPE_5, nullptr, nullptr);
|
GibSprite(actor, GIBTYPE_5, nullptr, nullptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
actPostSprite(actor, kStatExplosion);
|
actPostSprite(actor, kStatExplosion);
|
||||||
actor->spr.xrepeat = actor->spr.yrepeat = explodeInfo[nType].repeat;
|
actor->spr.xrepeat = actor->spr.yrepeat = explodeInfo[nType].repeat;
|
||||||
|
|
||||||
|
|
|
@ -728,7 +728,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
||||||
const EXPLOSION* pExpl = &explodeInfo[nType];
|
const EXPLOSION* pExpl = &explodeInfo[nType];
|
||||||
if (CheckProximity(actor, target->spr.pos, target->sector(), pExpl->radius >> 1))
|
if (CheckProximity(actor, target->spr.pos, target->sector(), pExpl->radius >> 1))
|
||||||
{
|
{
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
if (doExplosion(actor, nType) && actor->xspr.health > 0)
|
if (doExplosion(actor, nType) && actor->xspr.health > 0)
|
||||||
actDamageSprite(actor, actor, kDamageExplode, 65535);
|
actDamageSprite(actor, actor, kDamageExplode, 65535);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,11 @@ public:
|
||||||
{
|
{
|
||||||
return spr.type >= kItemAmmoBase && spr.type < kItemAmmoMax;
|
return spr.type >= kItemAmmoBase && spr.type < kItemAmmoMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZeroVelocity()
|
||||||
|
{
|
||||||
|
vel = { 0,0,0 };
|
||||||
|
}
|
||||||
|
|
||||||
bool isActive()
|
bool isActive()
|
||||||
{
|
{
|
||||||
|
|
|
@ -291,7 +291,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9
|
||||||
actor->spr.type = actor->spr.inittype;
|
actor->spr.type = actor->spr.inittype;
|
||||||
actor->SetOwner(nullptr);
|
actor->SetOwner(nullptr);
|
||||||
actor->spr.flags &= ~kHitagRespawn;
|
actor->spr.flags &= ~kHitagRespawn;
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
actor->xspr.respawnPending = 0;
|
actor->xspr.respawnPending = 0;
|
||||||
actor->xspr.burnTime = 0;
|
actor->xspr.burnTime = 0;
|
||||||
actor->xspr.isTriggered = 0;
|
actor->xspr.isTriggered = 0;
|
||||||
|
@ -556,7 +556,7 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16
|
||||||
|
|
||||||
void sleeveStopBouncing(DBloodActor* actor)
|
void sleeveStopBouncing(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
if (actor->hasX()) seqKill(actor);
|
if (actor->hasX()) seqKill(actor);
|
||||||
sfxKill3DSound(actor, -1, -1);
|
sfxKill3DSound(actor, -1, -1);
|
||||||
|
|
||||||
|
@ -712,7 +712,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ???
|
||||||
actor->spr.angle = actor2->spr.angle;
|
actor->spr.angle = actor2->spr.angle;
|
||||||
ChangeActorSect(actor, actor2->sector());
|
ChangeActorSect(actor, actor2->sector());
|
||||||
sfxPlay3DSound(actor2, 201, -1, 0);
|
sfxPlay3DSound(actor2, 201, -1, 0);
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
viewBackupSpriteLoc(actor);
|
viewBackupSpriteLoc(actor);
|
||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2651,7 +2651,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
||||||
else flags &= ~(kPhysGravity | kPhysFalling);
|
else flags &= ~(kPhysGravity | kPhysFalling);
|
||||||
|
|
||||||
targetactor->spr.flags &= ~(kPhysMove | kPhysGravity | kPhysFalling);
|
targetactor->spr.flags &= ~(kPhysMove | kPhysGravity | kPhysFalling);
|
||||||
targetactor->vel.X = targetactor->vel.Y = targetactor->vel.Z = 0;
|
targetactor->ZeroVelocity();
|
||||||
targetactor->xspr.restState = targetactor->xspr.state;
|
targetactor->xspr.restState = targetactor->xspr.state;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2764,7 +2764,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
||||||
{
|
{
|
||||||
|
|
||||||
if (oldFlags == 0)
|
if (oldFlags == 0)
|
||||||
targetactor->vel.X = targetactor->vel.Y = targetactor->vel.Z = 0;
|
targetactor->ZeroVelocity();
|
||||||
|
|
||||||
if (nIndex != -1)
|
if (nIndex != -1)
|
||||||
{
|
{
|
||||||
|
@ -2800,7 +2800,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
|
||||||
{
|
{
|
||||||
|
|
||||||
targetactor->xspr.physAttr = flags;
|
targetactor->xspr.physAttr = flags;
|
||||||
targetactor->vel.X = targetactor->vel.Y = targetactor->vel.Z = 0;
|
targetactor->ZeroVelocity();
|
||||||
if (targetactor->spr.lotag >= kThingBase && targetactor->spr.lotag < kThingMax)
|
if (targetactor->spr.lotag >= kThingBase && targetactor->spr.lotag < kThingMax)
|
||||||
ChangeActorStat(targetactor, kStatThing); // if it was a thing - restore statnum
|
ChangeActorStat(targetactor, kStatThing); // if it was a thing - restore statnum
|
||||||
}
|
}
|
||||||
|
@ -3279,7 +3279,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
||||||
|
|
||||||
if (sourceactor->xspr.data3 == 1)
|
if (sourceactor->xspr.data3 == 1)
|
||||||
{
|
{
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
}
|
}
|
||||||
else if (sourceactor->xspr.data3 > 0)
|
else if (sourceactor->xspr.data3 > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -855,7 +855,7 @@ void playerStart(int nPlayer, int bNewLevel)
|
||||||
pPlayer->throwPower = 0;
|
pPlayer->throwPower = 0;
|
||||||
pPlayer->deathTime = 0;
|
pPlayer->deathTime = 0;
|
||||||
pPlayer->nextWeapon = kWeapNone;
|
pPlayer->nextWeapon = kWeapNone;
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
pInput->avel = 0;
|
pInput->avel = 0;
|
||||||
pInput->actions = 0;
|
pInput->actions = 0;
|
||||||
pInput->fvel = 0;
|
pInput->fvel = 0;
|
||||||
|
|
|
@ -1639,7 +1639,7 @@ void OperateTeleport(sectortype* pSector)
|
||||||
actor->spr.angle = destactor->spr.angle;
|
actor->spr.angle = destactor->spr.angle;
|
||||||
ChangeActorSect(actor, destactor->sector());
|
ChangeActorSect(actor, destactor->sector());
|
||||||
sfxPlay3DSound(destactor, 201, -1, 0);
|
sfxPlay3DSound(destactor, 201, -1, 0);
|
||||||
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
|
actor->ZeroVelocity();
|
||||||
actor->interpolated = false;
|
actor->interpolated = false;
|
||||||
viewBackupSpriteLoc(actor);
|
viewBackupSpriteLoc(actor);
|
||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
|
|
|
@ -4096,10 +4096,8 @@ void OffMotorcycle(player_struct *p)
|
||||||
p->VBumpTarget = 0;
|
p->VBumpTarget = 0;
|
||||||
p->VBumpNow = 0;
|
p->VBumpNow = 0;
|
||||||
p->TurbCount = 0;
|
p->TurbCount = 0;
|
||||||
p->vel.X = 0;
|
p->vel.X = 0 - p->angle.ang.Cos() * (1 << 7);
|
||||||
p->vel.Y = 0;
|
p->vel.Y = 0 - p->angle.ang.Sin() * (1 << 7);
|
||||||
p->vel.X -= p->angle.ang.Cos() * (1 << 7);
|
|
||||||
p->vel.Y -= p->angle.ang.Sin() * (1 << 7);
|
|
||||||
p->moto_underwater = 0;
|
p->moto_underwater = 0;
|
||||||
auto spawned = spawn(p->GetActor(), EMPTYBIKE);
|
auto spawned = spawn(p->GetActor(), EMPTYBIKE);
|
||||||
if (spawned)
|
if (spawned)
|
||||||
|
@ -4163,10 +4161,8 @@ void OffBoat(player_struct *p)
|
||||||
p->VBumpTarget = 0;
|
p->VBumpTarget = 0;
|
||||||
p->VBumpNow = 0;
|
p->VBumpNow = 0;
|
||||||
p->TurbCount = 0;
|
p->TurbCount = 0;
|
||||||
p->vel.X = 0;
|
p->vel.X = 0 - p->angle.ang.Cos() * (1 << 7);
|
||||||
p->vel.Y = 0;
|
p->vel.Y = 0 - p->angle.ang.Sin() * (1 << 7);
|
||||||
p->vel.X -= p->angle.ang.Cos() * (1 << 7);
|
|
||||||
p->vel.Y -= p->angle.ang.Sin() * (1 << 7);
|
|
||||||
p->moto_underwater = 0;
|
p->moto_underwater = 0;
|
||||||
auto spawned = spawn(p->GetActor(), EMPTYBOAT);
|
auto spawned = spawn(p->GetActor(), EMPTYBOAT);
|
||||||
if (spawned)
|
if (spawned)
|
||||||
|
|
Loading…
Reference in a new issue