예제 #1
0
            protected override void StartImpl()
            {
                // Make the outfit selection outwith the processing thread to ensure consistent RNG.
                // We select all potential Laras including the default for the level as there are
                // only 4 to choose from (there is also Assault Course Lara, but when holstering pistols
                // her trousers disappear, so she is excluded for the time being...).
                List <TR2Entities>      allLaras = TR2EntityUtilities.GetLaraTypes();
                List <TR2CombinedLevel> levels   = new List <TR2CombinedLevel>(_outfitAllocations.Keys);

                foreach (TR2CombinedLevel level in levels)
                {
                    // Add the persistent outfit first, but we will populate the candidate
                    // list regardless in case a level cannot support this choice.
                    if (_outer.PersistOutfits)
                    {
                        _outfitAllocations[level].Add(_outer._persistentOutfit);
                    }

                    while (_outfitAllocations[level].Count < allLaras.Count)
                    {
                        TR2Entities nextLara = allLaras[_outer._generator.Next(0, allLaras.Count)];
                        if (!_outfitAllocations[level].Contains(nextLara))
                        {
                            _outfitAllocations[level].Add(nextLara);
                        }
                    }
                }
            }
예제 #2
0
 private void SetPersistentOutfit()
 {
     if (PersistOutfits)
     {
         List <TR2Entities> allLaras = TR2EntityUtilities.GetLaraTypes();
         _persistentOutfit = allLaras[_generator.Next(0, allLaras.Count)];
     }
 }