Advertisement
Guest User

pezdec

a guest
Aug 30th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GetSpawnListFromSquad(byte SquadIdx, out array< KFAISpawnSquad > SquadsList, out array< class<KFPawn_Monster> >  AISpawnList)
  2. {
  3.     local KFAISpawnSquad Squad;
  4.     local EAIType AIType;
  5.     local int i, j, RandNum;
  6.     local ESquadType LargestMonsterSquadType;
  7.     local array<class<KFPawn_Monster> > TempSpawnList;
  8.     local class<KFPawn_Monster> ForcedPawn${1}< ${3} >
  9.  
  10.     Squad = SquadsList[SquadIdx];
  11.  
  12.     LargestMonsterSquadType = EST_Crawler;
  13.  
  14.     for ( i = 0; i < Squad.MonsterList.Length; i++ )
  15.     {
  16.         for ( j = 0; j < Squad.MonsterList[i].Num; j++ )
  17.         {
  18.             if( Squad.MonsterList[i].CustomClass != None )
  19.             {
  20.                 TempSpawnList.AddItem(Squad.MonsterList[i].CustomClass);
  21.             }
  22.             else
  23.             {
  24.                 AIType = Squad.MonsterList[i].Type;
  25.                 if( AIType == AT_BossRandom )
  26.                 {
  27. `if(`notdefined(ShippingPC))
  28.                     if( ForcedBossNum >= 0 )
  29.                     {
  30.                         if (ForcedBossNum < AIBossClassList.Length)
  31.                         {
  32.                             ForcedPawnClass = AIBossClassList[ForcedBossNum];
  33.                         }
  34.                         else if ((ForcedBossNum - AIBossClassList.Length) < AITestBossClassList.Length)
  35.                         {
  36.                             ForcedPawnClass = AITestBossClassList[ForcedBossNum - AIBossClassList.Length];
  37.                         }
  38.  
  39.                         //If we've forced the class we don't greatly care about the memory results, preload content now
  40.                         ForcedPawnClass.static.PreloadContent();
  41.                         TempSpawnList.AddItem(ForcedPawnClass);
  42.                     }
  43.                     else
  44. `endif
  45.                     //Always have the squad type be a boss if we're spawning one in case of override
  46.                     TempSpawnList.AddItem(GetBossAISpawnType());
  47.                     LargestMonsterSquadType = EST_Boss;
  48.                 }
  49.                 else
  50.                 {
  51.                     TempSpawnList.AddItem(GetAISpawnType(AIType));
  52.                 }
  53.             }
  54.  
  55.             if( TempSpawnList[TempSpawnList.Length - 1].default.MinSpawnSquadSizeType < LargestMonsterSquadType )
  56.             {
  57.                 LargestMonsterSquadType = TempSpawnList[TempSpawnList.Length - 1].default.MinSpawnSquadSizeType;
  58.             }
  59.         }
  60.     }
  61.     if( TempSpawnList.Length > 0 )
  62.     {
  63.         while( TempSpawnList.Length > 0 )
  64.         {
  65.             RandNum = Rand( TempSpawnList.Length );
  66.             AISpawnList.AddItem( TempSpawnList[RandNum] );
  67.             TempSpawnList.Remove( RandNum, 1 );
  68.         }
  69.  
  70.         DesiredSquadType = Squad.MinVolumeType;
  71.  
  72.         if( LargestMonsterSquadType < DesiredSquadType )
  73.         {
  74.             DesiredSquadType = LargestMonsterSquadType;
  75.             //`log("adjusted largest squad for squad "$Squad$" to "$GetEnum(enum'ESquadType',DesiredSquadType));
  76.         }
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement