Ejemplo n.º 1
0
        private void RefreshEquipButton(UnitData unit)
        {
            bool      flag             = false;
            int       selectedJobIndex = this.GetSelectedJobIndex(unit);
            EquipData rankupEquipData  = unit.GetRankupEquipData(selectedJobIndex, (int)GlobalVars.SelectedEquipmentSlot);

            if (rankupEquipData != null && rankupEquipData.IsValid() && !rankupEquipData.IsEquiped())
            {
                if (MonoSingleton <GameManager> .Instance.Player.HasItem(rankupEquipData.ItemID))
                {
                    flag = (int)rankupEquipData.ItemParam.equipLv <= unit.Lv;
                }
                else if (unit.Jobs[selectedJobIndex].Rank <= 0 && rankupEquipData.ItemParam.IsCommon)
                {
                    ItemParam commonEquip = MonoSingleton <GameManager> .Instance.MasterParam.GetCommonEquip(rankupEquipData.ItemParam, true);

                    flag = commonEquip != null && MonoSingleton <GameManager> .Instance.Player.HasItem(commonEquip.iname);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.EquipButton, (UnityEngine.Object)null))
            {
                ((Selectable)this.EquipButton).set_interactable(flag);
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CommonEquipButton, (UnityEngine.Object)null))
            {
                return;
            }
            ((Selectable)this.CommonEquipButton).set_interactable(flag);
        }
Ejemplo n.º 2
0
        public static ItemData CreateItemData(ItemParam param, int num = 0)
        {
            ItemData itemData = new ItemData();

            itemData.Setup(0L, param, num);
            return(itemData);
        }
Ejemplo n.º 3
0
        protected virtual void Refresh()
        {
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null))
            {
                return;
            }
            for (int index = this.mItems.Count - 1; index >= 0; --index)
            {
                Object.Destroy((Object)this.mItems[index]);
            }
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            GameManager instance  = MonoSingleton <GameManager> .Instance;
            Transform   transform = ((Component)this).get_transform();

            if (dataOfClass.dropItems == null)
            {
                return;
            }
            for (int index = 0; index < dataOfClass.dropItems.Length; ++index)
            {
                ItemParam itemParam = instance.GetItemParam(dataOfClass.dropItems[index]);
                if (itemParam != null)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    DataSource.Bind <ItemParam>(gameObject, itemParam);
                    gameObject.get_transform().SetParent(transform, false);
                    gameObject.SetActive(true);
                }
            }
        }
Ejemplo n.º 4
0
        private string MakeResultString(Json_DropInfo[] drops)
        {
            MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;

            UnitParam[] allUnits = masterParam.GetAllUnits();
            string      str      = string.Empty;

            foreach (Json_DropInfo drop in drops)
            {
                ItemParam itemParam = masterParam.GetItemParam(drop.iname);
                if (itemParam != null)
                {
                    str = str + itemParam.name + "\n";
                }
                else
                {
                    foreach (UnitParam unitParam in allUnits)
                    {
                        if (unitParam.iname == drop.iname)
                        {
                            str = str + unitParam.name + "\n";
                            break;
                        }
                    }
                }
            }
            return(str);
        }
Ejemplo n.º 5
0
        private void RefreshSubPanel(int index = -1)
        {
            this.ClearPanel();
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.MainPanelCloseBtn, (UnityEngine.Object)null))
            {
                DebugUtility.LogWarning("UnitEvolutionWindow.cs => RefreshSubPanel():MainPanelCloseBtn is Null References!");
            }
            else
            {
                ((Component)this.MainPanelCloseBtn).get_gameObject().SetActive(false);
                if (index < 0)
                {
                    DebugUtility.LogWarning("UnitEvolutionWindow.cs => RefreshSubPanel():index is 0!");
                }
                else
                {
                    RecipeParam currentRecipe = this.GetCurrentRecipe(this.mCurrentUnit);
                    if (currentRecipe == null)
                    {
                        DebugUtility.LogError("UnitEvolutionWindow.cs => RefreshSubPanel():recipeParam is Null References!");
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .GetInstanceDirect().GetItemParam(currentRecipe.items[index].iname);

                        if (itemParam == null)
                        {
                            DebugUtility.LogError("UnitEvolutionWindow.cs => RefreshSubPanel():itemParam is Null References!");
                        }
                        else
                        {
                            this.SubPanel.SetActive(true);
                            DataSource.Bind <ItemParam>(this.SubPanel, itemParam);
                            GameParameter.UpdateAll(this.SubPanel.get_gameObject());
                            if (this.mLastSelectItemIname != itemParam.iname)
                            {
                                this.ResetScrollPosition();
                                this.mLastSelectItemIname = itemParam.iname;
                            }
                            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)QuestDropParam.Instance, (UnityEngine.Object)null))
                            {
                                return;
                            }
                            QuestParam[]      availableQuests   = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
                            List <QuestParam> itemDropQuestList = QuestDropParam.Instance.GetItemDropQuestList(itemParam, GlobalVars.GetDropTableGeneratedDateTime());
                            using (List <QuestParam> .Enumerator enumerator = itemDropQuestList.GetEnumerator())
                            {
                                while (enumerator.MoveNext())
                                {
                                    QuestParam qp = enumerator.Current;
                                    DebugUtility.Log("QuestList:" + qp.iname);
                                    bool isActive = Array.Find <QuestParam>(availableQuests, (Predicate <QuestParam>)(p => p.iname == qp.iname)) != null;
                                    this.AddList(qp, isActive);
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public static string ItemIcon(ItemParam param)
        {
            if (param != null)
            {
                switch (param.type)
                {
                case EItemType.ArtifactPiece:
                    if (!string.IsNullOrEmpty((string)param.icon))
                    {
                        AssetPath.mSB.Length = 0;
                        AssetPath.mSB.Append("ArtiIcon/");
                        AssetPath.mSB.Append((string)param.icon);
                        return(AssetPath.mSB.ToString());
                    }
                    break;

                case EItemType.Unit:
                    if (!string.IsNullOrEmpty((string)param.icon))
                    {
                        UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.iname);

                        if (unitParam != null)
                        {
                            return(AssetPath.UnitIconSmall(unitParam, unitParam.GetJobId(0)));
                        }
                        break;
                    }
                    break;

                default:
                    return(AssetPath.ItemIcon((string)param.icon));
                }
            }
            return((string)null);
        }
        private void Start()
        {
            if (Object.op_Inequality((Object)this.Title, (Object)null))
            {
                this.Title.set_text(LocalizedText.Get("sys.UPDATE_ITEMLIST_TITLE"));
            }
            if (Object.op_Inequality((Object)this.Message, (Object)null))
            {
                ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(GlobalVars.ShopType);

                string empty = string.Empty;
                string str;
                switch (shopParam.UpdateCostType)
                {
                case ESaleType.Gold:
                    str   = LocalizedText.Get("sys.GOLD");
                    empty = LocalizedText.Get("sys.GOLD");
                    break;

                case ESaleType.TourCoin:
                    str = LocalizedText.Get("sys.TOUR_COIN");
                    break;

                case ESaleType.ArenaCoin:
                    str = LocalizedText.Get("sys.ARENA_COIN");
                    break;

                case ESaleType.PiecePoint:
                    str = LocalizedText.Get("sys.PIECE_POINT");
                    break;

                case ESaleType.MultiCoin:
                    str = LocalizedText.Get("sys.MULTI_COIN");
                    break;

                case ESaleType.EventCoin:
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(GlobalVars.EventShopItem.shop_cost_iname);

                    str = itemParam == null?LocalizedText.Get("sys.EVENT_COIN") : itemParam.name;

                    break;

                default:
                    str = LocalizedText.Get("sys.COIN");
                    break;
                }
                int shopUpdateCost = MonoSingleton <GameManager> .Instance.Player.GetShopUpdateCost(GlobalVars.ShopType, false);

                this.Message.set_text(string.Format(LocalizedText.Get("sys.UPDATE_ITEMLIST_MESSAGE"), (object)str, (object)shopUpdateCost, (object)empty));
            }
            if (Object.op_Inequality((Object)this.DecideText, (Object)null))
            {
                this.DecideText.set_text(LocalizedText.Get("sys.CMD_YES"));
            }
            if (Object.op_Inequality((Object)this.CancelText, (Object)null))
            {
                this.CancelText.set_text(LocalizedText.Get("sys.CMD_NO"));
            }
            this.Refresh();
        }
Ejemplo n.º 8
0
        private int CalcConvertedGold(MailData mail)
        {
            int num1 = 0;

            if (mail == null)
            {
                return(num1);
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < mail.gifts.Length; ++index)
            {
                if (!string.IsNullOrEmpty(mail.gifts[index].iname))
                {
                    ItemParam itemParam = instance.GetItemParam(mail.gifts[index].iname);
                    if (itemParam != null)
                    {
                        ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemParam.iname);
                        if (itemDataByItemId != null)
                        {
                            int num2 = itemDataByItemId.Num + mail.gifts[index].num - (int)itemParam.cap;
                            if (num2 > 0)
                            {
                                num1 += num2 * (int)itemParam.sell;
                            }
                        }
                    }
                }
            }
            return(num1);
        }
Ejemplo n.º 9
0
        public void UpdateJobRankTransfarStatus(MasterParam master)
        {
            BaseStatus baseStatus = new BaseStatus();

            for (int index1 = 0; index1 < this.ranks.Length; ++index1)
            {
                if (this.ranks[index1] != null)
                {
                    this.ranks[index1].TransfarStatus.Clear();
                    baseStatus.CopyTo(this.ranks[index1].TransfarStatus);
                    if (this.ranks[index1].equips != null || index1 != this.ranks.Length)
                    {
                        for (int index2 = 0; index2 < this.ranks[index1].equips.Length; ++index2)
                        {
                            if (!string.IsNullOrEmpty(this.ranks[index1].equips[index2]))
                            {
                                ItemParam itemParam = master.GetItemParam(this.ranks[index1].equips[index2]);
                                if (itemParam != null && !string.IsNullOrEmpty((string)itemParam.skill))
                                {
                                    SkillData skillData = new SkillData();
                                    skillData.Setup((string)itemParam.skill, 1, 1, master);
                                    skillData.BuffSkill(ESkillTiming.Passive, baseStatus, (BaseStatus)null, baseStatus, (BaseStatus)null, (RandXorshift)null, SkillEffectTargets.Target);
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
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);
                }
            }
        }
        private ItemData CreateItemData(ItemParam iparam, int num)
        {
            ItemData itemData = new ItemData();

            itemData.Setup(0L, iparam, num);
            return(itemData);
        }
Ejemplo n.º 12
0
        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());
        }
Ejemplo n.º 13
0
 private void CreateBuffList(MasterParam master_param)
 {
     for (int index1 = 0; index1 < this.ranks.Length; ++index1)
     {
         if (this.ranks[index1] != null)
         {
             List <BuffEffect.BuffValues> list = new List <BuffEffect.BuffValues>();
             if (this.ranks[index1].equips != null || index1 != this.ranks.Length)
             {
                 for (int index2 = 0; index2 < this.ranks[index1].equips.Length; ++index2)
                 {
                     if (!string.IsNullOrEmpty(this.ranks[index1].equips[index2]))
                     {
                         ItemParam itemParam = master_param.GetItemParam(this.ranks[index1].equips[index2]);
                         if (itemParam != null && !string.IsNullOrEmpty(itemParam.skill))
                         {
                             SkillData skillData = new SkillData();
                             skillData.Setup(itemParam.skill, 1, 1, master_param);
                             skillData.BuffSkill(ESkillTiming.Passive, EElement.None, (BaseStatus)null, (BaseStatus)null, (BaseStatus)null, (BaseStatus)null, (BaseStatus)null, (BaseStatus)null, (RandXorshift)null, SkillEffectTargets.Target, false, list);
                         }
                     }
                 }
                 if (list.Count > 0)
                 {
                     this.ranks[index1].buff_list = new BuffEffect.BuffValues[list.Count];
                     for (int index2 = 0; index2 < list.Count; ++index2)
                     {
                         this.ranks[index1].buff_list[index2] = list[index2];
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 14
0
        private void RefreshGainedQuests(UnitParam unit)
        {
            this.ClearPanel();
            this.QuestList.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.QuestListItemTemplate, (UnityEngine.Object)null) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.QuestListParent, (UnityEngine.Object)null))
            {
                return;
            }
            ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(this.UnlockUnit.piece);

            DataSource.Bind <ItemParam>(this.QuestList, itemParam);
            this.QuestList.SetActive(true);
            this.SetScrollTop();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)QuestDropParam.Instance, (UnityEngine.Object)null))
            {
                return;
            }
            QuestParam[]      availableQuests   = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            List <QuestParam> itemDropQuestList = QuestDropParam.Instance.GetItemDropQuestList(itemParam, GlobalVars.GetDropTableGeneratedDateTime());

            using (List <QuestParam> .Enumerator enumerator = itemDropQuestList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    this.AddPanel(enumerator.Current, availableQuests);
                }
            }
            if (itemDropQuestList.Count != 0 || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TxtQuestNothing, (UnityEngine.Object)null))
            {
                return;
            }
            ((Component)this.TxtQuestNothing).get_gameObject().SetActive(true);
        }
Ejemplo n.º 15
0
        public List <ItemParam> GetQuestDropList(string quest_iname, DateTime date_time)
        {
            List <ItemParam>    itemParamList    = new List <ItemParam>();
            SimpleDropTableList simpleDropTables = this.FindSimpleDropTables(quest_iname);

            if (simpleDropTables != null)
            {
                List <ItemParam> currTimeDropItems = this.GetCurrTimeDropItems(new List <SimpleDropTableList>()
                {
                    simpleDropTables
                }, date_time);
                if (currTimeDropItems != null)
                {
                    itemParamList.AddRange((IEnumerable <ItemParam>)currTimeDropItems);
                }
            }
            List <ItemParam> enemyDropItems = this.GetEnemyDropItems(quest_iname, date_time);

            if (enemyDropItems != null)
            {
                using (List <ItemParam> .Enumerator enumerator = enemyDropItems.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ItemParam current = enumerator.Current;
                        if (!itemParamList.Contains(current))
                        {
                            itemParamList.Add(current);
                        }
                    }
                }
            }
            return(itemParamList);
        }
Ejemplo n.º 16
0
        private void Refresh()
        {
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || Object.op_Equality((Object)this.ItemLayout, (Object)null))
            {
                return;
            }
            for (int index = 0; index < this.Chapter.keys.Count; ++index)
            {
                KeyItem key = this.Chapter.keys[index];
                if (key != null && !string.IsNullOrEmpty(key.iname) && key.num != 0)
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                    ItemData itemDataByItemParam = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(itemParam);

                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    DataSource.Bind <ChapterParam>(gameObject, this.Chapter);
                    DataSource.Bind <ItemParam>(gameObject, itemParam);
                    DataSource.Bind <ItemData>(gameObject, itemDataByItemParam);
                    DataSource.Bind <KeyItem>(gameObject, key);
                    KeyQuestBanner component = (KeyQuestBanner)gameObject.GetComponent <KeyQuestBanner>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.UpdateValue();
                    }
                    gameObject.get_transform().SetParent(this.ItemLayout.get_transform(), false);
                    gameObject.SetActive(true);
                }
            }
        }
