Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////
- // Legacy Mode mutator by HUNTER 23.10.2018 //
- //////////////////////////////////////////////
- class LegacyModeMut extends KFMutator
- config ( LegacyMode );
- var config bool bLegacyBalance;
- var config int MaxMonsters;
- var config int TraderTime;
- var config float SpawnRateMod;
- var config float MovementSpeedMod;
- var config float WaveCountMod;
- var config float DoshKillMod;
- var config float MediumAttackChance;
- var config float HardAttackChance;
- function InitMutator( string Options, out string ErrorMessage )
- {
- super.InitMutator( Options, ErrorMessage );
- KFGameInit();
- SaveConfig();
- `log("Legacy Mode mutator initialized");
- }
- function PostBeginPlay()
- {
- if ( WorldInfo.Game.BaseMutator == None )
- WorldInfo.Game.BaseMutator = Self;
- else WorldInfo.Game.BaseMutator.AddMutator( Self );
- }
- function AddMutator( Mutator M )
- {
- if ( M != Self )
- {
- if ( M.Class == Class )
- M.Destroy();
- else super.AddMutator( M );
- }
- }
- function KFGameInit()
- {
- local int i, j;
- local KFGameInfo KFGI;
- local KFGameDifficulty_Legacy KFDI;
- KFGI = KFGameInfo( WorldInfo.Game );
- KFDI = KFGameDifficulty_Legacy ( KFGI.DifficultyInfo );
- if ( KFGI != None )
- {
- KFGI.PlayerControllerClass = class'KFPlayerController_Legacy';
- KFGI.KFGFxManagerClass = class'KFGFxMoviePlayer_Manager_Legacy';
- KFGI.SpawnManagerClasses[0] = class'KFAISpawnManager_Short_Legacy';
- KFGI.SpawnManagerClasses[1] = class'KFAISpawnManager_Normal_Legacy';
- KFGI.SpawnManagerClasses[2] = class'KFAISpawnManager_Long_Legacy';
- KFGI.DifficultyInfo = new( KFGI ) class'KFGameDifficulty_Legacy';
- KFGI.DifficultyInfo.SetDifficultySettings( KFGI.GameDifficulty );
- }
- if ( KFGI.SpawnManager != None )
- {
- for ( i = 0; i < KFGI.SpawnManager.PerDifficultyMaxMonsters.length; i++ )
- {
- for ( j = 0; j < KFGI.SpawnManager.PerDifficultyMaxMonsters[i].MaxMonsters.length ; j++ )
- KFGI.SpawnManager.PerDifficultyMaxMonsters[i].MaxMonsters[j] = MaxMonsters;
- }
- }
- if ( KFDI != None && KFGI.DifficultyInfo != None )
- {
- KFDI.LegacySettings.TraderTime = TraderTime;
- KFDI.LegacySettings.SpawnRateModifier = SpawnRateMod;
- KFDI.LegacySettings.MovementSpeedMod = MovementSpeedMod;
- KFDI.LegacySettings.WaveCountMod = WaveCountMod;
- KFDI.LegacySettings.DoshKillMod = DoshKillMod;
- KFDI.LegacySettings.MediumAttackChance = MediumAttackChance;
- KFDI.LegacySettings.HardAttackChance = HardAttackChance;
- }
- bLegacyBalance = true;
- if ( bLegacyBalance )
- {
- MaxMonsters = 48;
- TraderTime = 75;
- SpawnRateMod = 0.35f;
- MovementSpeedMod = 1.f;
- WaveCountMod = 2.3f;
- DoshKillMod = 1.5;
- MediumAttackChance = 0.85f;
- HardAttackChance = 1.5f;
- }
- SaveConfig();
- SetTimer( 1.0, false, nameof( AdjustBossWave ));
- }
- function AdjustBossWave()
- {
- local KFGameInfo KFGI;
- local KFGameReplicationInfo KFGRI;
- KFGI = KFGameInfo( WorldInfo.Game );
- KFGRI = KFGameReplicationInfo( WorldInfo.GRI );
- if ( KFGRI.WaveNum == KFGRI.WaveMax && KFGRI.IsBossWave() )
- {
- KFGI.SpawnManager.TimeUntilNextSpawn = 10;
- SetTimer( 5.0, false, nameof( AdjustBossList ));
- }
- }
- function AdjustBossList()
- {
- local KFGameInfo KFGI;
- local array < class < KFPawn_Monster > > BossList;
- local byte RandChoice;
- KFGI = KFGameInfo( WorldInfo.Game );
- RandChoice = Rand(2);
- if ( RandChoice == 0 )
- BossList.AddItem(class'KFPawn_ZedHans');
- if ( RandChoice == 1 )
- BossList.AddItem(class'KFPawn_ZedPatriarch');
- KFGI.NumAISpawnsQueued += KFGI.SpawnManager.SpawnSquad( BossList );
- KFGI.SpawnManager.TimeUntilNextSpawn = KFGI.SpawnManager.CalcNextGroupSpawnTime();
- }
- function bool CheckRelevance( Actor Other )
- {
- local bool SuperRelevant;
- local KFDroppedPickup PlayerWeapon;
- SuperRelevant = super.CheckRelevance( Other );
- if ( !SuperRelevant )
- return SuperRelevant;
- PlayerWeapon = KFDroppedPickup( Other );
- if ( PlayerWeapon != None )
- {
- PlayerWeapon.Lifespan = 2147483647;
- return SuperRelevant;
- }
- return SuperRelevant;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement