コード例 #1
0
        public string AttrTrans(EquipmentAttr data, bool color = false)
        {
            string str = color ? "[42fe79]+" : "+";

            switch (data.Name)
            {
            case "ATK": return(str + Mathf.FloorToInt(data.Value).ToString());

            case "MaxHP": return(str + Mathf.FloorToInt(data.Value).ToString());

            case "DEF": return(str + Mathf.FloorToInt(data.Value).ToString());

            case "CritP": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "CritV": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "ChainAtk": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "SpExtra": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "SpRes": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "MaxHPrate": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "ATKrate": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "DEFrate": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "Speed": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "speedrate": return(str + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            default: return(EB.Localizer.GetString("ID_ATTR_Unknown") + ":");
            }
        }
コード例 #2
0
        public string AttrTypeValue(EquipmentAttr data)
        {
            switch (data.Name)
            {
            case "ATK": return("+" + Mathf.FloorToInt(data.Value).ToString());

            case "MaxHP": return("+" + Mathf.FloorToInt(data.Value).ToString());

            case "DEF": return("+" + Mathf.FloorToInt(data.Value).ToString());

            case "CritP": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "CritV": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "ChainAtk": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "SpExtra": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "SpRes": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "MaxHPrate": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "ATKrate": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "DEFrate": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "Speed": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            case "speedrate": return("+" + Mathf.FloorToInt(data.Value * 100).ToString() + "%");

            default: return(EB.Localizer.GetString("ID_ATTR_Unknown") + ":");
            }
        }
コード例 #3
0
        public void OnEquipmentClick(int Eid, int equipmentLevel, int equipmentType)
        {
            infoPanel.gameObject.SetActive(true);
            infoPanel.GetComponent <TweenScale>().ResetToBeginning();
            infoPanel.GetComponent <TweenScale>().PlayForward();
            ClickItemCell.SetCellData(this, Eid, equipmentType, equipmentLevel);
            Hotfix_LT.Data.EquipmentItemTemplate tpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipment(Eid);
            DetailedEquipmentInfo attr = equipmentAttrs[Eid];

            Effect_4Label.effectStyle = UILabel.Effect.None;
            Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
            ClickItemTitle.applyGradient  = true;
            ClickItemTitle.gradientTop    = LT.Hotfix.Utility.ColorUtility.QualityToGradientTopColor(tpl.QualityLevel);
            ClickItemTitle.gradientBottom = LT.Hotfix.Utility.ColorUtility.QualityToGradientBottomColor(tpl.QualityLevel);
            ClickItemTitle.text           = ClickItemTitle.transform.GetChild(0).GetComponent <UILabel>().text = tpl.Name;
            Hotfix_LT.Data.SkillTemplate suitAttr1 = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_1);
            Hotfix_LT.Data.SkillTemplate suitAttr2 = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_2);
            int need       = 0;
            int SuitAttrId = -1;

            if (suitAttr1 != null)
            {
                need = 2;
                string FirstSuitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_1).Description;
                SuitAttrId = tpl.SuitAttrId_1;
                if (data.equipmentSuits.Count > 0)
                {
                    LTUIUtil.SetText(Effect_4Label, string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[data.equipmentSuits[SuitAttrId] >= need], FirstSuitAttr));
                }
            }
            else if (suitAttr2 != null)
            {
                need       = 4;
                SuitAttrId = tpl.SuitAttrId_2;
                string SecondSuitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_2).Description;
                LTUIUtil.SetText(Effect_4Label, string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[data.equipmentSuits[SuitAttrId] >= need], SecondSuitAttr));
            }

            if (data.equipmentSuits.Count > 0 && data.equipmentSuits[SuitAttrId] >= need)
            {
                Effect_4Label.effectStyle = UILabel.Effect.Outline8;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.74f, 1f, 0.85f);
            }
            else
            {
                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
            }

            EquipmentAttr MainAttributes = attr.MainAttributes;
            string        MainStr        = AttrTypeTrans(MainAttributes.Name);

            MainAttr.GetChild(0).GetComponent <UILabel>().text = "[fff348]" + MainStr;
            MainAttr.GetChild(1).GetComponent <UILabel>().text = AttrTypeValue(MainAttributes.Name, MainAttributes.Value);

            List <EquipmentAttr> exadd = attr.ExAttributes;
            int exCount = exadd.Count;

            for (int i = 0; i < 4; i++)
            {
                if (i > exCount - 1)
                {
                    ExAttr[i].gameObject.CustomSetActive(false);
                }
                else
                {
                    EquipmentAttr add        = exadd[i];
                    string        exAddName  = add.Name;
                    float         exAddValue = add.Value;
                    string        ExNameStr  = AttrTypeTrans(exAddName);
                    ExAttr[i].GetChild(0).GetComponent <UILabel>().text = ExNameStr;
                    ExAttr[i].GetChild(1).GetComponent <UILabel>().text = AttrTypeValue(exAddName, exAddValue);
                    ExAttr[i].gameObject.CustomSetActive(true);
                }
            }
            infoPanel.GetComponent <UIWidget>().height = 413 + 88 * exCount + ((Effect_4Label.gameObject.activeSelf) ? Effect_4Label.height : 0);
            EffectPos.UpdateAnchors();
            Effect2BgPos.UpdateAnchors();
            Effect4BgPos.UpdateAnchors();
        }