Ejemplo n.º 17
0
        protected virtual void Refresh()
        {
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null))
            {
                return;
            }
            for (int index = this.mItems.Count - 1; index >= 0; --index)
            {
                Object.Destroy((Object)this.mItems[index]);
            }
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (dataOfClass == null || !Object.op_Inequality((Object)QuestDropParam.Instance, (Object)null))
            {
                return;
            }
            List <ItemParam> questDropList = QuestDropParam.Instance.GetQuestDropList(dataOfClass.iname, GlobalVars.GetDropTableGeneratedDateTime());

            if (questDropList == null)
            {
                return;
            }
            for (int index = 0; index < questDropList.Count; ++index)
            {
                ItemParam data = questDropList[index];
                if (data != null)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    DataSource.Bind <ItemParam>(gameObject, data);
                    gameObject.get_transform().SetParent(((Component)this).get_transform(), false);
                    gameObject.SetActive(true);
                }
            }
        }
        public void Refresh(Dictionary <string, int> dict)
        {
            if (dict == null || dict.Count < 0)
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            using (Dictionary <string, int> .KeyCollection.Enumerator enumerator = dict.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string    current   = enumerator.Current;
                    ItemParam itemParam = instance.MasterParam.GetItemParam(current);
                    if (itemParam != null && dict[current] > 0)
                    {
                        ItemData data = new ItemData();
                        data.Setup(0L, itemParam, dict[current]);
                        GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                        gameObject.get_transform().SetParent((Transform)this.ItemLayoutParent, false);
                        DataSource.Bind <ItemData>(gameObject, data);
                        this.mExpItems.Add(gameObject);
                        gameObject.SetActive(true);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Ejemplo n.º 19
0
 private void SetIconAsync(ItemParam param, bool isSecret)
 {
     if (Object.op_Equality((Object)this.Icon, (Object)null))
     {
         return;
     }
     MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, this.GetIconPath(param, isSecret));
 }
Ejemplo n.º 20
0
 private string GetName(ItemParam param)
 {
     if (param == null)
     {
         return((string)null);
     }
     return(param.name);
 }
Ejemplo n.º 21
0
 private string GetIconPath(ItemParam param)
 {
     if (param == null)
     {
         return((string)null);
     }
     return(AssetPath.ItemIcon(param));
 }
Ejemplo n.º 22
0
 private void LoadIcon(ItemParam 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)));
 }
Ejemplo n.º 23
0
 private void SetFrameSprite(ItemParam param, bool isSecret)
 {
     if (Object.op_Equality((Object)this.Frame, (Object)null))
     {
         return;
     }
     this.Frame.set_sprite(this.GetFrameSprite(param, isSecret));
 }
Ejemplo n.º 24
0
        private void RefreshQuestMissionReward(QuestParam questParam)
        {
            if (questParam.bonusObjective == null)
            {
                return;
            }
            for (int index = 0; index < questParam.bonusObjective.Length; ++index)
            {
                QuestMissionItem questMissionItem;
                if (questParam.bonusObjective[index].itemType == RewardType.Artifact)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ArtifactTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                }
                else
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(questParam.bonusObjective[index].item);

                    if (itemParam != null)
                    {
                        questMissionItem = itemParam.type != EItemType.Unit ? (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ItemTemplate).get_gameObject())).GetComponent <QuestMissionItem>() : (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.UnitTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                    }
                    else
                    {
                        continue;
                    }
                }
                if (!Object.op_Equality((Object)questMissionItem, (Object)null))
                {
                    if (Object.op_Inequality((Object)questMissionItem.Star, (Object)null))
                    {
                        questMissionItem.Star.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.FrameParam, (Object)null))
                    {
                        questMissionItem.FrameParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.IconParam, (Object)null))
                    {
                        questMissionItem.IconParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.NameParam, (Object)null))
                    {
                        questMissionItem.NameParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.AmountParam, (Object)null))
                    {
                        questMissionItem.AmountParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.ObjectigveParam, (Object)null))
                    {
                        questMissionItem.ObjectigveParam.Index = index;
                    }
                    ((Component)questMissionItem).get_gameObject().SetActive(true);
                    ((Component)questMissionItem).get_transform().SetParent(this.ContentsParent.get_transform(), false);
                    GameParameter.UpdateAll(((Component)questMissionItem).get_gameObject());
                }
            }
        }
