Пример #1
0
        //9个位置icon的创建
        void creatrveicon(int id)
        {
            Dictionary <int, hallowsData> dic = A3_HallowsModel.getInstance().now_hallows();

            GameObject iconf = lsts_nine_region[id - 1].transform.FindChild("icon/icon").gameObject;
            GameObject icon  = IconImageMgr.getInstance().createA3ItemIcon((uint)dic[id].item_id, true, -1, 1, true);

            icon.transform.SetParent(iconf.transform, false);

            Text   name      = lsts_nine_region[id - 1].transform.FindChild("name").GetComponent <Text>();
            string item_name = XMLMgr.instance.GetSXML("item.item", "id==" + (uint)dic[id].item_id).getString("item_name");

            name.text = Globle.getColorStrByQuality(item_name, dic[id].h_s_d.quality);

            a3_BagItemData data = new a3_BagItemData();

            data.tpid = (uint)dic[id].item_id;
            data.num  = 1;
            a3_ItemData da = new a3_ItemData();

            da             = a3_BagModel.getInstance().getItemDataById(data.tpid);
            data.confdata  = da;
            data.ishallows = true;
            new BaseButton(icon.transform).onClick = delegate(GameObject go) { this.itemOnclick(icon, data, 3); ShoworHideModel(false); };
        }
Пример #2
0
 public string getName()
 {
     if (tpid == 0)
     {
         return("<color=#ffd800>" + ContMgr.getCont("comm_money", count.ToString()) + "</color>");
     }
     return(Globle.getColorStrByQuality(itemXml.getString("item_name"), itemXml.getInt("quality")));
 }
Пример #3
0
 public string getDropItemName()
 {
     if (tpid == 0)
     {
         return(ContMgr.getCont("comm_money", count.ToString()));
     }
     //string strGod = a3_BagModel.getInstance().addGodStr(itemXml.getInt("equip_level"));
     return(Globle.getColorStrByQuality(itemXml.getString("item_name"), itemXml.getInt("quality")));
 }
Пример #4
0
        public void flygetText(DropItem item)
        {
            bool flag = item.itemdta.tpid == 0;

            if (flag)
            {
                MediaClient.instance.PlaySoundUrl("audio/common/collect_coin", false, null);
                bool flag2 = GameRoomMgr.getInstance().curRoom != null;
                if (flag2)
                {
                    GameRoomMgr.getInstance().curRoom.onPickMoney(item.itemdta.count);
                }
                bool flag3 = a3_insideui_fb.instance != null;
                if (flag3)
                {
                    this.goldnum = (uint)a3_insideui_fb.instance.addmoney;
                }
                else
                {
                    this.goldnum += (uint)item.itemdta.count;
                }
            }
            else
            {
                string @string = item.itemdta.itemXml.getString("item_name");
                int    @int    = item.itemdta.itemXml.getInt("quality");
                flytxt.instance.fly(string.Concat(new object[]
                {
                    ContMgr.getCont("gameroom_pick", null),
                    Globle.getColorStrByQuality(@string, @int),
                    "x",
                    item.itemdta.count
                }), 0, default(Color), null);
                DropItemdta dropItemdta = new DropItemdta();
                dropItemdta.tpid = item.itemdta.itemXml.getInt("id");
                dropItemdta.num  = item.itemdta.count;
                foreach (DropItemdta current in this.list2)
                {
                    bool flag4 = dropItemdta.tpid == current.tpid;
                    if (flag4)
                    {
                        current.num += item.itemdta.count;
                        return;
                    }
                }
                this.list2.Add(dropItemdta);
            }
        }
