Beispiel #1
0
    public static void ShowEquipStrengthText(UILabel label, int equipID, int strengthLevel)
    {
        if (label == null)
        {
            return;
        }
        DEquipStreng strengthDB = ReadCfgEquipStreng.GetDataById(equipID);

        label.text = string.Empty;
        for (int i = 0; i < strengthDB.Propertys.Count; i++)
        {
            DStrengthValue data = strengthDB.Propertys[i];
            if (data.Value <= 0 || data.Property == 0)
            {
                continue;
            }
            DProperty propertyDB = ReadCfgProperty.GetDataById(data.Property);
            string    desc       = GTTools.Format(propertyDB.Desc, data.Value);
            string    v          = string.Empty;
            if (data.UnlockLevel <= strengthLevel)
            {
                v = GTTools.Format("[00ff00]{0}[-]", desc);
            }
            else
            {
                v = GTTools.Format("[777777]{0} (强化至{1}级生效)[-]", desc, data.UnlockLevel);
            }
            label.Append(v);
        }
    }
Beispiel #2
0
 public override void Read(XmlElement element)
 {
     this.Id = element.GetInt32("Id");
     for (int i = 1; i <= 6; i++)
     {
         DStrengthValue data = new DStrengthValue();
         data.Property    = (EAttr)element.GetInt32("PropertyId" + i);
         data.Value       = element.GetInt32("PropertyNum" + i);
         data.UnlockLevel = element.GetInt32("PropertyLevel" + i);
         this.Propertys.Add(data);
     }
 }
Beispiel #3
0
    public override void Read(XmlElement element)
    {
        this.Id      = element.GetInt32("Id");
        this.Name    = element.GetString("Name");
        this.Quality = element.GetInt32("Quality");
        this.Suit    = element.GetInt32("Suit");
        this.Exp     = element.GetInt32("Exp");
        this.Pos     = element.GetInt32("Pos");

        for (int i = 1; i <= 3; i++)
        {
            EAttr          k   = (EAttr)element.GetInt32("PropertyId" + i);
            int            v   = element.GetInt32("PropertyNum" + i);
            int            l   = element.GetInt32("UnlockLevel" + i);
            DStrengthValue gem = new DStrengthValue(k, v, l);
            this.Propertys.Add(gem);
        }
    }
Beispiel #4
0
    public static void ShowGemPropertyText(UILabel label, int gemID, int level, bool showNext = false)
    {
        if (label.text == null)
        {
            return;
        }
        label.text = string.Empty;
        DGem      gemDB = ReadCfgGem.GetDataById(gemID);
        DGemLevel db1   = ReadCfgGemLevel.GetDataById(gemDB.Quality * 1000 + level);
        DGemLevel db2   = ReadCfgGemLevel.GetDataById(gemDB.Quality * 1000 + level + 1);

        for (int i = 0; i < gemDB.Propertys.Count; i++)
        {
            DStrengthValue gp = gemDB.Propertys[i];
            if (!ReadCfgProperty.ContainsKey(gp.Property))
            {
                continue;
            }
            DProperty propertyDB = ReadCfgProperty.GetDataById(gp.Property);
            int       ratio      = level > 0 ? db1.PropertyRatio : 100;
            string    s          = GTTools.Format(propertyDB.Desc, (int)(gp.Value * ratio / 100f));
            int       add        = (int)(gp.Value * (db2.PropertyRatio - ratio) / 100f);
            string    str        = string.Empty;
            if (level >= gp.UnlockLevel)
            {
                if (showNext)
                {
                    str = GTTools.Format("[00ff00]{0}(+{1})[-]", s, add);
                }
                else
                {
                    str = GTTools.Format("[00ff00]{0}[-]", s);
                }
            }
            else
            {
                str = GTTools.Format("[777777]{0} (宝石强化至{1}级生效)[-]", s, gp.UnlockLevel);
            }
            label.Append(str);
        }
        label.text = label.text.TrimEnd('\n');
    }
Beispiel #5
0
    static void CalcGemStrenthLevel(Dictionary <EAttr, int> dict, XGem gem)
    {
        DGem      gemDB = ReadCfgGem.GetDataById(gem.Id);
        DGemLevel db    = ReadCfgGemLevel.GetDataById(gemDB.Quality * 1000 + gem.StrengthenLevel);

        for (int i = 0; i < gemDB.Propertys.Count; i++)
        {
            DStrengthValue gp = gemDB.Propertys[i];
            if (gem.StrengthenLevel >= gp.UnlockLevel)
            {
                dict[gp.Property] += gp.Value;
                int ratio = gem.StrengthenLevel > 0 ? db.PropertyRatio : 100;
                dict[gp.Property] = (int)(dict[gp.Property] * ratio / 100f);
            }
            else
            {
                break;
            }
        }
    }
Beispiel #6
0
    static void CalCfgStrengthValuethLevel(Dictionary <EAttr, int> dict, XEquip equip)
    {
        int    lv      = equip.StrengthenLevel;
        DEquip equipDB = ReadCfgEquip.GetDataById(equip.Id);

        dict[EAttr.HP] += lv * equipDB.StrengthGrow1;
        dict[EAttr.AP] += lv * equipDB.StrengthGrow2;
        dict[EAttr.DF] += lv * equipDB.StrengthGrow3;
        DEquipStreng strengthDB = ReadCfgEquipStreng.GetDataById(equip.Id);

        for (int i = 0; i < strengthDB.Propertys.Count; i++)
        {
            DStrengthValue es = strengthDB.Propertys[i];
            if (lv >= es.UnlockLevel)
            {
                dict[es.Property] += es.Value;
            }
            else
            {
                break;
            }
        }
    }