Peacemaker implemented, with some minor model adjustments.
Fixed ammo bars in hud being positioned incorrectly if a weapon in the slot has no ammo. Sentries now will also complain if the terrain is too steep or you're trying to deploy them in mid-air. Adjusted protomag spin animation. Still not perfect but I tried my best. Guess what: more PNG optimization.
This commit is contained in:
parent
6950bb48a1
commit
e562754f00
43 changed files with 760 additions and 17 deletions
|
|
@ -1527,9 +1527,28 @@ Class SentryItem : UnrealInventory
|
|||
}
|
||||
Vector3 origin = Owner.Vec2OffsetZ(0,0,Owner.player.viewz);
|
||||
FLineTraceData d;
|
||||
Owner.LineTrace(Owner.angle,90,Owner.pitch,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
|
||||
if ( d.HitType != TRACE_HitNone ) origin = d.HitLocation-d.HitDir*20;
|
||||
else origin = d.HitLocation;
|
||||
Owner.LineTrace(Owner.angle,80,Owner.pitch,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
|
||||
if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
Vector3 normal = -d.HitDir;
|
||||
if ( d.HitType == TRACE_HitFloor )
|
||||
{
|
||||
if ( d.Hit3DFloor ) normal = -d.Hit3DFloor.top.Normal;
|
||||
else normal = d.HitSector.floorplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitCeiling )
|
||||
{
|
||||
if ( d.Hit3DFloor ) normal = -d.Hit3DFloor.bottom.Normal;
|
||||
else normal = d.HitSector.ceilingplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitWall )
|
||||
{
|
||||
normal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
||||
if ( !d.LineSide ) normal *= -1;
|
||||
}
|
||||
origin = d.HitLocation+normal*20;
|
||||
}
|
||||
else origin = d.HitLocation-d.HitDir*20;
|
||||
Owner.LineTrace(0,56,90,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
|
||||
origin = d.HitLocation;
|
||||
let a = Spawn("MinigunSentryBase",origin);
|
||||
|
|
@ -1539,6 +1558,28 @@ Class SentryItem : UnrealInventory
|
|||
a.Destroy();
|
||||
return false;
|
||||
}
|
||||
if ( a.pos.z-a.floorz > 50 )
|
||||
{
|
||||
if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$M_MSNOFLOOR"));
|
||||
a.Destroy();
|
||||
return false;
|
||||
}
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<a.floorsector.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( a.floorsector.Get3DFloor(i).top.ZAtPoint(pos.xy) > floorz ) continue;
|
||||
ff = a.floorsector.Get3DFLoor(i);
|
||||
break;
|
||||
}
|
||||
Vector3 normal;
|
||||
if ( ff ) normal = -ff.top.Normal;
|
||||
else normal = a.floorsector.floorplane.Normal;
|
||||
if ( normal.z < 0.9 )
|
||||
{
|
||||
if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$M_MSNOFLAT"));
|
||||
a.Destroy();
|
||||
return false;
|
||||
}
|
||||
bActive = true;
|
||||
bUNTOSSABLE = true;
|
||||
bUNDROPPABLE = true;
|
||||
|
|
@ -2213,9 +2254,28 @@ Class SentryGunItem : UnrealInventory
|
|||
if ( pickup ) return false;
|
||||
Vector3 origin = Owner.Vec2OffsetZ(0,0,Owner.player.viewz);
|
||||
FLineTraceData d;
|
||||
Owner.LineTrace(Owner.angle,90,Owner.pitch,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
|
||||
if ( d.HitType != TRACE_HitNone ) origin = d.HitLocation-d.HitDir*20;
|
||||
else origin = d.HitLocation;
|
||||
Owner.LineTrace(Owner.angle,60,Owner.pitch,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
|
||||
if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
Vector3 normal = -d.HitDir;
|
||||
if ( d.HitType == TRACE_HitFloor )
|
||||
{
|
||||
if ( d.Hit3DFloor ) normal = -d.Hit3DFloor.top.Normal;
|
||||
else normal = d.HitSector.floorplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitCeiling )
|
||||
{
|
||||
if ( d.Hit3DFloor ) normal = -d.Hit3DFloor.bottom.Normal;
|
||||
else normal = d.HitSector.ceilingplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitWall )
|
||||
{
|
||||
normal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
||||
if ( !d.LineSide ) normal *= -1;
|
||||
}
|
||||
origin = d.HitLocation+normal*20;
|
||||
}
|
||||
else origin = d.HitLocation-d.HitDir*20;
|
||||
Owner.LineTrace(0,56,90,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
|
||||
origin = d.HitLocation;
|
||||
let a = Spawn("SentryGun",origin);
|
||||
|
|
@ -2225,6 +2285,28 @@ Class SentryGunItem : UnrealInventory
|
|||
a.Destroy();
|
||||
return false;
|
||||
}
|
||||
if ( a.pos.z-a.floorz > 50 )
|
||||
{
|
||||
if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$M_MSNOFLOOR"));
|
||||
a.Destroy();
|
||||
return false;
|
||||
}
|
||||
F3DFloor ff = null;
|
||||
for ( int i=0; i<a.floorsector.Get3DFloorCount(); i++ )
|
||||
{
|
||||
if ( a.floorsector.Get3DFloor(i).top.ZAtPoint(pos.xy) > floorz ) continue;
|
||||
ff = a.floorsector.Get3DFLoor(i);
|
||||
break;
|
||||
}
|
||||
Vector3 normal;
|
||||
if ( ff ) normal = -ff.top.Normal;
|
||||
else normal = a.floorsector.floorplane.Normal;
|
||||
if ( normal.z < 0.9 )
|
||||
{
|
||||
if ( Owner.CheckLocalView() ) Console.Printf(StringTable.Localize("$M_MSNOFLAT"));
|
||||
a.Destroy();
|
||||
return false;
|
||||
}
|
||||
tracer = a;
|
||||
a.master = Owner;
|
||||
a.angle = Owner.angle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue