示例#1
0
        static internal TBAGW.KeyValuePair <Type, int> getStat(String statName)
        {
            LuaStat     temp = new LuaStat(statName, 5);
            LuaStatEdit coll = new LuaStatEdit();

            coll.modifyStats.Add(temp);
            STATChart sc = coll.ExtractStatChart();

            for (int i = 0; i < sc.currentActiveStats.Count; i++)
            {
                if (sc.currentActiveStats[i] != 0)
                {
                    return(new TBAGW.KeyValuePair <Type, int>(typeof(STATChart.ACTIVESTATS), i));
                }
            }

            for (int i = 0; i < sc.currentPassiveStats.Count; i++)
            {
                if (sc.currentPassiveStats[i] != 0)
                {
                    return(new TBAGW.KeyValuePair <Type, int>(typeof(STATChart.PASSIVESTATS), i));
                }
            }

            for (int i = 0; i < sc.currentSpecialStats.Count; i++)
            {
                if (sc.currentSpecialStats[i] != 0)
                {
                    return(new TBAGW.KeyValuePair <Type, int>(typeof(STATChart.SPECIALSTATS), i));
                }
            }

            return(new TBAGW.KeyValuePair <Type, int>(null, 0));
        }
示例#2
0
        private bool TryExtractSpecialStats(ref STATChart temp, LuaStat ls)
        {
            foreach (var item in Enum.GetNames(typeof(CritNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentSpecialStats[(int)TBAGW.STATChart.SPECIALSTATS.EXTRA_BASE_CRIT] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(DodgeNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentSpecialStats[(int)TBAGW.STATChart.SPECIALSTATS.EXTRA_BASE_DODGE] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(MPRegenNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentSpecialStats[(int)TBAGW.STATChart.SPECIALSTATS.DOT_MANA] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(HPRegenNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentSpecialStats[(int)TBAGW.STATChart.SPECIALSTATS.DOT_HP] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(HitChanceNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentSpecialStats[(int)TBAGW.STATChart.SPECIALSTATS.EXTRA_HIT_CHANCE] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(FailChance)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentSpecialStats[(int)TBAGW.STATChart.SPECIALSTATS.EXTRA_BASE_FAIL] += ls.value;
                    return(true);
                }
            }

            return(false);
        }
示例#3
0
        private bool TryExtractActiveStats(ref STATChart temp, LuaStat ls)
        {
            foreach (var item in Enum.GetNames(typeof(HealthNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentActiveStats[(int)TBAGW.STATChart.ACTIVESTATS.HP] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(ManaNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentActiveStats[(int)TBAGW.STATChart.ACTIVESTATS.MANA] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(AmmoNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentActiveStats[(int)TBAGW.STATChart.ACTIVESTATS.AMMO] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(ShieldNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentActiveStats[(int)TBAGW.STATChart.ACTIVESTATS.SHIELD] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(StoredAPNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentActiveStats[(int)TBAGW.STATChart.ACTIVESTATS.STORED_AP] += ls.value;
                    return(true);
                }
            }
            return(false);
        }
示例#4
0
        private bool TryExtractPassiveStats(ref STATChart temp, LuaStat ls)
        {
            foreach (var item in Enum.GetNames(typeof(MaxHealthNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.MAXHP] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(MaxManaNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.MAXMANA] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(MaxAmmoNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.MAXAMMO] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(MaxShieldNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.MAXSHIELD] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(StrNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.STR] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(DefNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.DEF] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(AgiNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.AGI] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(IntNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.INT] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(ApNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.AP] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(MobNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.MOB] += ls.value;
                    return(true);
                }
            }

            foreach (var item in Enum.GetNames(typeof(MasteryNames)))
            {
                if (item.Equals(ls.name, StringComparison.OrdinalIgnoreCase))
                {
                    temp.currentPassiveStats[(int)TBAGW.STATChart.PASSIVESTATS.MASTERY] += ls.value;
                    return(true);
                }
            }

            return(false);
        }
示例#5
0
 public void AddModStat(LuaStat ls)
 {
     modifyStats.Add(ls);
 }