Пример #5
0
        public void flygetText(DropItem item)
        {
            if (item.itemdta.tpid == 0)
            {
                MediaClient.instance.PlaySoundUrl("audio_common_collect_coin", false, null);
                // flytxt.instance.fly("拾取金币 " + item.itemdta.count);
                //已有金币添加飘字
                // if (a3_insideui_fb.instance != null) a3_insideui_fb.instance.SetInfMoney(item.itemdta.count);
                if (GameRoomMgr.getInstance().curRoom != null)
                {
                    GameRoomMgr.getInstance().curRoom.onPickMoney(item.itemdta.count);
                }

                //记录拾取金币
                //goldnum += (uint)item.itemdta.count;
                if (a3_insideui_fb.instance != null)
                {
                    goldnum = (uint)a3_insideui_fb.instance.addmoney;
                }
                else
                {
                    goldnum += (uint)item.itemdta.count;
                }
            }
            else
            {
                string name    = item.itemdta.itemXml.getString("item_name");
                int    quality = item.itemdta.itemXml.getInt("quality");
                flytxt.instance.fly(ContMgr.getCont("gameroom_pick") + Globle.getColorStrByQuality(name, quality) + "x" + item.itemdta.count);

                DropItemdta v = new DropItemdta();

                v.tpid = item.itemdta.itemXml.getInt("id");
                v.num  = item.itemdta.count;
                foreach (var it in list2)
                {
                    if (v.tpid == it.tpid)
                    {
                        it.num += item.itemdta.count;
                        return;
                    }
                }
                list2.Add(v);
            }
        }
Пример #6
0
        public string getDropItemName()
        {
            bool   flag = this.tpid == 0;
            string result;

            if (flag)
            {
                result = ContMgr.getCont("comm_money", new string[]
                {
                    this.count.ToString()
                });
            }
            else
            {
                result = Globle.getColorStrByQuality(this.itemXml.getString("item_name"), this.itemXml.getInt("quality"));
            }
            return(result);
        }
Пример #7
0
        public void AutoEquipProcess(a3_BagItemData itmdata)
        {
            AutoPlayModel instance = ModelBase <AutoPlayModel> .getInstance();

            bool flag = !SelfRole.fsm.Autofighting;

            if (!flag)
            {
                bool flag2 = instance.EqpType == 0 || ModelBase <A3_VipModel> .getInstance().Level < 3;

                if (!flag2)
                {
                    int  eqpProc = instance.EqpProc;
                    int  quality = itmdata.confdata.quality;
                    int  num     = 1 << quality - 1;
                    bool flag3   = (eqpProc & num) == 0;
                    if (!flag3)
                    {
                        bool flag4 = instance.EqpType == 1;
                        if (flag4)
                        {
                            BaseProxy <BagProxy> .getInstance().sendSellItems(itmdata.id, itmdata.num);

                            flytxt.instance.fly("自动出售 " + Globle.getColorStrByQuality(itmdata.confdata.item_name, itmdata.confdata.quality), 0, default(Color), null);
                        }
                        else
                        {
                            bool flag5 = instance.EqpType == 2;
                            if (flag5)
                            {
                                List <uint> list = new List <uint>();
                                list.Add(itmdata.id);
                                BaseProxy <EquipProxy> .getInstance().sendsell(list);

                                flytxt.instance.fly("自动分解 " + Globle.getColorStrByQuality(itmdata.confdata.item_name, itmdata.confdata.quality), 0, default(Color), null);
                            }
                        }
                    }
                }
            }
        }
Пример #8
0
        public void AutoEquipProcess(a3_BagItemData itmdata)
        {
            AutoPlayModel apmodel = AutoPlayModel.getInstance();

            //!--非自动挂机不做处理
            if (!SelfRole.fsm.Autofighting)
            {
                return;
            }

            //!--不处理装备,或vip等级3以下
            if (apmodel.EqpType == 0 || A3_VipModel.getInstance().Level < 3)
            {
                return;
            }

            int eqpproc = apmodel.EqpProc;
            int quality = itmdata.confdata.quality;
            int bitqual = (1 << (quality - 1));

            if ((eqpproc & bitqual) == 0)
            {
                return;
            }

            if (apmodel.EqpType == 1)
            {//!--自动出售
                BagProxy.getInstance().sendSellItems(itmdata.id, itmdata.num);


                flytxt.instance.fly(ContMgr.getCont("StatePick0") + Globle.getColorStrByQuality(itmdata.confdata.item_name, itmdata.confdata.quality));
            }
            else if (apmodel.EqpType == 2)
            {//!--自动分解
                List <uint> eqps = new List <uint>();
                eqps.Add(itmdata.id);
                EquipProxy.getInstance().sendsell(eqps);

                flytxt.instance.fly(ContMgr.getCont("StatePick1") + Globle.getColorStrByQuality(itmdata.confdata.item_name, itmdata.confdata.quality));
            }
        }
