- Fixed: A_CountdownArg and A_Die must ensure a certain kill.
- Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. SVN r1599 (trunk)
This commit is contained in:
parent
466b6e4535
commit
e61b4b3c76
21 changed files with 234 additions and 139 deletions
|
|
@ -268,6 +268,8 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< DeathSound
|
||||
<< ActiveSound
|
||||
<< UseSound
|
||||
<< BounceSound
|
||||
<< WallBounceSound
|
||||
<< Speed
|
||||
<< FloatSpeed
|
||||
<< Mass
|
||||
|
|
@ -278,6 +280,7 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< MissileState
|
||||
<< MaxDropOffHeight
|
||||
<< MaxStepHeight
|
||||
<< bouncetype
|
||||
<< bouncefactor
|
||||
<< wallbouncefactor
|
||||
<< bouncecount
|
||||
|
|
@ -1249,6 +1252,31 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void AActor::PlayBounceSound(bool onfloor)
|
||||
{
|
||||
if (!onfloor && (flags3 & MF3_NOWALLBOUNCESND))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(flags4 & MF4_NOBOUNCESOUND))
|
||||
{
|
||||
if (bouncetype & BOUNCE_UseSeeSound)
|
||||
{
|
||||
S_Sound (this, CHAN_VOICE, SeeSound, 1, ATTN_IDLE);
|
||||
}
|
||||
else if (onfloor || WallBounceSound <= 0)
|
||||
{
|
||||
S_Sound (this, CHAN_VOICE, BounceSound, 1, ATTN_IDLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_Sound (this, CHAN_VOICE, WallBounceSound, 1, ATTN_IDLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
// PROC P_FloorBounceMissile
|
||||
|
|
@ -1281,8 +1309,10 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
}
|
||||
|
||||
fixed_t dot = TMulScale16 (momx, plane.a, momy, plane.b, momz, plane.c);
|
||||
int bt = bouncetype & BOUNCE_TypeMask;
|
||||
|
||||
if ((flags2 & MF2_BOUNCETYPE) == MF2_HERETICBOUNCE)
|
||||
|
||||
if (bt == BOUNCE_Heretic)
|
||||
{
|
||||
momx -= MulScale15 (plane.a, dot);
|
||||
momy -= MulScale15 (plane.b, dot);
|
||||
|
|
@ -1301,16 +1331,12 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
momz = MulScale30 (momz - MulScale15 (plane.c, dot), bouncescale);
|
||||
angle = R_PointToAngle2 (0, 0, momx, momy);
|
||||
|
||||
if (SeeSound && !(flags4 & MF4_NOBOUNCESOUND))
|
||||
{
|
||||
S_Sound (this, CHAN_VOICE, SeeSound, 1, ATTN_IDLE);
|
||||
}
|
||||
|
||||
if ((flags2 & MF2_BOUNCETYPE) == MF2_DOOMBOUNCE)
|
||||
PlayBounceSound(true);
|
||||
if (bt == BOUNCE_Doom)
|
||||
{
|
||||
if (!(flags & MF_NOGRAVITY) && (momz < 3*FRACUNIT))
|
||||
{
|
||||
flags2 &= ~MF2_BOUNCETYPE;
|
||||
bouncetype = BOUNCE_None;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1705,7 +1731,8 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
steps = 0;
|
||||
if (BlockingMobj)
|
||||
{
|
||||
if (mo->flags2 & MF2_BOUNCE2)
|
||||
int bt = mo->bouncetype & BOUNCE_TypeMask;
|
||||
if (bt == BOUNCE_Doom || bt == BOUNCE_Hexen)
|
||||
{
|
||||
if (mo->flags5&MF5_BOUNCEONACTORS ||
|
||||
(BlockingMobj->flags2 & MF2_REFLECTIVE) ||
|
||||
|
|
@ -1723,10 +1750,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->momx = FixedMul (speed, finecosine[angle]);
|
||||
mo->momy = FixedMul (speed, finesine[angle]);
|
||||
if (mo->SeeSound && !(mo->flags4&MF4_NOBOUNCESOUND))
|
||||
{
|
||||
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
|
||||
}
|
||||
mo->PlayBounceSound(true);
|
||||
return oldfloorz;
|
||||
}
|
||||
else
|
||||
|
|
@ -1741,10 +1765,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
// Struck a wall
|
||||
if (P_BounceWall (mo))
|
||||
{
|
||||
if (mo->SeeSound && !(mo->flags3 & MF3_NOWALLBOUNCESND))
|
||||
{
|
||||
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
|
||||
}
|
||||
mo->PlayBounceSound(false);
|
||||
return oldfloorz;
|
||||
}
|
||||
}
|
||||
|
|
@ -2074,7 +2095,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
|||
(!(gameinfo.gametype & GAME_DoomChex) || !(mo->flags & MF_NOCLIP)))
|
||||
{
|
||||
mo->z = mo->floorz;
|
||||
if (mo->flags2 & MF2_BOUNCETYPE)
|
||||
if (mo->bouncetype != BOUNCE_None)
|
||||
{
|
||||
mo->FloorBounceMissile (mo->floorsector->floorplane);
|
||||
return;
|
||||
|
|
@ -2167,7 +2188,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
|||
if (mo->z + mo->height > mo->ceilingz)
|
||||
{
|
||||
mo->z = mo->ceilingz - mo->height;
|
||||
if (mo->flags2 & MF2_BOUNCETYPE)
|
||||
if (mo->bouncetype != BOUNCE_None)
|
||||
{ // ceiling bounce
|
||||
mo->FloorBounceMissile (mo->ceilingsector->ceilingplane);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue