Updated to the latest KF version

This commit is contained in:
ForrestMarkX 2020-01-09 05:05:13 -06:00
parent fd568e3d66
commit 245eb9e552
12 changed files with 1408 additions and 1044 deletions

View File

@ -230,7 +230,7 @@ function int AddItemByPriority( out SItemInformation WeaponInfo )
return BestIndex;
}
function bool CanCarry( const out STraderItem Item )
function bool CanCarry(const out STraderItem Item, optional int OverrideLevelValue = INDEX_NONE)
{
local int Result;

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@ function UpdatePerk()
{
local int CurrentPerkLevel,CurrentPerkEXP;
local Ext_PerkBase CurrentPerk;
local GFxObject PerkIconObject;
if( ExPC == none || ExPC.ActivePerkManager==None || ExPC.ActivePerkManager.CurrentPerk==None )
return;
@ -26,7 +27,11 @@ function UpdatePerk()
if( ( ExLastPerkClass != CurrentPerk.Class ) || ( LastPerkLevel != CurrentPerkLevel ) )
{
CurPerkPath = CurrentPerk.GetPerkIconPath(CurrentPerkLevel);
SetString("playerPerkIcon" , CurPerkPath);
PerkIconObject = CreateObject("Object");
PerkIconObject.SetString("perkIcon", CurPerkPath);
SetObject("playerPerkIcon", PerkIconObject);
SetInt("playerPerkXPPercent", CurrentPerk.GetProgressPercent() * 100.f );
if( LastPerkLevel != CurrentPerkLevel && ExLastPerkClass==CurrentPerk.Class )
{

File diff suppressed because it is too large Load Diff

View File

@ -103,8 +103,8 @@ defaultproperties
WidgetBindings.Add((WidgetName="PlayerBackpackWidget",WidgetClass=class'ExtHUD_PlayerBackpack'))
WidgetBindings.Remove((WidgetName="WaveInfoContainer",WidgetClass=class'KFGFxHUD_WaveInfo'))
WidgetBindings.Add((WidgetName="WaveInfoContainer",WidgetClass=class'ExtHUD_WaveInfo'))
WidgetBindings.Remove((WidgetName="bossHealthBar", WidgetClass=class'KFGFxWidget_BossHealthBar'))
WidgetBindings.Add((WidgetName="bossHealthBar", WidgetClass=class'ExtWidget_BossHealthBar'))
//WidgetBindings.Remove((WidgetName="bossHealthBar", WidgetClass=class'KFGFxWidget_BossHealthBar'))
//WidgetBindings.Add((WidgetName="bossHealthBar", WidgetClass=class'ExtWidget_BossHealthBar'))
WidgetBindings.Remove((WidgetName="WeaponSelectContainer",WidgetClass=class'KFGFxHUD_WeaponSelectWidget'))
WidgetBindings.Add((WidgetName="WeaponSelectContainer",WidgetClass=class'ExtHUD_WeaponSelectWidget'))
}

View File

@ -144,7 +144,7 @@ reliable client event ReceiveLocalizedMessage( class<LocalMessage> Message, opti
Super.ReceiveLocalizedMessage(Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject);
}
function AddZedKill( class<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT )
function AddZedKill( class<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT, bool bKiller )
{
// Stats.
if( ActivePerkManager!=None )
@ -603,7 +603,7 @@ simulated function CancelConnection()
else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect");
}
function NotifyLevelUp(class<KFPerk> PerkClass, byte PerkLevel);
function NotifyLevelUp(class<KFPerk> PerkClass, byte PerkLevel, byte NewPrestigeLevel);
function ShowBossNameplate( KFInterface_MonsterBoss KFBoss, optional string PlayerName)
{
@ -1167,6 +1167,16 @@ state Dead
}
}
exec function RequestSwitchTeam()
{
ConsoleCommand("disconnect");
}
exec function SwitchTeam()
{
ConsoleCommand("disconnect");
}
defaultproperties
{
InputClass=Class'ExtPlayerInput'

View File

@ -8,15 +8,14 @@ struct FCustomCharEntry
};
struct FMyCustomChar // Now without constant.
{
var int CharacterIndex,HeadMeshIndex,HeadSkinIndex,BodyMeshIndex,BodySkinIndex,AttachmentMeshIndices[`MAX_COSMETIC_ATTACHMENTS],AttachmentSkinIndices[`MAX_COSMETIC_ATTACHMENTS];
var int CharacterIndex,HeadMeshIndex,HeadSkinIndex,BodyMeshIndex,BodySkinIndex,AttachmentMeshIndices[`MAX_COSMETIC_ATTACHMENTS],AttachmentSkinIndices[`MAX_COSMETIC_ATTACHMENTS];
structdefaultproperties
{
CharacterIndex=255
AttachmentMeshIndices[0]=255
AttachmentMeshIndices[1]=255
AttachmentMeshIndices[2]=255
}
structdefaultproperties
{
AttachmentMeshIndices[0]=`CLEARED_ATTACHMENT_INDEX
AttachmentMeshIndices[1]=`CLEARED_ATTACHMENT_INDEX
AttachmentMeshIndices[2]=`CLEARED_ATTACHMENT_INDEX
}
};
// For custom trader inventory.
@ -658,7 +657,7 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
c = 0;
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
{
if( CustomCharacter.AttachmentMeshIndices[i]!=255 )
if( CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX )
++c;
}
@ -668,7 +667,7 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
// Write attachments.
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
{
if( CustomCharacter.AttachmentMeshIndices[i]!=255 )
if( CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX )
{
Data.SaveInt(i);
Data.SaveInt(CustomCharacter.AttachmentMeshIndices[i]);
@ -748,6 +747,16 @@ static final function DummySaveChar( ExtSaveDataBase Data )
Data.SaveStr("");
}
simulated function Texture2D GetCurrentIconToDisplay()
{
if(CurrentVoiceCommsRequest == VCT_NONE && ECurrentPerk != none)
{
return ECurrentPerk.default.PerkIcon;
}
return class'KFLocalMessage_VoiceComms'.default.VoiceCommsIcons[CurrentVoiceCommsRequest];
}
// Set admin levels without having to hard-reference to this mod.
event BeginState(Name N)
{

View File

@ -21,7 +21,7 @@ function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
local bool bIsLeader;
local bool bIsMyPlayer;
local ExtPlayerController EPC;
local GFxObject PlayerInfoObject;
local GFxObject PlayerInfoObject, PerkIconObject;
local ExtPlayerReplicationInfo EPRI;
PlayerInfoObject = CreateObject("Object");
@ -42,8 +42,11 @@ function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
PlayerInfoObject.SetBool("myPlayer", bIsMyPlayer);
if( ExtMemberSlots[SlotIndex].PerkClass != none )
{
PerkIconObject = CreateObject("Object");
PerkIconObject.SetString("perkIcon", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
PlayerInfoObject.SetObject("perkImageSource", PerkIconObject);
PlayerInfoObject.SetString("perkLevel", string(EPRI.ECurrentPerkLevel));
PlayerInfoObject.SetString("perkIconPath", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
}
if( !bIsMyPlayer )
{
@ -76,5 +79,4 @@ function GFxObject RefreshSlot( int SlotIndex, KFPlayerReplicationInfo KFPRI )
DefaultProperties
{
PlayerSlots=12
}

View File

@ -105,7 +105,7 @@ simulated final function bool IsWeaponOnPerk( KFWeapon W )
simulated static function string GetPerkIconPath( int Level )
{
return "img://"$PathName(Default.PerkIcon);
return "img://"$PathName(default.PerkIcon);
}
simulated function PostBeginPlay()

View File

@ -446,97 +446,131 @@ final function RenderProgress()
function DrawHUD()
{
local KFPawn KFPH;
local KFPawn_Human H;
local KFPawn_Human KFPH;
local KFPawn_Scripted KFPS;
local vector ViewLocation, ViewVector, PlayerPartyInfoLocation, PawnLocation;
local rotator ViewRotation;
local array<PlayerReplicationInfo> VisibleHumanPlayers;
local array<sHiddenHumanPawnInfo> HiddenHumanPlayers;
local float ThisDot,DotScale;
local vector TargetLocation;
local Actor LocActor;
local KFPawn_Monster M;
local vector V;
local bool bSpec;
local array<PlayerReplicationInfo> VisibleHumanPlayers;
local array<sHiddenHumanPawnInfo> HiddenHumanPlayers;
local vector ViewLocation,PawnLocation;
local rotator ViewRotation;
Super(HUD).DrawHUD();
// Draw the crosshair for casual mode
if( bDrawCrosshair || bForceDrawCrosshair || (KFPlayerOwner != none && KFPlayerOwner.GetTeamNum() == 255) )
{
if( KFPlayerOwner != none && !KFPlayerOwner.bCinematicMode )
DrawCrosshair();
// Draw weapon HUD underneath everything else
if( KFPlayerOwner != none && KFPlayerOwner.Pawn != none && KFPlayerOwner.Pawn.Weapon != none )
{
KFPlayerOwner.Pawn.Weapon.DrawHUD( self, Canvas );
}
super.DrawHUD();
// Cache GRI
if( KFGRI == none )
{
KFGRI = KFGameReplicationInfo( WorldInfo.GRI );
}
// Don't draw canvas HUD in cinematic mode
if( KFPlayerOwner != none && KFPlayerOwner.bCinematicMode )
{
return;
}
LocActor = KFPlayerOwner.ViewTarget != none ? KFPlayerOwner.ViewTarget : KFPlayerOwner;
// Draw the crosshair for casual mode
if( KFPlayerOwner != none && (bDrawCrosshair || bForceDrawCrosshair || KFPlayerOwner.GetTeamNum() == 255) )
{
DrawCrosshair();
}
// Friendly player status
bSpec = (PlayerOwner.PlayerReplicationInfo!=None && PlayerOwner.PlayerReplicationInfo.bOnlySpectator);
if( bSpec || PlayerOwner.GetTeamNum()==0 )
{
//Friendly player status
if( !class'ExtPlayerController'.Default.bHideNameBeacons )
{
if( KFPlayerOwner != none )
{
KFPlayerOwner.GetPlayerViewPoint( ViewLocation, ViewRotation );
}
{
if( KFPlayerOwner != none )
{
KFPlayerOwner.GetPlayerViewPoint( ViewLocation, ViewRotation );
}
ViewVector = vector(ViewRotation);
Canvas.EnableStencilTest(true);
foreach WorldInfo.AllPawns(class'KFPawn', KFPH)
{
if( KFPH == None )
continue;
Canvas.EnableStencilTest(true);
foreach WorldInfo.AllPawns( class'KFPawn_Human', KFPH )
{
if( KFPH.IsAliveAndWell() && KFPH != KFPlayerOwner.Pawn && KFPH.Mesh.SkeletalMesh != none && KFPH.Mesh.bAnimTreeInitialised )
{
PlayerPartyInfoLocation = KFPH.Mesh.GetPosition() + ( KFPH.CylinderComponent.CollisionHeight * vect(0,0,1) );
if(`TimeSince(KFPH.Mesh.LastRenderTime) < 0.2f && Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector > 0.f )
{
if( DrawFriendlyHumanPlayerInfo(KFPH) )
{
VisibleHumanPlayers.AddItem( KFPH.PlayerReplicationInfo );
}
else
{
HiddenHumanPlayers.Insert( 0, 1 );
HiddenHumanPlayers[0].HumanPawn = KFPH;
HiddenHumanPlayers[0].HumanPRI = KFPH.PlayerReplicationInfo;
}
}
else
{
HiddenHumanPlayers.Insert( 0, 1 );
HiddenHumanPlayers[0].HumanPawn = KFPH;
HiddenHumanPlayers[0].HumanPRI = KFPH.PlayerReplicationInfo;
}
}
}
H = KFPawn_Human(KFPH);
if( KFPH.PlayerReplicationInfo!=None && KFPH.PlayerReplicationInfo.Team!=None && KFPH.PlayerReplicationInfo.Team.TeamIndex==0 )
{
V = KFPH.Location + KFPH.MTO_PhysSmoothOffset + KFPH.CylinderComponent.CollisionHeight * vect(0,0,1);
ThisDot = Normal(V - PLCameraLoc) dot Normal(PLCameraDir);
foreach WorldInfo.AllPawns(class'KFPawn_Scripted', KFPS)
{
if (KFPS.ShouldShowOnHUD())
{
PlayerPartyInfoLocation = KFPS.Mesh.GetPosition() + (KFPS.CylinderComponent.CollisionHeight * vect(0,0,1));
DrawScriptedPawnInfo(KFPS, Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector, `TimeSince(KFPS.Mesh.LastRenderTime) < 0.2f);
}
}
if( KFPH.IsAliveAndWell() && KFPH != PlayerOwner.Pawn)
{
if((WorldInfo.TimeSeconds - KFPH.Mesh.LastRenderTime) < 0.4f && (ThisDot > 0 && ThisDot < 1.0) )
{
if( H!=None )
{
DrawFriendlyHUD(H);
VisibleHumanPlayers.AddItem( H.PlayerReplicationInfo );
}
else DrawMonsterHUD(KFPH);
}
else if( H != None )
{
HiddenHumanPlayers.Insert( 0, 1 );
HiddenHumanPlayers[0].HumanPawn = H;
HiddenHumanPlayers[0].HumanPRI = H.PlayerReplicationInfo;
}
}
}
}
if( !KFGRI.bHidePawnIcons )
{
// Draw hidden players
CheckAndDrawHiddenPlayerIcons( VisibleHumanPlayers, HiddenHumanPlayers );
// Draw hidden players
CheckAndDrawHiddenPlayerIcons( VisibleHumanPlayers, HiddenHumanPlayers );
// Draw last remaining zeds
CheckAndDrawRemainingZedIcons();
// Draw last remaining zeds
CheckAndDrawRemainingZedIcons();
//Draw our current objective location
if(KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none)
{
KFGRI.ObjectiveInterface.DrawHUD(self, Canvas);
Canvas.EnableStencilTest(false);
TargetLocation = KFGRI.ObjectiveInterface.GetIconLocation();
ThisDot = Normal((TargetLocation + (class'KFPawn_Human'.default.CylinderComponent.CollisionHeight * vect(0, 0, 1))) - ViewLocation) dot ViewVector;
if( bSpec )
{
// Draw zed health bars.
foreach WorldInfo.AllPawns(class'KFPawn_Monster', M)
{
ThisDot = (PLCameraDir Dot (M.Location + M.CylinderComponent.CollisionHeight * vect(0,0,1))) - PLCameraDot;
if( ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f )
DrawFriendlyHUDZ(M);
}
}
}
if (ThisDot > 0 &&
KFGRI.ObjectiveInterface.ShouldShowObjectiveHUD() &&
(!KFGRI.ObjectiveInterFace.HasObjectiveDrawDistance() || VSizeSq(TargetLocation - LocActor.Location) < MaxDrawDistanceObjective))
{
DrawObjectiveHUD();
}
}
}
Canvas.EnableStencilTest(false);
}
}
else if( KFPawn_Monster(PlayerOwner.Pawn)!=None )
{
// Draw human health auras.
DotScale = Canvas.ClipX*0.2f;
foreach WorldInfo.AllPawns(class'KFPawn_Human', H)
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFPH)
{
PawnLocation = H.Location;
PawnLocation = KFPH.Location;
if( IsZero( PawnLocation ) )
{
@ -544,12 +578,12 @@ function DrawHUD()
}
ThisDot = (PLCameraDir Dot PawnLocation) - PLCameraDot;
if( H.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f )
if( KFPH.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f )
{
V = Canvas.Project(PawnLocation);
if( V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100) )
continue;
Canvas.DrawColor = GetHPColorScale(H);
Canvas.DrawColor = GetHPColorScale(KFPH);
if( PlayerOwner.FastTrace(PawnLocation,PLCameraLoc) )
ThisDot*=1.75f;
ThisDot = (DotScale/ThisDot)*350.f;
@ -560,6 +594,7 @@ function DrawHUD()
if( !class'ExtPlayerController'.Default.bHideNameBeacons )
{
Canvas.EnableStencilTest(true);
// Draw zed health bars.
foreach WorldInfo.AllPawns(class'KFPawn_Monster', M)
{
@ -567,52 +602,9 @@ function DrawHUD()
if( ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f )
DrawFriendlyHUDZ(M);
}
Canvas.EnableStencilTest(false);
}
}
Canvas.Font = GetFontSizeIndex(0);
DrawActorOverlays(PLCameraLoc, PLCameraRot);
}
function DrawHiddenHumanPlayerIcon( PlayerReplicationInfo PRI, vector IconWorldLocation )
{
local vector ScreenPos;
local float IconSizeMult;
local KFPlayerReplicationInfo KFPRI;
local Texture2D PlayerIcon;
local Color PerkColor;
local ExtPlayerReplicationInfo ExtPRI;
local Texture2D HumanIcon;
KFPRI = KFPlayerReplicationInfo(PRI);
if( KFPRI == None )
return;
// Project world pos to canvas
ScreenPos = Canvas.Project( IconWorldLocation + vect(0,0,2.2f) * class'KFPAwn_Human'.default.CylinderComponent.CollisionHeight );
// Fudge by icon size
IconSizeMult = PlayerStatusIconSize * FriendlyHudScale * 0.5f;
ScreenPos.X -= IconSizeMult;
ScreenPos.Y -= IconSizeMult;
if( ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY )
{
return;
}
ExtPRI = ExtPlayerReplicationInfo(KFPRI);
if( ExtPRI == None )
return;
HumanIcon = ExtPRI.ECurrentPerk != None ? ExtPRI.ECurrentPerk.Default.PerkIcon : GenericHumanIconTexture;
PlayerIcon = PlayerOwner.GetTeamNum() == 0 ? HumanIcon : GenericHumanIconTexture;
PerkColor = ExtPRI.HUDPerkColor;
// Draw human icon
Canvas.SetDrawColor( PerkColor.R, PerkColor.G, PerkColor.B, PerkColor.A );
Canvas.SetPos( ScreenPos.X, ScreenPos.Y );
Canvas.DrawTile( PlayerIcon, PlayerStatusIconSize * FriendlyHudScale, PlayerStatusIconSize * FriendlyHudScale, 0, 0, 256, 256 );
}
simulated static final function color GetHPColorScale( Pawn P )
@ -642,8 +634,10 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH )
local vector ScreenPos, TargetLocation;
local FontRenderInfo MyFontRenderInfo;
local float FontScale;
local byte FadeAlpha;
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
FadeAlpha = DrawToDistance(KFPH);
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
BarHeight = FMin(8.f * (float(Canvas.SizeX) / 1024.f), 8.f) * FriendlyHudScale;
@ -656,16 +650,19 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH )
//Draw health bar
Percentage = float(KFPH.Health) / float(KFPH.HealthMax);
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor);
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor, FadeAlpha);
//Draw player name (Top)
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
Canvas.SetDrawColorStruct(DrawToDistance(KFPH, PlayerBarTextColor));
Canvas.DrawColor = PlayerBarTextColor;
Canvas.DrawColor.A = FadeAlpha;
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 2);
Canvas.DrawText( KFPH.PlayerReplicationInfo.PlayerName,,FontScale,FontScale, MyFontRenderInfo );
}
simulated function DrawFriendlyHUD( KFPawn_Human KFPH )
simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH )
{
local float Percentage;
local float BarHeight, BarLength;
@ -673,91 +670,122 @@ simulated function DrawFriendlyHUD( KFPawn_Human KFPH )
local ExtPlayerReplicationInfo KFPRI;
local FontRenderInfo MyFontRenderInfo;
local float FontScale;
local string S;
local float ResModifier;
local float PerkIconPosX, PerkIconPosY, SupplyIconPosX, SupplyIconPosY, PerkIconSize;
local color CurrentArmorColor, CurrentHealthColor, TextColor;
local string S;
local byte FadeAlpha;
ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale;
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
if( KFPRI == none )
return;
{
return false;
}
FadeAlpha = DrawToDistance(KFPH);
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
BarLength = FMin(PlayerStatusBarLengthMax * (Canvas.ClipX / 1024.f), PlayerStatusBarLengthMax) * ResModifier;
BarHeight = FMin(8.f * (Canvas.ClipX / 1024.f), 8.f) * ResModifier;
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
BarHeight = FMin(8.f * (float(Canvas.SizeX) / 1024.f), 8.f) * FriendlyHudScale;
TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 1.2;
ScreenPos = Canvas.Project(TargetLocation);
if( ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY )
return;
//Draw health bar
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax),1.f);
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor, true);
//Draw armor bar
Percentage = FMin(float(KFPH.Armor) / float(KFPH.MaxArmor),1.f);
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight, ArmorColor);
TargetLocation = KFPH.Mesh.GetPosition() + ( KFPH.CylinderComponent.CollisionHeight * vect(0,0,2.5f) );
ScreenPos = Canvas.Project( TargetLocation );
if( ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY )
{
return false;
}
//Draw player name (Top)
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
S = KFPRI.GetHumanReadableName();
// drop shadow for player name text
S = KFPRI.PlayerName;
if( KFPRI.bBot )
{
S = S$" (Bot)";
Canvas.DrawColor = KFPRI.HUDPerkColor;
TextColor = KFPRI.HUDPerkColor;
}
else if( KFPRI.ShowAdminName() ) // Admin info.
{
S = S$" ("$KFPRI.GetAdminNameAbr()$")";
Canvas.DrawColor = KFPRI.GetAdminColorC();
TextColor = KFPRI.GetAdminColorC();
}
else Canvas.DrawColor = WhiteColor;
else TextColor = PlayerBarTextColor;
if( bMeAdmin && KFPRI.FixedData>0 )
{
Canvas.SetDrawColor(255,0,0,255);
S $= " -"$KFPRI.GetDesc();
TextColor = MakeColor(255,0,0,255);
S @= "-"$KFPRI.GetDesc();
}
Canvas.DrawColor = DrawToDistance(KFPH, Canvas.DrawColor);
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 3);
Canvas.DrawText( S,,FontScale,FontScale, MyFontRenderInfo );
TextColor.A = FadeAlpha;
if( KFPRI.ECurrentPerk!=none )
Canvas.DrawColor = PlayerBarShadowColor;
Canvas.DrawColor.A = FadeAlpha;
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f) + 1, ScreenPos.Y + 8);
Canvas.DrawText(S, , FontScale, FontScale, MyFontRenderInfo);
Canvas.DrawColor = TextColor;
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + 7);
Canvas.DrawText(S, , FontScale, FontScale, MyFontRenderInfo);
//Draw armor bar
Percentage = FMin(float(KFPH.Armor) / float(KFPH.MaxArmor), 100);
CurrentArmorColor = ClassicPlayerInfo ? ClassicArmorColor : ArmorColor;
CurrentArmorColor.A = FadeAlpha;
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight + (36 * FontScale * ResModifier), CurrentArmorColor, FadeAlpha);
//Draw health bar
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax), 100);
CurrentHealthColor = ClassicPlayerInfo ? ClassicHealthColor : HealthColor;
CurrentHealthColor.A = FadeAlpha;
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 2 + (36 * FontScale * ResModifier), CurrentHealthColor, FadeAlpha, true);
if( KFPRI.ECurrentPerk == None )
{
//draw perk icon
Canvas.DrawColor = DrawToDistance(KFPH, KFPRI.HUDPerkColor);
Canvas.SetPos(ScreenPos.X - (BarLength * 0.75), ScreenPos.Y - BarHeight * 2);
Canvas.DrawRect(PlayerStatusIconSize*FriendlyHudScale,PlayerStatusIconSize*FriendlyHudScale,KFPRI.ECurrentPerk.default.PerkIcon);
//Draw perk level and name text
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y + BarHeight);
Canvas.DrawText( KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.default.PerkName,,FontScale,FontScale, MyFontRenderInfo );
if( KFPRI.HasSupplier!=None )
{
Canvas.DrawColor = DrawToDistance(KFPH, (KFPlayerOwner.Pawn==None || KFPRI.CanUseSupply(KFPlayerOwner.Pawn)) ? SupplierUsableColor : SupplierActiveColor);
Canvas.SetPos( ScreenPos.X + BarLength * 0.5f, ScreenPos.Y - BarHeight * 2 );
Canvas.DrawRect( PlayerStatusIconSize*FriendlyHudScale, PlayerStatusIconSize*FriendlyHudScale, KFPRI.HasSupplier.Default.SupplyIcon);
}
return false;
}
else if( KFPRI.bBot && KFPRI.CurrentPerkClass!=none )
{
//draw perk icon
Canvas.SetPos(ScreenPos.X - (BarLength * 0.75), ScreenPos.Y - BarHeight * 2);
Canvas.DrawRect(PlayerStatusIconSize*FriendlyHudScale,PlayerStatusIconSize*FriendlyHudScale,KFPRI.CurrentPerkClass.default.PerkIcon);
//Draw name text
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y + BarHeight);
Canvas.DrawText( KFPRI.CurrentPerkClass.default.PerkName,,FontScale,FontScale, MyFontRenderInfo );
}
// drop shadow for perk name text
Canvas.DrawColor = PlayerBarShadowColor;
Canvas.DrawColor.A = FadeAlpha;
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f) + 1, ScreenPos.Y + BarHeight * 3 + (36 * FontScale * ResModifier) + 1);
Canvas.DrawText(KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.default.PerkName, , FontScale, FontScale, MyFontRenderInfo);
//Draw perk level and name text
Canvas.DrawColor = PlayerBarTextColor;
Canvas.DrawColor.A = FadeAlpha;
Canvas.SetPos(ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 3 + (36 * FontScale * ResModifier));
Canvas.DrawText(KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.default.PerkName, , FontScale, FontScale, MyFontRenderInfo);
// drop shadow for perk icon
Canvas.DrawColor = PlayerBarShadowColor;
Canvas.DrawColor.A = FadeAlpha;
PerkIconSize = PlayerStatusIconSize * ResModifier;
PerkIconPosX = ScreenPos.X - (BarLength * 0.5f) - PerkIconSize + 1;
PerkIconPosY = ScreenPos.Y + (36 * FontScale * ResModifier) + 1;
SupplyIconPosX = ScreenPos.X + (BarLength * 0.5f) + 1;
SupplyIconPosY = PerkIconPosY + 4 * ResModifier;
DrawPerkIcons(KFPH, PerkIconSize, PerkIconPosX, PerkIconPosY, SupplyIconPosX, SupplyIconPosY, true);
//draw perk icon
Canvas.DrawColor = PlayerBarIconColor;
Canvas.DrawColor.A = FadeAlpha;
PerkIconPosX = ScreenPos.X - (BarLength * 0.5f) - PerkIconSize;
PerkIconPosY = ScreenPos.Y + (36 * FontScale * ResModifier);
SupplyIconPosX = ScreenPos.X + (BarLength * 0.5f);
SupplyIconPosY = PerkIconPosY + 4 * ResModifier;
DrawPerkIcons(KFPH, PerkIconSize, PerkIconPosX, PerkIconPosY, SupplyIconPosX, SupplyIconPosY, false);
return true;
}
simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float BarLength, float BarHeight, float XPos, float YPos, Color BarColor, optional bool bDrawingHealth )
simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float BarLength, float BarHeight, float XPos, float YPos, Color BarColor, byte FadeAlpha, optional bool bDrawingHealth )
{
//background for status bar
Canvas.SetDrawColorStruct(DrawToDistance(P, PlayerBarBGColor));
Canvas.DrawColor = PlayerBarBGColor;
Canvas.DrawColor.A = FadeAlpha;
Canvas.SetPos(XPos, YPos);
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength, BarHeight, 0, 0, 32, 32);
@ -767,7 +795,8 @@ simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float
BarHeight-=2;
//Forground for status bar.
Canvas.SetDrawColorStruct(DrawToDistance(P, BarColor));
Canvas.DrawColor = BarColor;
Canvas.DrawColor.A = FadeAlpha;
Canvas.SetPos(XPos, YPos);
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32);
@ -777,11 +806,76 @@ simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float
XPos+=(BarLength * BarPercentage);
BarPercentage = FMin(float(ExtHumanPawn(P).RepRegenHP) / float(P.HealthMax),1.f-BarPercentage);
Canvas.DrawColor = DrawToDistance(P, MakeColor(255,128,128,255));
Canvas.DrawColor = MakeColor(255,128,128,FadeAlpha);
Canvas.SetPos(XPos, YPos);
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32);
}
}
simulated function DrawPerkIcons(KFPawn_Human KFPH, float PerkIconSize, float PerkIconPosX, float PerkIconPosY, float SupplyIconPosX, float SupplyIconPosY, bool bDropShadow)
{
local byte PrestigeLevel;
local ExtPlayerReplicationInfo KFPRI;
local color TempColor;
local float ResModifier;
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
if (KFPRI == none)
{
return;
}
PrestigeLevel = KFPRI.GetActivePerkPrestigeLevel();
ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale;
if (KFPRI.CurrentVoiceCommsRequest == VCT_NONE && KFPRI.ECurrentPerk != none && PrestigeLevel > 0)
{
Canvas.SetPos(PerkIconPosX, PerkIconPosY);
Canvas.DrawTile(KFPRI.ECurrentPerk.default.BasePerk.default.PrestigeIcons[PrestigeLevel - 1], PerkIconSize, PerkIconSize, 0, 0, 256, 256);
}
if (PrestigeLevel > 0)
{ //icon slot in image is not centered
Canvas.SetPos(PerkIconPosX + (PerkIconSize * (1 - PrestigeIconScale)) / 2, PerkIconPosY + PerkIconSize * 0.05f);
Canvas.DrawTile(KFPRI.GetCurrentIconToDisplay(), PerkIconSize * PrestigeIconScale, PerkIconSize * PrestigeIconScale, 0, 0, 256, 256);
}
else
{
Canvas.SetPos(PerkIconPosX, PerkIconPosY);
Canvas.DrawTile(KFPRI.GetCurrentIconToDisplay(), PerkIconSize, PerkIconSize, 0, 0, 256, 256);
}
if (KFPRI.PerkSupplyLevel > 0 && KFPRI.ECurrentPerk.default.BasePerk.static.GetInteractIcon() != none)
{
if (!bDropShadow)
{
if (KFPRI.PerkSupplyLevel == 2)
{
if (KFPRI.bPerkPrimarySupplyUsed && KFPRI.bPerkSecondarySupplyUsed)
{
TempColor = SupplierActiveColor;
}
else if (KFPRI.bPerkPrimarySupplyUsed || KFPRI.bPerkSecondarySupplyUsed)
{
TempColor = SupplierHalfUsableColor;
}
else
{
TempColor = SupplierUsableColor;
}
}
else if (KFPRI.PerkSupplyLevel == 1)
{
TempColor = KFPRI.bPerkPrimarySupplyUsed ? SupplierActiveColor : SupplierUsableColor;
}
Canvas.SetDrawColorStruct(TempColor);
}
Canvas.SetPos(SupplyIconPosX, SupplyIconPosY); //offset so that supplier icon shows up on the correct side of the player's health bar
Canvas.DrawTile(KFPRI.ECurrentPerk.default.BasePerk.static.GetInteractIcon(), (PlayerStatusIconSize * 0.75) * ResModifier, (PlayerStatusIconSize * 0.75) * ResModifier, 0, 0, 256, 256);
}
}
simulated function DrawMonsterHUD( KFPawn KFPH )
{
local float Percentage;
@ -790,11 +884,13 @@ simulated function DrawMonsterHUD( KFPawn KFPH )
local Ext_T_MonsterPRI PRI;
local FontRenderInfo MyFontRenderInfo;
local float FontScale;
local byte FadeAlpha;
PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo);
if( PRI==None )
return;
FadeAlpha = DrawToDistance(KFPH);
MyFontRenderInfo = Canvas.CreateFontRenderInfo( true );
BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale;
@ -808,12 +904,12 @@ simulated function DrawMonsterHUD( KFPawn KFPH )
//Draw health bar
Percentage = FMin(float(KFPH.Health) / float(KFPH.HealthMax),1.f);
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor);
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength *0.5f), ScreenPos.Y, HealthColor, FadeAlpha);
//Draw player name (Top)
FontScale = class'KFGameEngine'.Static.GetKFFontScale() * FriendlyHudScale;
Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont();
Canvas.DrawColor = DrawToDistance(KFPH, (PRI.OwnerPRI==PlayerOwner.PlayerReplicationInfo ? MakeColor(32,250,32,255) : MakeColor(250,32,32,255)));
Canvas.DrawColor = PRI.OwnerPRI==PlayerOwner.PlayerReplicationInfo ? MakeColor(32,250,32,FadeAlpha) : MakeColor(250,32,32,FadeAlpha);
Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 3);
Canvas.DrawText( PRI.PlayerName,,FontScale,FontScale, MyFontRenderInfo );
@ -866,18 +962,16 @@ simulated function DrawPetInfo()
}
}
function Color DrawToDistance(KFPawn Pawn, Color DrawColor)
function byte DrawToDistance(Actor A, optional float StartAlpha=255.f, optional float MinAlpha=90.f)
{
local float Dist, fZoom;
local float Dist, fZoom;
Dist = VSize(Pawn.Location - PLCameraLoc) * 0.5;
Dist = VSize(A.Location - PLCameraLoc);
if ( Dist <= HealthBarFullVisDist || PlayerOwner.PlayerReplicationInfo.bOnlySpectator )
fZoom = 1.0;
else fZoom = FMax(1.0 - (Dist - HealthBarFullVisDist) / (HealthBarCutoffDist - HealthBarFullVisDist), 0.0);
DrawColor.A = Clamp(255 * fZoom, 90, 255);
return DrawColor;
return Clamp(StartAlpha * fZoom, MinAlpha, StartAlpha);
}
final function AddNumberMsg( int Amount, vector Pos, byte Type )
@ -1059,13 +1153,13 @@ simulated final function DrawItemsList()
Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale);
if( NewItems[i].Icon!=None )
/*if( NewItems[i].Icon!=None )
{
Canvas.SetPos(XPos-YSize,YPos);
Canvas.DrawRect(YSize,YSize,NewItems[i].Icon);
XS = XPos-(YSize*1.1)-XS;
}
else XS = XPos-XS;
else */XS = XPos-XS;
Canvas.SetPos(XS,YPos);
Canvas.DrawText("New Item:",,FontScale,FontScale);

View File

@ -0,0 +1,5 @@
Class SRPerkManager extends ExtPerkManager;
defaultproperties
{
}

View File

@ -49,6 +49,7 @@ var int LastWaveNum,NumWaveSwitches;
var ExtSpawnPointHelper SpawnPointer;
var bool bRespawnCheck,bSpecialSpawn,bGameHasEnded,bIsPostGame;
var config bool bKillMessages,bDamageMessages,bEnableMapVote,bNoAdminCommands,bNoWebAdmin,bNoBoomstickJumping,bDumpXMLStats,bRagdollFromFall,bRagdollFromMomentum,bRagdollFromBackhit,bAddCountryTags;
var config bool bServerPerksMode;
function PostBeginPlay()
{
@ -426,7 +427,7 @@ final function GT_PlayerKilled( Controller Killer, Controller Killed, class<Dama
if( KFG!=None && KFPC != none && MonsterPawn!=none )
{
//Chris: We have to do it earlier here because we need a damage type
KFPC.AddZedKill( MonsterPawn.class, KFG.GameDifficulty, damageType );
KFPC.AddZedKill( MonsterPawn.class, KFG.GameDifficulty, damageType, false );
if( KFPC.ActivePerkManager!=none && KFPC.ActivePerkManager.CanEarnSmallRadiusKillXP(damageType) )
KFG.CheckForBerserkerSmallRadiusKill( MonsterPawn, KFPC );