Пример #9
0
        public string getEquipNameInfo(uint tpid, int stage_lv, int intensify_ly, int add_level, int equip_level, int attribute)
        {
            string text    = "";
            int    quality = 1;
            SXML   sXML    = XMLMgr.instance.GetSXML("item.item", "id==" + tpid);
            bool   flag    = sXML != null;

            if (flag)
            {
                text    = sXML.getString("item_name");
                quality = sXML.getInt("quality");
            }
            string str = "";

            switch (stage_lv)
            {
            case 0:
                str = "普通的";
                break;

            case 1:
                str = "强化的";
                break;

            case 2:
                str = "打磨的";
                break;

            case 3:
                str = "优良的";
                break;

            case 4:
                str = "珍惜的";
                break;

            case 5:
                str = "祝福的";
                break;

            case 6:
                str = "完美的";
                break;

            case 7:
                str = "卓越的";
                break;

            case 8:
                str = "传说的";
                break;

            case 9:
                str = "神话的";
                break;

            case 10:
                str = "创世的";
                break;
            }
            text = str + text;
            string str2 = "";

            switch (attribute)
            {
            case 1:
                str2 = "[风]";
                break;

            case 2:
                str2 = "[火]";
                break;

            case 3:
                str2 = "[光]";
                break;

            case 4:
                str2 = "[雷]";
                break;

            case 5:
                str2 = "[冰]";
                break;
            }
            text += str2;
            string str3  = (intensify_ly > 0) ? ("+" + intensify_ly) : string.Empty;
            string text2 = (add_level > 0) ? ("追" + add_level.ToString()) : string.Empty;

            str3  = "<color=#ff5555ff>" + str3 + "</color>";
            text2 = "<color=#ff9500ff>" + text2 + "</color>";
            return(Globle.getColorStrByQuality(text, quality) + str3 + text2);
        }
Пример #10
0
        private void onItemCardInfo(Variant d)
        {
            bool flag = d.ContainsKey("tp");

            if (flag)
            {
                HttpAppMgr.instance.onGetRewardItems(d["tp"]);
            }
            else
            {
                bool flag2 = d.ContainsKey("tpchange");
                if (flag2)
                {
                    int random = ConfigUtil.getRandom(0, 20);
                    DelayDoManager.singleton.AddDelayDo(delegate
                    {
                        this.sendLoadItemCardInfo(null);
                    }, random, 0u);
                    debug.Log("兑换码后台发生变!!!间隔发送请求礼品卡:" + random);
                }
                else
                {
                    bool flag3 = d.ContainsKey("card_fetch");
                    if (flag3)
                    {
                        Variant variant  = d["card_fetch"];
                        int     num      = variant["tp"];
                        string  text     = variant["cardid"];
                        Variant variant2 = variant["reward"];
                        bool    flag4    = variant2.ContainsKey("money");
                        if (flag4)
                        {
                            flytxt.instance.fly("金币+ " + variant2["money"], 0, default(Color), null);
                        }
                        bool flag5 = variant2.ContainsKey("yb");
                        if (flag5)
                        {
                            flytxt.instance.fly("钻石+ " + variant2["yb"], 0, default(Color), null);
                        }
                        bool flag6 = variant2.ContainsKey("bndyb");
                        if (flag6)
                        {
                            flytxt.instance.fly("绑定钻石+ " + variant2["bndyb"], 0, default(Color), null);
                        }
                        bool flag7 = variant2.ContainsKey("itm");
                        if (flag7)
                        {
                            List <Variant> arr = variant2["itm"]._arr;
                            for (int i = 0; i < arr.Count; i++)
                            {
                                a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(arr[i]["tpid"]);

                                string colorStrByQuality = Globle.getColorStrByQuality(itemDataById.item_name, itemDataById.quality);
                                flytxt.instance.fly("获得" + colorStrByQuality + "+" + arr[i]["cnt"], 0, default(Color), null);
                            }
                        }
                    }
                    bool flag8 = d.ContainsKey("cards");
                    if (flag8)
                    {
                        List <Variant> arr2 = d["cards"]._arr;
                        for (int j = 0; j < arr2.Count; j++)
                        {
                            int    num2  = arr2[j]["tp"];
                            string text2 = arr2[j]["cardid"];
                            bool   flag9 = num2 == 4;
                            if (flag9)
                            {
                            }
                        }
                    }
                    bool flag10 = d.ContainsKey("tpawds");
                    if (flag10)
                    {
                        List <Variant> arr3 = d["tpawds"]._arr;
                        for (int k = 0; k < arr3.Count; k++)
                        {
                            GiftCardType giftCardType = new GiftCardType();
                            giftCardType.init(arr3[k]);
                            HttpAppMgr.instance.giftCard.addGiftType(giftCardType);
                        }
                    }
                    HttpAppMgr.instance.giftCard.getAllCode();
                }
            }
        }