Ejemplo n.º 25
0
        private void Start()
        {
            this.Chapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (this.Chapter == null)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null) && this.ItemTemplate.get_activeInHierarchy())
                {
                    this.ItemTemplate.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.Message, (Object)null))
                {
                    string    str       = (string)null;
                    ItemParam itemParam = (ItemParam)null;
                    int       num       = 0;
                    if (this.Chapter.keys.Count > 0)
                    {
                        KeyItem key = this.Chapter.keys[0];
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                        num = key.num;
                    }
                    KeyQuestTypes keyQuestType     = this.Chapter.GetKeyQuestType();
                    bool          keyQuestTimeOver = GlobalVars.KeyQuestTimeOver;
                    switch (keyQuestType)
                    {
                    case KeyQuestTypes.Timer:
                        if (this.Chapter.keytime != 0L && itemParam != null)
                        {
                            TimeSpan timeSpan = TimeManager.FromUnixTime(this.Chapter.keytime) - TimeManager.FromUnixTime(0L);
                            if (timeSpan.TotalDays >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_D" : "sys.KEYQUEST_TIMEOVER_D", (object)itemParam.name, (object)num, (object)timeSpan.Days);
                                break;
                            }
                            if (timeSpan.TotalHours >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_H" : "sys.KEYQUEST_TIMEOVER_H", (object)itemParam.name, (object)num, (object)timeSpan.Hours);
                                break;
                            }
                            str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_M" : "sys.KEYQUEST_TIMEOVER_M", (object)itemParam.name, (object)num, (object)Mathf.Max(timeSpan.Minutes, 0));
                            break;
                        }
                        break;

                    case KeyQuestTypes.Count:
                        str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_COUNT" : "sys.KEYQUEST_TIMEOVER_COUNT", (object)itemParam.name, (object)num);
                        break;
                    }
                    this.Message.set_text(str);
                }
                this.Refresh();
            }
        }
Ejemplo n.º 26
0
        public bool IsCommonEquipUI(long unit_id, int slot)
        {
            if (!this.IsTreeTop)
            {
                return(false);
            }
            GameManager instance           = MonoSingleton <GameManager> .Instance;
            UnitData    unitDataByUniqueId = instance.Player.FindUnitDataByUniqueID(unit_id);
            int         selectedJobIndex   = this.GetSelectedJobIndex(unitDataByUniqueId);

            if (unitDataByUniqueId.GetRankupEquipData(selectedJobIndex, slot).IsEquiped())
            {
                return(false);
            }
            JobData job = unitDataByUniqueId.Jobs[selectedJobIndex];

            if (job.Rank == 0)
            {
                return(false);
            }
            string    rankupItem        = job.GetRankupItems(job.Rank)[slot];
            ItemData  itemDataByItemId1 = instance.Player.FindItemDataByItemID(rankupItem);
            ItemParam itemParam         = instance.GetItemParam(rankupItem);

            if (itemParam == null || !itemParam.IsCommon || (int)itemParam.equipLv > unitDataByUniqueId.Lv)
            {
                return(false);
            }
            if (itemDataByItemId1 != null && itemDataByItemId1.Num >= 1)
            {
                return(true);
            }
            ItemParam commonEquip = instance.MasterParam.GetCommonEquip(itemParam, job.Rank == 0);

            if (commonEquip == null)
            {
                return(false);
            }
            ItemData itemDataByItemId2 = instance.Player.FindItemDataByItemID(commonEquip.iname);

            if (itemDataByItemId2 == null)
            {
                return(true);
            }
            if (instance.MasterParam.FixParam.EquipCommonPieceNum == null)
            {
                return(false);
            }
            int num1 = (int)instance.MasterParam.FixParam.EquipCommonPieceNum[(int)itemParam.rare];
            int num2 = job.Rank <= 0 ? 1 : num1;

            if (itemDataByItemId2 != null && itemDataByItemId2.Num >= num2)
            {
                return(job.Rank > 0);
            }
            return(true);
        }
