Пример #1
0
        public static bool IsCanBuy(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin == null)
            {
                return(false);
            }
            if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID))
            {
                return(false);
            }
            ResSkinPromotion resSkinPromotion = new ResSkinPromotion();
            stPayInfoSet     stPayInfoSet     = default(stPayInfoSet);

            resSkinPromotion = CSkinInfo.GetSkinPromotion(heroSkin.dwID);
            if (resSkinPromotion != null)
            {
                stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(false, 0u, resSkinPromotion.bIsBuyCoupons > 0, resSkinPromotion.dwBuyCoupons, resSkinPromotion.bIsBuyDiamond > 0, resSkinPromotion.dwBuyDiamond, 10000u);
            }
            else
            {
                stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(heroSkin);
            }
            return(stPayInfoSet.m_payInfoCount > 0);
        }
Пример #2
0
        public static void GetHeroSkinProp(uint heroId, uint skinId, ref int[] propArr, ref int[] propPctArr, ref string[] propIconArr)
        {
            int num = 37;

            for (int i = 0; i < num; i++)
            {
                propArr[i]     = 0;
                propPctArr[i]  = 0;
                propIconArr[i] = string.Empty;
            }
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                for (int i = 0; i < heroSkin.astAttr.Length; i++)
                {
                    if (heroSkin.astAttr[i].wType == 0)
                    {
                        break;
                    }
                    if (heroSkin.astAttr[i].bValType == 0)
                    {
                        propArr[(int)heroSkin.astAttr[i].wType] += heroSkin.astAttr[i].iValue;
                    }
                    else if (heroSkin.astAttr[i].bValType == 1)
                    {
                        propPctArr[(int)heroSkin.astAttr[i].wType] += heroSkin.astAttr[i].iValue;
                    }
                }
            }
        }
Пример #3
0
 private void ResetSkinList()
 {
     this.m_skinList.Clear();
     Dictionary <long, object> .Enumerator enumerator = GameDataMgr.heroSkinDatabin.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <long, object> current = enumerator.get_Current();
         ResHeroSkin resHeroSkin             = current.get_Value() as ResHeroSkin;
         if (resHeroSkin != null && resHeroSkin.dwSkinID != 0u && GameDataMgr.IsSkinAvailableAtShop(resHeroSkin.dwID))
         {
             ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(resHeroSkin.dwHeroID);
             if (dataByKey != null && GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID))
             {
                 CMallItem cMallItem = new CMallItem(resHeroSkin.dwHeroID, resHeroSkin.dwSkinID, CMallItem.IconType.Normal);
                 if (this.m_heroJobType == enHeroJobType.All || dataByKey.bMainJob == (byte)this.m_heroJobType || dataByKey.bMinorJob == (byte)this.m_heroJobType)
                 {
                     if (this.m_notOwnFlag)
                     {
                         if (!cMallItem.Owned(false))
                         {
                             this.m_skinList.Add(resHeroSkin);
                         }
                     }
                     else
                     {
                         this.m_skinList.Add(resHeroSkin);
                     }
                 }
             }
         }
     }
 }
Пример #4
0
 public void AnalyseSoundBanks(ref ActorPreloadTab loadInfo, ref CActorInfo charInfo, ref ActorServerData serverData)
 {
     if (charInfo.SoundBanks != null && charInfo.SoundBanks.Length > 0)
     {
         for (int i = 0; i < charInfo.SoundBanks.Length; i++)
         {
             AssetLoadBase assetLoadBase = default(AssetLoadBase);
             assetLoadBase.assetPath = charInfo.SoundBanks[i];
             loadInfo.soundBanks.Add(assetLoadBase);
         }
     }
     if (serverData.SkinId != 0u)
     {
         ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)loadInfo.theActor.ConfigId, serverData.SkinId);
         if (heroSkin != null && !string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
         {
             AssetLoadBase assetLoadBase2 = default(AssetLoadBase);
             assetLoadBase2.assetPath = heroSkin.szSkinSoundResPack + "_SFX";
             loadInfo.soundBanks.Add(assetLoadBase2);
             assetLoadBase2           = default(AssetLoadBase);
             assetLoadBase2.assetPath = heroSkin.szSkinSoundResPack + "_VO";
             loadInfo.soundBanks.Add(assetLoadBase2);
         }
     }
 }
Пример #5
0
 public void AnalyseSoundBanks(ref ActorPreloadTab loadInfo, ref CActorInfo charInfo, ref ActorServerData serverData)
 {
     if ((charInfo.SoundBanks != null) && (charInfo.SoundBanks.Length > 0))
     {
         for (int i = 0; i < charInfo.SoundBanks.Length; i++)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = charInfo.SoundBanks[i]
             };
             loadInfo.soundBanks.Add(item);
         }
     }
     if (serverData.SkinId != 0)
     {
         ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)loadInfo.theActor.ConfigId, serverData.SkinId);
         if ((heroSkin != null) && !string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
         {
             AssetLoadBase base3 = new AssetLoadBase {
                 assetPath = heroSkin.szSkinSoundResPack + "_SFX"
             };
             loadInfo.soundBanks.Add(base3);
             base3 = new AssetLoadBase {
                 assetPath = heroSkin.szSkinSoundResPack + "_VO"
             };
             loadInfo.soundBanks.Add(base3);
         }
     }
 }
Пример #6
0
        public int Compare(ResHeroSkin l, ResHeroSkin r)
        {
            if (l == null)
            {
                return(1);
            }
            if (r == null)
            {
                return(-1);
            }
            if (this.m_roleInfo == null)
            {
                return(-1);
            }
            switch (this.m_sortType)
            {
            case CMallSortHelper.SkinSortType.Name:
                return(this.CompareName(l, r));

            case CMallSortHelper.SkinSortType.Coupons:
                return(this.CompareCoupons(l, r));

            case CMallSortHelper.SkinSortType.ReleaseTime:
                return(this.CompareReleaseTime(l, r));
            }
            return(this.CompareDefault(l, r));
        }
Пример #7
0
        private int CompareCoupons(ResHeroSkin l, ResHeroSkin r)
        {
            ResSkinPromotion skinPromotion    = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID);
            ResSkinPromotion resPromotion     = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID);
            stPayInfoSet     payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, skinPromotion);
            stPayInfoSet     set2             = CMallSystem.GetPayInfoSetOfGood(r, resPromotion);
            uint             maxValue         = uint.MaxValue;
            uint             payValue         = uint.MaxValue;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan)) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) && (payInfoSetOfGood.m_payInfos[i].m_payValue < maxValue))
                {
                    maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < set2.m_payInfoCount; j++)
            {
                if ((((set2.m_payInfos[j].m_payType == enPayType.Diamond) || (set2.m_payInfos[j].m_payType == enPayType.DianQuan)) || (set2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)) && (set2.m_payInfos[j].m_payValue < payValue))
                {
                    payValue = set2.m_payInfos[j].m_payValue;
                }
            }
            if ((maxValue == uint.MaxValue) && this.IsDesc())
            {
                maxValue = 0;
            }
            if ((payValue == uint.MaxValue) && this.IsDesc())
            {
                payValue = 0;
            }
            return(maxValue.CompareTo(payValue));
        }
Пример #8
0
        private int CompareName(ResHeroSkin l, ResHeroSkin r)
        {
            string text  = string.Format("{0}{1}", l.szHeroName, l.szSkinName);
            string text2 = string.Format("{0}{1}", r.szHeroName, r.szSkinName);

            return(string.Compare(text, text2, this.m_culture, 0));
        }
Пример #9
0
        private int CompareName(ResHeroSkin l, ResHeroSkin r)
        {
            string strA = string.Format("{0}{1}", l.szHeroName, l.szSkinName);
            string strB = string.Format("{0}{1}", r.szHeroName, r.szSkinName);

            return(string.Compare(strA, strB, this.m_culture, CompareOptions.None));
        }
Пример #10
0
        public void OpenAwakeAwardForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFinishFormPath, false, true);

            if (script != null)
            {
                Text             component = script.transform.Find("Panel/panelRewards/award1/lblDesc").GetComponent <Text>();
                Text             text2     = script.transform.Find("Panel/panelRewards/award2/lblDesc").GetComponent <Text>();
                CUI3DImageScript script2   = script.transform.Find("3DImage").GetComponent <CUI3DImageScript>();
                ResTalentLib     dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID);
                if (dataByKey != null)
                {
                    component.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc);
                }
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID);
                if (heroSkin != null)
                {
                    string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) };
                    text2.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args);
                }
                ObjNameData data  = CUICommonSystem.GetHeroPrefabPath(this.m_heroInfo.cfgInfo.dwCfgID, (int)heroSkin.dwSkinID, true);
                GameObject  model = (script2 == null) ? null : script2.AddGameObject(data.ObjectName, false, false);
                if (model != null)
                {
                    CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance();

                    instance.Set3DModel(model);
                    instance.InitAnimatList();
                    instance.InitAnimatSoundList(this.m_heroInfo.cfgInfo.dwCfgID, heroSkin.dwSkinID);
                    instance.OnModePlayAnima("Come");
                }
            }
        }
Пример #11
0
        private int CompareCoupons(ResHeroSkin l, ResHeroSkin r)
        {
            ResSkinPromotion skinPromotion     = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID);
            ResSkinPromotion skinPromotion2    = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID);
            stPayInfoSet     payInfoSetOfGood  = CMallSystem.GetPayInfoSetOfGood(l, skinPromotion);
            stPayInfoSet     payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, skinPromotion2);
            uint             num  = 4294967295u;
            uint             num2 = 4294967295u;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood.m_payInfos[i].m_payValue < num)
                {
                    num = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++)
            {
                if ((payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood2.m_payInfos[j].m_payValue < num2)
                {
                    num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue;
                }
            }
            if (num == 4294967295u && this.IsDesc())
            {
                num = 0u;
            }
            if (num2 == 4294967295u && this.IsDesc())
            {
                num2 = 0u;
            }
            return(num.CompareTo(num2));
        }
Пример #12
0
        public void OpenStartAwakeForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFormPath, false, true);

            if (script != null)
            {
                Image      component = script.transform.Find("Panel/PanelLeft/HeroCell/Hero").GetComponent <Image>();
                Text       text      = script.transform.Find("Panel/PanelLeft/lblContent").GetComponent <Text>();
                Text       text2     = script.transform.Find("Panel/PanelLeft/panelRewards/award1/lblDesc").GetComponent <Text>();
                Text       text3     = script.transform.Find("Panel/PanelLeft/panelRewards/award2/lblDesc").GetComponent <Text>();
                GameObject prefab    = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szImagePath), true, true);
                component.SetSprite(prefab);
                text.text = StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szWakeDesc);
                ResTalentLib dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID);
                if (dataByKey != null)
                {
                    text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc);
                }
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID);
                if (heroSkin != null)
                {
                    string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) };
                    text3.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args);
                }
            }
        }
Пример #13
0
        public void LoadSkinSoundBank(uint heroId, uint skinId, GameObject obj, bool bLobby)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if ((heroSkin == null) && (skinId != 0))
            {
                heroSkin = CSkinInfo.GetHeroSkin(heroId, 0);
            }
            if (heroSkin != null)
            {
                if (!string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
                {
                    if (bLobby)
                    {
                        this.LoadHeroSoundBank(heroSkin.szSkinSoundResPack + "_Show");
                    }
                    else
                    {
                        this.LoadBank(heroSkin.szSkinSoundResPack + "_SFX", BankType.Battle);
                        this.LoadBank(heroSkin.szSkinSoundResPack + "_VO", BankType.Battle);
                    }
                }
                if (!string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                {
                    this.PostEvent(heroSkin.szSoundSwitchEvent, obj);
                }
            }
            else
            {
                object[] inParameters = new object[] { heroId, skinId };
                DebugHelper.Assert(false, "Default sound resource can not find heroId = {0}skinId ={1}", inParameters);
            }
        }
Пример #14
0
        public void SetSkinProp(uint heroId, uint skinId, bool bWear)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            DebugHelper.Assert(heroSkin != null, "Skin==null");
            ushort wType    = 0;
            byte   bValType = 0;
            int    val      = 0;

            for (int i = 0; i < 15; i++)
            {
                wType    = heroSkin.astAttr[i].wType;
                bValType = heroSkin.astAttr[i].bValType;
                val      = heroSkin.astAttr[i].iValue;
                if ((wType != 0) && (val != 0))
                {
                    if (bWear)
                    {
                        this.ChangeFuncEft((RES_FUNCEFT_TYPE)wType, (RES_VALUE_TYPE)bValType, val, true);
                    }
                    else
                    {
                        this.ChangeFuncEft((RES_FUNCEFT_TYPE)wType, (RES_VALUE_TYPE)bValType, -val, true);
                    }
                }
            }
        }
Пример #15
0
        public override void Fight()
        {
            base.Fight();
            if (ActorHelper.IsCaptainActor(ref this.actorPtr))
            {
                base.m_isControledByMan = true;
                base.m_isAutoAI         = false;
            }
            else
            {
                base.m_isControledByMan = false;
                base.m_isAutoAI         = true;
            }
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorData = new ActorServerData();

            if ((actorDataProvider != null) && actorDataProvider.GetActorServerData(ref base.actor.TheActorMeta, ref actorData))
            {
                this.m_skinId    = actorData.SkinId;
                this.m_skinCfgId = CSkinInfo.GetSkinCfgId((uint)base.actor.TheActorMeta.ConfigId, this.m_skinId);
                if (this.m_skinId != 0)
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)base.actor.TheActorMeta.ConfigId, this.m_skinId);
                    if ((heroSkin != null) && !string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                    {
                        Singleton <CSoundManager> .instance.PostEvent(heroSkin.szSoundSwitchEvent, base.actor.gameObject);
                    }
                }
            }
            base.EnableRVO(false);
        }
Пример #16
0
        public static void GetHeroSkinProp(uint heroId, uint skinId, ref int[] propArr, ref int[] propPctArr)
        {
            int index = 0;
            int num2  = 0x24;

            for (index = 0; index < num2; index++)
            {
                propArr[index]    = 0;
                propPctArr[index] = 0;
            }
            ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                for (index = 0; index < heroSkin.astAttr.Length; index++)
                {
                    if (heroSkin.astAttr[index].wType == 0)
                    {
                        break;
                    }
                    if (heroSkin.astAttr[index].bValType == 0)
                    {
                        propArr[heroSkin.astAttr[index].wType] += heroSkin.astAttr[index].iValue;
                    }
                    else if (heroSkin.astAttr[index].bValType == 1)
                    {
                        propPctArr[heroSkin.astAttr[index].wType] += heroSkin.astAttr[index].iValue;
                    }
                }
            }
        }
Пример #17
0
        public static bool IsCanBuy(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId);

            if (heroSkin == null)
            {
                return(false);
            }
            if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID))
            {
                return(false);
            }
            ResSkinPromotion skinPromotion    = new ResSkinPromotion();
            stPayInfoSet     payInfoSetOfGood = new stPayInfoSet();

            skinPromotion = GetSkinPromotion(heroSkin.dwID);
            if (skinPromotion != null)
            {
                payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(false, 0, skinPromotion.bIsBuyCoupons > 0, skinPromotion.dwBuyCoupons, skinPromotion.bIsBuyDiamond > 0, skinPromotion.dwBuyDiamond, 0x2710);
            }
            else
            {
                payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(heroSkin);
            }
            return(payInfoSetOfGood.m_payInfoCount > 0);
        }
Пример #18
0
        private void SetSkinItem(CMallItemWidget mallWidget, ResHeroSkin skinInfo, CUIFormScript form)
        {
            Image component = mallWidget.m_icon.GetComponent <Image>();

            component.color = CUIUtility.s_Color_White;
            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, skinInfo.szSkinPicID);

            component.SetSprite(prefabPath, form, false, true, true);
            mallWidget.m_skinLabel.CustomSetActive(true);
            CUICommonSystem.SetHeroSkinLabelPic(form, mallWidget.m_skinLabel, skinInfo.dwHeroID, skinInfo.dwSkinID);
            mallWidget.m_topNameLeftText.GetComponent <Text>().text = skinInfo.szHeroName;
            mallWidget.m_topNameRightText.CustomSetActive(true);
            mallWidget.m_topNameRightText.GetComponent <Text>().text = skinInfo.szSkinName;
            ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(skinInfo.dwHeroID, skinInfo.dwSkinID);

            this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(skinInfo, skinPromotion);
            uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp);

            this.SetItemTag(mallWidget, null, skinPromotion, form);
            stUIEventParams eventParams = new stUIEventParams();

            eventParams.openHeroFormPar.heroId = skinInfo.dwHeroID;
            eventParams.openHeroFormPar.skinId = skinInfo.dwSkinID;
            eventParams.commonUInt32Param1     = num;
            mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mall_GiftShowDetail, eventParams);
            stUIEventParams params2 = new stUIEventParams();

            params2.heroSkinParam.heroId      = skinInfo.dwHeroID;
            params2.heroSkinParam.skinId      = skinInfo.dwSkinID;
            params2.heroSkinParam.isCanCharge = true;
            params2.commonUInt64Param1        = this._curFriendUid;
            params2.commonBool         = this._curFriendIsSns;
            params2.commonUInt32Param1 = this._curWorldId;
            mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, params2);
        }
Пример #19
0
        public CHeroSkin(ulong objID, uint baseID, int stackCount = 0, int addTime = 0)
        {
            ResHeroSkin dataByKey = GameDataMgr.heroSkinDatabin.GetDataByKey(baseID);

            if (dataByKey != null)
            {
                ResHeroSkinShop shop = null;
                GameDataMgr.skinShopInfoDict.TryGetValue(baseID, out shop);
                this.m_heroId = dataByKey.dwHeroID;
                this.m_skinId = dataByKey.dwSkinID;
                base.m_type   = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN;
                base.m_objID  = objID;
                base.m_baseID = baseID;
                base.m_name   = StringHelper.UTF8BytesToString(ref dataByKey.szSkinName);
                if (shop != null)
                {
                    base.m_description = StringHelper.UTF8BytesToString(ref shop.szSkinDesc);
                }
                else
                {
                    base.m_description = string.Empty;
                }
                base.m_iconID      = uint.Parse(StringHelper.UTF8BytesToString(ref dataByKey.szSkinPicID));
                base.m_stackCount  = stackCount;
                base.m_stackMax    = 1;
                base.m_skinCoinBuy = (shop == null) ? 1 : shop.dwChgItemCnt;
                base.m_dianQuanBuy = (shop == null) ? 1 : shop.dwBuyCoupons;
                base.m_diamondBuy  = (shop == null) ? 1 : shop.dwBuyDiamond;
                base.m_coinSale    = 0;
                base.m_grade       = 3;
                base.m_isSale      = 0;
                base.m_addTime     = 0;
                base.ResetTime();
            }
        }
Пример #20
0
        public static ResSkinPromotion GetSkinPromotion(uint uniSkinId)
        {
            ResHeroSkin heroSkin = GetHeroSkin(uniSkinId);

            if (heroSkin != null)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo == null)
                {
                    return(null);
                }
                for (int i = 0; i < 5; i++)
                {
                    uint key = heroSkin.PromotionID[i];
                    if ((key != 0) && GameDataMgr.skinPromotionDict.ContainsKey(key))
                    {
                        ResSkinPromotion promotion = new ResSkinPromotion();
                        if ((GameDataMgr.skinPromotionDict.TryGetValue(key, out promotion) && (promotion.dwOnTimeGen <= masterRoleInfo.getCurrentTimeSinceLogin())) && (promotion.dwOffTimeGen >= masterRoleInfo.getCurrentTimeSinceLogin()))
                        {
                            return(promotion);
                        }
                    }
                }
            }
            return(null);
        }
Пример #21
0
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp;
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min(stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint num3;
                    uint num4;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out num3, out num4);
                    CUICommonSystem.ShowNewHeroOrSkin(num3, num4, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, dataByKey.dwChgItemCnt, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID;
                        uint heroId   = 0;
                        uint skinId   = 0;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId, out skinId);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);
                        if (heroSkin != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, heroSkin.dwChgItemCnt, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }
Пример #22
0
        private void RealIndexGetReady(bool forceUpdate = false)
        {
            if (!forceUpdate && this._curFilterJob == this._curJobView && this._curFilterMenuPage == this._curMenuPage && ((this._curFilterMenuPage == GiftCenter.MenuPage.Hero && this._curFilterHeroSortType == this._curHeroSortType) || (this._curFilterMenuPage == GiftCenter.MenuPage.Skin && this._curFilterSkinSortType == this._curSkinSortType)))
            {
                return;
            }
            this._curFilterJob      = this._curJobView;
            this._curFilterMenuPage = this._curMenuPage;
            int num = 0;

            if (this._curMenuPage == GiftCenter.MenuPage.Skin)
            {
                this._curFilterSkinSortType = this._curSkinSortType;
                this.CleanSortSkinList();
                for (int i = 0; i < this._skinTotalNum; i++)
                {
                    ResHeroSkin    resHeroSkin = this._skinList[i];
                    ResHeroCfgInfo dataByKey   = GameDataMgr.heroDatabin.GetDataByKey(resHeroSkin.dwHeroID);
                    if (dataByKey.bMainJob == (byte)this._curJobView || dataByKey.bMinorJob == (byte)this._curJobView)
                    {
                        if (num < this._filterTempList.get_Count())
                        {
                            this._filterTempList.set_Item(num, i);
                        }
                        else
                        {
                            this._filterTempList.Add(i);
                        }
                        num++;
                    }
                }
                this._tempListNum = num;
            }
            else
            {
                this._curFilterHeroSortType = this._curHeroSortType;
                this.CleanSortHeroList();
                for (int j = 0; j < this._heroTotalNum; j++)
                {
                    ResHeroCfgInfo resHeroCfgInfo = this._heroList[j];
                    if (resHeroCfgInfo.bMainJob == (byte)this._curJobView || resHeroCfgInfo.bMinorJob == (byte)this._curJobView)
                    {
                        if (num < this._filterTempList.get_Count())
                        {
                            this._filterTempList.set_Item(num, j);
                        }
                        else
                        {
                            this._filterTempList.Add(j);
                        }
                        num++;
                    }
                }
                this._tempListNum = num;
            }
        }
Пример #23
0
        public static string GetSkinIconPath(uint skinCfgId)
        {
            ResHeroSkin dataByKey = GameDataMgr.heroSkinDatabin.GetDataByKey(skinCfgId);

            if (dataByKey != null)
            {
                return(CUIUtility.s_Sprite_Dynamic_Icon_Dir + dataByKey.szSkinPicID);
            }
            return(string.Empty);
        }
Пример #24
0
        public static string GetSkinName(uint skinUniId)
        {
            ResHeroSkin dataByKey = GameDataMgr.heroSkinDatabin.GetDataByKey(skinUniId);

            if (dataByKey != null)
            {
                return(StringHelper.UTF8BytesToString(ref dataByKey.szSkinName));
            }
            return(string.Empty);
        }
Пример #25
0
        public static int GetCombatEft(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                return((int)heroSkin.dwCombatAbility);
            }
            return(0);
        }
Пример #26
0
        public static uint GetSkinCfgId(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                return(heroSkin.dwID);
            }
            return(0);
        }
Пример #27
0
        public static stPayInfoSet GetSkinPayInfoSet(uint heroId, uint skinId)
        {
            ResSkinPromotion resPromotion = new ResSkinPromotion();
            stPayInfoSet     stPayInfoSet = default(stPayInfoSet);

            resPromotion = CSkinInfo.GetSkinPromotion(heroId, skinId);
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            return(CMallSystem.GetPayInfoSetOfGood(heroSkin, resPromotion));
        }
Пример #28
0
        public static string GetHeroSkinPic(uint heroId, uint skinId)
        {
            string      str      = string.Empty;
            ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                str = StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID);
            }
            return(str);
        }
Пример #29
0
        private void OnBuyItem(CUIEvent uiEvent)
        {
            enPayType     tag           = (enPayType)uiEvent.m_eventParams.tag;
            uint          payValue      = uiEvent.m_eventParams.commonUInt32Param1;
            string        goodName      = string.Empty;
            COM_ITEM_TYPE com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_NULL;
            uint          uniSkinId     = 0;
            long          key           = 0L;

            if (uiEvent.m_eventParams.heroSkinParam.skinId != 0)
            {
                com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN;
                uniSkinId     = CSkinInfo.GetSkinCfgId(uiEvent.m_eventParams.heroSkinParam.heroId, uiEvent.m_eventParams.heroSkinParam.skinId);
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(uniSkinId);
                DebugHelper.Assert(heroSkin != null, string.Format("找不到皮肤{0}的配置信息", uniSkinId));
                if (heroSkin == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName);
            }
            else if (uiEvent.m_eventParams.heroId != 0)
            {
                com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HERO;
                uniSkinId     = uiEvent.m_eventParams.heroId;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(uniSkinId);
                DebugHelper.Assert(dataByKey != null, string.Format("找不到英雄{0}的配置信息", uniSkinId));
                if (dataByKey == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            }
            else
            {
                DebugHelper.Assert(false, "神秘商店购买不支持该物品类型");
                return;
            }
            key = GameDataMgr.GetDoubleKey((uint)com_item_type, uniSkinId);
            CMallMysteryProduct product = new CMallMysteryProduct();

            if (!this.m_ProductDic.TryGetValue(key, out product))
            {
                DebugHelper.Assert(false, string.Format("神秘商店找不到该物品{0}/{1}", Enum.GetName(typeof(COM_ITEM_TYPE), com_item_type), uniSkinId));
            }
            else
            {
                CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                uIEvent.m_eventID         = enUIEventID.Mall_Mystery_On_Confirm_Buy_Item;
                uIEvent.m_eventParams.tag = (int)product.ID;
                CMallSystem.TryToPay(enPayPurpose.Buy, goodName, tag, payValue, uIEvent.m_eventID, ref uIEvent.m_eventParams, enUIEventID.None, false, true);
            }
        }
Пример #30
0
 private void RealIndexGetReady(bool forceUpdate = false)
 {
     if (((forceUpdate || (this._curFilterJob != this._curJobView)) || (this._curFilterMenuPage != this._curMenuPage)) || (((this._curFilterMenuPage != MenuPage.Hero) || (this._curFilterHeroSortType != this._curHeroSortType)) && ((this._curFilterMenuPage != MenuPage.Skin) || (this._curFilterSkinSortType != this._curSkinSortType))))
     {
         this._curFilterJob      = this._curJobView;
         this._curFilterMenuPage = this._curMenuPage;
         int num = 0;
         if (this._curMenuPage == MenuPage.Skin)
         {
             this._curFilterSkinSortType = this._curSkinSortType;
             this.CleanSortSkinList();
             for (int i = 0; i < this._skinTotalNum; i++)
             {
                 ResHeroSkin    skin      = this._skinList[i];
                 ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(skin.dwHeroID);
                 if ((dataByKey.bMainJob == ((byte)this._curJobView)) || (dataByKey.bMinorJob == ((byte)this._curJobView)))
                 {
                     if (num < this._filterTempList.Count)
                     {
                         this._filterTempList[num] = i;
                     }
                     else
                     {
                         this._filterTempList.Add(i);
                     }
                     num++;
                 }
             }
             this._tempListNum = num;
         }
         else
         {
             this._curFilterHeroSortType = this._curHeroSortType;
             this.CleanSortHeroList();
             for (int j = 0; j < this._heroTotalNum; j++)
             {
                 ResHeroCfgInfo info2 = this._heroList[j];
                 if ((info2.bMainJob == ((byte)this._curJobView)) || (info2.bMinorJob == ((byte)this._curJobView)))
                 {
                     if (num < this._filterTempList.Count)
                     {
                         this._filterTempList[num] = j;
                     }
                     else
                     {
                         this._filterTempList.Add(j);
                     }
                     num++;
                 }
             }
             this._tempListNum = num;
         }
     }
 }