コード例 #4
0
        private DetailedEquipmentInfo PreseDetailedEquipmentInfor(object data, int EID = 0)
        {
            int eid = EID;

            if (eid == 0)
            {
                eid = EB.Dot.Integer("inventory_id", data, 0);
            }
            DetailedEquipmentInfo info = new DetailedEquipmentInfo(eid);

            info.ECid       = EB.Dot.String("economy_id", data, info.ECid);
            info.EquipLevel = EB.Dot.Integer("currentLevel", data, info.EquipLevel);
            info.IconName   = EB.Dot.String("iconId", data, null);
            string location = EB.Dot.String("location", data, null);

            switch (location)
            {
            case "equipment": { info.isDress = true; }; break;

            default: { info.isDress = false; }; break;
            }
            info.isLock       = EB.Dot.Bool("lock", data, info.isLock);
            info.QualityLevel = EB.Dot.Integer("qualityLevel", data, info.QualityLevel);
            info.CellPos      = EB.Dot.String("cell", data, null);
            string EquipTypeStr = EB.Dot.String("equipment_type", data, null);

            switch (EquipTypeStr)
            {
            case "1": info.Type = EquipPartType.part1; break;

            case "2": info.Type = EquipPartType.part2; break;

            case "3": info.Type = EquipPartType.part3; break;

            case "4": info.Type = EquipPartType.part4; break;

            case "5": info.Type = EquipPartType.part5; break;

            case "6": info.Type = EquipPartType.part6; break;

            default: info.Type = EquipPartType.none; break;
            }

            //新增
            //info.Name = EB.Dot.String("name", data, info.Name);名字改由读表获得

            string attrName = EB.Dot.String("attrs.main.name", data, null);
            int    attrId   = EB.Dot.Integer("attrs.main.attrId", data, 0);

            float value;

            Hotfix_LT.Data.EquipmentAttribute m_data = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipAttrInfo(attrId);
            if (info.EquipLevel >= 15)
            {
                value = m_data.finalValue;
            }
            else
            {
                value  = EB.Dot.Single("attrs.main.value", data, 0);
                value += m_data.addValue * info.EquipLevel;
            }
            info.MainAttributes = new EquipmentAttr(attrName, value);

            ArrayList attrList = Hotfix_LT.EBCore.Dot.Array("attrs.ex", data, null);

            info.ExAttributes = new List <EquipmentAttr>();
            if (attrList != null)
            {
                for (var i = 0; i < attrList.Count; i++)
                {
                    object obj = attrList[i];

                    if (obj != null)
                    {
                        Hashtable Data = obj as Hashtable;
                        if (Data != null)
                        {
                            string attrName_ex = EB.Dot.String("name", Data, null);
                            float  value_ex    = EB.Dot.Single("value", Data, 0);
                            int    attrId_ex   = EB.Dot.Integer("attrId", Data, 0);
                            int    level_ex    = EB.Dot.Integer("level", Data, 0);
                            Hotfix_LT.Data.EquipmentAttribute ex_data = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipAttrInfo(attrId_ex);
                            value_ex += ex_data.addValue * level_ex;
                            EquipmentAttr data_ex = new EquipmentAttr(attrName_ex, value_ex);
                            info.ExAttributes.Add(data_ex);
                        }
                    }
                }
            }
            info.Exp = EB.Dot.Integer("currentExp", data, 0);
            return(info);
        }