Example #1
0
    public string GetStatString(bool default_value)
    {
        var stat_string = "";

        foreach (eStatType type in Enum.GetValues(typeof(eStatType)))
        {
            if ((int)type >= 100)
            {
                continue;
            }

            if (default_value != StatInfo.IsDefaultValue(Info.AttackType, type))
            {
                continue;
            }

            int value = StatTotal.GetValue(type);
            if (value == 0)
            {
                continue;
            }

            if (string.IsNullOrEmpty(stat_string) == false)
            {
                stat_string += "\n";
            }

            if (StatInfo.IsPercentValue(type) == true)
            {
                stat_string += string.Format("{0} : [c][7D0000]{1}%[-][/c]", Localization.Get(string.Format("StatType_{0}", type)), value / 100f);
            }
            else
            {
                stat_string += string.Format("{0} : [c][7D0000]{1}[-][/c]", Localization.Get(string.Format("StatType_{0}", type)), value);
            }
        }

        return(stat_string);
    }
Example #2
0
    string GetDetailString()
    {
        Dictionary <eStatType, float> stat_dic = new Dictionary <eStatType, float>();

        foreach (Rune rune in m_Creature.Runes)
        {
            foreach (SkillInfo.Action action in rune.Info.Skill.Actions)
            {
                if (stat_dic.ContainsKey(action.statType) == false)
                {
                    stat_dic.Add(action.statType, action.increasePerLevel * rune.Level);
                }
                else
                {
                    stat_dic[action.statType] += action.increasePerLevel * rune.Level;
                }
            }
        }

        var stat_string = "";

        foreach (eStatType type in Enum.GetValues(typeof(eStatType)))
        {
            if ((int)type >= 100)
            {
                continue;
            }

            if (StatInfo.IsDefaultValue(m_Creature.Info.AttackType, type) == false)
            {
                continue;
            }

            int value = m_Creature.StatTotal.GetValue(type);
            if (value == 0)
            {
                continue;
            }

            if (string.IsNullOrEmpty(stat_string) == false)
            {
                stat_string += "\n";
            }

            if (StatInfo.IsPercentValue(type) == true)
            {
                if (stat_dic.ContainsKey(type) == true)
                {
                    stat_string += string.Format("[c][F6D79F]{0}[-][/c] [c][E8AD05]{1}%[-][/c] [c][00B050](+{2}%)[-][/c]", Localization.Get(string.Format("StatType_{0}", type)), value / 100f, stat_dic[type]);
                    stat_dic.Remove(type);
                }
                else
                {
                    stat_string += string.Format("[c][F6D79F]{0}[-][/c] [c][E8AD05]{1}%[-][/c]", Localization.Get(string.Format("StatType_{0}", type)), value / 100f);
                }
            }
            else
            {
                if (stat_dic.ContainsKey(type) == true)
                {
                    stat_string += string.Format("[c][F6D79F]{0}[-][/c] [c][E8AD05]{1}[-][/c] [c][00B050](+{2})[-][/c]", Localization.Get(string.Format("StatType_{0}", type)), value, stat_dic[type]);
                    stat_dic.Remove(type);
                }
                else
                {
                    stat_string += string.Format("[c][F6D79F]{0}[-][/c] [c][E8AD05]{1}[-][/c]", Localization.Get(string.Format("StatType_{0}", type)), value);
                }
            }
        }

        stat_string += "\n";

        foreach (KeyValuePair <eStatType, float> values in stat_dic)
        {
            if (StatInfo.IsPercentValue(values.Key) == true)
            {
                stat_string += string.Format("[c][00B050]{0} +{1}%[-][/c]\n", Localization.Get(string.Format("StatType_{0}", values.Key)), values.Value);
            }
            else
            {
                stat_string += string.Format("[c][00B050]{0} +{2}%[-][/c]\n", Localization.Get(string.Format("StatType_{0}", values.Key)), values.Value);
            }
        }


        return(stat_string);
    }