fix: map objectives (#20) and zed counter (#8)

- map objectives now work;
- counter no longer shows BOSS on the penultimate wave;
- remove unused files.
This commit is contained in:
GenZmeY 2020-12-26 03:09:56 +03:00
parent b52205b148
commit ec800ea36f
3 changed files with 0 additions and 191 deletions

View File

@ -1,56 +0,0 @@
class ExtHUD_WaveInfo extends KFGFxHUD_WaveInfo;
function TickHud(float DeltaTime)
{
local int i;
if (KFGRI == none)
KFGRI = KFGameReplicationInfo(GetPC().WorldInfo.GRI);
else
{
if (KFGRI.bTraderIsOpen)
{
i = KFGRI.GetTraderTimeRemaining();
if (LastTraderTimeRemaining != i)
{
SetInt("remainingTraderTime" ,i);
LastTraderTimeRemaining = i;
}
}
else
{
i = KFGRI.IsFinalWave() ? INDEX_NONE : Max(KFGRI.AIRemaining,0);
if (LastZEDCount != i)
{
SetInt("remainingZEDs" ,i);
LastZEDCount = i;
}
}
// Max # of waves.
if (LastWaveMax != KFGRI.WaveMax)
{
LastWaveMax = KFGRI.WaveMax;
SetInt("maxWaves" ,LastWaveMax-1);
}
// Current wave we're on.
if (LastWave!=KFGRI.WaveNum)
{
LastWave = KFGRI.WaveNum;
if (LastWave>LastWaveMax)
{
SetInt("currentWave",0); // Force text to refresh.
SetString("finalText", "END");
}
SetInt("currentWave",Min(LastWave,LastWaveMax));
}
}
}
function UpdateWaveCount();
DefaultProperties
{
LastWave=-1
}

View File

@ -101,10 +101,6 @@ defaultproperties
WidgetBindings.Add((WidgetName="PlayerStatWidgetMC",WidgetClass=class'ExtHUD_PlayerStatus')) WidgetBindings.Add((WidgetName="PlayerStatWidgetMC",WidgetClass=class'ExtHUD_PlayerStatus'))
WidgetBindings.Remove((WidgetName="PlayerBackpackWidget",WidgetClass=class'KFGFxHUD_PlayerBackpack')) WidgetBindings.Remove((WidgetName="PlayerBackpackWidget",WidgetClass=class'KFGFxHUD_PlayerBackpack'))
WidgetBindings.Add((WidgetName="PlayerBackpackWidget",WidgetClass=class'ExtHUD_PlayerBackpack')) 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="WeaponSelectContainer",WidgetClass=class'KFGFxHUD_WeaponSelectWidget')) WidgetBindings.Remove((WidgetName="WeaponSelectContainer",WidgetClass=class'KFGFxHUD_WeaponSelectWidget'))
WidgetBindings.Add((WidgetName="WeaponSelectContainer",WidgetClass=class'ExtHUD_WeaponSelectWidget')) WidgetBindings.Add((WidgetName="WeaponSelectContainer",WidgetClass=class'ExtHUD_WeaponSelectWidget'))
} }

View File

@ -1,131 +0,0 @@
class ExtWidget_BossHealthBar extends KFGFxWidget_BossHealthBar;
var transient array<KFPawn_Monster> BossList;
var transient float NextBossDistTime,LastHP,LastShield;
var transient byte NumBosses;
var transient bool bVisib,bHasInit;
function TickHud(float DeltaTime)
{
if (!KFPC.bHideBossHealthBar && BossList.Length>0)
{
if (KFPC.WorldInfo.RealTimeSeconds>LastUpdateTime && HasBossesAlive())
{
LastUpdateTime = KFPC.WorldInfo.RealTimeSeconds + UpdateTickTime;
if (!bVisib)
{
LastHP = -1;
LastShield = -1;
bVisib = true;
SetVisible(true);
}
UpdateBossInfo();
}
}
else if (bHasInit)
{
NumBosses = 0;
bHasInit = false;
BossList.Length = 0;
if (bVisib)
{
bVisib = false;
SetVisible(false);
}
}
}
final function bool HasBossesAlive()
{
local int i;
for (i=(BossList.Length-1); i>=0; --i)
{
if (BossList[i]==None || BossList[i].bDeleteMe || BossList[i].GetTeamNum()==0)
{
BossList.Remove(i,1);
--NumBosses;
}
else if (!BossList[i].IsAliveAndWell())
BossList.Remove(i,1);
}
return (BossList.Length>0);
}
function SetBossPawn(KFInterface_MonsterBoss NewBoss)
{
if (!KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell())
{
bHasInit = true;
++NumBosses;
BossList.AddItem(NewBoss.GetMonsterPawn());
}
}
final function UpdateBossInfo()
{
local float V;
local KFPawn_Monster B;
if (NextBossDistTime<KFPC.WorldInfo.RealTimeSeconds)
{
NextBossDistTime = KFPC.WorldInfo.RealTimeSeconds + 1.f;
CheckBestBoss();
}
V = (BossPawn!=None ? FClamp(float(BossPawn.GetMonsterPawn().Health) / float(BossPawn.GetMonsterPawn().HealthMax),0.f,1.f) : 0.f);
if (LastHP!=V)
{
LastHP = V;
SetFloat("currentHealthPercentValue",V);
}
V = 0.f;
if (NumBosses>1)
{
foreach BossList(B)
V += FClamp(float(B.Health) / float(B.HealthMax),0.f,1.f);
V /= NumBosses;
}
if (LastShield!=V)
{
LastShield = V;
SetFloat("currentShieldPercecntValue",V);
}
}
final function CheckBestBoss()
{
local KFPawn_Monster B,Best;
local vector Pos;
local float Dist,BestDist;
Pos = (KFPC.ViewTarget!=None ? KFPC.ViewTarget.Location : KFPC.Location);
foreach BossList(B)
{
Dist = VSizeSq(Pos-B.Location);
if (Best==None || Dist<BestDist)
{
Best = B;
BestDist = Dist;
}
}
if (Best!=BossPawn)
{
BossPawn = Best;
SetBossName(Best.static.GetLocalizedName());
}
}
function OnNamePlateHidden();
function UpdateBossHealth();
function UpdateBossBattlePhase(int BattlePhase);
function UpdateBossShield(float NewShieldPercect);
DefaultProperties
{
}