Пример #11
0
        private void onItemCardInfo(Variant d)
        {
            if (d.ContainsKey("tp"))//兑换完奖励
            {
                HttpAppMgr.instance.onGetRewardItems(d["tp"]);
                return;
            }

            if (d.ContainsKey("tpchange"))//兑换码变化
            {
                int sec = ConfigUtil.getRandom(0, 20);

                DelayDoManager.singleton.AddDelayDo(() =>
                {
                    sendLoadItemCardInfo();
                }, sec);
                debug.Log("兑换码后台发生变!!!间隔发送请求礼品卡:" + sec);
                return;
            }

            if (d.ContainsKey("card_fetch"))
            {
                Variant card_fetch = d["card_fetch"];
                int     tp         = card_fetch["tp"];
                string  cardid     = card_fetch["cardid"];

                Variant reward = card_fetch["reward"];
                if (reward.ContainsKey("money"))
                {
                    flytxt.instance.fly(ContMgr.getCont("comm_moneyadd") + reward["money"]);
                }
                if (reward.ContainsKey("yb"))
                {
                    flytxt.instance.fly(ContMgr.getCont("comm_zuanshiadd") + reward["yb"]);
                }
                if (reward.ContainsKey("bndyb"))
                {
                    flytxt.instance.fly(ContMgr.getCont("comm_bangzuanadd") + reward["bndyb"]);
                }
                if (reward.ContainsKey("itm"))
                {
                    List <Variant> tpawds = reward["itm"]._arr;
                    for (int i = 0; i < tpawds.Count; i++)
                    {
                        a3_ItemData one  = a3_BagModel.getInstance().getItemDataById(tpawds[i]["tpid"]);
                        string      name = Globle.getColorStrByQuality(one.item_name, one.quality);
                        flytxt.instance.fly(ContMgr.getCont("comm_get") + name + "+" + tpawds[i]["cnt"]);
                    }
                }
            }

            //if (d.ContainsKey("fetched_cards"))
            //{
            //    Variant fetched_cards = d["fetched_cards"];
            //    int tp = fetched_cards["tp"];
            //    int tm = fetched_cards["tm"];//时间戳
            //}

            if (d.ContainsKey("cards"))
            {
                List <Variant> cardsa = d["cards"]._arr;
                for (int i = 0; i < cardsa.Count; i++)
                {
                    int    tpa     = cardsa[i]["tp"];
                    string cardida = cardsa[i]["cardid"];

                    if (tpa == 4)
                    {//补偿卡礼包通过邮件领取
                    }
                }
            }

            if (d.ContainsKey("tpawds"))
            {
                List <Variant> tpawds = d["tpawds"]._arr;
                for (int i = 0; i < tpawds.Count; i++)
                {
                    GiftCardType giftType = new GiftCardType();
                    giftType.init(tpawds[i]);
                    HttpAppMgr.instance.giftCard.addGiftType(giftType);
                }
            }

            HttpAppMgr.instance.giftCard.getAllCode();

            //if (d.ContainsKey("tpawds"))
            //{
            //    List<Variant> l = d["tpawds"];
            //    for (int i = 0; i < l.Count; i++)
            //    {

            //    }

            //}
        }