public List <string> GetEquipShowAddAttributes(LocalSave.EquipOne one)
        {
            List <string> list     = new List <string>();
            Equip_equip   beanById = base.GetBeanById(one.EquipID);
            int           index    = 0;
            int           length   = beanById.AdditionSkills.Length;

            while (index < length)
            {
                string item = string.Empty;
                if (!int.TryParse(beanById.AdditionSkills[index], out int num3))
                {
                    string str2 = beanById.AdditionSkills[index];
                    Goods_goods.GoodShowData goodShowData = Goods_goods.GetGoodShowData(str2);
                    if (one.IsBaby && !str2.Contains("EquipBaby:"))
                    {
                        string   languageByTID = GameLogic.Hold.Language.GetLanguageByTID("Attr_BabyParentContent", Array.Empty <object>());
                        object[] args          = new object[] { languageByTID, goodShowData.goodType };
                        goodShowData.goodType = Utils.FormatString("{0}{1}", args);
                    }
                    item = goodShowData.ToString();
                }
                else
                {
                    object[] args = new object[] { num3 };
                    item = GameLogic.Hold.Language.GetLanguageByTID(Utils.FormatString("技能描述{0}", args), Array.Empty <object>());
                }
                list.Add(item);
                index++;
            }
            return(list);
        }
        public List <Goods_goods.GoodShowData> GetEquipShowAttrs(LocalSave.EquipOne one)
        {
            List <Goods_goods.GoodShowData> list = new List <Goods_goods.GoodShowData>();
            int         level    = one.Level;
            Equip_equip beanById = base.GetBeanById(one.EquipID);
            int         index    = 0;
            int         length   = beanById.Attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]);
                level = MathDxx.Clamp(level, 0, one.CurrentMaxLevel);
                if (goodData.percent)
                {
                    goodData.value += ((level - 1) * beanById.AttributesUp[index]) * 100;
                }
                else
                {
                    goodData.value += (level - 1) * beanById.AttributesUp[index];
                }
                goodData.value = (long)(goodData.value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position)));
                Goods_goods.GoodShowData goodShowData = Goods_goods.GetGoodShowData(goodData);
                if (one.IsBaby && !goodData.goodType.Contains("EquipBaby:"))
                {
                    string   languageByTID = GameLogic.Hold.Language.GetLanguageByTID("Attr_BabyParentContent", Array.Empty <object>());
                    object[] args          = new object[] { languageByTID, goodShowData.goodType };
                    goodShowData.goodType = Utils.FormatString("{0}{1}", args);
                }
                list.Add(goodShowData);
                index++;
            }
            return(list);
        }
        public List <string> GetEquipAttributesNext(LocalSave.EquipOne one)
        {
            LocalSave.EquipOne one2 = new LocalSave.EquipOne {
                EquipID = one.EquipID,
                Level   = one.Level + 1
            };
            List <Goods_goods.GoodData> equipAttributes = this.GetEquipAttributes(one);
            List <Goods_goods.GoodData> list2           = this.GetEquipAttributes(one2);
            List <string> list3    = new List <string>();
            Equip_equip   beanById = base.GetBeanById(one.EquipID);
            int           index    = 0;
            int           length   = beanById.Attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]);
                string item = string.Empty;
                if (goodData.percent)
                {
                    object[] args = new object[] { beanById.AttributesUp[index] };
                    item = item + Utils.FormatString("+ {0}%", args);
                }
                else
                {
                    equipAttributes[index].value = (long)(equipAttributes[index].value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position)));
                    list2[index].value           = (long)(list2[index].value * (1f + GameLogic.SelfAttributeShow.GetUpPercent(one.Position)));
                    object[] args = new object[] { list2[index].value - equipAttributes[index].value };
                    item = item + Utils.FormatString("+ {0}", args);
                }
                list3.Add(item);
                index++;
            }
            return(list3);
        }
Esempio n. 4
0
    private List <BattleDropData> GetDropList()
    {
        List <BattleDropData> list = new List <BattleDropData>();

        this.equiplist = LocalSave.Instance.mFakeStageDrop.GetDropList();
        if ((this.equiplist != null) && (this.equiplist.Count > 0))
        {
            int num   = 0;
            int count = this.equiplist.Count;
            while (num < count)
            {
                Drop_DropModel.DropData data = this.equiplist[num];
                this.can_drop = true;
                LocalSave.EquipOne newEquipByID = LocalSave.Instance.GetNewEquipByID(data.id, data.count);
                if (!this.equipexp_talent_enable)
                {
                    if (newEquipByID.Overlying)
                    {
                        this.can_drop = false;
                    }
                }
                else if (newEquipByID.Overlying && !LocalSave.Instance.mEquip.Get_EquipExp_CanDrop(newEquipByID))
                {
                    this.can_drop = false;
                }
                if (this.can_drop)
                {
                    list.Add(new BattleDropData(FoodType.eEquip, newEquipByID));
                }
                num++;
            }
        }
        return(list);
    }
Esempio n. 5
0
    private void InitUI()
    {
        this.mBoxCtrl.Init();
        SdkManager.send_event_equipment("GET", this.mTransfer.data.id, this.mTransfer.data.count, 1, this.mTransfer.source, 0);
        this.mRetryCtrl.transform.localScale = Vector3.zero;
        this.equipdata         = new LocalSave.EquipOne();
        this.equipdata.EquipID = this.mTransfer.data.id;
        this.effect_light.SetActive(false);
        this.Text_Name.text    = this.equipdata.NameOnlyString;
        this.Text_Quality.text = this.equipdata.QualityString;
        this.Text_Name.set_color(this.equipdata.qualityColor);
        this.Text_Quality.set_color(this.equipdata.qualityColor);
        this.Text_Info.text = this.equipdata.InfoString;
        this.Text_Info.set_color(new Color(1f, 1f, 1f, 0f));
        this.titleparent.SetActive(false);
        this.equipparent.alpha = 0f;
        this.nameparent.alpha  = 0f;
        this.nameparent.transform.localScale  = Vector3.one * 1.5f;
        this.equipparent.transform.localScale = Vector3.one;
        this.show_close(false);
        this.mBoxCtrl.ShowOpenEffect(false);
        this.mBoxCtrl.transform.localScale = Vector3.one;
        this.mBoxCtrl.ShowBoxOpeningEffect(false);
        this.mBoxCtrl.ShowBoxOneEffect(false);
        GameLogic.Hold.Sound.PlayUI(0xf4249);
        this.mBoxCtrl.Play(BoxOpenBoxAniCtrl.BoxState.BoxOpenShow, this.mTransfer.boxtype);
        Sequence sequence = this.mSeqPool.Get();

        TweenSettingsExtensions.AppendInterval(sequence, 0.9f);
        TweenSettingsExtensions.AppendCallback(sequence, new TweenCallback(this, this.< InitUI > m__2));
    }
Esempio n. 6
0
    private void InitUI()
    {
        this.mCurrencyCtrl.gameObject.SetActive(false);
        this.mEquipCtrl.gameObject.SetActive(false);
        this.seq = DOTween.Sequence();
        PropType type = this.mTransfer.type;

        if (type == PropType.eCurrency)
        {
            this.mCurrencyCtrl.gameObject.SetActive(true);
            TweenSettingsExtensions.Append(this.seq, this.mCurrencyCtrl.Init(this.mTransfer));
        }
        else if (type == PropType.eEquip)
        {
            this.mEquipCtrl.gameObject.SetActive(true);
            LocalSave.EquipOne equip = new LocalSave.EquipOne {
                EquipID = this.mTransfer.id,
                Level   = 1,
                Count   = 1
            };
            TweenSettingsExtensions.Append(this.seq, this.mEquipCtrl.Init(equip, this.mTransfer.count));
        }
        else
        {
            object[] args = new object[] { this.mTransfer.ToString() };
            SdkManager.Bugly_Report("BoxOpenOneUICtrl", Utils.FormatString("InitUI {0}", args));
        }
        if (< > f__am$cache0 == null)
        {
 public void AddEquipInternal(LocalSave.EquipOne one)
 {
     Debug.Log("addequip " + one.EquipID);
     if (!one.Overlying)
     {
         this.mEquips.Add(one);
     }
     else
     {
         bool flag  = false;
         int  num   = 0;
         int  count = this.mEquips.Count;
         while (num < count)
         {
             if (this.mEquips[num].EquipID == one.EquipID)
             {
                 LocalSave.EquipOne local1 = this.mEquips[num];
                 local1.Count += one.Count;
                 flag          = true;
                 break;
             }
             num++;
         }
         if (!flag)
         {
             this.mEquips.Insert(0, one);
         }
     }
 }
    public void Init(LocalSave.EquipOne one)
    {
        LocalSave.EquipOne propShowByID = LocalSave.Instance.GetPropShowByID(one.data.UpgradeNeed);
        this.mMaterialData = propShowByID;
        this.init_equip();
        int count = 0;

        if (propShowByID != null)
        {
            count = propShowByID.Count;
        }
        int needMatCount = one.NeedMatCount;

        object[] args = new object[] { this.mMaterialData.NameString, count, needMatCount };
        this.Text_Info.text = Utils.FormatString("{0}: {1}/{2}", args);
        if (count >= needMatCount)
        {
            object[] objArray2 = new object[] { this.mMaterialData.NameString, count, needMatCount };
            this.Text_Info.text = Utils.FormatString("{0}: {1}/{2}", objArray2);
        }
        else
        {
            object[] objArray3 = new object[] { this.mMaterialData.NameString, count, needMatCount };
            this.Text_Info.text = Utils.FormatString("{0}: <color=#ff0000ff>{1}/{2}</color>", objArray3);
        }
    }
 private void Split()
 {
     Debugger.Log("武器精通");
     LocalSave.EquipOne one = null;
     if (one != null)
     {
         this.wearweapontype = one.data.Type;
         char[]   separator = new char[] { ',' };
         string[] strArray  = base.mData.Split(separator);
         if (strArray.Length != 2)
         {
             object[] args = new object[] { base.mData };
             SdkManager.Bugly_Report(base.GetType().ToString(), Utils.FormatString("{0} is invalid.", args));
         }
         else
         {
             int    num = int.Parse(strArray[0]);
             string str = strArray[1];
             if (num == this.wearweapontype)
             {
                 Debugger.Log(string.Concat(new object[] { "武器类型相同 ", num, " 增加属性 ", str }));
                 base.m_Entity.m_EntityData.ExcuteAttributes(str);
             }
         }
     }
 }
Esempio n. 10
0
    public void UpdateMaxLevel(LocalSave.EquipOne mBefore, LocalSave.EquipOne mAfter)
    {
        this.type = 0;
        this.baseatt.SetActive(true);
        this.skills.SetActive(false);
        string languageByTID = GameLogic.Hold.Language.GetLanguageByTID("EquipUI_MaxLevel", Array.Empty <object>());

        this.Text_Name.text = languageByTID;
        object[] args = new object[] { mBefore.CurrentMaxLevel };
        this.Text_Before.text = Utils.FormatString("{0}", args);
        object[] objArray2 = new object[] { mAfter.CurrentMaxLevel };
        this.Text_After.text = Utils.FormatString("{0}", objArray2);
    }
Esempio n. 11
0
    public Sequence Init(LocalSave.EquipOne equip, int count)
    {
        this.DeInit();
        this.equipdata = equip;
        object[] args = new object[] { count };
        this.Text_Count.text = Utils.FormatString("x{0}", args);
        this.mAddParent.SetActive(false);
        this.fx_open.SetActive(false);
        this.equipparent.localScale = Vector3.zero;
        int quality = 1;

        if (count <= 5)
        {
            quality = 1;
        }
        else if (count <= 10)
        {
            quality = 2;
        }
        else
        {
            quality = 3;
        }
        this.Text_Title.set_color(this.GetColor(quality));
        this.Text_Count.set_color(this.Text_Title.get_color());
        object[] objArray2 = new object[1];
        object[] objArray3 = new object[] { quality };
        objArray2[0]         = GameLogic.Hold.Language.GetLanguageByTID(Utils.FormatString("BoxOpenOne_EquipTitle{0}", objArray3), Array.Empty <object>());
        this.Text_Title.text = Utils.FormatString("{0}!", objArray2);
        this.Text_Name.text  = equip.NameString;
        this.Text_Info.text  = equip.InfoString;
        this.Text_Title.transform.localScale = Vector3.zero;
        this.Text_Name.transform.localScale  = Vector3.zero;
        this.Text_Info.transform.localScale  = Vector3.zero;
        object[] objArray4 = new object[] { this.equipdata.Quality };
        this.Image_BG.set_sprite(SpriteManager.GetCharUI(Utils.FormatString("CharUI_Quality{0}", objArray4)));
        this.Image_Icon.set_sprite(this.equipdata.Icon);
        this.Image_White.set_color(new Color(1f, 1f, 1f, 0.7f));
        this.seq = DOTween.Sequence();
        TweenSettingsExtensions.Append(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DOScale(this.Text_Title.transform, 1f, 0.3f), 0x1b));
        TweenSettingsExtensions.AppendInterval(this.seq, 0.3f);
        TweenSettingsExtensions.Append(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DOScale(this.Text_Name.transform, 1f, 0.3f), 0x1b));
        TweenSettingsExtensions.Append(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DOScale(this.Text_Info.transform, 1f, 0.3f), 0x1b));
        TweenSettingsExtensions.AppendCallback(this.seq, new TweenCallback(this, this.< Init > m__0));
        TweenSettingsExtensions.Append(this.seq, ShortcutExtensions.DOScale(this.equipparent, 1f, 0.3f));
        TweenSettingsExtensions.AppendInterval(this.seq, 0.3f);
        TweenSettingsExtensions.AppendCallback(this.seq, new TweenCallback(this, this.< Init > m__1));
        TweenSettingsExtensions.AppendInterval(this.seq, 0.3f);
        return(this.seq);
    }
 public void Init(LocalSave.EquipOne equip)
 {
     if (string.IsNullOrEmpty(this.uniqueid))
     {
         this.bShow = false;
     }
     else if (!this.uniqueid.Equals(equip.UniqueID) || (this.wearindex != equip.WearIndex))
     {
         this.bShow = false;
     }
     this.uniqueid  = equip.UniqueID;
     this.wearindex = equip.WearIndex;
     this.equipdata = equip;
 }
 private void add_equipexp(CEquipmentItem item)
 {
     if (item != null)
     {
         LocalSave.EquipOne one = new LocalSave.EquipOne {
             UniqueID = item.m_nUniqueID,
             EquipID  = (int)item.m_nEquipID,
             Level    = 1,
             Count    = (int)item.m_nFragment
         };
         if (one.Overlying)
         {
             LocalSave.Instance.AddProp(item);
         }
     }
 }
        public List <int> GetAdditionSkills_ui(LocalSave.EquipOne one)
        {
            List <int>  list     = new List <int>();
            Equip_equip beanById = base.GetBeanById(one.EquipID);
            int         index    = 0;
            int         length   = beanById.AdditionSkills.Length;

            while (index < length)
            {
                if (int.TryParse(beanById.AdditionSkills[index], out int num))
                {
                    list.Add(num);
                }
                index++;
            }
            return(list);
        }
Esempio n. 15
0
    private void OnUpdate(float delta)
    {
        if (this.bStart)
        {
            if ((this.currentFrame % 3) == 0)
            {
                if (((this.goodslist == null) || (this.currentindex >= this.goodslist.Count)) || (this.currentindex < 0))
                {
                    if (this.callback != null)
                    {
                        this.callback();
                    }
                    this.bStart = false;
                    return;
                }
                string str = string.Empty;
                switch (this.goodslist[this.currentindex].type)
                {
                case FoodType.eHP:
                case FoodType.eGold:
                case FoodType.eExp:
                    str = this.goodslist[this.currentindex].childtype.ToString();
                    break;

                case FoodType.eEquip:
                {
                    LocalSave.EquipOne data = this.goodslist[this.currentindex].data as LocalSave.EquipOne;
                    str = "1010101";
                    break;
                }
                }
                object[]   args = new object[] { "Game/Food/", str };
                GameObject obj2 = GameLogic.EffectGet(Utils.GetString(args));
                obj2.transform.parent     = this.MapGoodsDrop;
                obj2.transform.position   = new Vector3(this.pos.x, 0f, this.pos.z);
                obj2.transform.localScale = Vector3.one;
                FoodBase component = obj2.GetComponent <FoodBase>();
                component.Init(this.goodslist[this.currentindex].data);
                Vector3 randomEndPosition = this.GetRandomEndPosition(this.Goldslist, this.GoldsCenter);
                component.SetEndPosition(this.pos, randomEndPosition);
                this.currentindex++;
            }
            this.currentFrame++;
        }
    }
        public List <string> GetEquipAddAttributes(LocalSave.EquipOne one)
        {
            List <string> list   = new List <string>();
            Equip_equip   data   = one.data;
            int           index  = 0;
            int           length = data.AdditionSkills.Length;

            while (index < length)
            {
                string s = data.AdditionSkills[index];
                if (!int.TryParse(s, out _))
                {
                    list.Add(data.AdditionSkills[index]);
                }
                index++;
            }
            return(list);
        }
Esempio n. 17
0
 private void GetRandomEquip(ref List <BattleDropData> list, Soldier_soldier data)
 {
     if (this.equip_talent_enable)
     {
         int num = (int)(((data.EquipRate * this.mDropData.EquipProb) * 100f) * (1f + GameLogic.Self.m_EntityData.attribute.EquipDrop.Value));
         if (this.equip_must_drop)
         {
             if (data.CharID > 0x1388)
             {
                 List <BattleDropData> dropList = this.GetDropList();
                 int num2  = 0;
                 int count = dropList.Count;
                 while (num2 < count)
                 {
                     if ((dropList[num2].type == FoodType.eEquip) && (dropList[num2].data != null))
                     {
                         LocalSave.EquipOne one = dropList[num2].data as LocalSave.EquipOne;
                         if ((one != null) && (one.data.Position != 1))
                         {
                             list.Add(dropList[num2]);
                             this.equip_must_drop = false;
                             return;
                         }
                     }
                     num2++;
                 }
                 this.GetRandomEquip(ref list, data);
             }
         }
         else
         {
             this.level_dropequip += num;
             this.level_dropequip  = MathDxx.Clamp(this.level_dropequip, 0L, (long)(1E+08f * GameConfig.GetEquipDropMaxRate()));
             if (GameLogic.Random(0, 0x5f5e100) < this.level_dropequip)
             {
                 this.level_dropequip = 0L;
                 List <BattleDropData> dropList = this.GetDropList();
                 list.AddRange(dropList);
             }
             LocalSave.Instance.SaveExtra.SetEquipDropRate(this.level_dropequip);
         }
     }
 }
Esempio n. 18
0
 protected override void OnInstall(object[] args)
 {
     base.mBabyID = int.Parse(base.m_SkillData.Args[0]);
     base.OnInstall();
     this.mParent = base.baby.GetParent();
     if (this.mParent != null)
     {
         this.mParent.m_EntityData.attribute.OnAttackUpdate = (Action <long>)Delegate.Combine(this.mParent.m_EntityData.attribute.OnAttackUpdate, new Action <long>(this.OnAttackUpdate));
         if (this.mParent.m_EntityData.attribute.BabyCountAttack.Value > 0f)
         {
             this.mParent.m_EntityData.ExcuteAttributes("Attack%", this.mParent.m_EntityData.attribute.BabyCountAttack.ValueLong);
         }
         if (this.mParent.m_EntityData.attribute.BabyCountAttackSpeed.Value > 0f)
         {
             this.mParent.m_EntityData.ExcuteAttributes("AttackSpeed%", this.mParent.m_EntityData.attribute.BabyCountAttackSpeed.ValueLong);
         }
     }
     for (int i = 1; i < base.m_SkillData.Args.Length; i++)
     {
         string str = base.m_SkillData.Args[i];
         Goods_goods.GoodData goodData = Goods_goods.GetGoodData(str);
         if (goodData.goodType == "AttackParentAttack%")
         {
             this.attackparentatt = str;
         }
         base.baby.m_EntityData.ExcuteAttributes(goodData);
     }
     if (((args.Length == 1) && (args[0] != null)) && (args[0] is LocalSave.EquipOne))
     {
         LocalSave.EquipOne          one            = args[0] as LocalSave.EquipOne;
         List <Goods_goods.GoodData> babyAttributes = one.GetBabyAttributes();
         for (int j = 0; j < babyAttributes.Count; j++)
         {
             base.baby.m_EntityData.ExcuteAttributes(babyAttributes[j]);
         }
         List <int> babySkills = one.GetBabySkills();
         for (int k = 0; k < babySkills.Count; k++)
         {
             base.baby.AddSkillBaby(babySkills[k], Array.Empty <object>());
         }
     }
 }
    public void Init(int index)
    {
        if (this.mEquipItem == null)
        {
            this.mEquipItem = CInstance <UIResourceCreator> .Instance.GetEquip(this.itemparent);
        }
        int num  = LocalModelManager.Instance.Equip_equip.RandomEquipExp();
        int num2 = GameLogic.Random(5, 15);

        LocalSave.EquipOne equip = new LocalSave.EquipOne {
            EquipID = num,
            Count   = num2
        };
        this.mEquipItem.Init(equip);
        this.mIndex   = index;
        this.shopdata = LocalModelManager.Instance.Shop_Shop.GetBeanById(0x65 + index);
        object[] args = new object[] { mRewards[this.mIndex] };
        this.Text_Title.text = GameLogic.Hold.Language.GetLanguageByTID("shopui_equipexp_reward", args);
        this.mGoldCtrl.SetValue(this.shopdata.Price);
    }
Esempio n. 20
0
    public void Init(LocalSave.EquipOne equipdata)
    {
        this.equipdata = equipdata;
        if (this.equipdata == null)
        {
            this.ctrl.gameObject.SetActive(false);
        }
        else
        {
            this.ctrl.gameObject.SetActive(true);
            this.ctrl.Init(equipdata);
            this.ctrl.SetButtonEnable(false);
        }
        this.UpdateBGShow();
        this.UpdateRedNode();
        RectTransform transform = this.ctrl.transform as RectTransform;

        transform.localScale       = Vector3.one * 1.1f;
        transform.anchoredPosition = Vector2.zero;
        this.StopRotate();
    }
Esempio n. 21
0
 public void UpdateUI(LocalSave.EquipOne mBefore, LocalSave.EquipOne mAfter, int index)
 {
     this.mAfter  = mAfter;
     this.mBefore = mBefore;
     this.baseatt.SetActive(false);
     this.skills.SetActive(false);
     if (index < mBefore.data.Attributes.Length)
     {
         this.type = 0;
         this.baseatt.SetActive(true);
         string attName = mAfter.GetAttName(index);
         string currentAttributeString = mBefore.GetCurrentAttributeString(index);
         string str3 = mAfter.GetCurrentAttributeString(index);
         this.Text_Name.text = attName;
         object[] args = new object[] { currentAttributeString };
         this.Text_Before.text = Utils.FormatString("{0}", args);
         object[] objArray2 = new object[] { str3 };
         this.Text_After.text = Utils.FormatString("{0}", objArray2);
     }
     else if (mAfter.data.AdditionSkills.Length > mBefore.data.AdditionSkills.Length)
     {
         this.skills.SetActive(true);
         this.type             = 1;
         this.Text_Before.text = string.Empty;
         this.Text_After.text  = string.Empty;
         string s = mAfter.data.AdditionSkills[mAfter.data.AdditionSkills.Length - 1];
         this.Text_Name.text = GameLogic.Hold.Language.GetLanguageByTID("equip_combine_unlock_newatt", Array.Empty <object>());
         if (!int.TryParse(s, out int num))
         {
             this.Text_Down.text = Goods_goods.GetGoodShowData(s).ToString();
         }
         else
         {
             object[] args          = new object[] { num };
             string   languageByTID = GameLogic.Hold.Language.GetLanguageByTID(Utils.FormatString("技能描述{0}", args), Array.Empty <object>());
             this.Text_Down.text = languageByTID;
         }
     }
 }
Esempio n. 22
0
 private void GetRandomEquipExp(ref List <BattleDropData> list, Soldier_soldier data)
 {
     if (this.equipexp_talent_enable)
     {
         List <int> equipExpDrop = LocalModelManager.Instance.Stage_Level_stagechapter.GetEquipExpDrop((EntityType)LocalModelManager.Instance.Character_Char.GetBeanById(data.CharID).TypeID);
         int        num2         = 0;
         int        count        = equipExpDrop.Count;
         while (num2 < count)
         {
             int num = equipExpDrop[num2];
             if (num > 0)
             {
                 int equipexpid = LocalModelManager.Instance.Equip_equip.RandomEquipExp();
                 if (LocalSave.Instance.mEquip.Get_EquipExp_CanDrop(equipexpid))
                 {
                     LocalSave.EquipOne newEquipByID = LocalSave.Instance.GetNewEquipByID(equipexpid, num);
                     list.Add(new BattleDropData(FoodType.eEquip, newEquipByID));
                 }
             }
             num2++;
         }
     }
 }
        public List <Goods_goods.GoodData> GetEquipAttributes(LocalSave.EquipOne one)
        {
            List <Goods_goods.GoodData> list = new List <Goods_goods.GoodData>();
            Equip_equip beanById             = base.GetBeanById(one.EquipID);
            int         level  = one.Level;
            int         index  = 0;
            int         length = beanById.Attributes.Length;

            while (index < length)
            {
                Goods_goods.GoodData goodData = Goods_goods.GetGoodData(beanById.Attributes[index]);
                if (goodData.percent)
                {
                    goodData.value += ((level - 1) * beanById.AttributesUp[index]) * 100;
                }
                else
                {
                    goodData.value += (level - 1) * beanById.AttributesUp[index];
                }
                list.Add(goodData);
                index++;
            }
            return(list);
        }
    private void OnClickBuy(BlackItemOnectrl one)
    {
        int coins = (one.mData.PriceType != 1) ? 0 : one.mData.Price;
        int gems  = (one.mData.PriceType != 2) ? 0 : one.mData.Price;

        SdkManager.send_event_mysteries("CLICK", this.shoptype, one.mIndex, one.mData.ProductId, 0, 0, 0, 0, 0, 0, 0, 0, coins, gems, string.Empty, string.Empty);
        LocalSave.EquipOne one2 = new LocalSave.EquipOne {
            EquipID   = one.mData.ProductId,
            bNew      = false,
            Count     = one.mData.ProductNum,
            Level     = 1,
            WearIndex = -1
        };
        EquipInfoModuleProxy.Transfer data = new EquipInfoModuleProxy.Transfer {
            one          = one2,
            type         = EquipInfoModuleProxy.InfoType.eBuy,
            buy_itemone  = one,
            buy_callback = new Action <BlackItemOnectrl>(this.OnClickBuyInternal)
        };
        EquipInfoModuleProxy proxy = new EquipInfoModuleProxy(data);

        Facade.Instance.RegisterProxy(proxy);
        WindowUI.ShowWindow(WindowID.WindowID_EquipInfo);
    }
Esempio n. 25
0
    protected override void OnInit()
    {
        if (base.data == null)
        {
            SdkManager.Bugly_Report("PropOneEquip", Utils.FormatString("OnInit data == null.", Array.Empty <object>()));
        }
        else
        {
            base.Text_Value.fontSize          = (int)((30f * (base.transform as RectTransform).sizeDelta.x) / 150f);
            base.Text_Value.resizeTextMinSize = base.Text_Value.fontSize / 2;
            base.Text_Value.resizeTextMaxSize = base.Text_Value.fontSize;
            base.Text_Content.text            = string.Empty;
            base.Image_Icon.enabled           = true;
            base.Image_BG.enabled             = true;
            switch (base.data.type)
            {
            case PropType.eCurrency:
            {
                if (!(base.data.data is CurrencyData))
                {
                    SdkManager.Bugly_Report("PropOneEquip", Utils.FormatString("OnInit data.data is not a CurrencyData.", Array.Empty <object>()));
                    return;
                }
                CurrencyData data = base.data.data as CurrencyData;
                base.Image_Type.enabled        = false;
                base.Image_QualityGold.enabled = false;
                this.gold = data.count;
                object[] args = new object[] { this.gold };
                base.Text_Value.text = Utils.FormatString("x{0}", args);
                object[] objArray2 = new object[] { 0 };
                base.Image_BG.set_sprite(SpriteManager.GetCharUI(Utils.FormatString("CharUI_Quality{0}", objArray2)));
                base.Image_Icon.enabled = false;
                base.Text_Content.text  = string.Empty;
                CurrencyType id = (CurrencyType)data.id;
                if (id == CurrencyType.Reborn)
                {
                    base.Text_Content.text = GameLogic.Hold.Language.GetLanguageByTID("currency_reborn", Array.Empty <object>());
                }
                else
                {
                    base.Image_Icon.enabled = true;
                    base.Image_Icon.set_sprite(SpriteManager.GetUICommonCurrency(id));
                    base.Image_Icon.get_rectTransform().sizeDelta = new Vector2(100f, 100f);
                }
                break;
            }

            case PropType.eEquip:
            {
                if (!(base.data.data is EquipData))
                {
                    SdkManager.Bugly_Report("PropOneEquip", Utils.FormatString("OnInit data.data is not a EquipData.", Array.Empty <object>()));
                    return;
                }
                EquipData          data2 = base.data.data as EquipData;
                LocalSave.EquipOne one   = new LocalSave.EquipOne {
                    EquipID = data2.id
                };
                if ((data2.count == 0) || !one.Overlying)
                {
                    base.Text_Value.text = string.Empty;
                }
                else
                {
                    object[] objArray3 = new object[] { data2.count };
                    base.Text_Value.text = Utils.FormatString("x{0}", objArray3);
                }
                object[] args = new object[] { one.Quality };
                base.Image_BG.set_sprite(SpriteManager.GetCharUI(Utils.FormatString("CharUI_Quality{0}", args)));
                base.Image_Icon.enabled = true;
                base.Image_Icon.set_sprite(one.Icon);
                base.Image_Icon.get_rectTransform().sizeDelta = this.ImageSize;
                Sprite typeIcon = one.TypeIcon;
                base.Image_Type.enabled = typeIcon != null;
                base.Image_Type.set_sprite(typeIcon);
                base.Image_QualityGold.enabled = one.ShowQualityGoldImage;
                break;
            }
            }
        }
    }
Esempio n. 26
0
 public void Init(LocalSave.EquipOne equip)
 {
     this.equipdata = equip;
     this.Init();
 }
 public void UpdateUI(LocalSave.EquipOne one)
 {
     this.mEquipData = one;
 }
 public void AddEquip(LocalSave.EquipOne one)
 {
     this.AddEquipInternal(one);
     LocalSave.Instance.BattleIn_AddEquip(one);
 }