예제 #1
0
 private void OnEnd_BuyItem(P2CBuyItem ret)
 {
     this.StopWaitCoroutine();
     if (ret != null && ret.retaCode == 0)
     {
         List <string> rItems = BattleEquipTools_config.GetRItems(this.RItems, this.CurHItem, this.PItems);
         if (BattleEquipTools_config.IsChanged(this.RItems, rItems))
         {
             this.Update_rItems(rItems);
             this.Update_rItemsSub();
             if (this.CurMenu == BattleEquipType.recommend)
             {
                 this.Update_curSItem(null);
                 this.Update_sItems();
             }
         }
         if (this.DealingShop != null)
         {
             this.DealingShop.DealCounter++;
             this.DealingShop.RollbackStack.Push(this.data.CurRollbackInfo);
             this.data.CurRollbackInfo = null;
         }
     }
     else
     {
         MobaMessageManagerTools.SendClientMsg(ClientC2C.BattleShop_err, "购买失败,errCode=" + ret.retaCode, false);
     }
     if (this.DealingShop != null)
     {
         this.DealingShop.State = EBattleShopState.eIdle;
         this.DealingShop       = null;
     }
     this.CurHItem = null;
 }
예제 #2
0
 public RItemData(string id, Dictionary <EBattleShopType, ShopInfo> shops)
 {
     this.itemID       = id;
     this.allShops     = shops;
     this.supportShops = new Dictionary <EBattleShopType, ShopInfo>();
     BattleEquipTools_config.GetBattleItemVo(this.itemID, out this.config);
     this.GetSupportShops();
 }
        private void OnMsg_BattleShop_recommendItemsSubChanged(MobaMessage msg)
        {
            List <RItemData> list         = msg.Param as List <RItemData>;
            bool             itemsChanged = BattleEquipTools_config.IsChanged(this.recommendItemsSub, list);

            this.recommendItemsSub.Clear();
            this.recommendItemsSub.AddRange(list);
            this.RefreshUI_initRecommendItems(itemsChanged);
        }
예제 #4
0
 public ShopInfo(SysBattleShopVo con, bool inA = false)
 {
     this.bOpen       = false;
     this.inArea      = inA;
     this.config      = con;
     this.dealCounter = 0;
     this.state       = EBattleShopState.eIdle;
     this.pveStack    = new Stack <RollbackInfo>();
     this.ShopItems   = BattleEquipTools_config.GetShopItems(con);
 }
예제 #5
0
 private void RefreshUI_value()
 {
     if (this.attriType != AttrType.None && this.detailAttr != null)
     {
         this.label_value.text = BattleEquipTools_config.GetAttriValueStr(this.detailAttr, this.attriType);
     }
     else
     {
         this.label_value.text = string.Empty;
     }
 }
예제 #6
0
        public List <RItemData> GenerateChilren(int level)
        {
            List <RItemData> list  = new List <RItemData>();
            List <string>    list2 = BattleEquipTools_config.StringToStringList(this.config.consumption, ',', "[]");

            for (int i = 0; i < list2.Count; i++)
            {
                RItemData item = new RItemData(list2[i], this.allShops);
                list.Add(item);
            }
            return(list);
        }
    private void RefreshUI_item()
    {
        RItemData rItemData = this.RecommendItem;

        if (rItemData != null)
        {
            this.sprite_icon.spriteName = rItemData.Config.icon;
            this.label_name.text        = LanguageManager.Instance.GetStringById(rItemData.Config.name);
            this.label_attri.text       = BattleEquipTools_config.GetAttriDes(rItemData.Config, " ", 2);
            this.label_des.text         = LanguageManager.Instance.GetStringById(rItemData.Config.recommend_describe);
            this.label_price.text       = rItemData.RealPrice.ToString();
            base.name = rItemData.ID;
        }
    }
    private void RefreshUI_iniItems()
    {
        int equipMenuCount = BattleEquipTools_config.GetEquipMenuCount();

        GridHelper.FillGrid <BattleEquip_MenuItem>(this.grid_menu, this.template_menuItem, equipMenuCount, delegate(int idx, BattleEquip_MenuItem comp)
        {
            BattleEquipType equipMenuTypeByIndex = BattleEquipTools_config.GetEquipMenuTypeByIndex(idx);
            comp.gameObject.SetActive(true);
            comp.MenuItemType = equipMenuTypeByIndex;
            comp.OnClick      = new Action <BattleEquip_MenuItem>(this.OnClick_menuItem);
            this.dict[equipMenuTypeByIndex] = comp;
        });
        this.RefreshUI_state();
    }
예제 #9
0
    private void InitDynamicData()
    {
        this.self.ChangeAttr(AttrType.Hp, OpType.Add, this.self.hp_max * this.self.hp_init_p);
        this.self.ChangeAttr(AttrType.Mp, OpType.Add, this.self.mp_max * this.self.mp_init_p);
        this.self.attackExtraDamage        = 0f;
        this.self.attackMultipleDamage     = 0f;
        this.self.beheadedCoefficient      = 0f;
        this.self.attackReboundCoefficient = 0f;
        this.self.a_growthFactor           = 1f;
        this.self.attackForTargetBuff      = string.Empty;
        List <string> heroItemsString = BattleEquipTools_op.GetHeroItemsString(this.self);
        Dictionary <AttrType, float> dictionary;
        Dictionary <AttrType, float> dictionary2;

        BattleEquipTools_config.GetItemsAttri(heroItemsString, out dictionary, out dictionary2);
        foreach (KeyValuePair <AttrType, float> current in dictionary)
        {
            base.ChangeAttr(current.Key, OpType.Add, current.Value);
        }
        foreach (KeyValuePair <AttrType, float> current2 in dictionary2)
        {
            base.ChangeAttr(current2.Key, OpType.Mul, current2.Value);
        }
    }
예제 #10
0
 public SItemData(SysBattleItemsVo vo)
 {
     this.config = vo;
     this.cItems = BattleEquipTools_config.StringToStringList(this.config.consumption, ',', "[]");
 }
예제 #11
0
 private void RefreshUI_icon()
 {
     this.icon.spriteName = BattleEquipTools_config.GetIconByEquipType(this.MenuItemType);
     this.icon.MakePixelPerfect();
 }
예제 #12
0
 private void RefreshUI_name()
 {
     this.name.spriteName = BattleEquipTools_config.GetNameByEquipType(this.MenuItemType);
 }