Beispiel #1
0
        private void AddConversionStat(List <TranslatedStat> result, string skill, IItemStat input, IItemStat output, IItemStat percentage)
        {
            if (input == null || output == null)
            {
                return;
            }

            if (percentage != null)
            {
                result.Add(new TranslatedStat
                {
                    Param5 = DamageTypeTranslation(input.TextValue),
                    Param6 = DamageTypeTranslation(output.TextValue),
                    Param2 = percentage.Value,
                    Param3 = skill,
                    Text   = _language.GetTag("customtag_xpac_modif_dmgConversionPerc"),
                    Type   = TranslatedStatType.FOOTER
                });
            }
            else
            {
                result.Add(new TranslatedStat
                {
                    Param5 = input.TextValue,
                    Param6 = output.TextValue,
                    Param3 = skill,
                    Text   = _language.GetTag("customtag_xpac_modif_dmgConversion"),
                    Type   = TranslatedStatType.FOOTER
                });
            }
        }
Beispiel #2
0
        /// <summary>
        /// Process skill stats
        /// These are non-standard skills, pre-processed by the parser.
        ///
        /// augmentSkill contains both the skill name and the increment amount
        /// augmentSkillExtras contains any additional info like which class it belongs to, and tier.
        /// This is done to avoid cross-record/item lookups at runtime
        /// </summary>
        /// <param name="stats"></param>
        /// <param name="result"></param>
        private void ProcessAddSkill(ISet <IItemStat> stats, List <TranslatedStat> result)
        {
            var skillCandidates = stats.Where(m => m.Stat.StartsWith("augmentSkill") && m.Stat.Length == "augmentSkill".Length + 1).ToList();

            // "augmentSkill1", "augmentSkill2",
            foreach (var stat in skillCandidates)
            {
                var statName = stat.Stat;
                // Record is requires as we may have "augmentSkill1" multiple times, from different records.
                IItemStat statExtras = stats.FirstOrDefault(m => m.Stat == statName + "Extras" && m.Record == stat.Record);

                TranslatedStat extraStat = null;
                if (statExtras != null)
                {
                    extraStat = new TranslatedStat
                    {
                        Text   = _language.GetTag(statName + "Extras"),
                        Param0 = statExtras.Value,
                        Param3 = _language.GetTag(statExtras.TextValue)
                    };
                }
                if (stat != null)
                {
                    result.Add(new TranslatedStat
                    {
                        Text   = _language.GetTag(statName),
                        Param0 = stat.Value,
                        Param3 = stat.TextValue,
                        Extra  = extraStat
                    });
                }
            }
        }
Beispiel #3
0
        public static void Scale(IItemStat stat, int seed)
        {
            var NoScale = new List <string>()
            {
                "characterStrength",
                "characterDexterity",
                "characterIntelligence",
                "defensiveLife",
                "characterMana",

                "characterStrengthModifier",
                "characterDexterityModifier",
                "characterIntelligenceModifier",
                "defensiveLifeModifier",
                "characterManaModifier",

                "characterOffensiveAbility",
                "characterDefensiveAbility",
                "characterOffensiveAbilityModifier",
                "characterDefensiveAbilityModifier",

                "characterLifeRegen",
                "characterManaRegen",
                "characterLifeRegenModifier",
                "characterManaRegenModifier",
            };



            if (NoScale.Contains(stat.Stat))
            {
                stat.Value = new Randomizer(seed).IGenerate((int)stat.Value - 20, (int)stat.Value + 20);
            }
        }
Beispiel #4
0
 private DatabaseItemStat map(IItemStat stat)
 {
     return(new DatabaseItemStat {
         Stat = stat.Stat,
         TextValue = stat.TextValue,
         Value = stat.Value
     });
 }
Beispiel #5
0
 public ItemStatViewModel(IVTubeMonDbConnection vTubeMonDbConnection, IItemStat itemStat = null)
 {
     _vTubeMonDbConnection = vTubeMonDbConnection;
     ItemStat  = itemStat;
     StatValue = itemStat.StatValue.Value;
     if (itemStat != null)
     {
         SetName();
     }
 }