コード例 #1
0
        public float GetAttackStat(MonAtkStat stat, MonAtkName atkName, int i)
        {
            string[] s     = GetBaseAttackStat(stat, atkName);
            float    total = 0;

            float[] atkStatModifiers = GetAtkStatModifiers(stat, atkName);
            total = (float.Parse(s[i]) + atkStatModifiers[1]) * (1 + atkStatModifiers[0] / 100);
            // print(atkName.ToString() + " " + stat.ToString() + " has a value of " + total);

            return(total);
        }
コード例 #2
0
 public float[] GetAttackStatArray(MonAtkStat stat, MonAtkName atkName)
 {
     string[] s     = GetBaseAttackStat(stat, atkName);
     float[]  total = new float[s.Length];
     for (int i = 0; i < s.Length; i++)
     {
         float[] atkStatModifiers = GetAtkStatModifiers(stat, atkName);
         total[i] = (float.Parse(s[i]) + atkStatModifiers[1]) * (1 + atkStatModifiers[0] / 100);
     }
     return(total);
 }
コード例 #3
0
 private float[] GetAtkStatModifiers(MonAtkStat stat, MonAtkName atkName)
 {
     float[] total = new float[] { 0, 0 };
     foreach (IMonAtkEffectProvider fxProvider in GetComponents <IMonAtkEffectProvider>())
     {
         foreach (float[] modifier in fxProvider.GetMonAtkStatModifiers(atkName, stat))
         {
             total[0] += modifier[0];
             total[1] += modifier[1];
         }
     }
     return(total);
 }
コード例 #4
0
        public IEnumerable <bool> GetMonAtkBooleanModifiers(MonAtkName atkName, MonAtkStat attackStat)
        {
            if (buffList.Count == 0)
            {
                yield return(false);
            }

            bool result = false;

            //Run through each active buff
            foreach (string id in buffList.Keys)
            {
                EffectName effect = (EffectName)Enum.Parse(typeof(EffectName), id);
                // Check if effect type boosts Attack, otherwise desired EffectStats aren't assigned
                if (effectDB.GetEffectStat(EffectStat.EffectType, effect) == "Atk Boost")
                {
                    // Skip if not a boolean buff value
                    if (int.Parse(effectDB.GetEffectStat(EffectStat.Additive, effect)) != 2)
                    {
                        continue;
                    }

                    // Get affected skill list and compare with the provided AtkType
                    string fxAttackTypes = effectDB.GetEffectStat(EffectStat.AtkTypesAffected, effect);
                    if (fxAttackTypes == "All" || fxAttackTypes.Contains(atkName.ToString()))
                    {
                        string fxAttackStats = effectDB.GetEffectStat(EffectStat.AtkStatsAffected, effect);
                        // Compare the Effect stat to the provided stat
                        if (fxAttackStats.Contains(attackStat.ToString()))
                        {
                            // Check and assign value, then check if buff is consumed on activation
                            if (effectDB.GetEffectStat(EffectStat.AtkEffectValues, effect).ToLower() == "true")
                            {
                                result = true;
                            }
                            if (int.Parse(effectDB.GetEffectStat(EffectStat.Consumed, effect)) == 1)
                            {
                                removeIDs.Add(id);
                            }
                        }
                    }
                }
            }

            yield return(result);
        }
コード例 #5
0
        public IEnumerable <float[]> GetMonAtkStatModifiers(MonAtkName atkName, MonAtkStat attackStat)
        {
            if (buffList.Count == 0)
            {
                yield return new float[] { 0, 0 }
            }
            ;

            float[] result = new float[] { 0, 0 };
            //Run through each active buff
            foreach (string id in buffList.Keys)
            {
                EffectName effect = (EffectName)Enum.Parse(typeof(EffectName), id);

                // Check if effect type boosts Attack, otherwise desired EffectStats aren't assigned
                if (effectDB.GetEffectStat(EffectStat.EffectType, effect) == "Atk Boost")
                {
                    // Skip if buff value is a bool
                    int modType = int.Parse(effectDB.GetEffectStat(EffectStat.Additive, effect));
                    if (modType == 2)
                    {
                        continue;
                    }

                    // Get affected skill list and compare with the provided AtkType
                    string fxAttackTypes = effectDB.GetEffectStat(EffectStat.AtkTypesAffected, effect);
                    if (fxAttackTypes == "All" || fxAttackTypes.Contains(atkName.ToString()))
                    {
                        string fxAttackStats = effectDB.GetEffectStat(EffectStat.AtkStatsAffected, effect);
                        // Compare the Effect stat to the provided stat
                        if (fxAttackStats.Contains(attackStat.ToString()))
                        {
                            // Check and assign value, then check if buff is consumed on activation
                            result[modType] += float.Parse(effectDB.GetEffectStat(EffectStat.AtkEffectValues, effect));
                            if (int.Parse(effectDB.GetEffectStat(EffectStat.Consumed, effect)) == 1 && !removeIDs.Contains(id))
                            {
                                removeIDs.Add(id);
                            }
                        }
                    }
                }
            }

            yield return(result);
        }
コード例 #6
0
        public string[] GetAttackStat(MonAtkStat stat, MonAtkName monAtkName)
        {
            BuildLookup();

            return(lookupTable[monAtkName][stat]);
        }
コード例 #7
0
 private string GetAttackString(MonAtkStat stat)
 {
     return(monAtkDB.GetAttackStat(stat, curAtk)[0]);
 }
コード例 #8
0
        private float GetAttackStat(MonAtkStat stat, int i)
        {
            float value = monAttacks.GetAttackStat(stat, curAtk, i);

            return(value);
        }
コード例 #9
0
 private string[] GetBaseAttackStat(MonAtkStat stat, MonAtkName atkName)
 {
     return(monAtkDB.GetAttackStat(stat, atkName));
 }