// All code is TheDruidXPAWX's. Really. BotFodder copied from stuff and then figured out // what the arguements to DrawTile meant - that's pretty much it. So it really ain't mine. // I just put some stuff together and it's all Dru's as far as I'm concerned. class RPGHUDInvasion extends HUDInvasion config(user); var PlayerController PC; #EXEC OBJ LOAD FILE=InterfaceContent.utx #EXEC OBJ LOAD FILE=AS_FX_TX.utx simulated function UpdatePrecacheMaterials() { Super.UpdatePrecacheMaterials(); } simulated function ShowTeamScorePassA(Canvas C) { Super.ShowTeamScorePassA(C); } simulated function ShowTeamScorePassC(Canvas C) { local Pawn P; local float Dist, MaxDist, RadarWidth, PulseBrightness,Angle,DotSize,OffsetY,OffsetScale; local rotator Dir; local vector Start; local FriendlyMonsterEffect effect; local RPGStatsInv StatsInv; local int x; local bool ok; local int DeltaHealth; if(PC == None) //Initialize PC PC = Level.GetLocalPlayerController(); LastDrawRadar = Level.TimeSeconds; RadarWidth = 0.5 * RadarScale * C.ClipX; DotSize = 24*C.ClipX*HUDScale/1600; if ( PawnOwner == None ) Start = PlayerOwner.Location; else Start = PawnOwner.Location; MaxDist = 3000 * RadarPulse; C.Style = ERenderStyle.STY_Translucent; OffsetY = RadarPosY + RadarWidth/C.ClipY; MinEnemyDist = 3000; ForEach DynamicActors(class'Pawn',P) { ok = false; if ( P.Health > 0 ) { Dist = VSize(Start - P.Location); if ( Dist < 3000 ) { if ( Dist < MaxDist ) PulseBrightness = 255 - 255*Abs(Dist*0.00033 - RadarPulse); else PulseBrightness = 255 - 255*Abs(Dist*0.00033 - RadarPulse - 1); if ( Monster(P) != None ) { MinEnemyDist = FMin(MinEnemyDist, Dist); if(PawnOwner == None) { //Dont know what color to give it C.DrawColor.R = PulseBrightness; C.DrawColor.G = PulseBrightness; C.DrawColor.B = 0; } else { DeltaHealth = Max(Min(PawnOwner.Health - P.Health, 255), -255); //Green for less dangerous, Red for more dangerous. C.DrawColor.R = ((-1 * DeltaHealth) / 2 + 128) * (PulseBrightness / 255.0); C.DrawColor.G = (DeltaHealth / 2 + 128) * (PulseBrightness / 255.0); C.DrawColor.B = 0; } } else if ( Vehicle(P) != None && Vehicle(P).Driver == None) { //make empty vehicles grey. C.DrawColor.R = PulseBrightness/2; C.DrawColor.G = PulseBrightness/2; C.DrawColor.B = PulseBrightness/2; } else { //BotFodder: I'd like to take credit for the code below but I lifted it close to //verbatim from some of Dru's other code. StatsInv = RPGStatsInv(P.FindInventoryType(class'RPGStatsInv')); if (StatsInv != None) { for (x = 0; x < StatsInv.Data.Abilities.length && !ok; x++) if(StatsInv.Data.Abilities[x] == class'AbilityLoadedHealing') ok = true; } // Check if they're a medic if (ok) { // BF: Lightened it just a little with a bit of green. C.DrawColor.R = 0; C.DrawColor.G = PulseBrightness/4; C.DrawColor.B = PulseBrightness; } else { //make players blue C.DrawColor.R = 0; C.DrawColor.G = 0; C.DrawColor.B = PulseBrightness; } } Dir = rotator(P.Location - Start); OffsetScale = RadarScale*Dist*0.000167; if ( PawnOwner == None ) Angle = ((Dir.Yaw - PlayerOwner.Rotation.Yaw) & 65535) * 6.2832/65536; else Angle = ((Dir.Yaw - PawnOwner.Rotation.Yaw) & 65535) * 6.2832/65536; C.SetPos(RadarPosX * C.ClipX + OffsetScale * C.ClipX * sin(Angle) - 0.5*DotSize, OffsetY * C.ClipY - OffsetScale * C.ClipX * cos(Angle) - 0.5*DotSize); if (ok) { // BF: Medics will look like blue health crosses - even the owner of the radar. // Could change that but Medics will have a reminder of which character // they're playing C.DrawTile(Material'InterfaceContent.Hud.SkinA',DotSize,DotSize,29,775,85,85); } else { C.DrawTile(Material'InterfaceContent.Hud.SkinA',DotSize,DotSize,838,238,144,144); } } } } ForEach DynamicActors(class'FriendlyMonsterEffect',Effect) { Dist = VSize(Start - Effect.Location); if ( Dist < 3000 ) { if ( Dist < MaxDist ) PulseBrightness = 255 - 255*Abs(Dist*0.00033 - RadarPulse); else PulseBrightness = 255 - 255*Abs(Dist*0.00033 - RadarPulse - 1); Dir = rotator(Effect.Location - Start); OffsetScale = RadarScale*Dist*0.000167; if ( PawnOwner == None ) Angle = ((Dir.Yaw - PlayerOwner.Rotation.Yaw) & 65535) * 6.2832/65536; else Angle = ((Dir.Yaw - PawnOwner.Rotation.Yaw) & 65535) * 6.2832/65536; if (PC != None && PC.PlayerReplicationInfo != None && PC.PlayerReplicationInfo == Effect.MasterPRI) { //make my monsters look green C.DrawColor.R = 0; C.DrawColor.G = FMin(PulseBrightness*2, 255); C.DrawColor.B = 0; } else { //Make friendly monsters an off blue C.DrawColor.R = 0; C.DrawColor.G = 0; C.DrawColor.B = FMin(PulseBrightness*2, 255); } C.SetPos(RadarPosX * C.ClipX + OffsetScale * C.ClipX * sin(Angle) - 0.5*(DotSize*1.4), OffsetY * C.ClipY - OffsetScale * C.ClipX * cos(Angle) - 0.5*(DotSize*1.4)); C.DrawTile(Material'InterfaceContent.Hud.SkinA',(DotSize*1.4),(DotSize*1.4),838,238,144,144); } } } simulated function Tick(float DeltaTime) { Super.Tick(DeltaTime); } defaultproperties { }