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:
Marisa the Magician 2019-09-11 16:52:02 +02:00
commit c0c4023adf
4 changed files with 126 additions and 30 deletions

View file

@ -8,7 +8,7 @@ $random ut/maledie { ut/maledie1 ut/maledie2 ut/maledie3 }
ut/malexdie1 deathc51
ut/malexdie2 deathc52
ut/malexdie3 deathc53
$random ut/malexdie { ut/malexdie1 ut/malexdie2 ut/malexdie3 }
$random ut/malexdie { ut/malexdie1 ut/malexdie3 }
ut/gibp newgib
ut/malepain1 injurl2
ut/malepain2 injurl04
@ -48,6 +48,7 @@ $playeralias tmale1 neutral *usefail ut/malehump1
$playeralias tmale1 neutral *surface ut/malesurface
$playeralias tmale1 neutral *gasp ut/malegasp
$playeralias tmale1 neutral *death-decapitated ut/malexdie2
$playeralias tmale1 neutral *death-drowning ut/maledrowned
$playeralias tmale1 neutral *xdeath-drowning ut/maledrowned
$playeralias tmale1 neutral *pain100-drowning ut/maledrowning
@ -81,7 +82,7 @@ ut/femaledie1 decap01
ut/femaledie2 death1d
ut/femaledie3 death2a
ut/femaledie4 death3c
$random ut/femaledie { ut/femaledie1 ut/femaledie2 ut/femaledie3 }
$random ut/femaledie { ut/femaledie4 ut/femaledie2 ut/femaledie3 }
ut/femalexdie1 death41
ut/femalexdie2 death42
$random ut/femalexdie { ut/femalexdie1 ut/femalexdie2 }
@ -112,6 +113,7 @@ $playeralias tfemale neutral *usefail ut/femalegrunt
$playeralias tfemale neutral *surface ut/femalesurf
$playeralias tfemale neutral *gasp ut/femalegasp
$playeralias tfemale neutral *death-decapitated ut/femaledie1
$playeralias tfemale neutral *death-drowning ut/femaledrowned
$playeralias tfemale neutral *xdeath-drowning ut/femaledrowned
$playeralias tfemale neutral *pain100-drowning ut/femaledrowning
@ -131,9 +133,9 @@ ut/bosspain1 binjur1
ut/bosspain2 binjur2
ut/bosspain3 binjur3
ut/bosspain4 binjur4
ut/bossgrunt bland01
ut/bossgrunt blland01
ut/bossland bland01
ut/bossjump bjump1
ut/bosshump bjump1
$playeralias tboss neutral *death ut/bossdie
$playeralias tboss neutral *xdeath ut/bossxdie
@ -144,9 +146,9 @@ $playeralias tboss neutral *pain50 ut/bosspain3
$playeralias tboss neutral *pain25 ut/bosspain4
$playeralias tboss neutral *grunt ut/bossgrunt
$playeralias tboss neutral *land DSEMPTY
$playeralias tboss neutral *uland ut/bossgrunt
$playeralias tboss neutral *uland ut/bossland
$playeralias tboss neutral *jump ut/bossjump
$playeralias tboss neutral *usefail ut/bosshump
$playeralias tboss neutral *usefail ut/bossgrunt
$playeralias tboss neutral *surface ut/malesurf
$playeralias tboss neutral *gasp ut/malegasp

BIN
sounds/Blland01.ogg Normal file

Binary file not shown.

View file

@ -241,7 +241,7 @@ Class BioGel : Actor
}
else if ( atsector ) // attempt to follow the movement of the plane
{
SetOrigin(Vec2OffsetZ(0,0,atz+cursector.GetPlaneTexZ(atplane)),true);
SetOrigin(Vec2OffsetZ(0,0,atz+atsector.GetPlaneTexZ(atplane)),true);
if ( ceilingz-floorz <= 2 ) deadtimer = min(deadtimer,0);
}
}
@ -270,7 +270,9 @@ Class BioGel : Actor
SetStateLabel("XDeath");
}
}
// align self to what surface was hit, currently does not support 3d floors + slopes properly
// align self to what surface was hit
// TODO handle plane collision within the very border between two
// sectors (most noticeable with moving 3d floors)
virtual void AlignSelf()
{
F3DFloor ff;
@ -386,41 +388,57 @@ Class BioGel : Actor
else if ( BlockingFloor )
{
// find closest 3d floor for its normal
for ( int i=0; i<CurSector.Get3DFloorCount(); i++ )
for ( int i=0; i<BlockingFloor.Get3DFloorCount(); i++ )
{
if ( !(CurSector.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
ff = CurSector.Get3DFLoor(i);
if ( !(BlockingFloor.Get3DFloor(i).top.ZAtPoint(pos.xy) ~== floorz) ) continue;
ff = BlockingFloor.Get3DFLoor(i);
break;
}
if ( ff ) normal = -ff.top.Normal;
else normal = BlockingFloor.floorplane.Normal;
atsector = BlockingFloor;
atplane = 0;
if ( ff )
{
normal = -ff.top.Normal;
atsector = ff.model;
atplane = 1;
}
else
{
normal = BlockingFloor.floorplane.Normal;
atsector = BlockingFloor;
atplane = 0;
}
pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);
SetOrigin((pos.x,pos.y,floorz)+normal*0.5,false);
atz = pos.z-BlockingFloor.GetPlaneTexZ(0);
atz = pos.z-atsector.GetPlaneTexZ(atplane);
hittype = HIT_FLOOR;
}
else if ( BlockingCeiling )
{
// find closest 3d floor for its normal
for ( int i=0; i<CurSector.Get3DFloorCount(); i++ )
for ( int i=0; i<BlockingCeiling.Get3DFloorCount(); i++ )
{
if ( !(CurSector.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
ff = CurSector.Get3DFloor(i);
if ( !(BlockingCeiling.Get3DFloor(i).bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
ff = BlockingCeiling.Get3DFloor(i);
break;
}
if ( ff ) normal = -ff.bottom.Normal;
else normal = BlockingCeiling.ceilingplane.Normal;
atsector = BlockingCeiling;
atplane = 1;
if ( ff )
{
normal = -ff.bottom.Normal;
atsector = ff.model;
atplane = 0;
}
else
{
normal = BlockingCeiling.ceilingplane.Normal;
atsector = BlockingCeiling;
atplane = 1;
}
pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);
SetOrigin((pos.x,pos.y,ceilingz)+normal*0.5,false);
atz = pos.z-BlockingCeiling.GetPlaneTexZ(1);
atz = pos.z-atsector.GetPlaneTexZ(atplane);
if ( waterlevel > 0 ) hittype = HIT_FLOOR;
else if ( normal dot (0,0,-1) > 0.7 )
hittype = HIT_CEILING;
@ -442,8 +460,26 @@ Class BioGel : Actor
// attempt to guess line part (upper/mid/lower)
if ( !atline.sidedef[1] ) atpart = 0; // mid
else if ( atline.sidedef[atside?0:1].sector.ceilingplane.ZAtPoint(pos.xy) < pos.z ) atpart = 1; // upper
else if ( atline.sidedef[atside?0:1].sector.floorplane.ZAtPoint(pos.xy) > pos.z ) atpart = -1; // lower
else atpart = 0;
else if ( atline.sidedef[atside?0:1].sector.floorplane.ZAtPoint(pos.xy) > (pos.z+height) ) atpart = -1; // lower
else
{
atpart = 0;
// check if we're touching a 3d floor line
Sector backsector = atline.sidedef[atside?0:1].sector;
for ( int i=0; i<backsector.Get3DFloorCount(); i++ )
{
if ( backsector.Get3DFloor(i).bottom.ZAtPoint(pos.xy) > (pos.z+height) ) continue;
if ( backsector.Get3DFloor(i).top.ZAtPoint(pos.xy) < pos.z ) continue;
ff = backsector.Get3DFloor(i);
break;
}
// attach to it
if ( ff )
{
atline = ff.master;
atside = 0;
}
}
if ( atpart == 1 )
{
if ( atline.flags&Line.ML_DONTPEGTOP ) atz = pos.z-atline.sidedef[atside].sector.GetPlaneTexZ(1);

View file

@ -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));