Additional 3D floor support code.
Added missing boss land grunt from beta files. Correction: A specific death sound for male and female classes is meant to be used for decapitation.
This commit is contained in:
parent
3e5bd63029
commit
c0c4023adf
4 changed files with 126 additions and 30 deletions
|
|
@ -841,8 +841,37 @@ Class ShockBall : Actor
|
|||
Spawn("ShockExplLight",pos);
|
||||
A_SetScale(1.0);
|
||||
let r = Spawn("ShockBeamRing",pos);
|
||||
r.angle = angle;
|
||||
r.pitch = pitch;
|
||||
Vector3 HitNormal = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||
if ( BlockingLine ) HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
|
||||
else if ( BlockingFloor )
|
||||
{
|
||||
// find closest 3d floor for its normal
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
|
||||
ff = BlockingFloor.Get3DFloor(i);
|
||||
break;
|
||||
}
|
||||
if ( ff ) HitNormal = -ff.top.Normal;
|
||||
else HitNormal = BlockingFloor.floorplane.Normal;
|
||||
r.SetOrigin(r.Vec3Offset(0,0,2),false);
|
||||
}
|
||||
else if ( BlockingCeiling )
|
||||
{
|
||||
// find closest 3d floor for its normal
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
|
||||
ff = BlockingCeiling.Get3DFloor(i);
|
||||
break;
|
||||
}
|
||||
if ( ff ) HitNormal = -ff.bottom.Normal;
|
||||
else HitNormal = BlockingCeiling.ceilingplane.Normal;
|
||||
}
|
||||
r.angle = atan2(HitNormal.y,HitNormal.x);
|
||||
r.pitch = asin(-HitNormal.z);
|
||||
r.scale *= 1.5;
|
||||
A_PlaySound("shock/hit",CHAN_VOICE);
|
||||
A_PlaySound("shock/ball",CHAN_WEAPON,pitch:FRandom[ASMD](0.5,1.5));
|
||||
|
|
@ -905,8 +934,37 @@ Class SuperShockBall : Actor
|
|||
Spawn("SuperShockExplLight",pos);
|
||||
A_SetScale(1.5);
|
||||
let r = Spawn("SuperShockBeamRing",pos);
|
||||
r.angle = angle;
|
||||
r.pitch = pitch;
|
||||
Vector3 HitNormal = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||
if ( BlockingLine ) HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
|
||||
else if ( BlockingFloor )
|
||||
{
|
||||
// find closest 3d floor for its normal
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
|
||||
ff = BlockingFloor.Get3DFloor(i);
|
||||
break;
|
||||
}
|
||||
if ( ff ) HitNormal = -ff.top.Normal;
|
||||
else HitNormal = BlockingFloor.floorplane.Normal;
|
||||
r.SetOrigin(r.Vec3Offset(0,0,2),false);
|
||||
}
|
||||
else if ( BlockingCeiling )
|
||||
{
|
||||
// find closest 3d floor for its normal
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
|
||||
ff = BlockingCeiling.Get3DFloor(i);
|
||||
break;
|
||||
}
|
||||
if ( ff ) HitNormal = -ff.bottom.Normal;
|
||||
else HitNormal = BlockingCeiling.ceilingplane.Normal;
|
||||
}
|
||||
r.angle = atan2(HitNormal.y,HitNormal.x);
|
||||
r.pitch = asin(-HitNormal.z);
|
||||
r.scale *= 1.5;
|
||||
A_PlaySound("shock/hit",CHAN_VOICE,attenuation:0.5);
|
||||
A_PlaySound("shock/ball",CHAN_WEAPON,attenuation:0.5,pitch:FRandom[ASMD](0.5,1.5));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue