Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetSpawnListFromSquad(byte SquadIdx, out array< KFAISpawnSquad > SquadsList, out array< class<KFPawn_Monster> > AISpawnList)
- {
- local KFAISpawnSquad Squad;
- local EAIType AIType;
- local int i, j, RandNum;
- local ESquadType LargestMonsterSquadType;
- local array<class<KFPawn_Monster> > TempSpawnList;
- local class<KFPawn_Monster> ForcedPawn${1}< ${3} >
- Squad = SquadsList[SquadIdx];
- LargestMonsterSquadType = EST_Crawler;
- for ( i = 0; i < Squad.MonsterList.Length; i++ )
- {
- for ( j = 0; j < Squad.MonsterList[i].Num; j++ )
- {
- if( Squad.MonsterList[i].CustomClass != None )
- {
- TempSpawnList.AddItem(Squad.MonsterList[i].CustomClass);
- }
- else
- {
- AIType = Squad.MonsterList[i].Type;
- if( AIType == AT_BossRandom )
- {
- `if(`notdefined(ShippingPC))
- if( ForcedBossNum >= 0 )
- {
- if (ForcedBossNum < AIBossClassList.Length)
- {
- ForcedPawnClass = AIBossClassList[ForcedBossNum];
- }
- else if ((ForcedBossNum - AIBossClassList.Length) < AITestBossClassList.Length)
- {
- ForcedPawnClass = AITestBossClassList[ForcedBossNum - AIBossClassList.Length];
- }
- //If we've forced the class we don't greatly care about the memory results, preload content now
- ForcedPawnClass.static.PreloadContent();
- TempSpawnList.AddItem(ForcedPawnClass);
- }
- else
- `endif
- //Always have the squad type be a boss if we're spawning one in case of override
- TempSpawnList.AddItem(GetBossAISpawnType());
- LargestMonsterSquadType = EST_Boss;
- }
- else
- {
- TempSpawnList.AddItem(GetAISpawnType(AIType));
- }
- }
- if( TempSpawnList[TempSpawnList.Length - 1].default.MinSpawnSquadSizeType < LargestMonsterSquadType )
- {
- LargestMonsterSquadType = TempSpawnList[TempSpawnList.Length - 1].default.MinSpawnSquadSizeType;
- }
- }
- }
- if( TempSpawnList.Length > 0 )
- {
- while( TempSpawnList.Length > 0 )
- {
- RandNum = Rand( TempSpawnList.Length );
- AISpawnList.AddItem( TempSpawnList[RandNum] );
- TempSpawnList.Remove( RandNum, 1 );
- }
- DesiredSquadType = Squad.MinVolumeType;
- if( LargestMonsterSquadType < DesiredSquadType )
- {
- DesiredSquadType = LargestMonsterSquadType;
- //`log("adjusted largest squad for squad "$Squad$" to "$GetEnum(enum'ESquadType',DesiredSquadType));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement