Botpack
Class DMMutator

source: e:\games\UnrealTournament\Botpack\Classes\DMMutator.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.Mutator
            |
            +--Botpack.DMMutator
Direct Known Subclasses:None

class DMMutator
extends Engine.Mutator

//============================================================================= // DMMutator. //=============================================================================
Variables
 DeathMatchPlus MyGame


Function Summary
 bool AlwaysKeep(Actor Other)
 bool CheckReplacement(Actor Other, out byte)
 void PostBeginPlay()



Source Code


00001	//=============================================================================
00002	// DMMutator.
00003	//=============================================================================
00004	
00005	class DMMutator expands Mutator;
00006	
00007	var DeathMatchPlus MyGame;
00008	
00009	function PostBeginPlay()
00010	{
00011		MyGame = DeathMatchPlus(Level.Game);
00012		Super.PostBeginPlay();
00013	}
00014	
00015	function bool AlwaysKeep(Actor Other)
00016	{
00017		local bool bTemp;
00018	
00019		if ( Other.IsA('StationaryPawn') )
00020			return true;
00021	
00022		if ( NextMutator != None )
00023			return ( NextMutator.AlwaysKeep(Other) );
00024		return false;
00025	}
00026	
00027	function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
00028	{
00029		local Inventory Inv;
00030	
00031		// replace Unreal I inventory actors by their Unreal Tournament equivalents
00032		// set bSuperRelevant to false if want the gameinfo's super.IsRelevant() function called
00033		// to check on relevancy of this actor.
00034	
00035		bSuperRelevant = 1;
00036		if ( MyGame.bMegaSpeed && Other.bIsPawn && Pawn(Other).bIsPlayer )
00037		{
00038			Pawn(Other).GroundSpeed *= 1.4;
00039			Pawn(Other).WaterSpeed *= 1.4;
00040			Pawn(Other).AirSpeed *= 1.4;
00041			Pawn(Other).AccelRate *= 1.4;
00042		}
00043	
00044		if ( Other.IsA('StationaryPawn') )
00045			return true;
00046	
00047		Inv = Inventory(Other);
00048	 	if ( Inv == None )
00049		{
00050			bSuperRelevant = 0;
00051			if ( Other.IsA('TorchFlame') )
00052				Other.NetUpdateFrequency = 0.5;
00053			return true;
00054		}
00055	
00056		if ( MyGame.bNoviceMode && MyGame.bRatedGame && (Level.NetMode == NM_Standalone) )
00057			Inv.RespawnTime *= (0.5 + 0.1 * MyGame.Difficulty);
00058	
00059		if ( Other.IsA('Weapon') )
00060		{
00061			if ( Other.IsA('TournamentWeapon') )
00062				return true;
00063	
00064			log("Found "$Other$" at "$Other.location);
00065			//Assert(false);
00066			if ( Other.IsA('Stinger') )
00067			{
00068				ReplaceWith(Other, "Botpack.PulseGun");
00069				return false; 
00070			}
00071			if ( Other.IsA('Rifle') )
00072			{
00073				ReplaceWith( Other, "Botpack.SniperRifle" );
00074				return false;
00075			}
00076			if ( Other.IsA('Razorjack') )
00077			{
00078				ReplaceWith( Other, "Botpack.Ripper" );
00079				return false;
00080			}
00081			if ( Other.IsA('Minigun') )
00082			{
00083				ReplaceWith( Other, "Botpack.Minigun2" );
00084				return false;
00085			}
00086			if ( Other.IsA('AutoMag') )
00087			{
00088				ReplaceWith( Other, "Botpack.Enforcer" );
00089				return false;
00090			}
00091			if ( Other.IsA('Eightball') )
00092			{
00093				ReplaceWith( Other, "Botpack.UT_Eightball" );
00094				return false;
00095			}
00096			if ( Other.IsA('FlakCannon') )
00097			{
00098				ReplaceWith( Other, "Botpack.UT_FlakCannon" );
00099				return false;
00100			}
00101			if ( Other.IsA('ASMD') )
00102			{
00103				ReplaceWith( Other, "Botpack.ShockRifle" );
00104				return false;
00105			}
00106			if ( Other.IsA('GesBioRifle') )
00107			{
00108				ReplaceWith( Other, "Botpack.UT_BioRifle" );
00109				return false;
00110			}
00111			if ( Other.IsA('DispersionPistol') )
00112			{
00113				ReplaceWith( Other, "Botpack.ImpactHammer");
00114				return false;
00115			}
00116			bSuperRelevant = 0;
00117			return true;
00118		}
00119		if ( Other.IsA('Ammo') )
00120		{
00121			if ( Other.IsA('TournamentAmmo') )
00122				return true;
00123	
00124			log("Found "$Other$" at "$Other.location);
00125			//Assert(false);
00126	
00127			if ( Other.IsA('ASMDAmmo') )
00128			{
00129				ReplaceWith( Other, "Botpack.ShockCore" );
00130				return false;
00131			}
00132			if ( Other.IsA('RocketCan') )
00133			{
00134				ReplaceWith( Other, "Botpack.RocketPack" );
00135				return false;
00136			}
00137			if ( Other.IsA('StingerAmmo') )
00138			{
00139				ReplaceWith(Other, "Botpack.PAmmo");
00140				return false;
00141			}
00142			if ( Other.IsA('RazorAmmo') )
00143			{
00144				ReplaceWith( Other, "Botpack.BladeHopper" );
00145				return false;
00146			}
00147			if ( Other.IsA('RifleRound') )
00148			{
00149				ReplaceWith( Other, "Botpack.RifleShell" );
00150				return true;
00151			}
00152			if ( Other.IsA('RifleAmmo') )
00153			{
00154				ReplaceWith( Other, "Botpack.BulletBox" );
00155				return false;
00156			}
00157			if ( Other.IsA('FlakBox') )
00158			{
00159				ReplaceWith( Other, "Botpack.FlakAmmo" );
00160				return false;
00161			}
00162			if ( Other.IsA('Clip') )
00163			{
00164				ReplaceWith( Other, "Botpack.EClip" );
00165				return false;
00166			}
00167			if ( Other.IsA('ShellBox') )
00168			{
00169				ReplaceWith( Other, "Botpack.MiniAmmo" );
00170				return false;
00171			}
00172			if ( Other.IsA('Sludge') )
00173			{
00174				ReplaceWith( Other, "Botpack.BioAmmo" );
00175				return false;
00176			}
00177			bSuperRelevant = 0;
00178			return true;
00179		}
00180	
00181		if ( Other.IsA('Pickup') )
00182		{
00183			Pickup(Other).bAutoActivate = true;
00184			if ( Other.IsA('TournamentPickup') )
00185				return true;
00186		}
00187		if ( Other.IsA('TournamentHealth') )
00188			return true;
00189	
00190		log("Found "$Other$" at "$Other.location);
00191		//Assert(false);
00192	
00193		if ( Other.IsA('JumpBoots') )
00194		{
00195			if ( MyGame.bJumpMatch )
00196				return false;
00197			ReplaceWith( Other, "Botpack.UT_JumpBoots" );
00198			return false;
00199		}
00200		if ( Other.IsA('Amplifier') )
00201		{
00202			ReplaceWith( Other, "Botpack.UDamage" );
00203			return false;
00204		}
00205		if ( Other.IsA('WeaponPowerUp') )
00206			return false; 
00207	
00208		if ( Other.IsA('KevlarSuit') )
00209		{
00210			ReplaceWith( Other, "Botpack.ThighPads");
00211			return false;
00212		}
00213		if ( Other.IsA('SuperHealth') )
00214		{
00215			ReplaceWith( Other, "Botpack.HealthPack" );
00216			return false;
00217		}
00218		if ( Other.IsA('Armor') )
00219		{
00220			ReplaceWith( Other, "Botpack.Armor2" );
00221			return false;
00222		}
00223		if ( Other.IsA('Bandages') )
00224		{
00225			ReplaceWith( Other, "Botpack.HealthVial" );
00226			return false;
00227		}
00228		if ( Other.IsA('Health') && !Other.IsA('HealthPack') && !Other.IsA('HealthVial')
00229			 && !Other.IsA('MedBox') && !Other.IsA('NaliFruit') )
00230		{
00231			ReplaceWith( Other, "Botpack.MedBox" );
00232			return false;
00233		}
00234		if ( Other.IsA('ShieldBelt') )
00235		{
00236			ReplaceWith( Other, "Botpack.UT_ShieldBelt" );
00237			return false;
00238		}
00239		if ( Other.IsA('Invisibility') )
00240		{
00241			ReplaceWith( Other, "Botpack.UT_Invisibility" );
00242			return false;
00243		}
00244	
00245		bSuperRelevant = 0;
00246		return true;
00247	}
00248	
00249	defaultproperties
00250	{
00251	}

End Source Code