- Added bounce states. Set the BOUNCE_UseBounceState flag to use them (+USEBOUNCESTATE via
DECORATE). Then you can use: * Bounce * Bounce.Floor * Bounce.Ceiling * Bounce.Wall * Bounce.Actor * Bounce.Actor.Creature Partial matches work just like Pain states, so if an actor bounces off a floor and you don't have a Bounce.Floor state, but you do have a Bounce state, it will use the Bounce state. Conversely, if you only have a Bounce.Floor state but no Bounce state, then the actor will only enter the Bounce.Floor state when it bounces on a floor; bouncing off anything else will not cause it to change state. SVN r4250 (trunk)
This commit is contained in:
parent
8830d3a07a
commit
40f7abb8e9
5 changed files with 54 additions and 0 deletions
|
|
@ -1383,6 +1383,22 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
}
|
||||
|
||||
PlayBounceSound(true);
|
||||
|
||||
// Set bounce state
|
||||
if (BounceFlags & BOUNCE_UseBounceState)
|
||||
{
|
||||
FName names[2];
|
||||
FState *bouncestate;
|
||||
|
||||
names[0] = NAME_Bounce;
|
||||
names[1] = plane.c < 0 ? NAME_Ceiling : NAME_Floor;
|
||||
bouncestate = FindState(2, names);
|
||||
if (bouncestate != NULL)
|
||||
{
|
||||
SetState(bouncestate);
|
||||
}
|
||||
}
|
||||
|
||||
if (BounceFlags & BOUNCE_MBF) // Bring it to rest below a certain speed
|
||||
{
|
||||
if (abs(velz) < (fixed_t)(Mass * GetGravity() / 64))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue