Exemple #1
0
 public static string ConceptCard(ConceptCardParam card)
 {
     AssetPath.mSB.Length = 0;
     AssetPath.mSB.Append("ConceptCard/");
     AssetPath.mSB.Append(card.icon);
     return(AssetPath.mSB.ToString());
 }
Exemple #2
0
        public override void UpdateValue()
        {
            ItemParam itemParam = (ItemParam)null;
            int       itemNum   = 0;

            this.InstanceType.GetInstanceData(this.InstanceIndex, ((Component)this).get_gameObject(), out itemParam, out itemNum);
            if (itemParam != null)
            {
                base.UpdateValue();
            }
            else
            {
                ConceptCardParam         conceptCardParam = (ConceptCardParam)null;
                QuestResult.DropItemData dropItemData     = (QuestResult.DropItemData)null;
                this.GetParam(ref conceptCardParam, ref dropItemData);
                if (conceptCardParam != null)
                {
                    this.Refresh_ConceptCard(conceptCardParam);
                }
                else
                {
                    if (dropItemData == null)
                    {
                        return;
                    }
                    this.Refresh_DropItem(dropItemData);
                }
            }
        }
Exemple #3
0
            public bool CheckReceivable(MailData mailData)
            {
                int  num1 = 0;
                int  num2 = 0;
                bool flag = true;

                if (mailData.gifts != null)
                {
                    foreach (GiftData gift in mailData.gifts)
                    {
                        if (gift.CheckGiftTypeIncluded(GiftTypes.Artifact))
                        {
                            num1 += this.currentNums[GiftTypes.Artifact] + gift.num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.ConceptCard))
                        {
                            num2 += this.currentNums[GiftTypes.ConceptCard] + gift.ConceptCardNum;
                            if (gift.conceptCard != null)
                            {
                                ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(gift.conceptCard.iname);

                                if (conceptCardParam != null && conceptCardParam.type != eCardType.Equipment)
                                {
                                    flag = false;
                                }
                            }
                        }
                    }
                    if (num1 > (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ArtifactBoxCap || num2 > (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.CardMax && flag)
                    {
                        return(false);
                    }
                }
                return(true);
            }
        public void SetItemInames(Json_ShopLineupItem[] lineups)
        {
            if (lineups == null || lineups.Length <= 0)
            {
                return;
            }
            GameManager   instance      = MonoSingleton <GameManager> .Instance;
            StringBuilder stringBuilder = new StringBuilder();

            for (int index1 = 0; index1 < lineups.Length; ++index1)
            {
                Json_ShopLineupItemDetail[] items = lineups[index1].items;
                if (items != null)
                {
                    for (int index2 = 0; index2 < items.Length; ++index2)
                    {
                        Json_ShopLineupItemDetail lineupItemDetail = items[index2];
                        if (lineupItemDetail != null)
                        {
                            switch (lineupItemDetail.GetShopItemTypeWithIType())
                            {
                            case EShopItemType.Item:
                                ItemParam itemParam = instance.GetItemParam(lineupItemDetail.iname);
                                if (itemParam != null)
                                {
                                    stringBuilder.Append("・" + itemParam.name + "\n");
                                    continue;
                                }
                                continue;

                            case EShopItemType.Artifact:
                                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(lineupItemDetail.iname);
                                if (artifactParam != null)
                                {
                                    stringBuilder.Append("・" + artifactParam.name + "\n");
                                    continue;
                                }
                                continue;

                            case EShopItemType.ConceptCard:
                                ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(lineupItemDetail.iname);
                                if (conceptCardParam != null)
                                {
                                    stringBuilder.Append("・" + conceptCardParam.name + "\n");
                                    continue;
                                }
                                continue;

                            default:
                                DebugUtility.LogError(string.Format("不明な商品タイプです (item.itype => {0})", (object)lineupItemDetail.itype));
                                continue;
                            }
                        }
                    }
                    stringBuilder.Append("\n");
                }
            }
            stringBuilder.Append(LocalizedText.Get("sys.MSG_SHOP_LINEUP_CAUTION"));
            this.lineuplist.set_text(stringBuilder.ToString());
        }
Exemple #5
0
            public Param(SkillData groupSkill, ConceptCardData currentCardData, int levelCap, int awakeCountCap, int prevLevel, int prevAwakeCount, bool includeMaxPowerUp)
            {
                this.skilName             = groupSkill.Name;
                this.prevParam            = new BaseStatus();
                this.prevParamMul         = new BaseStatus();
                this.currentParam         = new BaseStatus();
                this.currentParamMul      = new BaseStatus();
                this.prevParamBonus       = new BaseStatus();
                this.prevParamBonusMul    = new BaseStatus();
                this.currentParamBonus    = new BaseStatus();
                this.currentParamBonusMul = new BaseStatus();
                ConceptCardParam.GetSkillAllStatus(groupSkill.SkillID, levelCap, (int)currentCardData.Lv, ref this.currentParam, ref this.currentParamMul);
                ConceptCardParam.GetSkillAllStatus(groupSkill.SkillID, levelCap, prevLevel, ref this.prevParam, ref this.currentParamMul);
                SkillPowerUpResultContent.Param.GetBonusStatus(groupSkill, currentCardData, levelCap, awakeCountCap, (int)currentCardData.Lv, (int)currentCardData.AwakeCount, ref this.currentParamBonus, ref this.currentParamBonusMul, includeMaxPowerUp);
                SkillPowerUpResultContent.Param.GetBonusStatus(groupSkill, currentCardData, levelCap, awakeCountCap, prevLevel, prevAwakeCount, ref this.prevParamBonus, ref this.currentParamBonusMul, false);
                int length = Enum.GetValues(typeof(ParamTypes)).Length;

                for (int index1 = 0; index1 < length; ++index1)
                {
                    if (index1 != 2)
                    {
                        ParamTypes index2 = (ParamTypes)index1;
                        if ((int)this.prevParamBonus[index2] != (int)this.currentParamBonus[index2])
                        {
                            this.typeList.Add(index2);
                        }
                        if ((int)this.prevParamBonusMul[index2] != (int)this.currentParamBonusMul[index2])
                        {
                            this.typeListMul.Add(index2);
                        }
                    }
                }
            }
Exemple #6
0
        private bool RefreshEquipParam(ConceptCardData conceptCardData, ConceptCardEffectsParam equipParam)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mStatusList, (UnityEngine.Object)null))
            {
                return(false);
            }
            if (equipParam == null)
            {
                this.mStatusList.SetValues(new BaseStatus(), new BaseStatus(), false);
                return(false);
            }
            BaseStatus add1   = new BaseStatus();
            BaseStatus add2   = new BaseStatus();
            BaseStatus scale1 = new BaseStatus();
            BaseStatus scale2 = new BaseStatus();

            ConceptCardParam.GetSkillStatus(equipParam.statusup_skill, (int)conceptCardData.LvCap, (int)conceptCardData.Lv, ref add1, ref scale1);
            if (this.mIsEnhance)
            {
                int levelCap = Mathf.Min((int)conceptCardData.LvCap, (int)conceptCardData.CurrentLvCap + this.mAddAwakeLv);
                int totalExp = (int)conceptCardData.Exp + this.mAddExp;
                int lv       = MonoSingleton <GameManager> .Instance.MasterParam.CalcConceptCardLevel((int)conceptCardData.Rarity, totalExp, levelCap);

                ConceptCardParam.GetSkillStatus(equipParam.statusup_skill, (int)conceptCardData.LvCap, lv, ref add2, ref scale2);
                this.mStatusList.SetValuesAfterOnly(add1, scale1, add2, scale2, false, true);
            }
            else
            {
                this.mStatusList.SetValues(add1, scale1, false);
            }
            return(this.IsValueEmpty(add1, scale1));
        }
Exemple #7
0
 private void SetFrameSprite(ConceptCardParam param, bool isSecret)
 {
     if (Object.op_Equality((Object)this.Frame, (Object)null))
     {
         return;
     }
     this.Frame.set_sprite(this.GetFrameSprite(param, isSecret));
 }
Exemple #8
0
 private void SetIconAsync(ConceptCardParam param, bool isSecret)
 {
     if (Object.op_Equality((Object)this.Icon, (Object)null))
     {
         return;
     }
     MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, this.GetIconPath(param, isSecret));
 }
Exemple #9
0
 private void LoadIcon(ConceptCardParam param, bool isSecret)
 {
     if (Object.op_Equality((Object)this.Icon, (Object)null))
     {
         return;
     }
     this.Icon.set_texture((Texture)AssetManager.Load <Texture2D>(this.GetIconPath(param, isSecret)));
 }
 private string GetIconPath(ConceptCardParam param)
 {
     if (param == null)
     {
         return((string)null);
     }
     return(AssetPath.ConceptCardIcon(param));
 }
Exemple #11
0
 public void AddReward(ConceptCardParam param, int num)
 {
     if (param == null)
     {
         return;
     }
     this.AddReward(param.iname, GiftTypes.ConceptCard, param.rare, num);
 }
Exemple #12
0
 public Sprite GetConceptCardFrame(ConceptCardParam param)
 {
     if (param != null)
     {
         return(this.GetConceptCardFrame(param.rare));
     }
     DebugUtility.LogError(string.Format("GameSettings.GetConceptCardFrame => param == null"));
     return((Sprite)null);
 }
Exemple #13
0
        public bool Deserialize(JSON_ConceptCardMaterial json)
        {
            this.mUniqueID = (OLong)json.id;
            this.mIName    = (OString)json.iname;
            this.mNum      = (OInt)json.num;
            this.mParam    = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(json.iname);

            return(true);
        }
Exemple #14
0
        public static bool IsGetUnitConceptCard(string iname)
        {
            if (string.IsNullOrEmpty(iname))
            {
                return(false);
            }
            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(iname);

            return(conceptCardParam != null && !string.IsNullOrEmpty(conceptCardParam.first_get_unit));
        }
        private Sprite GetFrameSprite(ConceptCardParam param, int rarity)
        {
            Sprite sprite = this.Frame.get_sprite();

            if (param == null)
            {
                return(sprite);
            }
            return(GameSettings.Instance.GetConceptCardFrame(param));
        }
Exemple #16
0
 public void Init()
 {
     this.type        = GachaDropData.Type.None;
     this.unit        = (UnitParam)null;
     this.item        = (ItemParam)null;
     this.artifact    = (ArtifactParam)null;
     this.conceptcard = (ConceptCardParam)null;
     this.num         = 0;
     this.isNew       = false;
     this.rarity      = 0;
 }
Exemple #17
0
 private string GetIconPath(ConceptCardParam param, bool isSecret)
 {
     if (isSecret)
     {
         return(this.GetSecretIconPath());
     }
     if (param == null)
     {
         return(string.Empty);
     }
     return(AssetPath.ConceptCardIcon(param));
 }
Exemple #18
0
 private Sprite GetFrameSprite(ConceptCardParam param, bool isSecret)
 {
     if (isSecret)
     {
         return(this.GetSecretFrameSprite(!Object.op_Inequality((Object)this.Frame, (Object)null) ? (Sprite)null : this.Frame.get_sprite()));
     }
     if (param == null)
     {
         return((Sprite)null);
     }
     return(GameSettings.Instance.GetConceptCardFrame(param.rare));
 }
Exemple #19
0
        private RewardData GiftDataToRewardData(GiftData[] giftDatas)
        {
            RewardData rewardData = new RewardData();

            rewardData.Exp        = 0;
            rewardData.Stamina    = 0;
            rewardData.MultiCoin  = 0;
            rewardData.KakeraCoin = 0;
            for (int index = 0; index < giftDatas.Length; ++index)
            {
                GiftData giftData = giftDatas[index];
                rewardData.Coin       += giftData.coin;
                rewardData.Gold       += giftData.gold;
                rewardData.ArenaMedal += giftData.arenacoin;
                rewardData.MultiCoin  += giftData.multicoin;
                rewardData.KakeraCoin += giftData.kakeracoin;
                if (giftData.CheckGiftTypeIncluded(GiftTypes.ConceptCard))
                {
                    ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(giftData.ConceptCardIname);

                    rewardData.AddReward(conceptCardParam, giftData.ConceptCardNum);
                    if (giftData.IsGetConceptCardUnit)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(giftData.ConceptCardGetUnitIname);

                        rewardData.AddReward(itemParam, 1);
                    }
                }
                if (giftData.iname != null)
                {
                    if (giftData.CheckGiftTypeIncluded(GiftTypes.Artifact))
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(giftData.iname);

                        rewardData.AddReward(artifactParam, giftData.num);
                    }
                    else if (giftData.CheckGiftTypeIncluded(GiftTypes.Award))
                    {
                        AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(giftData.iname);

                        rewardData.AddReward(awardParam.ToItemParam(), giftData.num);
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(giftData.iname);

                        rewardData.AddReward(itemParam, giftData.num);
                    }
                }
            }
            return(rewardData);
        }
 public Sprite GetConceptCardSprite(ConceptCardParam param)
 {
     if (param == null)
     {
         return((Sprite)null);
     }
     Sprite[] conceptCardIconRarity = GameSettings.Instance.ConceptCardIcon_Rarity;
     if (param.rare >= 0 && param.rare < conceptCardIconRarity.Length)
     {
         return(conceptCardIconRarity[param.rare]);
     }
     return((Sprite)null);
 }
Exemple #21
0
 private void GetParam(ref ConceptCardParam conceptCardParam, ref QuestResult.DropItemData dropItemData)
 {
     conceptCardParam = DataSource.FindDataOfClass <ConceptCardParam>(((Component)this).get_gameObject(), (ConceptCardParam)null);
     if (conceptCardParam != null)
     {
         return;
     }
     dropItemData = DataSource.FindDataOfClass <QuestResult.DropItemData>(((Component)this).get_gameObject(), (QuestResult.DropItemData)null);
     if (dropItemData != null)
     {
         ;
     }
 }
        public void Initailize(ConceptCardParam param, int current_awake_count, bool is_level_max)
        {
            List <ConceptCardBonusContentAwake> bonusContentAwakeList = new List <ConceptCardBonusContentAwake>();

            if (Object.op_Inequality((Object)this.mAwakeBonusTemplate, (Object)null) && Object.op_Inequality((Object)this.mAwakeBonusParent, (Object)null))
            {
                for (int awake_count = 1; awake_count <= param.AwakeCountCap; ++awake_count)
                {
                    bool is_enable = current_awake_count >= awake_count;
                    ConceptCardBonusContentAwake bonusContentAwake = (ConceptCardBonusContentAwake)Object.Instantiate <ConceptCardBonusContentAwake>((M0)this.mAwakeBonusTemplate);
                    ((Component)bonusContentAwake).get_transform().SetParent(this.mAwakeBonusParent, false);
                    bonusContentAwake.Setup(param.effects, awake_count, param.AwakeCountCap, is_enable);
                    bonusContentAwakeList.Add(bonusContentAwake);
                }
                for (int index1 = 0; index1 < bonusContentAwakeList.Count; ++index1)
                {
                    int  index2    = index1 + 1;
                    bool is_enable = false;
                    bool is_active = true;
                    if (bonusContentAwakeList.Count > index2)
                    {
                        is_enable = bonusContentAwakeList[index2].IsEnable;
                    }
                    else
                    {
                        is_active = false;
                    }
                    bonusContentAwakeList[index1].SetProgressLineImage(is_enable, is_active);
                }
                ((Component)this.mAwakeBonusTemplate).get_gameObject().SetActive(false);
            }
            if (Object.op_Inequality((Object)this.mLvMaxBonusSkillTemplate, (Object)null) && Object.op_Inequality((Object)this.mLvMaxBonusParent, (Object)null))
            {
                bool is_enable = is_level_max;
                ConceptCardBonusContentLvMax bonusContentLvMax = (ConceptCardBonusContentLvMax)Object.Instantiate <ConceptCardBonusContentLvMax>((M0)this.mLvMaxBonusSkillTemplate);
                ((Component)bonusContentLvMax).get_transform().SetParent(this.mLvMaxBonusParent, false);
                bonusContentLvMax.Setup(param.effects, param.lvcap, param.lvcap, param.AwakeCountCap, is_enable, ConceptCardBonusWindow.eViewType.CARD_SKILL);
                ((Component)this.mLvMaxBonusSkillTemplate).get_gameObject().SetActive(false);
            }
            if (!Object.op_Inequality((Object)this.mLvMaxBonusAbilityTemplate, (Object)null) || !Object.op_Inequality((Object)this.mLvMaxBonusParent, (Object)null))
            {
                return;
            }
            bool is_enable1 = is_level_max;
            ConceptCardBonusContentLvMax bonusContentLvMax1 = (ConceptCardBonusContentLvMax)Object.Instantiate <ConceptCardBonusContentLvMax>((M0)this.mLvMaxBonusAbilityTemplate);

            ((Component)bonusContentLvMax1).get_transform().SetParent(this.mLvMaxBonusParent, false);
            bonusContentLvMax1.Setup(param.effects, param.lvcap, param.lvcap, param.AwakeCountCap, is_enable1, ConceptCardBonusWindow.eViewType.ABILITY);
            ((Component)this.mLvMaxBonusAbilityTemplate).get_gameObject().SetActive(false);
        }
        public bool Deserialize(JSON_ConceptCard json)
        {
            this.mUniqueID         = (OLong)json.iid;
            this.mExp              = (OInt)json.exp;
            this.mTrust            = (OInt)json.trust;
            this.mFavorite         = json.fav != 0;
            this.mTrustBonus       = json.trust_bonus != 0;
            this.mAwakeCount       = (OInt)json.plus;
            this.mConceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(json.iname);

            this.mLv = (OInt)this.CalcCardLevel();
            this.UpdateEquipEffect();
            this.RefreshFilterType();
            return(true);
        }
        public void SetConceptCard(ConceptCardTrustRewardItemParam reward_item)
        {
            if (string.IsNullOrEmpty(reward_item.iname))
            {
                return;
            }
            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(reward_item.iname);

            this.mItemName.set_text(conceptCardParam.name);
            DataSource.Bind <ConceptCardParam>(((Component)this).get_gameObject(), conceptCardParam);
            if (!Object.op_Inequality((Object)this.mCardIcon, (Object)null))
            {
                return;
            }
            ((Component)this.mCardIcon).get_gameObject().SetActive(true);
            this.mCardIcon.Setup(ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname));
        }
Exemple #25
0
        public void Setup(ConceptCardData conceptCardData)
        {
            try
            {
                UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(conceptCardData.Param.first_get_unit);

                ConceptCardParam card = conceptCardData.Param;
                if (Object.op_Inequality((Object)this.m_ConceptCardImage, (Object)null) && card != null)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.m_ConceptCardImage, AssetPath.ConceptCard(card));
                }
                if (Object.op_Inequality((Object)this.m_UnitImage, (Object)null) && unitParam != null)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.m_UnitImage, AssetPath.UnitImage(unitParam, unitParam.GetJobId(0)));
                }
                if (Object.op_Inequality((Object)this.m_UnitBlurImage, (Object)null) && unitParam != null)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.m_UnitBlurImage, AssetPath.UnitImage(unitParam, unitParam.GetJobId(0)));
                }
                if (Object.op_Inequality((Object)this.m_ConceptCardFrame, (Object)null))
                {
                    this.m_ConceptCardFrame.ImageIndex = card.rare;
                }
                if (Object.op_Inequality((Object)this.m_UnitTextDescription, (Object)null))
                {
                    this.m_UnitTextDescription.set_text(LocalizedText.Get("sys.CONCEPT_CARD_UNIT_GET_DESCRIPTION", (object)card.name, (object)unitParam.name));
                }
                this.SetConceptCardRarity(card.rare + 1);
                this.SetUnitRarity((int)unitParam.rare + 1);
                this.m_UnitRarity = (int)unitParam.rare;
                this.StartCoroutine(this.WaitConceptCardEffectEnd());
            }
            catch
            {
                this.SetConceptCardRarity(1);
                this.SetUnitRarity(1);
            }
        }
Exemple #26
0
 private void Refresh_ConceptCard(ConceptCardParam param)
 {
     if (param == null)
     {
         return;
     }
     this.mSecretConceptCardParam = param;
     this.SetIconAsync(param, this.IsSecret);
     this.SetFrameSprite(param, this.IsSecret);
     this.SwapIconFramePriority(this.IsSecret);
     if (!this.IsSecret)
     {
         return;
     }
     if (Object.op_Implicit((Object)this.SecretAmount))
     {
         this.SecretAmount.SetActive(false);
     }
     if (!Object.op_Implicit((Object)this.SecretBadge))
     {
         return;
     }
     ((Behaviour)this.SecretBadge).set_enabled(false);
 }
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            ShopData shopData = player.GetShopData(GlobalVars.ShopType);

            if (shopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                ShopItem shopitem = shopData.items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));
                if (shopitem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    int       buy       = 0;
                    ItemParam itemParam = (ItemParam)null;
                    if (shopitem.IsArtifact)
                    {
                        buy = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopitem.iname).GetBuyNum(shopitem.saleType);
                    }
                    else if (shopitem.IsConceptCard)
                    {
                        if (!MonoSingleton <GameManager> .Instance.Player.CheckConceptCardCapacity(shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(shopitem.iname);

                            if (conceptCardParam != null && conceptCardParam.type == eCardType.Equipment)
                            {
                                this.ActivateOutputLinks(106);
                                return;
                            }
                        }
                    }
                    else
                    {
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(shopitem.iname);

                        if (!shopitem.IsSet && !player.CheckItemCapacity(itemParam, shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            this.ActivateOutputLinks(106);
                            return;
                        }
                        buy = itemParam.GetBuyNum(shopitem.saleType);
                    }
                    switch (shopitem.saleType)
                    {
                    case ESaleType.Gold:
                        if (!this.CheckCanBuy(shopitem, buy, player.Gold, 107))
                        {
                            return;
                        }
                        break;

                    case ESaleType.Coin:
                        if (!this.CheckCanBuy(shopitem, buy, player.Coin, 108))
                        {
                            return;
                        }
                        break;

                    case ESaleType.TourCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.TourCoin, 109))
                        {
                            return;
                        }
                        break;

                    case ESaleType.ArenaCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.ArenaCoin, 110))
                        {
                            return;
                        }
                        break;

                    case ESaleType.PiecePoint:
                        if (!this.CheckCanBuy(shopitem, buy, player.PiecePoint, 111))
                        {
                            return;
                        }
                        break;

                    case ESaleType.MultiCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.MultiCoin, 112))
                        {
                            return;
                        }
                        break;

                    case ESaleType.EventCoin:
                        DebugUtility.Assert("There is no common price in the event coin.");
                        this.ActivateOutputLinks(113);
                        return;

                    case ESaleType.Coin_P:
                        if (!this.CheckCanBuy(shopitem, buy, player.PaidCoin, 114))
                        {
                            return;
                        }
                        break;
                    }
                    this.mShopType = GlobalVars.ShopType;
                    int shopBuyIndex = GlobalVars.ShopBuyIndex;
                    if (Network.Mode == Network.EConnectMode.Offline)
                    {
                        if (itemParam == null)
                        {
                            return;
                        }
                        player.DEBUG_BUY_ITEM(this.mShopType, shopBuyIndex);
                        ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType);

                        player.OnBuyAtShop(shopParam.iname, itemParam.iname, shopitem.num);
                        this.Success();
                    }
                    else
                    {
                        if (this.mShopType == EShopType.Guerrilla)
                        {
                            this.ExecRequest((WebAPI) new ReqItemGuerrillaShopBuypaid(shopBuyIndex, GlobalVars.ShopBuyAmount, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        }
                        else
                        {
                            this.ExecRequest((WebAPI) new ReqItemShopBuypaid(this.mShopType.ToString(), shopBuyIndex, GlobalVars.ShopBuyAmount, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        }
                        ((Behaviour)this).set_enabled(true);
                    }
                }
            }
        }
Exemple #28
0
        public void Refresh()
        {
            ((Component)this).get_gameObject().SetActive(true);
            ((Component)this.ClearBadge).get_gameObject().SetActive(false);
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(((Component)this).get_gameObject(), (TrophyParam)null);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || dataOfClass == null)
            {
                ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false);
                ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false);
                ((Component)this.ButtonSecret.button).get_gameObject().SetActive(true);
            }
            else
            {
                TrophyState trophyCounter        = ChallengeMission.GetTrophyCounter(dataOfClass);
                ChallengeMissionItem.State state = ChallengeMissionItem.State.Challenge;
                if (trophyCounter.IsEnded)
                {
                    state = ChallengeMissionItem.State.Ended;
                }
                else if (trophyCounter.IsCompleted)
                {
                    state = ChallengeMissionItem.State.Clear;
                }
                ChallengeMissionItem.ButtonObject buttonObject;
                if (state == ChallengeMissionItem.State.Clear)
                {
                    ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(true);
                    ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false);
                    ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false);
                    buttonObject = this.ButtonHighlight;
                }
                else
                {
                    ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false);
                    ((Component)this.ButtonNormal.button).get_gameObject().SetActive(true);
                    ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false);
                    buttonObject = this.ButtonNormal;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ClearBadge, (UnityEngine.Object)null))
                {
                    ((Component)this.ClearBadge).get_gameObject().SetActive(state == ChallengeMissionItem.State.Ended);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.title, (UnityEngine.Object)null))
                {
                    buttonObject.title.set_text(dataOfClass.Name);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.button, (UnityEngine.Object)null))
                {
                    ((UnityEventBase)buttonObject.button.get_onClick()).RemoveAllListeners();
                    ((UnityEvent)buttonObject.button.get_onClick()).AddListener(this.OnClick);
                    ((Selectable)buttonObject.button).set_interactable(state != ChallengeMissionItem.State.Ended);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.reward, (UnityEngine.Object)null))
                {
                    if (dataOfClass.Gold != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)dataOfClass.Gold));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Exp != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)dataOfClass.Exp));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Coin != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)dataOfClass.Coin));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Stamina != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)dataOfClass.Stamina));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Items != null && dataOfClass.Items.Length > 0)
                    {
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                        ItemParam itemParam = instanceDirect.GetItemParam(dataOfClass.Items[0].iname);
                        if (itemParam != null)
                        {
                            buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_ITEM"), (object)itemParam.name, (object)dataOfClass.Items[0].Num));
                        }
                    }
                    else if (dataOfClass.ConceptCards != null && dataOfClass.ConceptCards.Length > 0)
                    {
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, false);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, true);
                        ConceptCardParam conceptCardParam = instanceDirect.MasterParam.GetConceptCardParam(dataOfClass.ConceptCards[0].iname);
                        if (conceptCardParam != null)
                        {
                            buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_CONCEPT_CARD"), (object)conceptCardParam.name, (object)dataOfClass.ConceptCards[0].Num));
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.conceptCardIcon, (UnityEngine.Object)null))
                        {
                            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname);
                            buttonObject.conceptCardIcon.Setup(cardDataForDisplay);
                        }
                    }
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.icon, (UnityEngine.Object)null))
                {
                    return;
                }
                buttonObject.icon.UpdateValue();
            }
        }
Exemple #29
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            LimitedShopData limitedShopData = player.GetLimitedShopData();

            if (limitedShopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                LimitedShopItem shopitem = limitedShopData.items.FirstOrDefault <LimitedShopItem>((Func <LimitedShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));
                if (shopitem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    int buy = 0;
                    if (shopitem.IsArtifact)
                    {
                        buy = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopitem.iname).GetBuyNum(shopitem.saleType);
                    }
                    else if (shopitem.IsConceptCard)
                    {
                        if (!MonoSingleton <GameManager> .Instance.Player.CheckConceptCardCapacity(shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(shopitem.iname);

                            if (conceptCardParam != null && conceptCardParam.type == eCardType.Equipment)
                            {
                                this.ActivateOutputLinks(106);
                                return;
                            }
                        }
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(shopitem.iname);

                        if (!shopitem.IsSet && !player.CheckItemCapacity(itemParam, shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            this.ActivateOutputLinks(106);
                            return;
                        }
                        buy = itemParam.GetBuyNum(shopitem.saleType);
                    }
                    switch (shopitem.saleType)
                    {
                    case ESaleType.Gold:
                        if (!this.CheckCanBuy(shopitem, buy, player.Gold, 107))
                        {
                            return;
                        }
                        break;

                    case ESaleType.Coin:
                        if (!this.CheckCanBuy(shopitem, buy, player.Coin, 108))
                        {
                            return;
                        }
                        break;

                    case ESaleType.TourCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.TourCoin, 109))
                        {
                            return;
                        }
                        break;

                    case ESaleType.ArenaCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.ArenaCoin, 110))
                        {
                            return;
                        }
                        break;

                    case ESaleType.PiecePoint:
                        if (!this.CheckCanBuy(shopitem, buy, player.PiecePoint, 111))
                        {
                            return;
                        }
                        break;

                    case ESaleType.MultiCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.MultiCoin, 112))
                        {
                            return;
                        }
                        break;

                    case ESaleType.EventCoin:
                        this.ActivateOutputLinks(113);
                        return;

                    case ESaleType.Coin_P:
                        if (!this.CheckCanBuy(shopitem, buy, player.PaidCoin, 113))
                        {
                            return;
                        }
                        break;
                    }
                    if (Network.Mode == Network.EConnectMode.Offline)
                    {
                        player.DEBUG_BUY_ITEM(GlobalVars.ShopType, GlobalVars.ShopBuyIndex);
                        this.Success();
                    }
                    else
                    {
                        this.mShopType = GlobalVars.ShopType;
                        this.ExecRequest((WebAPI) new ReqItemLimitedShopBuypaid(GlobalVars.LimitedShopItem.shops.gname, GlobalVars.ShopBuyIndex, GlobalVars.ShopBuyAmount, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        ((Behaviour)this).set_enabled(true);
                    }
                }
            }
        }
Exemple #30
0
        public bool Deserialize(Json_DropInfo json)
        {
            this.Init();
            if (json == null)
            {
                return(false);
            }
            string type = json.type;

            if (type != null)
            {
                // ISSUE: reference to a compiler-generated field
                if (GachaDropData.\u003C\u003Ef__switch\u0024map8 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    GachaDropData.\u003C\u003Ef__switch\u0024map8 = new Dictionary <string, int>(4)
                    {
                        {
                            "item",
                            0
                        },
                        {
                            "unit",
                            1
                        },
                        {
                            "artifact",
                            2
                        },
                        {
                            "concept_card",
                            3
                        }
                    };
                }
                int num;
                // ISSUE: reference to a compiler-generated field
                if (GachaDropData.\u003C\u003Ef__switch\u0024map8.TryGetValue(type, out num))
                {
                    switch (num)
                    {
                    case 0:
                        this.type = GachaDropData.Type.Item;
                        this.item = MonoSingleton <GameManager> .Instance.GetItemParam(json.iname);

                        if (this.item == null)
                        {
                            DebugUtility.LogError("iname:" + json.iname + " => Not ItemParam!");
                            return(false);
                        }
                        this.rarity = this.item.rare;
                        break;

                    case 1:
                        this.unit = MonoSingleton <GameManager> .Instance.GetUnitParam(json.iname);

                        if (this.unit == null)
                        {
                            DebugUtility.LogError("iname:" + json.iname + " => Not UnitParam!");
                            return(false);
                        }
                        this.rarity = (int)this.unit.rare;
                        this.type   = GachaDropData.Type.Unit;
                        break;

                    case 2:
                        this.artifact = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(json.iname);

                        if (this.artifact == null)
                        {
                            DebugUtility.LogError("iname:" + json.iname + " => Not ArtifactParam!");
                            return(false);
                        }
                        if (json.rare != -1 && json.rare > this.artifact.raremax)
                        {
                            DebugUtility.LogError("武具:" + this.artifact.name + "の最大レアリティより大きい値が設定されています.");
                        }
                        else if (json.rare != -1 && json.rare < this.artifact.rareini)
                        {
                            DebugUtility.LogError("武具:" + this.artifact.name + "の初期レアリティより小さい値が設定されています.");
                        }
                        this.rarity = json.rare <= -1 ? this.artifact.rareini : Math.Min(Math.Max(this.artifact.rareini, json.rare), this.artifact.raremax);
                        this.type   = GachaDropData.Type.Artifact;
                        break;

                    case 3:
                        this.conceptcard = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(json.iname);

                        if (this.conceptcard == null)
                        {
                            DebugUtility.LogError("iname:" + json.iname + " => Not ConceptCardParam!");
                            return(false);
                        }
                        this.rarity = this.conceptcard.rare;
                        this.type   = GachaDropData.Type.ConceptCard;
                        break;
                    }
                }
            }
            this.num = json.num;
            if (0 < json.iname_origin.Length)
            {
                this.unitOrigin = MonoSingleton <GameManager> .Instance.GetUnitParam(json.iname_origin);
            }
            this.isNew = 1 == json.is_new;
            if (this.type == GachaDropData.Type.ConceptCard && !string.IsNullOrEmpty(json.get_unit))
            {
                this.cardunit = MonoSingleton <GameManager> .Instance.GetUnitParam(json.get_unit);

                if (this.cardunit == null)
                {
                    DebugUtility.LogError("get_unit:" + json.get_unit + " => Not UnitParam!");
                    return(false);
                }
            }
            this.isGift = json.is_gift == 1;
            return(true);
        }