Ejemplo n.º 27
0
 public void Init()
 {
     this.type     = GachaDropData.Type.None;
     this.unit     = (UnitParam)null;
     this.item     = (ItemParam)null;
     this.artifact = (ArtifactParam)null;
     this.num      = 0;
     this.isNew    = false;
 }
Ejemplo n.º 28
0
 public void Add(ItemParam _param, int _need_picec, bool is_soul = false)
 {
     if (!this.CommonNeedNum.ContainsKey(_param.cmn_type))
     {
         this.CommonNeedNum[_param.cmn_type] = new NeedEquipItemDictionary(_param, is_soul);
     }
     this.CommonNeedNum[_param.cmn_type].Add(_param, _need_picec);
     this.mLastAddParam = _param;
 }
Ejemplo n.º 29
0
        private void Refresh()
        {
            GameManager instance           = MonoSingleton <GameManager> .Instance;
            UnitData    unitDataByUniqueId = instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);

            if (unitDataByUniqueId == null || instance.MasterParam.FixParam.EquipCommonPieceNum == null || instance.MasterParam.FixParam.EquipCommonPieceCost == null)
            {
                return;
            }
            List <JobData> jobDataList = new List <JobData>((IEnumerable <JobData>)unitDataByUniqueId.Jobs);
            JobData        jobData     = jobDataList.Find((Predicate <JobData>)(x => (long)GlobalVars.SelectedJobUniqueID == x.UniqueID));

            if (jobData == null)
            {
                return;
            }
            int       jobNo           = jobDataList.IndexOf(jobData);
            EquipData rankupEquipData = unitDataByUniqueId.GetRankupEquipData(jobNo, (int)GlobalVars.SelectedEquipmentSlot);
            ItemParam commonEquip     = instance.MasterParam.GetCommonEquip(rankupEquipData.ItemParam, jobData.Rank == 0);

            if (commonEquip != null)
            {
                return;
            }
            DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), commonEquip);
            ItemData itemDataByItemParam = instance.Player.FindItemDataByItemParam(commonEquip);
            int      num1 = 0;

            if (itemDataByItemParam != null)
            {
                num1 = itemDataByItemParam.Num;
                DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemParam);
            }
            else
            {
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), commonEquip);
            }
            int num2 = (int)instance.MasterParam.FixParam.EquipCommonPieceNum[(int)commonEquip.rare];

            this.CommonName.set_text(LocalizedText.Get("sys.COMMON_EQUIP_NAME", (object)commonEquip.name, (object)num2));
            this.CommonAmount.set_text(LocalizedText.Get("sys.COMMON_EQUIP_NUM", new object[1]
            {
                (object)num1
            }));
            this.CommonDescription.set_text(LocalizedText.Get("sys.COMMON_EQUIP_DESCRIPT", (object)commonEquip.name, (object)num2));
            int num3 = (int)instance.MasterParam.FixParam.EquipCommonPieceCost[rankupEquipData.Rarity];

            this.CommonCost.set_text(num3.ToString());
            bool flag1 = num3 <= instance.Player.Gold;
            bool flag2 = num1 >= num2;

            this.NotEnough.SetActive(!flag1);
            ((Component)this.CommonDescription).get_gameObject().SetActive(flag2);
            ((Component)this.CommonDescriptionPieceNotEnough).get_gameObject().SetActive(!flag2);
            ((Selectable)this.ButtonCommonEquip).set_interactable(flag1 && flag2);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Ejemplo n.º 30
0
 public void Reset()
 {
     this.mUniqueID  = 0L;
     this.mItemParam = (ItemParam)null;
     this.mExp       = 0;
     this.mRank      = 1;
     this.mSkill     = (SkillData)null;
     this.mEquiped   = false;
 }