Guest User

UPak/MarineMatch.uc

a guest
Feb 28th, 2016
36
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // MarineMatch.
  3. //=============================================================================
  4. class MarineMatch expands DeathMatchGame;
  5.  
  6. var() Class<SpaceMarine> MarineTypes[4];
  7. var() config bool bTerranWeaponsOnly;
  8. function PostBeginPlay()
  9. {
  10.     super.PostBeginPlay();
  11.     if( bTerranWeaponsOnly )
  12.         Class'CloakMatch'.Static.TerranWeaponSetup(Self);
  13. }
  14. function bool AddBot()
  15. {
  16.     local NavigationPoint StartSpot;
  17.     local bots NewBot;
  18.     local int BotN;
  19.     local class<Bots> ConfigBot${1}< ${3} >
  20.  
  21.     Difficulty = BotConfig.Difficulty;
  22.     BotN = BotConfig.ChooseBotInfo();
  23.    
  24.     // Find a start spot.
  25.     StartSpot = FindPlayerStart(0);
  26.     if( StartSpot == None )
  27.     {
  28.         log("Could not find starting spot for Bot");
  29.         return false;
  30.     }
  31.  
  32.     // Try to spawn the player.
  33.     NewBot = Spawn( MarineTypes[Rand(ArrayCount(MarineTypes))],,, StartSpot.Location, StartSpot.Rotation );
  34.     if ( NewBot == None )
  35.         return false;
  36.  
  37.     ConfigBotClass = BotConfig.GetBotClass(BotN);
  38.     if (ConfigBotClass != none)
  39.         NewBot.bIsFemale = ConfigBotClass.default.bIsFemale;
  40.  
  41.     StartSpot.PlayTeleportEffect(NewBot, true);
  42.  
  43.     // Init player's information.
  44.     BotConfig.Individualize(NewBot, BotN, NumBots);
  45.     NewBot.ViewRotation = StartSpot.Rotation;
  46.  
  47.     // broadcast a welcome message.
  48.     BroadcastMessage( NewBot.PlayerReplicationInfo.PlayerName$EnteredMessage, true );
  49.  
  50.     AddDefaultInventory( NewBot );
  51.     NumBots++;
  52.     return true;
  53. }
  54. function InitGameReplicationInfo()
  55. {
  56.     Super.InitGameReplicationInfo();
  57.     GameName = Class'DeathMatchGame'.Default.GameName;
  58. }
  59.  
  60. defaultproperties
  61. {
  62.                 MarineTypes(0)=Class'UPak.SpaceMarine'
  63.                 MarineTypes(1)=Class'UPak.MarineDesert'
  64.                 MarineTypes(2)=Class'UPak.MarineJungle'
  65.                 MarineTypes(3)=Class'UPak.MarineArctic'
  66.                 bTerranWeaponsOnly=True
  67.                 GameName="MarineMatch"
  68. }
RAW Paste Data