KF2-StartWave/StartWave/Classes/StartWave.uc

529 lines
14 KiB
Ucode
Raw Normal View History

2023-05-20 18:10:14 +00:00
class StartWave extends Info
2021-06-20 02:45:18 +00:00
config(StartWave);
2023-05-20 18:10:14 +00:00
const OptionsParser = class'OptionsParser';
var private KFGameInfo KFGI;
var private KFGameInfo_Survival KFGIS;
var private KFGameInfo_Endless KFGIE;
2023-05-20 19:11:37 +00:00
var private KFGI_Access KFGIA;
2023-05-20 18:10:14 +00:00
var private KFGameReplicationInfo KFGRI;
2021-06-20 02:45:18 +00:00
/*********************************************************************************************************
* Config properties
*********************************************************************************************************/
/** The wave that the match should start on. It is clamped between wave 1 and the boss wave. */
var config int StartWave;
/** The duration of the 'initial' trader (before the first wave). */
var config int InitialTraderTime;
/** The duration of standard trader (between waves). */
var config int TraderTime;
/** The starting dosh of players. */
var config int Dosh;
/** Whether an 'initial' trader time should occur before the first wave. */
var config bool bStartWithTrader;
2023-05-20 16:48:47 +00:00
/** Log level. */
var config E_LogLevel LogLevel;
2021-06-20 02:45:18 +00:00
/**
2023-05-20 22:01:26 +00:00
*** The boss override index. For the default boss list, 0-Hans, 1-Patty, 2-King FP, 3-Abomination.
*** Negative values can be used to keep the boss spawn random.
2023-05-20 16:51:12 +00:00
***/
2021-06-20 02:45:18 +00:00
var config int Boss;
/*********************************************************************************************************
* Instance variables
*********************************************************************************************************/
/** Used to determine whether the initial trader is still open / hasn't been closed. */
var bool bInitialTrader;
//These are used to determine whether everything in OverrideTimer has been done.
/** Whether the difficulty settings have been overriden. */
var bool bOverridenDifficultySettings;
/** Whether the trader duration has been overriden. */
var bool bOverridenTraderDuration;
2023-05-20 18:10:14 +00:00
public simulated function bool SafeDestroy()
{
`Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
`Log_Trace();
if (WorldInfo.NetMode == NM_Client)
{
`Log_Fatal("Wrong NetMode:" @ WorldInfo.NetMode);
SafeDestroy();
return;
}
Super.PreBeginPlay();
PreInit();
}
public event PostBeginPlay()
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
`Log_Trace();
if (bPendingDelete || bDeleteMe) return;
Super.PostBeginPlay();
PostInit();
}
private function PreInit()
{
2023-05-20 20:10:40 +00:00
local String URL;
2023-05-20 18:10:14 +00:00
local String Options;
`Log_Trace();
2023-05-20 20:10:40 +00:00
URL = WorldInfo.GetLocalURL();
Options = Mid(URL, InStr(URL, "?"));
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Parse options entered via the launch command.
//We further restrict StartWave later when we know the maximum wave number for the selected game length.
2023-05-20 18:10:14 +00:00
StartWave = OptionsParser.static.GetIntOption (Options, "StartWave", StartWave);
InitialTraderTime = OptionsParser.static.GetIntOption (Options, "InitialTraderTime", InitialTraderTime);
TraderTime = OptionsParser.static.GetIntOption (Options, "TraderTime", TraderTime);
Dosh = OptionsParser.static.GetIntOption (Options, "Dosh", Dosh);
Boss = OptionsParser.static.GetIntOption (Options, "Boss", Boss);
bStartWithTrader = OptionsParser.static.GetBoolOption (Options, "bStartWithTrader", bStartWithTrader);
LogLevel = OptionsParser.static.GetLogLevelOption(Options, "LogLevel", LogLevel);
// Adjust values if needed
StartWave = Max(StartWave, 1);
InitialTraderTime = Max(InitialTraderTime, 1);
TraderTime = Max(TraderTime, 1);
Dosh = Max(Dosh, 0);
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//DEBUG
2023-05-20 20:13:21 +00:00
`Log_Info("LogLevel:" @ LogLevel);
`Log_Info("StartWave:" @ StartWave);
`Log_Info("InitialTraderTime:" @ InitialTraderTime);
`Log_Info("TraderTime:" @ TraderTime);
`Log_Info("Dosh:" @ Dosh);
`Log_Info("Boss:" @ Boss);
`Log_Info("bStartWithTrader:" @ bStartWithTrader);
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
bOverridenDifficultySettings = false;
2023-05-20 19:11:37 +00:00
bOverridenTraderDuration = false;
}
2023-05-14 08:31:02 +00:00
2023-05-20 19:11:37 +00:00
private function PostInit()
{
`Log_Trace();
2023-05-14 08:31:02 +00:00
2023-05-20 19:11:37 +00:00
if (WorldInfo.Game == None || WorldInfo.GRI == None)
{
SetTimer(0.2, false, nameof(PostInit));
return;
}
KFGI = KFGameInfo(WorldInfo.Game);
if (KFGI == None)
{
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game $ ". Destroy...");
SafeDestroy();
return;
}
KFGIA = new(KFGI) class'KFGI_Access';
if (KFGIA == None)
{
`Log_Fatal("Can't create KFGI_Access object");
SafeDestroy();
return;
}
KFGIS = KFGameInfo_Survival(KFGI);
if (KFGIS == None)
{
`Log_Warn("The game mode does not extend KFGameInfo_Survival. Most features of this mutator are not compatible with non-wave-based game modes.");
}
KFGIE = KFGameInfo_Endless(KFGIS);
KFGRI = KFGameReplicationInfo(WorldInfo.GRI);
if (KFGRI == None)
2021-06-20 02:45:18 +00:00
{
2023-05-20 19:11:37 +00:00
`Log_Fatal("Incompatible game replication info:" @ WorldInfo.GRI $ ". Destroy...");
SafeDestroy();
return;
2021-06-20 02:45:18 +00:00
}
2023-05-14 08:31:02 +00:00
2023-05-20 19:11:37 +00:00
SetTimer(0.1, false, nameof(OverrideTimer));
//Override the boss with the boss corresponding to the specified boss index. -1 signifies random.
KFGIA.OverrideBossIndex(Boss);
2021-06-20 02:45:18 +00:00
CheckForceInitialTrader();
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//We only care if this is the 'initial' trader time if we start with the trader active.
bInitialTrader = bStartWithTrader;
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//If we want to start with the trader active or alter the starting wave number.
2023-05-20 18:10:14 +00:00
if (bStartWithTrader || StartWave > 1)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Calling StartWaveTimer() to alter the start wave or activate the trader initially.");
2021-06-20 02:45:18 +00:00
SetTimer(0.2, false, nameof(StartWaveTimer));
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//If we will need to alter TimeBetweenWaves for later activations of the trader.
2023-05-20 18:10:14 +00:00
if (bStartWithTrader && InitialTraderTime != TraderTime)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Calling UpdateTraderDurationTimer() to alter the trader duration later.");
2021-06-20 02:45:18 +00:00
SetTimer(1, true, nameof(UpdateTraderDurationTimer));
}
2023-05-20 19:20:03 +00:00
`Log_Info("Initialized.");
2021-06-20 02:45:18 +00:00
}
/** Allows for handling player input in the console by the mutator. */
2023-05-20 18:10:14 +00:00
public function Mutate(string MutateString, PlayerController Sender)
2021-06-20 02:45:18 +00:00
{
local array<string> CommandBreakdown;
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
`Log_Trace();
if (MutateString == "")
2021-06-20 02:45:18 +00:00
{
return;
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Split the string on the space character.
ParseStringIntoArray(MutateString, CommandBreakdown, " ", true);
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//The CheatManager check is equivalent to checking if cheats are enabled for that player.
2023-05-20 18:10:14 +00:00
if (CommandBreakdown.Length > 1&&
CommandBreakdown[0] == "setwave" &&
Sender.CheatManager != None &&
KFGI.GetLivingPlayerCount() > 0)
2021-06-20 02:45:18 +00:00
{
//The setwave command should be: mutate setwave WaveNum bSkipTraderTime
//where WaveNum is an integer (or byte) and bSkipTraderTime is a bool.
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (CommandBreakdown.Length == 2)
2021-06-20 02:45:18 +00:00
{
SetWave(int(CommandBreakdown[1]), Sender);
}
else
{
SetWave(int(CommandBreakdown[1]), Sender, bool(CommandBreakdown[2]));
}
}
}
/** Jumps to the specified wave, NewWaveNum, with trader time iff bSkipTraderTime is false. */
2023-05-20 18:10:14 +00:00
private function SetWave(int NewWaveNum, PlayerController PC, optional bool bSkipTraderTime)
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
`Log_Trace();
if (NewWaveNum < 1)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Error("SetWave: new wave num must be > 0.");
2021-06-20 02:45:18 +00:00
return;
}
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (KFGIE != None)
2021-06-20 02:45:18 +00:00
{
//Jump straight to the final wave if the specified wave number is higher than wave max.
2023-05-20 18:10:14 +00:00
if (NewWaveNum > 254)
2021-06-20 02:45:18 +00:00
{
NewWaveNum = 254;
}
}
else
{
//Jump straight to the boss wave if the specified wave number is higher than wave max.
2023-05-20 19:20:03 +00:00
if (NewWaveNum > KFGIS.WaveMax)
2021-06-20 02:45:18 +00:00
{
2023-05-20 19:20:03 +00:00
NewWaveNum = KFGIS.WaveMax+1;
2021-06-20 02:45:18 +00:00
}
}
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (KFGIS != None)
{
KFGIS.WaveNum = NewWaveNum - 1;
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Kill all zeds currently alive.
2023-05-20 22:38:52 +00:00
KillZeds();
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Clear any current objectives.
2023-05-20 18:10:14 +00:00
KFGRI.DeactivateObjective();
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (bSkipTraderTime)
2021-06-20 02:45:18 +00:00
{
//Go to some unused state so that PlayingWave.BeginState is called when we go to PlayingWave.
2023-05-20 18:10:14 +00:00
KFGI.GotoState('TravelTheWorld');
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
UpdateEndlessDifficulty();
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Go to PlayingWave to start the new wave.
2023-05-20 18:10:14 +00:00
KFGI.GotoState('PlayingWave');
2021-06-20 02:45:18 +00:00
}
else
{
//Go to trader time before starting the new wave.
2023-05-20 18:10:14 +00:00
KFGI.GotoState('TraderOpen');
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
UpdateEndlessDifficulty();
}
2023-05-20 18:10:14 +00:00
KFGI.ResetAllPickups();
2021-06-20 02:45:18 +00:00
}
/**
2023-05-20 16:51:12 +00:00
*** Since the difficulty in Endless scales with the wave number, we need to update the difficulty when
*** jumping between wave numbers to match the expected difficulty.
***/
2023-05-20 18:10:14 +00:00
private function UpdateEndlessDifficulty()
2021-06-20 02:45:18 +00:00
{
local int i;
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
`Log_Trace();
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (KFGIE == None)
2021-06-20 02:45:18 +00:00
{
return;
}
2023-05-14 08:31:02 +00:00
2023-05-20 21:46:42 +00:00
// KFGIE.ResetDifficulty() does not reset ModifiedDifficulty, so do it manually
KFGRI.SetModifiedGameDifficulty(0);
KFGI.GameDifficultyModifier = 0;
2021-06-20 02:45:18 +00:00
//Reflects the difficulty update in KFGameInfo_Endless.SetWave.
2023-05-20 18:10:14 +00:00
KFGIE.bIsInHoePlus = false;
KFGIE.ResetDifficulty();
KFGIE.SpawnManager.GetWaveSettings(KFGIE.SpawnManager.WaveSettings);
KFGIE.UpdateGameSettings();
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Don't bother iterating for i=0-4, no difficulty increment can occur.
2023-05-20 21:46:42 +00:00
for (i = 5; i <= KFGIE.WaveNum; ++i)
2021-06-20 02:45:18 +00:00
{
//Simulate the death of a boss. The difficulty is incremented after each boss round.
2023-05-20 18:10:14 +00:00
if (i % 5 == 0)
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
KFGIE.IncrementDifficulty();
2021-06-20 02:45:18 +00:00
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//This should happen at the end of each wave (if we're in HoE+). The check is handled internally.
//We do this after the simulation of a boss death so that bIsInHoePlus can be set first.
2023-05-20 18:10:14 +00:00
KFGIE.HellOnEarthPlusRoundIncrement();
2021-06-20 02:45:18 +00:00
}
2023-05-20 21:46:42 +00:00
`Log_Debug("Updated difficulty (Game + Modifier):" @ String(KFGRI.GameDifficulty) @ "+" @ String(KFGRI.GameDifficultyModifier));
2021-06-20 02:45:18 +00:00
}
/** Checks whether we should force the initial trader, regardless of the config/command value. */
2023-05-20 18:10:14 +00:00
private function CheckForceInitialTrader()
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
`Log_Trace();
2021-06-20 02:45:18 +00:00
//Force the initial trader for compatibility with holdout maps. Otherwise, zeds spawn in the wrong room.
2023-05-20 18:10:14 +00:00
if (!bStartWithTrader && StartWave > 1)
2021-06-20 02:45:18 +00:00
{
bStartWithTrader = true;
InitialTraderTime = 1.0;
}
}
/** Overrides difficulty settings and trader duration when possible. */
2023-05-20 18:10:14 +00:00
private function OverrideTimer()
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
local KFGameDifficulty_Endless KFGDE;
2021-06-20 02:58:00 +00:00
local int i;
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
`Log_Trace();
2021-06-20 02:45:18 +00:00
//If we've overriden what we need to, don't call this timer again.
2023-05-20 18:10:14 +00:00
if (bOverridenDifficultySettings && bOverridenTraderDuration)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("All settings have been overriden.");
2021-06-20 02:45:18 +00:00
return;
}
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (!bOverridenDifficultySettings && KFGI.DifficultyInfo != None)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Overriding difficulty settings...");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
bOverridenDifficultySettings = true;
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Override starting dosh.
2023-05-20 18:10:14 +00:00
KFGI.DifficultyInfo.Normal.StartingDosh = Dosh;
KFGI.DifficultyInfo.Hard.StartingDosh = Dosh;
KFGI.DifficultyInfo.Suicidal.StartingDosh = Dosh;
KFGI.DifficultyInfo.HellOnEarth.StartingDosh = Dosh;
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (KFGIE != None)
2021-06-20 02:58:00 +00:00
{
2023-05-20 18:10:14 +00:00
KFGDE = KFGameDifficulty_Endless(KFGIE.DifficultyInfo);
if (KFGDE != None)
2021-06-20 02:58:00 +00:00
{
2023-05-20 18:10:14 +00:00
for (i = 0; i < KFGDE.CurrentDifficultyScaling.Difficulties.length; ++i)
2021-06-20 02:58:00 +00:00
{
2023-05-20 18:10:14 +00:00
KFGDE.CurrentDifficultyScaling.Difficulties[i].StartingDosh = Dosh;
2021-06-20 02:58:00 +00:00
}
}
}
2023-05-14 08:31:02 +00:00
2023-05-20 16:48:47 +00:00
`Log_Debug("Starting dosh has been set to:" @ Dosh @ "dosh.");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//We need to set the difficulty settings again - normally done in KFGameInfo.InitGame - to apply
//these changes, since this happens after InitGame is executed.
2023-05-20 18:10:14 +00:00
KFGI.DifficultyInfo.SetDifficultySettings(KFGI.GameDifficulty);
2021-06-20 02:45:18 +00:00
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Set the starting wave number.
2023-05-20 18:10:14 +00:00
if (!bOverridenTraderDuration)
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
if (KFGIS != None)
2021-06-20 02:45:18 +00:00
{
//We require the SpawnManager to be set, because this signifies that InitSpawnManager has been
//executed, which sets WaveMax.
2023-05-20 18:10:14 +00:00
if (KFGI.SpawnManager != None)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Overriding trader duration...");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
bOverridenTraderDuration = true;
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Since InitSpawnManager has been executed, then PreBeginPlay must have been executed. This
//means that PostBeginPlay will have been executed as well since it happens straight after.
//Now we can override TimeBetweenWaves.
2023-05-20 18:10:14 +00:00
KFGIS.TimeBetweenWaves = bInitialTrader ? InitialTraderTime : TraderTime;
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
`Log_Debug("Trader duration has been set to:" @ KFGIS.TimeBetweenWaves @ "seconds.");
2021-06-20 02:45:18 +00:00
}
else
{
2023-05-20 18:10:14 +00:00
`Log_Debug("KFGI.SpawnManager hasn't been set yet. Calling StartWaveTimer again.");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//We don't know WaveMax yet, so we need to wait longer.
SetTimer(0.1, false, nameof(StartWaveTimer));
return;
}
}
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//If the difficulty info isn't set yet, wait.
SetTimer(0.1, false, nameof(OverrideTimer));
}
2023-05-20 18:10:14 +00:00
private function StartWaveTimer()
2021-06-20 02:45:18 +00:00
{
local PlayerController PC;
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
`Log_Trace();
2021-06-20 02:45:18 +00:00
//We need to wait for the wave to be active, as this will signify that StartMatch has been executed.
2023-05-20 18:10:14 +00:00
if (!KFGI.IsWaveActive())
2021-06-20 02:45:18 +00:00
{
//If the wave isn't active yet (probably still in lobby), wait.
SetTimer(0.1, false, nameof(StartWaveTimer));
return;
}
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (KFGIS == None)
2021-06-20 02:45:18 +00:00
{
return;
}
2023-05-14 08:31:02 +00:00
2023-05-20 16:48:47 +00:00
`Log_Debug("Clearing the current wave.");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Clear the current wave.
foreach WorldInfo.AllControllers(class'PlayerController', PC)
{
if (KFDemoRecSpectator(PC) == none)
{
2023-05-20 22:38:52 +00:00
KillZeds();
2021-06-20 02:45:18 +00:00
break;
}
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Set the starting wave number.
//Keep the assignments separated so that we can used the restricted StartWave later if we want.
2023-05-20 18:10:14 +00:00
StartWave = Min(StartWave, KFGIS.WaveMax);
2021-06-20 02:45:18 +00:00
//We need to subtract 1 because when the state is eventually reset to PlayingWave, this will be
//incremented by 1.
2023-05-20 18:10:14 +00:00
KFGIS.WaveNum = StartWave - 1;
2023-05-14 08:31:02 +00:00
2023-05-20 21:46:42 +00:00
UpdateEndlessDifficulty();
`Log_Info("WaveNum set to:" @ KFGIS.WaveNum);
2023-05-14 08:31:02 +00:00
2023-05-20 18:10:14 +00:00
if (bStartWithTrader)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Switching to state: TraderOpen.");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//We need to update GRI's WaveNum and update the HUD element that shows the last wave.
2023-05-20 18:10:14 +00:00
KFGRI.WaveNum = KFGIS.WaveNum;
KFGRI.UpdateHUDWaveCount();
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Start with the trader active.
2023-05-20 18:10:14 +00:00
KFGI.GotoState('TraderOpen', 'Begin');
2021-06-20 02:45:18 +00:00
}
else
2023-05-14 08:31:02 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Switching to state: PlayingWave.");
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Start with a wave as usual - but our StartWave number will be used.
2023-05-20 18:10:14 +00:00
KFGI.GotoState('PlayingWave');
2021-06-20 02:45:18 +00:00
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//Since we've updated the wave number, we need to update the game settings (which includes the
//current wave number).
2023-05-20 18:10:14 +00:00
KFGI.UpdateGameSettings();
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
bInitialTrader = false;
}
/** Updates the trader duration. Waits until the initial trader has closed. */
2023-05-20 18:10:14 +00:00
private function UpdateTraderDurationTimer()
2021-06-20 02:45:18 +00:00
{
2023-05-20 18:10:14 +00:00
`Log_Trace();
2021-06-20 02:45:18 +00:00
//If the initial trader has already been opened, and the wave is now active.
2023-05-20 18:10:14 +00:00
if (!bInitialTrader && KFGI.IsWaveActive())
2021-06-20 02:45:18 +00:00
{
2023-05-20 19:20:03 +00:00
if (KFGIS != None)
2021-06-20 02:45:18 +00:00
{
2023-05-20 16:48:47 +00:00
`Log_Debug("Updating trader duration to" @ TraderTime @ "seconds.");
2021-06-20 02:45:18 +00:00
//We can update TimeBetweenWaves to be the TraderTime we specified in the launch command.
2023-05-20 19:20:03 +00:00
KFGIS.TimeBetweenWaves = TraderTime;
2021-06-20 02:45:18 +00:00
}
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
//We don't need to call this timer again.
ClearTimer(nameof(UpdateTraderDurationTimer));
}
}
2023-05-20 22:38:52 +00:00
private function KillZeds()
{
local KFPawn_Monster KFPM;
foreach WorldInfo.AllPawns(class'KFPawn_Monster', KFPM)
{
if (!KFPM.IsAliveAndWell()) continue;
if (KFPM.Health > 0 && PlayerController(KFPM.Controller) == None)
{
KFPM.Died(None, None, KFPM.Location);
}
}
}
2023-05-20 18:10:14 +00:00
defaultproperties
2021-06-20 02:45:18 +00:00
{
2023-05-14 08:31:02 +00:00
2021-06-20 02:45:18 +00:00
}