示例#1
0
    private void SetEnchantmentAttrs(int typeId)
    {
        List <string>    list             = new List <string>();
        FuMoDaoJuShuXing fuMoDaoJuShuXing = DataReader <FuMoDaoJuShuXing> .Get(typeId);

        string[] array = fuMoDaoJuShuXing.describe.Split(new char[]
        {
            ';'
        });
        string text = AttrUtility.GetAttrName(fuMoDaoJuShuXing.runeAttr) + "   " + string.Format(string.Concat(new string[]
        {
            "<color=#ff7d4b>",
            array[0],
            " - ",
            array[1],
            "</color>"
        }), new object[0]) + string.Empty;

        list.Add(text);
        for (int i = 0; i < 4; i++)
        {
            Text component = base.FindTransform("texAttr" + i).GetComponent <Text>();
            component.get_gameObject().SetActive(false);
        }
        int num = 0;

        while (num < list.get_Count() && num < 4)
        {
            Text component2 = base.FindTransform("texAttr" + num).GetComponent <Text>();
            component2.get_gameObject().SetActive(true);
            component2.set_text(list.get_Item(num));
            num++;
        }
    }
示例#2
0
 public static string GetDesc(AttrType type, long value, string hyphen, string typeColor, string valueColor, bool isHyphenAccordWithType)
 {
     if (isHyphenAccordWithType)
     {
         return(string.Format("{0}{1}", TextColorMgr.GetColor(string.Format("{0}{1}", AttrUtility.GetAttrName(type), hyphen), typeColor, string.Empty), TextColorMgr.GetColor(AttrUtility.GetAttrValueDisplay(type, value), valueColor, string.Empty)));
     }
     return(string.Format("{0}{1}", TextColorMgr.GetColor(AttrUtility.GetAttrName(type), typeColor, string.Empty), TextColorMgr.GetColor(string.Format("{0}{1}", hyphen, AttrUtility.GetAttrValueDisplay(type, value)), valueColor, string.Empty)));
 }
示例#3
0
 public void RefreshUI(int equipCfgID, int attrID)
 {
     this.attrText.set_text(string.Empty);
     if (attrID > 0)
     {
         this.attrText.set_text(AttrUtility.GetAttrName((AttrType)attrID));
         this.attrRangeText.set_text(EquipGlobal.GetExcellentRangeText(equipCfgID, attrID));
     }
 }
示例#4
0
    protected void SetAttrText(int attrID)
    {
        if (!DataReader <Attrs> .Contains(attrID))
        {
            return;
        }
        Attrs attrs = DataReader <Attrs> .Get(attrID);

        int num = (attrs.attrs.get_Count() >= attrs.values.get_Count()) ? attrs.values.get_Count() : attrs.attrs.get_Count();

        if (num == 0)
        {
            return;
        }
        XDict <int, long> xDict = new XDict <int, long>();

        for (int i = 0; i < num; i++)
        {
            if (xDict.ContainsKey(attrs.attrs.get_Item(i)))
            {
                XDict <int, long> xDict2;
                XDict <int, long> expr_76 = xDict2 = xDict;
                int  key;
                int  expr_85 = key = attrs.attrs.get_Item(i);
                long num2    = xDict2[key];
                expr_76[expr_85] = num2 + (long)attrs.values.get_Item(i);
            }
            else
            {
                xDict.Add(attrs.attrs.get_Item(i), (long)attrs.values.get_Item(i));
            }
        }
        if (xDict.Count < 3)
        {
            return;
        }
        this.RankUpChangeUIAttrTextTitle0.set_text(AttrUtility.GetAttrName(xDict.ElementKeyAt(0)));
        this.RankUpChangeUIAttrText0.set_text(AttrUtility.GetAddAttrValueDisplay(xDict.ElementKeyAt(0), xDict.ElementValueAt(0)));
        this.RankUpChangeUIAttrTextTitle1.set_text(AttrUtility.GetAttrName(xDict.ElementKeyAt(1)));
        this.RankUpChangeUIAttrText1.set_text(AttrUtility.GetAddAttrValueDisplay(xDict.ElementKeyAt(1), xDict.ElementValueAt(1)));
        this.RankUpChangeUIAttrTextTitle2.set_text(AttrUtility.GetAttrName(xDict.ElementKeyAt(2)));
        this.RankUpChangeUIAttrText2.set_text(AttrUtility.GetAddAttrValueDisplay(xDict.ElementKeyAt(2), xDict.ElementValueAt(2)));
    }
示例#5
0
    private void RefreshUIByCfg()
    {
        this.UpdateRewardItems();
        JunTuanZhanJiangLi junTuanZhanJiangLi = DataReader <JunTuanZhanJiangLi> .Get(1);

        if (junTuanZhanJiangLi != null)
        {
            int      title    = junTuanZhanJiangLi.Title;
            ChengHao chengHao = DataReader <ChengHao> .Get(title);

            if (chengHao != null && chengHao.displayWay == 2)
            {
                ResourceManager.SetSprite(this.titleImg, GameDataUtils.GetIcon(chengHao.icon));
                List <int> attrs = DataReader <Attrs> .Get(chengHao.gainProperty).attrs;

                List <int> values = DataReader <Attrs> .Get(chengHao.gainProperty).values;

                string text = string.Empty;
                int    num  = (attrs.get_Count() <= 2) ? attrs.get_Count() : 2;
                for (int i = 0; i < num; i++)
                {
                    if (i >= values.get_Count())
                    {
                        break;
                    }
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        AttrUtility.GetAttrName((GameData.AttrType)attrs.get_Item(i)),
                        ": <color=#47eb1b>+",
                        AttrUtility.GetAttrValueDisplay(attrs.get_Item(i), values.get_Item(i)),
                        "</color>"
                    });
                    if (i < num - 1)
                    {
                        text += "\n";
                    }
                }
                this.titleAttrName.set_text(text);
            }
        }
    }
示例#6
0
    private void ChangeCareerSuccess(RoleChangeCareerNty down)
    {
        List <LevelUpUnitData> list            = new List <LevelUpUnitData>();
        LevelUpUnitData        levelUpUnitData = new LevelUpUnitData();
        string beginStr = AttrUtility.GetAttrName(GameData.AttrType.Fighting) + ":";

        levelUpUnitData.BeginStr = beginStr;
        levelUpUnitData.Begin    = (float)down.oldFighting;
        levelUpUnitData.End      = (float)down.newFighting;
        list.Add(levelUpUnitData);
        levelUpUnitData          = new LevelUpUnitData();
        beginStr                 = "生命:";
        levelUpUnitData.BeginStr = beginStr;
        levelUpUnitData.Begin    = (float)down.oldHp;
        levelUpUnitData.End      = (float)down.newHp;
        list.Add(levelUpUnitData);
        levelUpUnitData          = new LevelUpUnitData();
        beginStr                 = "攻击:";
        levelUpUnitData.BeginStr = beginStr;
        levelUpUnitData.Begin    = (float)down.oldAttack;
        levelUpUnitData.End      = (float)down.newAttack;
        list.Add(levelUpUnitData);
        levelUpUnitData          = new LevelUpUnitData();
        beginStr                 = "防御:";
        levelUpUnitData.BeginStr = beginStr;
        levelUpUnitData.Begin    = (float)down.oldDefence;
        levelUpUnitData.End      = (float)down.newDefence;
        list.Add(levelUpUnitData);
        levelUpUnitData          = new LevelUpUnitData();
        beginStr                 = "格挡:";
        levelUpUnitData.BeginStr = beginStr;
        levelUpUnitData.Begin    = (float)down.oldParryRatio;
        levelUpUnitData.End      = (float)down.newParryRatio;
        list.Add(levelUpUnitData);
        levelUpUnitData          = new LevelUpUnitData();
        beginStr                 = "暴击:";
        levelUpUnitData.BeginStr = beginStr;
        levelUpUnitData.Begin    = (float)down.oldCritRatio;
        levelUpUnitData.End      = (float)down.newCritRatio;
        list.Add(levelUpUnitData);
        ChangeCareerSuccessUIViewModel.Instance.ShowChangeCareer(list, this.RoleChangeProfession);
    }
示例#7
0
 public static string GetAttrName(int typeNum)
 {
     return(AttrUtility.GetAttrName((AttrType)typeNum));
 }
示例#8
0
 public static string GetContent(int attrId, float value)
 {
     return(AttrUtility.GetAttrName((AttrType)attrId) + TextColorMgr.GetColor(value.ToString(), "A55539", string.Empty));
 }
示例#9
0
        protected void CheckFloatText(Buff buffData)
        {
            if (buffData.text == 0)
            {
                return;
            }
            BuffType type = (BuffType)buffData.type;

            if (type != BuffType.ChangeAttrs)
            {
                FloatTipManager.Instance.AddFloatTip(this.owner.ID, this.owner.Actor.FixTransform, GameDataUtils.GetChineseContent(buffData.text, false), string.Empty, true, 2.5f, 1f, 1f, 150f);
            }
            else
            {
                Attrs attrs = DataReader <Attrs> .Get(buffData.targetPropId);

                if (attrs != null)
                {
                    for (int i = 0; i < attrs.attrs.get_Count(); i++)
                    {
                        FloatTipManager.Instance.AddFloatTip(this.owner.ID, this.owner.Actor.FixTransform, string.Format(GameDataUtils.GetChineseContent(buffData.text, false), AttrUtility.GetAttrName((AttrType)attrs.attrs.get_Item(i)), (float)attrs.values.get_Item(i)), string.Empty, true, 2.5f, 1f, 1f, 150f);
                    }
                }
            }
        }
示例#10
0
    private void SetEnchantmentData(List <ExcellentAttr> enchantAttrs)
    {
        if (enchantAttrs == null || enchantAttrs.get_Count() <= 0)
        {
            this.EnchantmentAttr.get_gameObject().SetActive(false);
            return;
        }
        this.EnchantmentAttr.get_gameObject().SetActive(true);
        int  i    = 0;
        bool flag = false;
        int  num  = 0;

        while (i < enchantAttrs.get_Count())
        {
            if (i >= 3)
            {
                break;
            }
            if (enchantAttrs.get_Item(i).attrId > 0)
            {
                flag = true;
                int   attrId = enchantAttrs.get_Item(i).attrId;
                Items items  = DataReader <Items> .Get(attrId);

                string text = string.Empty;
                if (items != null)
                {
                    text = GameDataUtils.GetChineseContent(items.name, false);
                }
                FuMoDaoJuShuXing fuMoDaoJuShuXing = DataReader <FuMoDaoJuShuXing> .Get(attrId);

                this.EnchantmentAttr.FindChild("EquipItem2Text" + i).get_gameObject().SetActive(true);
                string text2 = string.Empty;
                if (fuMoDaoJuShuXing != null)
                {
                    if (fuMoDaoJuShuXing.valueType == 0)
                    {
                        text2 = string.Concat(new object[]
                        {
                            AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr),
                            " +",
                            (float)(enchantAttrs.get_Item(i).value * 100L) / 1000f,
                            "%"
                        });
                    }
                    else
                    {
                        text2 = AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr) + " +" + enchantAttrs.get_Item(i).value;
                    }
                    this.EnchantmentAttr.FindChild("EquipItem2Text" + i).FindChild("Item2Text").GetComponent <Text>().set_text(string.Format(text + ": <color=#ff7d4b>{0}</color>", text2));
                    num++;
                }
            }
            i++;
        }
        if (!flag)
        {
            this.EnchantmentAttr.get_gameObject().SetActive(false);
        }
        else
        {
            for (int j = num; j < 3; j++)
            {
                this.EnchantmentAttr.FindChild("EquipItem2Text" + j).get_gameObject().SetActive(false);
            }
        }
    }
示例#11
0
    public void OnEnchantmentEquipRes(ExcellentAttr oldExcellentAttr, ExcellentAttr newExcellentAttr)
    {
        EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == (EquipLibType.ELT) this.CurrentPos);
        string   text     = "原属性:";

        if (oldExcellentAttr == null)
        {
            text = "未附魔";
        }
        else if (oldExcellentAttr.attrId > 0)
        {
            FuMoDaoJuShuXing fuMoDaoJuShuXing = DataReader <FuMoDaoJuShuXing> .Get(oldExcellentAttr.attrId);

            if (fuMoDaoJuShuXing.valueType == 0)
            {
                string text2 = text;
                text = string.Concat(new object[]
                {
                    text2,
                    AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr),
                    " +",
                    (float)(oldExcellentAttr.value * 100L) / 1000f,
                    "%"
                });
            }
            else
            {
                string text2 = text;
                text = string.Concat(new object[]
                {
                    text2,
                    AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing.runeAttr),
                    " +",
                    oldExcellentAttr.value
                });
            }
        }
        else
        {
            text = "未附魔";
        }
        string text3 = string.Empty;

        if (newExcellentAttr != null)
        {
            FuMoDaoJuShuXing fuMoDaoJuShuXing2 = DataReader <FuMoDaoJuShuXing> .Get(newExcellentAttr.attrId);

            if (fuMoDaoJuShuXing2 != null)
            {
                text3 += "新属性:";
                if (fuMoDaoJuShuXing2.valueType == 0)
                {
                    string text2 = text3;
                    text3 = string.Concat(new object[]
                    {
                        text2,
                        AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing2.runeAttr),
                        " +",
                        (float)(newExcellentAttr.value * 100L) / 1000f,
                        "%"
                    });
                }
                else
                {
                    string text2 = text3;
                    text3 = string.Concat(new object[]
                    {
                        text2,
                        AttrUtility.GetAttrName((GameData.AttrType)fuMoDaoJuShuXing2.runeAttr),
                        " +",
                        newExcellentAttr.value
                    });
                }
            }
        }
        DialogEnchantmentUI dialogEnchantmentUI = UIManagerControl.Instance.OpenUI("DialogoEnchantmentUI", UINodesManager.TopUIRoot, false, UIType.NonPush) as DialogEnchantmentUI;

        dialogEnchantmentUI.ShowLeftAndRight(text, text3, null, delegate
        {
            if (equipLib != null)
            {
                EquipmentManager.Instance.SendEnchantEquipResultAckReq(this.CurrentPos, equipLib.wearingId, newExcellentAttr);
            }
        }, "放 弃", "更 换");
        this.RefreshUI(this.CurrentPos, this.CurrentSlot);
    }
示例#12
0
    private void RefreshRight(int formationID)
    {
        int          num          = 0;
        int          num2         = 0;
        int          num3         = 0;
        PetFormation petFormation = PetManager.Instance.Formation.Find((PetFormation a) => a.formationId == formationID);

        if (petFormation != null && petFormation.petFormationArr != null && petFormation.petFormationArr.Int64Array != null)
        {
            PetManager.Instance.GetFormationAddAttrValue(petFormation, out num, out num2, out num3);
            List <int> list = new List <int>();
            for (int i = 0; i < petFormation.petFormationArr.Int64Array.get_Count(); i++)
            {
                Int64IndexValue int64IndexValue = petFormation.petFormationArr.Int64Array.get_Item(i);
                PetInfo         petInfo         = PetManager.Instance.GetPetInfo(int64IndexValue.value);
                list.Add(petInfo.petId);
            }
            List <ChongWuJiBan> list2 = new List <ChongWuJiBan>();
            for (int j = 0; j < DataReader <ChongWuJiBan> .DataList.get_Count(); j++)
            {
                bool         flag         = true;
                ChongWuJiBan chongWuJiBan = DataReader <ChongWuJiBan> .DataList.get_Item(j);

                for (int k = 0; k < chongWuJiBan.linkedPetId.get_Count(); k++)
                {
                    int num4 = chongWuJiBan.linkedPetId.get_Item(k);
                    if (!list.Contains(num4))
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    list2.Add(chongWuJiBan);
                }
            }
            if (list2.get_Count() > 0)
            {
                for (int l = 0; l < list2.get_Count(); l++)
                {
                    ChongWuJiBan chongWuJiBan2 = list2.get_Item(l);
                    Transform    transform     = null;
                    if (l == 0)
                    {
                        transform = this.linkedPet1;
                    }
                    if (l == 2)
                    {
                        transform = this.linkedPet2;
                    }
                    if (l == 3)
                    {
                        transform = this.linkedPet3;
                    }
                    transform.FindChild("Title").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(chongWuJiBan2.name, false));
                    string text  = string.Empty;
                    Attrs  attrs = DataReader <Attrs> .Get(chongWuJiBan2.linkedAttrId);

                    for (int m = 0; m < attrs.attrs.get_Count(); m++)
                    {
                        text += AttrUtility.GetStandardAddDesc(attrs.attrs.get_Item(m), attrs.values.get_Item(m));
                    }
                    transform.FindChild("Content").GetComponent <Text>().set_text(text);
                }
                if (list2.get_Count() == 1)
                {
                    this.linkedPet1.get_gameObject().SetActive(true);
                    this.linkedPet2.get_gameObject().SetActive(false);
                    this.linkedPet3.get_gameObject().SetActive(false);
                }
                else if (list2.get_Count() == 2)
                {
                    this.linkedPet1.get_gameObject().SetActive(true);
                    this.linkedPet2.get_gameObject().SetActive(true);
                    this.linkedPet3.get_gameObject().SetActive(false);
                }
                else if (list2.get_Count() == 3)
                {
                    this.linkedPet1.get_gameObject().SetActive(true);
                    this.linkedPet2.get_gameObject().SetActive(true);
                    this.linkedPet3.get_gameObject().SetActive(true);
                }
            }
        }
        this.Property1.FindChild("Content").GetComponent <Text>().set_text(AttrUtility.GetAttrName(GameData.AttrType.Atk) + ":");
        this.Property2.FindChild("Content").GetComponent <Text>().set_text(AttrUtility.GetAttrName(GameData.AttrType.Defence) + ":");
        this.Property3.FindChild("Content").GetComponent <Text>().set_text(AttrUtility.GetAttrName(GameData.AttrType.HpLmt) + ":");
        this.Property1.FindChild("Value").GetComponent <Text>().set_text(num.ToString());
        this.Property2.FindChild("Value").GetComponent <Text>().set_text(num2.ToString());
        this.Property3.FindChild("Value").GetComponent <Text>().set_text(num3.ToString());
    }
示例#13
0
    public void UpdateItem(bool isOwn, TitleInfo ti)
    {
        this.isOwn = isOwn;
        ChengHao chengHao = DataReader <ChengHao> .Get(ti.titleId);

        if (chengHao.displayWay == 1)
        {
            this.Title.set_text(GameDataUtils.GetChineseContent(chengHao.icon, false));
            this.TitleImage.get_gameObject().SetActive(false);
            this.Title.get_gameObject().SetActive(true);
        }
        else if (chengHao.displayWay == 2)
        {
            ResourceManager.SetSprite(this.TitleImage, GameDataUtils.GetIcon(chengHao.icon));
            this.TitleImage.get_gameObject().SetActive(true);
            this.Title.get_gameObject().SetActive(false);
        }
        this.id       = ti.titleId;
        this.duration = chengHao.duration;
        for (int i = 0; i < 4; i++)
        {
            this.Bonuses[i].SetActive(false);
        }
        List <int> attrs = DataReader <Attrs> .Get(chengHao.gainProperty).attrs;

        List <int> values = DataReader <Attrs> .Get(chengHao.gainProperty).values;

        for (int j = 0; j < attrs.get_Count(); j++)
        {
            this.Bonuses[j].SetActive(true);
            this.Bonuses[j].get_transform().Find("BonusesDesc0").GetComponent <Text>().set_text(AttrUtility.GetAttrName((GameData.AttrType)attrs.get_Item(j)));
            this.Bonuses[j].get_transform().Find("BonusesNum0").GetComponent <Text>().set_text("+" + AttrUtility.GetAttrValueDisplay((GameData.AttrType)attrs.get_Item(j), values.get_Item(j)));
        }
        this.time = TimeManager.Instance.CalculateLocalServerTimeBySecond(ti.remainTime);
        string chineseContent = GameDataUtils.GetChineseContent(chengHao.gainIntroduction, false);
        string text           = GameDataUtils.GetChineseContent(chengHao.introduction, false);
        string text2          = null;
        int    condition      = chengHao.condition;

        if (condition != 2)
        {
            if (condition != 10)
            {
                text2 = chengHao.size.ToString();
            }
            else
            {
                int chapterOrder = DataReader <ZhuXianZhangJiePeiZhi> .Get(DataReader <ZhuXianPeiZhi> .Get(chengHao.size).chapterId).chapterOrder;

                int instance = DataReader <ZhuXianPeiZhi> .Get(chengHao.size).instance;

                string chineseContent2 = GameDataUtils.GetChineseContent(DataReader <ZhuXianPeiZhi> .Get(chengHao.size).name, false);
                text = string.Format(text, chapterOrder, instance, chineseContent2);
            }
        }
        else
        {
            text2 = GameDataUtils.GetChineseContent(DataReader <JingJiChangFenDuan> .Get(chengHao.size).name, false);
        }
        if (text2 != null)
        {
            text2 = "<color=#ff7d4b>" + text2 + "</color>";
            text  = string.Format(text, text2);
        }
        if (chengHao.schedule == -1)
        {
            this.ConditionOwn.set_text(chineseContent);
            this.Condition.set_text(text);
        }
        else
        {
            int num = 0;
            if (TitleManager.Instance.idProcessMap.ContainsKey(ti.titleId))
            {
                num = TitleManager.Instance.idProcessMap.get_Item(ti.titleId);
            }
            if (num > chengHao.schedule)
            {
                num = chengHao.schedule;
            }
            this.ConditionOwn.set_text(chineseContent);
            this.Condition.set_text(string.Concat(new object[]
            {
                text,
                "(",
                num,
                "/",
                chengHao.schedule,
                ")"
            }));
        }
        this.ConditionOwn.get_transform().get_parent().get_gameObject().SetActive(isOwn);
        this.Condition.get_transform().get_parent().get_gameObject().SetActive(!isOwn);
        if (ti.lookFlag)
        {
            this.New.SetActive(false);
        }
        else
        {
            this.New.SetActive(true);
        }
        if (ti.titleId == TitleManager.Instance.OwnCurrId)
        {
            this.Wear.SetActive(true);
        }
        else
        {
            this.Wear.SetActive(false);
        }
        this.NoHave.SetActive(!isOwn);
        this.RefreshTime();
    }