- Moreguns
- Code:
- class MoreGuns expands Mutator config(MoreGuns);
- #exec obj load file=..\System\FBFMac10.u package=FBFMac10
- #exec obj load file=..\System\MHAClusterRedeemer.u package=MHAClusterRedeemer
- #exec obj load file=..\System\TUC_M16A1.u package=TUC_M16A1
- var config bool GiveMac10;
- var config bool GiveCluster;
- var config bool GiveM16;
- var config bool EraseEnforcer;
- var config bool EraseHammer;
- var bool bInitialized;
- function PreBeginPlay()
- {
- if ( !bInitialized )
- {
- bInitialized = True;
- Self.NextMutator = Level.Game.BaseMutator.NextMutator;
- }
- }
- function ModifyPlayer(Pawn Other)
- {
- if (Other.IsA('PlayerPawn'))
- {
- if(GiveMac10)
- GiveWeapon(Other,class'FBFMac10.Mac10');
- if(GiveCluster)
- GiveWeapon(Other,class'MHAClusterRedeemer.MHAClusterRedeemer');
- if(GiveM16)
- GiveWeapon(Other,class'TUC_M16A1.TUC_M16A1');
- }
- if ( NextMutator != None )
- NextMutator.ModifyPlayer(Other);
- }
- function GiveWeapon(Pawn PlayerPawn, class<Weapon> WeaponClass )
- {
- local Weapon NewWeapon;
- newWeapon = Spawn(WeaponClass);
- if( PlayerPawn.FindInventoryType(WeaponClass) != None )
- return;
- if(newWeapon != None)
- {
- newWeapon.RespawnTime = 0.0;
- newWeapon.GiveTo(PlayerPawn);
- newWeapon.bHeldItem = true;
- newWeapon.GiveAmmo(PlayerPawn);
- newWeapon.SetSwitchPriority(PlayerPawn);
- newWeapon.WeaponSet(PlayerPawn);
- newWeapon.AmbientGlow = 0;
- PlayerPawn.PendingWeapon = None;
- if ( !newWeapon.IsA('MHAClusterRedeemer'))
- {
- newWeapon.AmmoType.AmmoAmount = newWeapon.AmmoType.MaxAmmo;
- }
- }
- }
- function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
- {
- if(EraseEnforcer)
- {
- if (Other.Class==Class'Enforcer')
- return False;
- }
- if(EraseHammer)
- {
- if (Other.Class==Class'ImpactHammer')
- return False;
- }
- bSuperRelevant = 0;
- return true;
- }
- defaultproperties
- {
- }
Raw Paste