KF2-Server-Extension/ServerExt/Classes/ExtHUD_WaveInfo.uc

56 lines
1.0 KiB
Ucode
Raw Normal View History

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