Advertisement
Blazephlozard

HuniePop 2 PopulateFinderSlots()

Feb 8th, 2021
1,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.50 KB | None | 0 0
  1.     public void PopulateFinderSlots()
  2.     {
  3.         List<GirlDefinition> allBySpecial = Game.Data.Girls.GetAllBySpecial(false);
  4.         Dictionary<GirlDefinition, PlayerFileGirl> dictionary = new Dictionary<GirlDefinition, PlayerFileGirl>();
  5.         for (int i = 0; i < allBySpecial.Count; i++)
  6.         {
  7.             dictionary.Add(allBySpecial[i], this.GetPlayerFileGirl(allBySpecial[i]));
  8.         }
  9.         List<GirlPairDefinition> allBySpecial2 = Game.Data.GirlPairs.GetAllBySpecial(false);
  10.         List<PlayerFileGirlPair> list = new List<PlayerFileGirlPair>();
  11.         for (int j = 0; j < allBySpecial2.Count; j++)
  12.         {
  13.             list.Add(this.GetPlayerFileGirlPair(allBySpecial2[j]));
  14.         }
  15.         ListUtils.ShuffleList<PlayerFileGirlPair>(list);
  16.         if (this.girlPairDefinition != null)
  17.         {
  18.             this.AddToFinderLists(null, null, this.girlPairDefinition, null, list);
  19.         }
  20.         for (int k = 0; k < list.Count; k++)
  21.         {
  22.             if (!dictionary[list[k].girlPairDefinition.girlDefinitionOne].playerMet && !dictionary[list[k].girlPairDefinition.girlDefinitionTwo].playerMet)
  23.             {
  24.                 list.RemoveAt(k);
  25.                 k--;
  26.             }
  27.         }
  28.         List<GirlPairDefinition> list2 = new List<GirlPairDefinition>();
  29.         List<LocationDefinition> list3 = new List<LocationDefinition>();
  30.         for (int l = 0; l < list.Count; l++)
  31.         {
  32.             if (list[l].relationshipType == GirlPairRelationshipType.ATTRACTED && (this.daytimeElapsed + ClockDaytimeType.AFTERNOON) % (ClockDaytimeType)4 == list[l].girlPairDefinition.sexDaytime)
  33.             {
  34.                 l = this.AddToFinderLists(list2, list3, list[l].girlPairDefinition, null, list);
  35.             }
  36.         }
  37.         for (int m = 0; m < list.Count; m++)
  38.         {
  39.             if (list[m].relationshipType == GirlPairRelationshipType.UNKNOWN && list[m].girlPairDefinition.introductionPair && list[m].girlPairDefinition.meetingLocationDefinition != this.locationDefinition && !list3.Contains(list[m].girlPairDefinition.meetingLocationDefinition))
  40.             {
  41.                 m = this.AddToFinderLists(list2, list3, list[m].girlPairDefinition, list[m].girlPairDefinition.meetingLocationDefinition, list);
  42.             }
  43.         }
  44.         for (int n = 0; n < list.Count; n++)
  45.         {
  46.             if ((list[n].relationshipType == GirlPairRelationshipType.UNKNOWN && !list[n].girlPairDefinition.introductionPair && list[n].girlPairDefinition.meetingLocationDefinition != this.locationDefinition && !list3.Contains(list[n].girlPairDefinition.meetingLocationDefinition) && dictionary[list[n].girlPairDefinition.girlDefinitionOne].playerMet && dictionary[list[n].girlPairDefinition.girlDefinitionTwo].playerMet) || list[n].relationshipType == GirlPairRelationshipType.COMPATIBLE)
  47.             {
  48.                 n = this.AddToFinderLists(list2, list3, list[n].girlPairDefinition, (list[n].relationshipType == GirlPairRelationshipType.UNKNOWN) ? list[n].girlPairDefinition.meetingLocationDefinition : null, list);
  49.             }
  50.         }
  51.         for (int num = 0; num < list.Count; num++)
  52.         {
  53.             if (list[num].relationshipType == GirlPairRelationshipType.LOVERS)
  54.             {
  55.                 num = this.AddToFinderLists(list2, list3, list[num].girlPairDefinition, null, list);
  56.             }
  57.         }
  58.         if (list2.Count <= 0)
  59.         {
  60.             for (int num2 = 0; num2 < list.Count; num2++)
  61.             {
  62.                 if (list[num2].relationshipType == GirlPairRelationshipType.ATTRACTED)
  63.                 {
  64.                     num2 = this.AddToFinderLists(list2, list3, list[num2].girlPairDefinition, null, list);
  65.                 }
  66.             }
  67.         }
  68.         List<LocationDefinition> allByLocationType = Game.Data.Locations.GetAllByLocationType(LocationType.SIM);
  69.         Dictionary<LocationDefinition, PlayerFileFinderSlot> dictionary2 = new Dictionary<LocationDefinition, PlayerFileFinderSlot>();
  70.         for (int num3 = 0; num3 < allByLocationType.Count; num3++)
  71.         {
  72.             PlayerFileFinderSlot playerFileFinderSlot = this.GetPlayerFileFinderSlot(allByLocationType[num3]);
  73.             playerFileFinderSlot.Clear();
  74.             dictionary2.Add(allByLocationType[num3], playerFileFinderSlot);
  75.         }
  76.         if (allByLocationType.Contains(this.locationDefinition))
  77.         {
  78.             allByLocationType.Remove(this.locationDefinition);
  79.         }
  80.         ListUtils.RemoveRangeUnique<LocationDefinition>(allByLocationType, list3);
  81.         for (int num4 = 0; num4 < list2.Count; num4++)
  82.         {
  83.             LocationDefinition locationDefinition = list3[num4];
  84.             if (locationDefinition == null)
  85.             {
  86.                 locationDefinition = allByLocationType[Random.Range(0, allByLocationType.Count)];
  87.                 allByLocationType.Remove(locationDefinition);
  88.             }
  89.             bool flipped = (!list2[num4].specialPair && list2[num4].introductionPair && this.GetPlayerFileGirlPair(list2[num4]).relationshipType == GirlPairRelationshipType.UNKNOWN) ? list2[num4].introSidesFlipped : MathUtils.RandomBool();
  90.             dictionary2[locationDefinition].Populate(list2[num4], flipped);
  91.         }
  92.     }
  93.  
  94.     // Token: 0x06000375 RID: 885 RVA: 0x0001D3E0 File Offset: 0x0001B5E0
  95.     private int AddToFinderLists(List<GirlPairDefinition> girlPairList, List<LocationDefinition> locationList, GirlPairDefinition girlPairDef, LocationDefinition locationDef, List<PlayerFileGirlPair> fileGirlPairs)
  96.     {
  97.         if (girlPairList != null && !girlPairList.Contains(girlPairDef))
  98.         {
  99.             girlPairList.Add(girlPairDef);
  100.             if (locationList != null && (locationDef == null || !locationList.Contains(locationDef)))
  101.             {
  102.                 locationList.Add(locationDef);
  103.             }
  104.         }
  105.         for (int i = 0; i < fileGirlPairs.Count; i++)
  106.         {
  107.             if (fileGirlPairs[i].girlPairDefinition.girlDefinitionOne == girlPairDef.girlDefinitionOne || fileGirlPairs[i].girlPairDefinition.girlDefinitionTwo == girlPairDef.girlDefinitionOne || fileGirlPairs[i].girlPairDefinition.girlDefinitionOne == girlPairDef.girlDefinitionTwo || fileGirlPairs[i].girlPairDefinition.girlDefinitionTwo == girlPairDef.girlDefinitionTwo)
  108.             {
  109.                 fileGirlPairs.RemoveAt(i);
  110.                 i--;
  111.             }
  112.         }
  113.         return -1;
  114.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement