Skip to content

Commit

Permalink
v2.6.2.7 Beta Merge pull request #677 from Die4Ever/develop
Browse files Browse the repository at this point in the history
v2.6.2.7 Beta
  • Loading branch information
Die4Ever authored Apr 1, 2024
2 parents 07cbaf5 + ca88a31 commit c9691b7
Show file tree
Hide file tree
Showing 20 changed files with 443 additions and 38 deletions.
352 changes: 346 additions & 6 deletions DXRBalance/DeusEx/Classes/AugDisplayWindow.uc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ function string formatMapName(string mapName)
// ----------------------------------------------------------------------
function DrawTargetAugmentation(GC gc)
{
local Weapon oldWeapon;
local Actor target;
local #var(prefix)Teleporter tgtTeleporter;
local DXRHoverHint hoverHint;
Expand All @@ -300,11 +299,7 @@ function DrawTargetAugmentation(GC gc)

gc.SetFont(Font'FontMenuSmall_DS'); //This font is so much better for everything

oldWeapon = Player.Weapon;
if(!Player.bCrosshairVisible)
Player.Weapon = None;
Super.DrawTargetAugmentation(gc);
Player.Weapon = oldWeapon;
SuperDrawTargetAugmentation(gc);

// check 500 feet in front of the player
target = TraceHoverHint(8000);
Expand Down Expand Up @@ -355,6 +350,351 @@ function DrawTargetAugmentation(GC gc)

}

// DXRando mostly copied from Super, but we want to hide aiming reticles when !bCrosshairVisible, and don't show the dumb "No Image" black rectangle on low levels of AugTarget
function SuperDrawTargetAugmentation(GC gc)
{
local String str;
local Actor target;
local float boxCX, boxCY, boxTLX, boxTLY, boxBRX, boxBRY, boxW, boxH;
local float x, y, w, h, mult;
local Vector v1, v2;
local int i, j, k;
local DeusExWeapon weapon;
local bool bUseOldTarget;
local Color crossColor;
local DeusExPlayer own;
local vector AimLocation;
local int AimBodyPart;


crossColor.R = 255; crossColor.G = 255; crossColor.B = 255;

// check 500 feet in front of the player
target = TraceLOS(8000,AimLocation);

targetplayerhealthstring = "";
targetplayerlocationstring = "";

if ( target != None )
{
GetTargetReticleColor( target, crossColor );

if ((DeusExPlayer(target) != None) && (bTargetActive))
{
AimBodyPart = DeusExPlayer(target).GetMPHitLocation(AimLocation);
if (AimBodyPart == 1)
TargetPlayerLocationString = "("$msgHead$")";
else if ((AimBodyPart == 2) || (AimBodyPart == 5) || (AimBodyPart == 6))
TargetPlayerLocationString = "("$msgTorso$")";
else if ((AimBodyPart == 3) || (AimBodyPart == 4))
TargetPlayerLocationString = "("$msgLegs$")";
}

weapon = DeusExWeapon(Player.Weapon);
// DXRando: added && Player.bCrosshairVisible
if (weapon != None && Player.bCrosshairVisible && !weapon.bHandToHand && !bUseOldTarget)
{
// if the target is out of range, don't draw the reticle
if (weapon.MaxRange >= VSize(target.Location - Player.Location))
{
w = width;
h = height;
x = int(w * 0.5)-1;
y = int(h * 0.5)-1;

// scale based on screen resolution - default is 640x480
mult = FClamp(weapon.currentAccuracy * 80.0 * (width/640.0), corner, 80.0);

// make sure it's not too close to the center unless you have a perfect accuracy
mult = FMax(mult, corner+4.0);
if (weapon.currentAccuracy == 0.0)
mult = corner;

// draw the drop shadowed reticle
gc.SetTileColorRGB(0,0,0);
for (i=1; i>=0; i--)
{
gc.DrawBox(x+i, y-mult+i, 1, corner, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+i, y+mult-corner+i, 1, corner, 0, 0, 1, Texture'Solid');
gc.DrawBox(x-(corner-1)/2+i, y-mult+i, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x-(corner-1)/2+i, y+mult+i, corner, 1, 0, 0, 1, Texture'Solid');

gc.DrawBox(x-mult+i, y+i, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+mult-corner+i, y+i, corner, 1, 0, 0, 1, Texture'Solid');
gc.DrawBox(x-mult+i, y-(corner-1)/2+i, 1, corner, 0, 0, 1, Texture'Solid');
gc.DrawBox(x+mult+i, y-(corner-1)/2+i, 1, corner, 0, 0, 1, Texture'Solid');

gc.SetTileColor(crossColor);
}
}
}
// movers are invalid targets for the aug
if (target.IsA('DeusExMover'))
target = None;
}

// let there be a 0.5 second delay before losing a target
if (target == None)
{
if ((Player.Level.TimeSeconds - lastTargetTime < 0.5) && IsActorValid(lastTarget))
{
target = lastTarget;
bUseOldTarget = True;
}
else
{
RemoveActorRef(lastTarget);
lastTarget = None;
}
}
else
{
lastTargetTime = Player.Level.TimeSeconds;
bUseOldTarget = False;
if (lastTarget != target)
{
RemoveActorRef(lastTarget);
lastTarget = target;
AddActorRef(lastTarget);
}
}

if (target != None)
{
// draw a cornered targetting box
v1.X = target.CollisionRadius;
v1.Y = target.CollisionRadius;
v1.Z = target.CollisionHeight;

if (ConvertVectorToCoordinates(target.Location, boxCX, boxCY))
{
boxTLX = boxCX;
boxTLY = boxCY;
boxBRX = boxCX;
boxBRY = boxCY;

// get the smallest box to enclose actor
// modified from Scott's ActorDisplayWindow
for (i=-1; i<=1; i+=2)
{
for (j=-1; j<=1; j+=2)
{
for (k=-1; k<=1; k+=2)
{
v2 = v1;
v2.X *= i;
v2.Y *= j;
v2.Z *= k;
v2.X += target.Location.X;
v2.Y += target.Location.Y;
v2.Z += target.Location.Z;

if (ConvertVectorToCoordinates(v2, x, y))
{
boxTLX = FMin(boxTLX, x);
boxTLY = FMin(boxTLY, y);
boxBRX = FMax(boxBRX, x);
boxBRY = FMax(boxBRY, y);
}
}
}
}

boxTLX = FClamp(boxTLX, margin, width-margin);
boxTLY = FClamp(boxTLY, margin, height-margin);
boxBRX = FClamp(boxBRX, margin, width-margin);
boxBRY = FClamp(boxBRY, margin, height-margin);

boxW = boxBRX - boxTLX;
boxH = boxBRY - boxTLY;

if ((bTargetActive) && (Player.Level.Netmode == NM_Standalone))
{
// set the coords of the zoom window, and draw the box
// even if we don't have a zoom window
x = width/8 + margin;
y = height/2;
w = width/4;
h = height/4;

// DXRando move drop shadow down into if targetLevel >2 && winZoom != None
//DrawDropShadowBox(gc, x-w/2, y-h/2, w, h);

boxCX = width/8 + margin;
boxCY = height/2;
boxTLX = boxCX - width/8;
boxTLY = boxCY - height/8;
boxBRX = boxCX + width/8;
boxBRY = boxCY + height/8;

if (targetLevel > 2)
{
if (winZoom != None)
{
DrawDropShadowBox(gc, x-w/2, y-h/2, w, h); // DXRando: moved this here
mult = (target.CollisionRadius + target.CollisionHeight);
v1 = Player.Location;
v1.Z += Player.BaseEyeHeight;
v2 = 1.5 * Player.Normal(target.Location - v1);
winZoom.SetViewportLocation(target.Location - mult * v2);
winZoom.SetWatchActor(target);
}
// window construction now happens in Tick()
}
else
{
// DXRando: this is dumb
// black out the zoom window and draw a "no image" message
/*gc.SetStyle(DSTY_Normal);
gc.SetTileColorRGB(0,0,0);
gc.DrawPattern(boxTLX, boxTLY, w, h, 0, 0, Texture'Solid');
gc.SetTextColorRGB(255,255,255);
gc.GetTextExtent(0, w, h, msgNoImage);
x = boxCX - w/2;
y = boxCY - h/2;
gc.DrawText(x, y, w, h, msgNoImage);*/
}

// print the name of the target above the box
if (target.IsA('Pawn'))
str = target.BindName;
else if (target.IsA('DeusExDecoration'))
str = DeusExDecoration(target).itemName;
else if (target.IsA('DeusExProjectile'))
str = DeusExProjectile(target).itemName;
else
str = target.GetItemName(String(target.Class));

// print disabled robot info
if (target.IsA('Robot') && (Robot(target).EMPHitPoints == 0))
str = str $ " (" $ msgDisabled $ ")";
gc.SetTextColor(crossColor);

// print the range to target
mult = VSize(target.Location - Player.Location);
str = str $ CR() $ msgRange @ Int(mult/16) @ msgRangeUnits;

gc.GetTextExtent(0, w, h, str);
x = boxTLX + margin;
y = boxTLY - h - margin;
gc.DrawText(x, y, w, h, str);

// level zero gives very basic health info
if (target.IsA('Pawn'))
mult = Float(Pawn(target).Health) / Float(Pawn(target).Default.Health);
else if (target.IsA('DeusExDecoration'))
mult = Float(DeusExDecoration(target).HitPoints) / Float(DeusExDecoration(target).Default.HitPoints);
else
mult = 1.0;

if (targetLevel == 0)
{
// level zero only gives us general health readings
if (mult >= 0.66)
{
str = msgHigh;
mult = 1.0;
}
else if (mult >= 0.33)
{
str = msgMedium;
mult = 0.5;
}
else
{
str = msgLow;
mult = 0.05;
}

str = str @ msgHealth;
}
else
{
// level one gives exact health readings
str = Int(mult * 100.0) $ msgPercent;
if (target.IsA('Pawn') && !target.IsA('Robot') && !target.IsA('Animal'))
{
x = mult; // save this for color calc
str = str @ msgOverall;
mult = Float(Pawn(target).HealthHead) / Float(Pawn(target).Default.HealthHead);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgHead;
mult = Float(Pawn(target).HealthTorso) / Float(Pawn(target).Default.HealthTorso);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgTorso;
mult = Float(Pawn(target).HealthArmLeft) / Float(Pawn(target).Default.HealthArmLeft);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgLeftArm;
mult = Float(Pawn(target).HealthArmRight) / Float(Pawn(target).Default.HealthArmRight);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgRightArm;
mult = Float(Pawn(target).HealthLegLeft) / Float(Pawn(target).Default.HealthLegLeft);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgLeftLeg;
mult = Float(Pawn(target).HealthLegRight) / Float(Pawn(target).Default.HealthLegRight);
str = str $ CR() $ Int(mult * 100.0) $ msgPercent @ msgRightLeg;
mult = x;
}
else
{
str = str @ msgHealth;
}
}

gc.GetTextExtent(0, w, h, str);
x = boxTLX + margin;
y = boxTLY + margin;
gc.SetTextColor(GetColorScaled(mult));
gc.DrawText(x, y, w, h, str);
gc.SetTextColor(colHeaderText);

if (targetLevel > 1)
{
// level two gives us weapon info as well
if (target.IsA('Pawn'))
{
str = msgWeapon;

if (Pawn(target).Weapon != None)
str = str @ target.GetItemName(String(Pawn(target).Weapon.Class));
else
str = str @ msgNone;

gc.GetTextExtent(0, w, h, str);
x = boxTLX + margin;
y = boxBRY - h - margin;
gc.DrawText(x, y, w, h, str);
}
}
}
else
{
// display disabled robots
if (target.IsA('Robot') && (Robot(target).EMPHitPoints == 0))
{
str = msgDisabled;
gc.SetTextColor(crossColor);
gc.GetTextExtent(0, w, h, str);
x = boxCX - w/2;
y = boxTLY - h - margin;
gc.DrawText(x, y, w, h, str);
}
}
}
}
else if ((bTargetActive) && (Player.Level.NetMode == NM_Standalone))
{
if (Player.Level.TimeSeconds % 1.5 > 0.75)
str = msgScanning1;
else
str = msgScanning2;
gc.GetTextExtent(0, w, h, str);
x = width/2 - w/2;
y = (height/2 - h) - 20;
gc.DrawText(x, y, w, h, str);
}

// set the crosshair colors
DeusExRootWindow(player.rootWindow).hud.cross.SetCrosshairColor(crossColor);
}


function GetTargetReticleColor( Actor target, out Color xcolor )
{
local AutoTurret turret;
Expand Down
6 changes: 3 additions & 3 deletions DXRBalance/DeusEx/Classes/AugMuscle.uc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function PostPostBeginPlay()
defaultproperties
{
MaxLevel=1
Description="Muscle strength is amplified with ionic polymeric gel myofibrils that allow the agent to push and lift extraordinarily heavy objects.|n|nTECH ONE: Strength is increased moderately.|n|nTECH TWO: An agent is inhumanly strong."
LevelValues(0)=1.500000
LevelValues(1)=2.000000
Description="Muscle strength is amplified with ionic polymeric gel myofibrils that allow the agent to push and lift extraordinarily heavy objects.|n|nTECH ONE: Strength is increased slightly.|n|nTECH TWO: An agent is inhumanly strong."
LevelValues(0)=1.25
LevelValues(1)=2.0
}
Loading

0 comments on commit c9691b7

Please sign in to comment.