Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WaveMaxMut extends KFMutator
- config(WaveMax);
- var globalconfig int WaveMax;
- simulated event PostBeginPlay()
- {
- super.PostBeginPlay();
- if ( WorldInfo.Game.BaseMutator == None )
- WorldInfo.Game.BaseMutator = Self;
- else WorldInfo.Game.BaseMutator.AddMutator( Self );
- SaveConfig();
- if ( !SetWaveMax() )
- SetTimer(1.f, true, 'CheckWaveMax');
- }
- function AddMutator( Mutator M )
- {
- if ( M != Self )
- {
- if ( M.Class == Class )
- M.Destroy();
- else super.AddMutator( M );
- }
- }
- simulated function CheckWaveMax()
- {
- if ( SetWaveMax() )
- ClearTimer('CheckWaveMax');
- }
- simulated function bool SetWaveMax()
- {
- local int i, j, NewWaveMax;
- local array<int> WaveCount;
- local KFGameInfo_Survival KFGI;
- NewWaveMax = (WaveMax > 0) ? WaveMax : 11;
- WaveCount.Length = NewWaveMax - 1;
- KFGI = KFGameInfo_Survival( MyKFGI );
- if ( KFGI == None )
- return false;
- if ( KFGI != None && KFGI.GameLength == GL_Long )
- {
- KFGI.WaveMax = NewWaveMax;
- if ( KFGI.MyKFGRI != None )
- KFGI.MyKFGRI.WaveMax = KFGI.WaveMax;
- KFGI.UpdateGameSettings();
- if ( KFGI.SpawnManager != None )
- {
- for ( i = 0; i < KFGI.SpawnManager.DifficultyWaveSettings.Length; i++ )
- {
- for ( j = 10; j < WaveCount.Length; j++ )
- KFGI.SpawnManager.DifficultyWaveSettings[i].Waves[j] = KFGI.SpawnManager.DifficultyWaveSettings[i].Waves[9];
- KFGI.SpawnManager.DifficultyWaveSettings[i].Waves[WaveCount.Length] = KFAIWaveInfo'GP_Spawning_ARCH.Long.HOE.ZED_Boss_Long_HOE';
- KFGI.SpawnManager.GetWaveSettings( KFGI.SpawnManager.WaveSettings );
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement