public RES_LUCKYDRAW_ITEMTAG TagType(ref ResHeroPromotion heroPromotion, ref ResSkinPromotion skinPromotion) { CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { if (type == CMallItem.ItemType.Skin) { if (this.m_skinData != null) { skinPromotion = CSkinInfo.GetSkinPromotion(this.m_skinData.dwID); if (skinPromotion == null) { return(0); } return(skinPromotion.bTag); } } } else if (this.m_heroData != null) { heroPromotion = this.m_heroData.promotion(); if (heroPromotion == null) { return(0); } return(heroPromotion.bTag); } return(0); }
public string ObtWay() { CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { if (type != CMallItem.ItemType.Skin) { return(null); } if (this.m_skinData == null) { return(null); } ResHeroSkinShop resHeroSkinShop = null; GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, ref resHeroSkinShop); return((resHeroSkinShop == null) ? null : resHeroSkinShop.szGetPath); } else { if (this.m_heroData == null) { return(null); } ResHeroShop resHeroShop = null; GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, ref resHeroShop); return((resHeroShop == null) ? null : resHeroShop.szObtWay); } }
public byte ObtWayType() { CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { if (type != CMallItem.ItemType.Skin) { return(0); } if (this.m_skinData == null) { return(0); } ResHeroSkinShop resHeroSkinShop = null; GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, ref resHeroSkinShop); return((resHeroSkinShop == null) ? 0 : resHeroSkinShop.bGetPathType); } else { if (this.m_heroData == null) { return(0); } ResHeroShop resHeroShop = null; GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, ref resHeroShop); return((resHeroShop == null) ? 0 : resHeroShop.bObtWayType); } }
public CMallItem(CMallFactoryShopController.ShopProduct product, CMallItem.IconType iconType = CMallItem.IconType.Small) { this.m_type = CMallItem.ItemType.Item; this.m_iconType = iconType; if (product != null) { this.m_useable = CUseableManager.CreateUseable(product.Type, 0uL, product.ID, (int)product.LimitCount, 0); this.m_product = product; this.m_firstName = this.m_useable.m_name; this.m_secondName = null; this.m_iconPath = this.m_useable.GetIconPath(); RES_SHOPBUY_COINTYPE coinType = product.CoinType; enPayType payType = CMallSystem.ResBuyTypeToPayType(coinType); uint buyPrice = this.m_useable.GetBuyPrice(coinType); uint payValue = product.ConvertWithRealDiscount(buyPrice); this.m_payInfoSet = new stPayInfoSet(1); this.m_payInfoSet.m_payInfoCount = 1; this.m_payInfoSet.m_payInfos[0].m_discountForDisplay = product.DiscountForShow; this.m_payInfoSet.m_payInfos[0].m_oriValue = buyPrice; this.m_payInfoSet.m_payInfos[0].m_payType = payType; this.m_payInfoSet.m_payInfos[0].m_payValue = payValue; } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_useable = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
public bool CanSendFriend() { CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { return(type == CMallItem.ItemType.Skin && this.m_skinData != null && CHeroSkinBuyManager.ShouldShowBuyForFriend(true, this.m_skinData.dwHeroID, this.m_skinData.dwSkinID, false)); } return(this.m_heroData != null && CHeroSkinBuyManager.ShouldShowBuyForFriend(false, this.m_heroData.cfgID, 0u, false)); }
public bool IsValidExperience() { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "IsValidExperience::Master Role Info Is Null"); if (masterRoleInfo == null) { return(false); } CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { return(type == CMallItem.ItemType.Skin && this.m_skinData != null && masterRoleInfo.IsValidExperienceSkin(this.m_skinData.dwHeroID, this.m_skinData.dwSkinID)); } return(this.m_heroData != null && masterRoleInfo.IsValidExperienceHero(this.m_heroData.cfgID)); }
public CMallItem(uint heroID, CMallItem.IconType iconType = CMallItem.IconType.Normal) { this.m_type = CMallItem.ItemType.Hero; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); if (this.m_heroData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = null; string s_Sprite_Dynamic_Icon_Dir = CUIUtility.s_Sprite_Dynamic_Icon_Dir; if (iconType == CMallItem.IconType.Small) { this.m_useable = CUseableManager.CreateUseable(4, heroID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else if (this.m_heroData.heroCfgInfo != null) { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_heroData.heroCfgInfo.szImagePath; } else { this.m_iconPath = null; } ResHeroPromotion resPromotion = this.m_heroData.promotion(); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_heroData.heroCfgInfo, resPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
public bool CanBeAskFor() { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "Owned::Master Role Info Is Null"); if (masterRoleInfo == null) { return(false); } if (this.Owned(false)) { return(false); } CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { return(type == CMallItem.ItemType.Skin && this.m_skinData != null && GameDataMgr.IsSkinCanBeAskFor(this.m_skinData.dwID)); } return(this.m_heroData != null && GameDataMgr.IsHeroCanBeAskFor(this.m_heroData.cfgID)); }
public CMallItem(uint heroID, uint skinID, CMallItem.IconType iconType = CMallItem.IconType.Normal) { this.m_type = CMallItem.ItemType.Skin; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); this.m_skinData = CSkinInfo.GetHeroSkin(heroID, skinID); if (this.m_heroData != null && this.m_skinData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = this.m_skinData.szSkinName; if (iconType == CMallItem.IconType.Small) { this.m_useable = CUseableManager.CreateUseable(7, this.m_skinData.dwID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_skinData.szSkinPicID; } ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(heroID, skinID); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_skinData, skinPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
public bool TagInfo(ref string iconPath, ref string text, bool owned = false) { CTextManager instance = Singleton <CTextManager> .GetInstance(); if (owned) { iconPath = "UGUI/Sprite/Common/Product_New.prefab"; text = instance.GetText("Mall_Hero_State_Own"); return(true); } if (this.Owned(false)) { iconPath = null; text = null; return(false); } ResHeroPromotion resHeroPromotion = null; ResSkinPromotion resSkinPromotion = null; RES_LUCKYDRAW_ITEMTAG rES_LUCKYDRAW_ITEMTAG = this.TagType(ref resHeroPromotion, ref resSkinPromotion); string text2 = null; if (this.m_type == CMallItem.ItemType.Hero) { ResHeroShop heroShop = null; GameDataMgr.heroShopInfoDict.TryGetValue(this.m_heroData.heroCfgInfo.dwCfgID, ref heroShop); text2 = CMallSystem.GetRegisterSalesHeroDay(ref resHeroPromotion, heroShop); } else if (this.m_type == CMallItem.ItemType.Skin) { ResHeroSkinShop heroShop2 = null; GameDataMgr.skinShopInfoDict.TryGetValue(this.m_skinData.dwID, ref heroShop2); text2 = CMallSystem.GetRegisterSalesSkinDay(ref resSkinPromotion, heroShop2); } if (text2 != null) { iconPath = "UGUI/Sprite/Common/Product_Unusual.prefab"; text = text2; return(true); } switch (rES_LUCKYDRAW_ITEMTAG) { case 0: if (this.m_type == CMallItem.ItemType.Hero && this.m_heroData.heroCfgInfo.bTag == 1) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { iconPath = null; text = null; return(false); } if (GameDataMgr.svr2CltCfgDict.ContainsKey(24u)) { ResGlobalInfo resGlobalInfo = new ResGlobalInfo(); if (GameDataMgr.svr2CltCfgDict.TryGetValue(24u, ref resGlobalInfo)) { uint dwConfValue = resGlobalInfo.dwConfValue; if (masterRoleInfo.PvpLevel < dwConfValue) { iconPath = "UGUI/Sprite/Common/Hero_Newbie.prefab"; text = Singleton <CTextManager> .GetInstance().GetText("Hero_Tag_Newbie"); return(true); } } } } iconPath = null; text = null; return(false); case 1: { int num = 0; uint currentUTCTime = (uint)CRoleInfo.GetCurrentUTCTime(); CMallItem.ItemType type = this.m_type; if (type != CMallItem.ItemType.Hero) { if (type == CMallItem.ItemType.Skin) { if (resSkinPromotion == null) { iconPath = null; text = null; return(false); } if (resSkinPromotion.dwOnTimeGen > currentUTCTime) { num = (int)(resSkinPromotion.dwOffTimeGen - resSkinPromotion.dwOnTimeGen); } else { num = (int)(resSkinPromotion.dwOffTimeGen - currentUTCTime); } } } else { if (resHeroPromotion == null) { iconPath = null; text = null; return(false); } if (resHeroPromotion.dwOnTimeGen > currentUTCTime) { num = (int)(resHeroPromotion.dwOffTimeGen - resHeroPromotion.dwOnTimeGen); } else { num = (int)(resHeroPromotion.dwOffTimeGen - currentUTCTime); } } if (num <= 0) { iconPath = null; text = null; return(false); } int num2 = (int)Math.Ceiling((double)num / 86400.0); if (num2 > 0) { iconPath = "UGUI/Sprite/Common/Product_Unusual.prefab"; text = Singleton <CTextManager> .GetInstance().GetText("Mall_Promotion_Tag_1", new string[] { num2.ToString() }); return(true); } iconPath = null; text = null; return(false); } case 2: iconPath = "UGUI/Sprite/Common/Product_New.prefab"; text = Singleton <CTextManager> .GetInstance().GetText("Common_Tag_New"); return(true); case 3: iconPath = "UGUI/Sprite/Common/Product_Hot.prefab"; text = Singleton <CTextManager> .GetInstance().GetText("Common_Tag_Hot"); return(true); case 4: { float num3 = 100f; switch (this.m_type) { case CMallItem.ItemType.Hero: if (resHeroPromotion == null) { iconPath = null; text = null; return(false); } num3 = resHeroPromotion.dwDiscount / 10f; break; case CMallItem.ItemType.Skin: if (resSkinPromotion == null) { iconPath = null; text = null; return(false); } num3 = resSkinPromotion.dwDiscount / 10f; break; } iconPath = "UGUI/Sprite/Common/Product_Discount.prefab"; if (Math.Abs(num3 % 1f) < 1.401298E-45f) { text = string.Format("{0}折", ((int)num3).ToString("D")); } else { text = string.Format("{0}折", num3.ToString("0.0")); } return(true); } default: iconPath = null; text = null; return(false); } }