Beispiel #1
0
 private GameStructs.CustomAugment[] GetCustomAugments(Int64 BaseAddress)
 {
     GameStructs.CustomAugment[] CustomAugments = new GameStructs.CustomAugment[7];
     for (int AugIndex = 0; AugIndex < 7; AugIndex++)
     {
         GameStructs.CustomAugment dummy = new GameStructs.CustomAugment()
         {
             ID    = Scanner.READ_BYTE(BaseAddress + 0x78 + AugIndex),
             Level = (byte)AugIndex
         };
         CustomAugments[AugIndex] = dummy;
     }
     return(CustomAugments);
 }
Beispiel #2
0
        static string BuildCustomPartsStructure(int WeaponType, GameStructs.CustomAugment[] CustomAugments, bool ShowError)
        {
            StringBuilder[] Structure = new StringBuilder[5];
            for (int cAugmentIndex = 0; cAugmentIndex < CustomAugments.Length; cAugmentIndex++)
            {
                GameStructs.CustomAugment cAugment = CustomAugments[cAugmentIndex];
                // Skip empty slots
                if (cAugment.ID == byte.MaxValue)
                {
                    continue;
                }
                string AugmentType = HoneyGearData.SelectSingleNode($"//Honey/Weapons/Custom").ChildNodes[WeaponType].SelectSingleNode($"Part[@Level='{cAugment.Level + 1}' and @ID='{cAugment.ID}']/@Type")?.Value;

                // If we dont find the augment id, then we try the wildcard ones, since there are some
                // missing IDs
                if (AugmentType == null)
                {
                    AugmentType = HoneyGearData.SelectSingleNode($"//Honey/Weapons/Custom").ChildNodes[WeaponType].SelectSingleNode($"Part[@Level='{cAugment.Level + 1}' and @ID='?']/@Type")?.Value;
                }

                // If the augment is still null, then it isn't supported yet. In this case we display an error
                // with the augment ID, so it's easier to map it.
                if (AugmentType == null && ShowError)
                {
                    Debugger.Error($"Unsupported custom augment (ID = {cAugment.ID}, Level = {cAugment.Level})");
                    continue;
                }

                // Initializes StringBuilder if it isn't initialized yet
                int.TryParse(AugmentType, out int parsed);
                if (Structure[parsed] == null)
                {
                    Structure[parsed] = new StringBuilder();
                }

                Structure[parsed].Append((cAugment.Level + 1).ToString());
            }

            StringBuilder JoinedResult = new StringBuilder();

            foreach (StringBuilder SubBuilder in Structure)
            {
                JoinedResult.Append(SubBuilder?.ToString() + ";");
            }
            JoinedResult.Remove(JoinedResult.Length - 1, 1);
            return(JoinedResult.ToString());
        }