TEXT   47
Moreguns build other
Guest on 21st August 2022 08:26:58 AM


  1. Moreguns
  2. Code:
  3. class MoreGuns expands Mutator config(MoreGuns);
  4.  
  5. #exec obj load file=..\System\FBFMac10.u package=FBFMac10
  6. #exec obj load file=..\System\MHAClusterRedeemer.u package=MHAClusterRedeemer
  7. #exec obj load file=..\System\TUC_M16A1.u package=TUC_M16A1
  8.  
  9. var config bool GiveMac10;
  10. var config bool GiveCluster;
  11. var config bool GiveM16;
  12.  
  13. var config bool EraseEnforcer;
  14. var config bool EraseHammer;
  15.  
  16. var bool bInitialized;
  17.  
  18. function PreBeginPlay()
  19. {
  20.    if ( !bInitialized )
  21.    {
  22.       bInitialized = True;
  23.       Self.NextMutator = Level.Game.BaseMutator.NextMutator;
  24.    }
  25. }
  26.  
  27. function ModifyPlayer(Pawn Other)
  28. {
  29.    if (Other.IsA('PlayerPawn'))
  30.    {
  31.       if(GiveMac10)
  32.          GiveWeapon(Other,class'FBFMac10.Mac10');
  33.       if(GiveCluster)
  34.          GiveWeapon(Other,class'MHAClusterRedeemer.MHAClusterRedeemer');
  35.       if(GiveM16)
  36.          GiveWeapon(Other,class'TUC_M16A1.TUC_M16A1');
  37.    }
  38.  
  39.    if ( NextMutator != None )
  40.       NextMutator.ModifyPlayer(Other);
  41. }
  42.  
  43. function GiveWeapon(Pawn PlayerPawn, class<Weapon> WeaponClass )
  44. {
  45.    local Weapon NewWeapon;
  46.  
  47.    newWeapon = Spawn(WeaponClass);
  48.    
  49.    if( PlayerPawn.FindInventoryType(WeaponClass) != None )
  50.       return;
  51.  
  52.    if(newWeapon != None)
  53.    {
  54.       newWeapon.RespawnTime = 0.0;
  55.       newWeapon.GiveTo(PlayerPawn);
  56.       newWeapon.bHeldItem = true;
  57.       newWeapon.GiveAmmo(PlayerPawn);
  58.       newWeapon.SetSwitchPriority(PlayerPawn);
  59.       newWeapon.WeaponSet(PlayerPawn);
  60.       newWeapon.AmbientGlow = 0;
  61.       PlayerPawn.PendingWeapon = None;
  62.       if ( !newWeapon.IsA('MHAClusterRedeemer'))
  63.       {
  64.     newWeapon.AmmoType.AmmoAmount = newWeapon.AmmoType.MaxAmmo;
  65.       }
  66.    }
  67. }
  68.  
  69. function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
  70. {
  71.    if(EraseEnforcer)
  72.    {
  73.       if (Other.Class==Class'Enforcer')
  74.          return False;
  75.    }
  76.  
  77.    if(EraseHammer)
  78.    {
  79.       if (Other.Class==Class'ImpactHammer')
  80.          return False;
  81.    }
  82.  
  83.    bSuperRelevant = 0;
  84.    return true;
  85. }
  86.  
  87. defaultproperties
  88. {
  89. }

Raw Paste

Login or Register to edit or fork this paste. It's free.