public override void OnNotify(NOTIFY_FLAG flags)
    {
        if ((flags & (NOTIFY_FLAG.UPDATE_SKILL_FAVORITE | NOTIFY_FLAG.UPDATE_ITEM_INVENTORY | NOTIFY_FLAG.UPDATE_SKILL_INVENTORY)) != (NOTIFY_FLAG)0L)
        {
            skillItem = MonoBehaviourSingleton <InventoryManager> .I.skillItemInventory.Find(skillItem.uniqueID);

            if (material != null)
            {
                List <SkillItemInfo> list = new List <SkillItemInfo>();
                int i = 0;
                for (int num = material.Length; i < num; i++)
                {
                    SkillItemInfo skillItemInfo = MonoBehaviourSingleton <InventoryManager> .I.skillItemInventory.Find(material[i].uniqueID);

                    if (skillItemInfo != null && !skillItemInfo.isFavorite)
                    {
                        list.Add(material[i]);
                    }
                }
                material = list.ToArray();
            }
            SetDirty(UI.GRD_MATERIAL);
        }
        base.OnNotify(flags);
    }
Ejemplo n.º 2
0
    public ItemStatus[] GetEquipTypeSkillParam()
    {
        ItemStatus[] array = new ItemStatus[MonoBehaviourSingleton <StatusManager> .I.ENABLE_EQUIP_TYPE_MAX + 1];
        int          i     = 0;

        for (int num = array.Length; i < num; i++)
        {
            array[i] = new ItemStatus();
        }
        int j = 0;

        for (int maxSlot = GetMaxSlot(); j < maxSlot; j++)
        {
            SkillItemInfo skillItem = GetSkillItem(j);
            if (skillItem != null)
            {
                ENABLE_EQUIP_TYPE[] array2 = (ENABLE_EQUIP_TYPE[])Enum.GetValues(typeof(ENABLE_EQUIP_TYPE));
                int k = 0;
                for (int num2 = array2.Length; k < num2; k++)
                {
                    ItemStatus itemStatus = array[k];
                    ItemStatus param      = skillItem.GetEquipTypeSkillParam()[k];
                    itemStatus.Add(param);
                }
            }
        }
        return(array);
    }
Ejemplo n.º 3
0
    private void OnQuery_SLOT_DETAIL()
    {
        int num = (int)GameSection.GetEventData();

        selectEquipIndex = num >> 16;
        selectSkillIndex = num % 65536;
        if (lookOnly || selectSkillIndex < 0 || selectEquipIndex < 0)
        {
            GameSection.StopEvent();
        }
        else
        {
            SkillItemInfo itemData      = equipAndSkill[selectEquipIndex].skillSlotUIData[selectSkillIndex].itemData;
            EquipItemInfo equipItemInfo = equipAndSkill[selectEquipIndex].equipItemInfo;
            if (itemData == null)
            {
                GameSection.StopEvent();
            }
            else
            {
                SkillItemSortData skillItemSortData = new SkillItemSortData();
                skillItemSortData.SetItem(itemData);
                GameSection.SetEventData(new object[4]
                {
                    ItemDetailEquip.CURRENT_SECTION.STATUS_SKILL_LIST,
                    skillItemSortData,
                    equipItemInfo,
                    selectSkillIndex
                });
            }
        }
    }
    public int GetExceedExp(SkillItemInfo material)
    {
        int   exceedRarityBasePoint = GetExceedRarityBasePoint(material.tableData.rarity);
        float exceedLevelRate       = GetExceedLevelRate(material.level, material.tableData.GetMaxLv(0));

        return((int)((float)exceedRarityBasePoint * exceedLevelRate));
    }
    public void SendInventorySellSkillItem(List <string> uids, Action <bool> call_back)
    {
        InventorySellSkillModel.RequestSendForm requestSendForm = new InventorySellSkillModel.RequestSendForm();
        requestSendForm.uids = uids;
        bool is_attach = false;

        requestSendForm.uids.ForEach(delegate(string str_uniq_id)
        {
            ulong uniq_id           = ulong.Parse(str_uniq_id);
            SkillItemInfo skillItem = MonoBehaviourSingleton <InventoryManager> .I.GetSkillItem(uniq_id);
            if (skillItem != null && skillItem.isAttached)
            {
                is_attach = true;
            }
        });
        Protocol.Send(InventorySellSkillModel.URL, requestSendForm, delegate(InventorySellSkillModel ret)
        {
            bool obj = false;
            if (ret.Error == Error.None)
            {
                obj = true;
                if (is_attach)
                {
                    MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_SKILL_CHANGE);
                }
            }
            call_back(obj);
        }, string.Empty);
    }
Ejemplo n.º 6
0
    private void _GetAttachSkillBuffParam(out int[] atk, out int[] def, out int hp)
    {
        atk = new int[7];
        def = new int[7];
        for (int i = 0; i < 7; i++)
        {
            atk[i] = 0;
            def[i] = 0;
        }
        hp = 0;
        int j = 0;

        for (int maxSlot = GetMaxSlot(); j < maxSlot; j++)
        {
            SkillItemInfo skillItem = GetSkillItem(j);
            if (skillItem != null)
            {
                GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(skillItem.tableData.growID, skillItem.level);

                if (growSkillItemData != null)
                {
                    hp += skillItem.hp;
                    int k = 0;
                    for (int num = 7; k < num; k++)
                    {
                        atk[k] += skillItem.atkList[k];
                        def[k] += skillItem.defList[k];
                    }
                }
            }
        }
    }
    private void SkillParam(SkillItemInfo item)
    {
        SetActive(detailBase, UI.OBJ_SUB_STATUS, true);
        SkillItemTable.SkillItemData tableData = item.tableData;
        SetLabelText(detailBase, UI.LBL_NAME, tableData.name);
        SkillCompareParam(item, GetCompareItem());
        SetLabelText(detailBase, UI.LBL_SELL, item.sellPrice.ToString());
        SetSupportEncoding(UI.LBL_DESCRIPTION, true);
        SetLabelText(detailBase, UI.LBL_DESCRIPTION, item.GetExplanationText(true));
        bool is_visible = (callSection & (ItemDetailEquip.CURRENT_SECTION.SMITH_CREATE | ItemDetailEquip.CURRENT_SECTION.SMITH_SKILL_MATERIAL | ItemDetailEquip.CURRENT_SECTION.QUEST_RESULT | ItemDetailEquip.CURRENT_SECTION.UI_PARTS | ItemDetailEquip.CURRENT_SECTION.EQUIP_LIST)) == ItemDetailEquip.CURRENT_SECTION.NONE;

        SetActive(detailBase, UI.OBJ_FAVORITE_ROOT, is_visible);
        ResetTween(detailBase, UI.TWN_FAVORITE, 0);
        ResetTween(detailBase, UI.TWN_UNFAVORITE, 0);
        SetActive(detailBase, UI.TWN_UNFAVORITE, !item.isFavorite);
        SetActive(detailBase, UI.TWN_FAVORITE, item.isFavorite);
        if (item.IsLevelMax())
        {
            SetProgressInt(detailBase, UI.PRG_EXP_BAR, item.exceedExp, item.exceedExpPrev, item.exceedExpNext, null);
        }
        else
        {
            SetProgressInt(detailBase, UI.PRG_EXP_BAR, item.exp, item.expPrev, item.expNext, null);
        }
        SetSkillSlotTypeIcon(detailBase, UI.SPR_SKILL_TYPE_ICON, UI.SPR_SKILL_TYPE_ICON_BG, UI.SPR_SKILL_TYPE_ICON_RARITY, tableData);
        SetRenderSkillItemModel((Enum)UI.TEX_MODEL, tableData.id, true, false);
        SetRenderSkillItemSymbolModel((Enum)UI.TEX_INNER_MODEL, tableData.id, true);
    }
    public override void Initialize()
    {
        object[] array = GameSection.GetEventData() as object[];
        callSection = (ItemDetailEquip.CURRENT_SECTION)(int) array[0];
        itemData    = array[1];
        if (array.Length > 2)
        {
            equipInfo = (array[2] as EquipItemInfo);
            slotIndex = (int)array[3];
        }
        SortCompareData sortCompareData = itemData as SortCompareData;

        if (sortCompareData != null)
        {
            itemData = (sortCompareData.GetItemData() as SkillItemInfo);
        }
        SkillItemInfo skillItemInfo = itemData as SkillItemInfo;

        if (skillItemInfo != null)
        {
            GameSaveData.instance.RemoveNewIconAndSave(ITEM_ICON_TYPE.SKILL_ATTACK, skillItemInfo.uniqueID);
        }
        bool flag = equipInfo != null;

        SetActive((Enum)UI.BTN_CHANGE, flag);
        SetActive((Enum)UI.BTN_GROW, ItemDetailEquip.CanSmithSection(callSection) && skillItemInfo != null && !skillItemInfo.IsLevelMax());
        SetActive((Enum)UI.BTN_SELL, MonoBehaviourSingleton <ItemExchangeManager> .I.IsExchangeScene() && !flag);
        base.Initialize();
    }
    public void SetList()
    {
        if (firstSetList)
        {
            firstSetList = false;
            OnceInventoryModel.Param inventory = MonoBehaviourSingleton <OnceManager> .I.result.inventory;
            equipItemInventory = EquipItemInfo.CreateList(inventory.equipItem);
            MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_EQUIP_INVENTORY);

            skillItemInventory = SkillItemInfo.CreateList(inventory.skillItem);
            MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_SKILL_INVENTORY);

            skillMaterialInventory = SkillItemInfo.CreateListFromItem(inventory.item);
            abilityItemInventory   = AbilityItemInfo.CreateList(inventory.abilityItem);
            inGameTempItemInventory.Clear();
            equipItemFilterList.Clear();
            itemInventory        = ItemInfo.CreateList(inventory.item);
            abilityItemInventory = InventoryList <AbilityItemInfo, AbilityItem> .CreateList(inventory.abilityItem);

            SetExpiredAtList(inventory.expiredItem);
            MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_ITEM_INVENTORY);

            questItemInventory = QuestItemInfo.CreateList(inventory.questItem);
            MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_QUEST_ITEM_INVENTORY);

            MonoBehaviourSingleton <QuestManager> .I.needRequestOrderQuestList = true;
        }
    }
Ejemplo n.º 10
0
    private void OnQuery_MATERIAL()
    {
        ResetSelectMaterialIcon();
        int num = (int)GameSection.GetEventData();
        SkillItemSortData item = inventory.datas[num] as SkillItemSortData;
        bool          flag     = materialSkillItem.Find((SkillItemInfo material) => material.uniqueID == item.GetUniqID()) != null;
        SkillItemInfo item2    = item.GetItemData() as SkillItemInfo;

        if (!IsEnableSelect(inventory.datas[num]))
        {
            toggleIndex = num;
            DispatchEvent("NOT_MATERIAL_FAVORITE", null);
        }
        else if (flag)
        {
            materialSkillItem.Remove(item2);
        }
        else if (materialSkillItem.Count < 10)
        {
            materialSkillItem.Add(item2);
        }
        else
        {
            toggleIndex = num;
        }
        UpdateMaterial();
        UpdateSelectMaterialIcon();
    }
    public override void Initialize()
    {
        //IL_0064: Unknown result type (might be due to invalid IL or missing references)
        //IL_0069: Unknown result type (might be due to invalid IL or missing references)
        //IL_007b: Unknown result type (might be due to invalid IL or missing references)
        object[] array = GameSection.GetEventData() as object[];
        skillItem = (array[0] as SkillItemInfo);
        material  = (array[1] as SkillItemInfo[]);
        GameSection.SetEventData(new object[2]
        {
            ItemDetailEquip.CURRENT_SECTION.UI_PARTS,
            skillItem
        });
        UILabel component = base.GetComponent <UILabel>((Enum)UI.LBL_GOLD);

        if (component != null)
        {
            goldColor = component.color;
        }
        UITweenCtrl component2 = GetCtrl(UI.OBJ_CAPTION).get_gameObject().GetComponent <UITweenCtrl>();

        if (component2 != null)
        {
            component2.Reset();
            int i = 0;
            for (int num = component2.tweens.Length; i < num; i++)
            {
                component2.tweens[i].ResetToBeginning();
            }
            component2.Play(true, null);
        }
        isExceed        = skillItem.IsLevelMax();
        isSortTypeReset = isExceed;
        base.Initialize();
    }
 private void ToNotEnableSkillTypeConfirm()
 {
     //IL_0057: Unknown result type (might be due to invalid IL or missing references)
     if (is_not_enable_skill_type)
     {
         is_not_enable_skill_type = false;
         GameSection.ChangeEvent("COME_BACK", null);
         Action action = delegate
         {
             SortCompareData sortCompareData = inventory.datas[selectIndex];
             SkillItemInfo   skillItemInfo   = sortCompareData.GetItemData() as SkillItemInfo;
             EQUIPMENT_TYPE? enableEquipType = skillItemInfo.tableData.GetEnableEquipType();
             DispatchEvent("NOT_SKILL_ENABLE_TYPE", new object[1]
             {
                 MonoBehaviourSingleton <StatusManager> .I.GetEquipItemGroupString(enableEquipType.Value)
             });
         };
         if (MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentScreenName().Contains(this.get_name()))
         {
             action();
         }
         else
         {
             this.StartCoroutine(DelayCall(action));
         }
     }
 }
    protected override void SetInventoryIsEmptyParam()
    {
        bool is_empty = true;

        if (inventory != null && inventory.datas.Length > 0 && equipItem != null)
        {
            SkillItemTable.SkillSlotData[] skillSlot = equipItem.tableData.GetSkillSlot(equipItem.exceed);
            if (skillSlot != null && skillSlot.Length > slotIndex)
            {
                SKILL_SLOT_TYPE skill_slot_type = skillSlot[slotIndex].slotType;
                Array.ForEach(inventory.datas, delegate(SortCompareData _data)
                {
                    if (is_empty && _data != null)
                    {
                        SkillItemInfo skillItemInfo = _data.GetItemData() as SkillItemInfo;
                        if (skillItemInfo.tableData.type == skill_slot_type)
                        {
                            is_empty = false;
                        }
                    }
                });
            }
        }
        isVisibleEmptySkill = is_empty;
    }
Ejemplo n.º 14
0
    public static int SetDropData(List <SortCompareData> drop_ary, int start_ary_index, List <QuestCompleteReward.SkillItem> drop_data, REWARD_CATEGORY category = REWARD_CATEGORY.DROP)
    {
        int num = start_ary_index;

        QuestCompleteReward.SkillItem[] ary = drop_data.ToArray();
        int i = 0;

        for (int num2 = ary.Length; i < num2; i++)
        {
            SortCompareData sortCompareData = null;
            if (num > 0 && category != REWARD_CATEGORY.BREAK)
            {
                sortCompareData = drop_ary.Find((SortCompareData _data) => _data != null && _data.GetTableID() == (uint)ary[i].skillItemId && _data is RewardSkillItemSortData);
            }
            if (sortCompareData == null)
            {
                SkillItemInfo skillItemInfo = new SkillItemInfo();
                skillItemInfo.tableID   = (uint)ary[i].skillItemId;
                skillItemInfo.tableData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)ary[i].skillItemId);

                RewardSkillItemSortData rewardSkillItemSortData = new RewardSkillItemSortData();
                rewardSkillItemSortData.SetItem(skillItemInfo);
                rewardSkillItemSortData.SetCategory(category);
                rewardSkillItemSortData.rewardNum = ary[i].num;
                drop_ary.Add(rewardSkillItemSortData);
                num++;
            }
            else
            {
                RewardSkillItemSortData rewardSkillItemSortData2 = sortCompareData as RewardSkillItemSortData;
                rewardSkillItemSortData2.rewardNum += ary[i].num;
            }
        }
        return(num);
    }
Ejemplo n.º 15
0
    private IEnumerator SendReplacementSkill(List <MigrationSkillData> migrationSkill, List <SkillItemInfo> detachSkill)
    {
        foreach (MigrationSkillData item in migrationSkill)
        {
            bool isSendFinish2   = false;
            MigrationSkillData i = item;
            MonoBehaviourSingleton <StatusManager> .I.SendSetSkill(i.toUniqueId, i.skill.uniqueID, i.toSlotNo, MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo(), delegate(bool isSucces)
            {
                ((_003CSendReplacementSkill_003Ec__Iterator10E) /*Error near IL_00ac: stateMachine*/)._003C_003Ef__this.MigrationSkillCallback(isSucces);
                ((_003CSendReplacementSkill_003Ec__Iterator10E) /*Error near IL_00ac: stateMachine*/)._003CisSendFinish_003E__0 = true;
            });

            if (!isSendFinish2)
            {
                yield return((object)null);
            }
        }
        foreach (SkillItemInfo item2 in detachSkill)
        {
            bool              isSendFinish2 = false;
            SkillItemInfo     d             = item2;
            EquipSetSkillData setInfo       = d.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo());
            MonoBehaviourSingleton <StatusManager> .I.SendDetachSkill(setInfo.equipItemUniqId, setInfo.equipSlotNo, setInfo.equipSetNo, delegate(bool isSucces)
            {
                ((_003CSendReplacementSkill_003Ec__Iterator10E) /*Error near IL_01a9: stateMachine*/)._003C_003Ef__this.MigrationSkillCallback(isSucces);
                ((_003CSendReplacementSkill_003Ec__Iterator10E) /*Error near IL_01a9: stateMachine*/)._003CisSendFinish_003E__0 = true;
            });

            if (!isSendFinish2)
            {
                yield return((object)null);
            }
        }
    }
    public override void UpdateUI()
    {
        base.UpdateUI();
        bool          flag          = true;
        SkillItemInfo skillItemInfo = resultData.itemData as SkillItemInfo;

        if (skillItemInfo != null && skillItemInfo.IsLevelMax())
        {
            flag = skillItemInfo.IsEnableExceed();
        }
        SetActive((Enum)UI.SPR_BG_NORMAL, !isExceed);
        SetActive((Enum)UI.SPR_BG_EXCEED, isExceed);
        SetActive((Enum)UI.BTN_NEXT, flag);
        SetActive((Enum)UI.BTN_NEXT_GRAY, !flag);
        SetLabelText((Enum)UI.LBL_NEXT_GRAY_BTN, base.sectionData.GetText("STR_NEXT"));
        if (isExceed)
        {
            if (resultData != null)
            {
                SetLabelText((Enum)UI.LBL_EXCEED_PREV, StringTable.Format(STRING_CATEGORY.SMITH, 9u, resultData.beforeExceedCnt));
            }
            if (skillItemInfo != null)
            {
                int exceedCnt = skillItemInfo.exceedCnt;
                SetLabelText((Enum)UI.LBL_EXCEED_NEXT, StringTable.Format(STRING_CATEGORY.SMITH, 9u, exceedCnt));
                ExceedSkillItemTable.ExceedSkillItemData exceedSkillItemData = Singleton <ExceedSkillItemTable> .I.GetExceedSkillItemData(exceedCnt);

                if (exceedSkillItemData != null)
                {
                    SetLabelText((Enum)UI.LBL_ADD_EXCEED, StringTable.Format(STRING_CATEGORY.SMITH, 8u, exceedSkillItemData.GetDecreaseUseGaugePercent()));
                }
            }
        }
    }
    private void OnQuery_MATERIAL()
    {
        int num = (int)GameSection.GetEventData();
        SkillItemSortData item = inventory.datas[num] as SkillItemSortData;
        bool          flag     = materialSkillItem.Find((SkillItemInfo material) => material.uniqueID == item.GetUniqID()) != null;
        SkillItemInfo item2    = item.GetItemData() as SkillItemInfo;

        if (!IsEnableSelect(inventory.datas[num]))
        {
            if (item.IsFavorite())
            {
                GameSection.ChangeEvent("NOT_MATERIAL_FAVORITE", null);
            }
        }
        else if (flag)
        {
            materialSkillItem.Remove(item2);
        }
        else if (materialSkillItem.Count < MATERIAL_SELECT_MAX)
        {
            materialSkillItem.Add(item2);
        }
        bool flag2 = isSelectMax;

        isSelectMax = (materialSkillItem.Count == MATERIAL_SELECT_MAX);
        if (flag2 != isSelectMax)
        {
            UpdateInventory();
        }
        UpdateSelectMaterialIcon();
    }
    public override void OnNotify(NOTIFY_FLAG flags)
    {
        if ((flags & (NOTIFY_FLAG.UPDATE_SKILL_FAVORITE | NOTIFY_FLAG.UPDATE_ITEM_INVENTORY | NOTIFY_FLAG.UPDATE_SKILL_INVENTORY)) != (NOTIFY_FLAG)0L)
        {
            inventory = new ItemStorageTop.SkillItemInventory((!isExceed) ? SortSettings.SETTINGS_TYPE.GROW_SKILL_ITEM : SortSettings.SETTINGS_TYPE.EXCEED_SKILL_ITEM, SKILL_SLOT_TYPE.NONE, true);
            sorting();
            skillItem = MonoBehaviourSingleton <InventoryManager> .I.skillItemInventory.Find(skillItem.uniqueID);

            List <SkillItemInfo> del_list = new List <SkillItemInfo>();
            materialSkillItem.ForEach(delegate(SkillItemInfo skill)
            {
                SkillItemInfo skillItemInfo  = MonoBehaviourSingleton <InventoryManager> .I.skillItemInventory.Find(skill.uniqueID);
                SkillItemInfo skillItemInfo2 = MonoBehaviourSingleton <InventoryManager> .I.skillMaterialInventory.Find(skill.uniqueID);
                if ((skillItemInfo == null && skillItemInfo2 == null) || (skillItemInfo != null && skillItemInfo.isFavorite))
                {
                    del_list.Add(skill);
                }
            });
            del_list.ForEach(delegate(SkillItemInfo delitem)
            {
                materialSkillItem.Remove(delitem);
            });
            inventory = null;
            RefreshUI();
        }
        base.OnNotify(flags);
    }
    private void OnQuery_ABILITY()
    {
        int num = (int)GameSection.GetEventData();
        EquipItemAbility equipItemAbility = null;
        EquipItemInfo    equipItemInfo    = resultData.itemData as EquipItemInfo;

        if (equipItemInfo != null)
        {
            equipItemAbility = new EquipItemAbility(equipItemInfo.ability[num].id, -1);
        }
        else
        {
            SkillItemInfo skillItemInfo = resultData.itemData as SkillItemInfo;
            if (skillItemInfo == null)
            {
                Debug.LogError((object)("err : result data is unknown : atk " + resultData.beforeAtk + " : def " + resultData.beforeDef));
            }
        }
        if (equipItemAbility == null)
        {
            GameSection.StopEvent();
        }
        else
        {
            GameSection.SetEventData(equipItemAbility);
        }
    }
Ejemplo n.º 20
0
    public SkillItemInfo GetSkillItem(int index, int setNo)
    {
        if (GetMaxSlot() <= index)
        {
            Log.Warning("GetSkillItem :: index out of bounds :: uniqID = " + base.uniqueID + " : tableID = " + base.tableID);
            return(null);
        }
        SkillItemInfo[] skillInventoryClone = MonoBehaviourSingleton <InventoryManager> .I.GetSkillInventoryClone();

        SkillItemInfo skill_info = null;

        Array.ForEach(skillInventoryClone, delegate(SkillItemInfo skill_item)
        {
            if (skill_info == null)
            {
                bool flag = false;
                EquipSetSkillData equipSetSkillData = skill_item.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == setNo);
                if (equipSetSkillData != null && equipSetSkillData.equipItemUniqId == base.uniqueID)
                {
                    if (equipSetSkillData.equipSlotNo == index)
                    {
                        flag = true;
                    }
                    else if (equipSetSkillData.equipSlotNo == GetExceedSkillSlotNo(index))
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                }
            }
        });
        return(skill_info);
    }
    public override void Initialize()
    {
        object[]      array         = GameSection.GetEventData() as object[];
        SkillItemInfo skillItemInfo = array[0] as SkillItemInfo;

        if (skillItemInfo != null)
        {
            baseItemID = skillItemInfo.tableID;
        }
        SortSettings sortSettings = array[1] as SortSettings;

        GameSection.SetEventData(sortSettings);
        isExceed = (sortSettings.settingsType == SortSettings.SETTINGS_TYPE.EXCEED_SKILL_ITEM);
        if (isExceed)
        {
            visible_type_flag_skill = 128;
            switch (skillItemInfo.tableData.type)
            {
            case SKILL_SLOT_TYPE.ATTACK:
                visible_type_flag_skill |= 1;
                break;

            case SKILL_SLOT_TYPE.SUPPORT:
                visible_type_flag_skill |= 2;
                break;

            case SKILL_SLOT_TYPE.HEAL:
                visible_type_flag_skill |= 4;
                break;
            }
        }
        base.Initialize();
    }
Ejemplo n.º 22
0
    public void SendExceedSkill(SkillItemInfo base_skill, SkillItemInfo[] material, Action <SkillItemInfo, bool> call_back)
    {
        string        suid = base_skill.uniqueID.ToString();
        List <string> list = new List <string>();
        int           i    = 0;

        for (int num = material.Length; i < num; i++)
        {
            list.Add(material[i].uniqueID.ToString());
        }
        AlchemyExceedModel.RequestSendForm requestSendForm = new AlchemyExceedModel.RequestSendForm();
        requestSendForm.suid  = suid;
        requestSendForm.uuids = list;
        Protocol.Send(AlchemyExceedModel.URL, requestSendForm, delegate(AlchemyExceedModel ret)
        {
            SkillItemInfo skillItemInfo = null;
            bool arg = false;
            if (ret.Error == Error.None)
            {
                arg           = ret.result.greatSuccess;
                skillItemInfo = MonoBehaviourSingleton <InventoryManager> .I.skillItemInventory.Find(base_skill.uniqueID);
                if (skillItemInfo != null)
                {
                    GameSaveData.instance.RemoveNewIconAndSave(ITEM_ICON_TYPE.SKILL_ATTACK, skillItemInfo.uniqueID);
                }
                MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_SKILL_GROW);
            }
            call_back(skillItemInfo, arg);
        }, string.Empty);
    }
    public void OnDiff(BaseModelDiff.DiffEquipSetSlot diff)
    {
        bool flag  = false;
        bool flag2 = false;

        if (Utility.IsExist(diff.add))
        {
            int i = 0;
            for (int count = diff.add.Count; i < count; i++)
            {
                SkillItem.DiffEquipSetSlot diffEquipSetSlot = diff.add[i];
                skillItemInventory.Find(ulong.Parse(diffEquipSetSlot.uniqId))?.equipSetSkill.Add(new EquipSetSkillData(diffEquipSetSlot));
            }
            flag = true;
        }
        if (Utility.IsExist(diff.update))
        {
            int j = 0;
            for (int count2 = diff.update.Count; j < count2; j++)
            {
                SkillItem.DiffEquipSetSlot o = diff.update[j];
                if (GameSaveData.instance.RemoveNewIcon(ITEM_ICON_TYPE.SKILL_ATTACK, o.uniqId))
                {
                    flag2 = true;
                }
                SkillItemInfo skillItemInfo = skillItemInventory.Find(ulong.Parse(o.uniqId));
                if (skillItemInfo != null)
                {
                    EquipSetSkillData equipSetSkillData = skillItemInfo.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == o.setNo);
                    ulong             num = ulong.Parse(o.euid);
                    if (num == 0L)
                    {
                        if (equipSetSkillData != null)
                        {
                            skillItemInfo.equipSetSkill.Remove(equipSetSkillData);
                        }
                    }
                    else if (equipSetSkillData == null)
                    {
                        skillItemInfo.equipSetSkill.Add(new EquipSetSkillData(o));
                    }
                    else
                    {
                        equipSetSkillData.equipItemUniqId = num;
                        equipSetSkillData.equipSlotNo     = o.slotNo;
                    }
                }
            }
            flag = true;
        }
        if (flag2)
        {
            GameSaveData.Save();
        }
        if (flag)
        {
            MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_SKILL_INVENTORY);
        }
    }
    public override void Set(object[] data = null)
    {
        //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
        //IL_0131: Unknown result type (might be due to invalid IL or missing references)
        //IL_0166: Unknown result type (might be due to invalid IL or missing references)
        //IL_0198: Unknown result type (might be due to invalid IL or missing references)
        //IL_01be: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d5: Unknown result type (might be due to invalid IL or missing references)
        base.Set(null);
        if (infoRootAry[0] != null)
        {
            infoRootAry[0].SetActive(false);
            if (selectSP != null)
            {
                selectSP.set_enabled(false);
            }
        }
        SkillItemSortData skillItemSortData = data[0] as SkillItemSortData;

        SetupSelectNumberSprite((int)data[2]);
        ItemIconDetail.ICON_STATUS iCON_STATUS = (ItemIconDetail.ICON_STATUS)(int) data[3];
        SkillItemInfo skillItemInfo            = skillItemSortData.GetItemData() as SkillItemInfo;
        string        text = $"{skillItemSortData.GetLevel()}/{skillItemInfo.GetMaxLevel()}";

        if (skillItemInfo.IsExceeded())
        {
            text += UIUtility.GetColorText(StringTable.Format(STRING_CATEGORY.SMITH, 9u, skillItemInfo.exceedCnt), ExceedSkillItemTable.color);
        }
        infoRootAry[1].SetActive(true);
        infoRootAry[2].SetActive(false);
        SetName(skillItemSortData.GetName());
        SetVisibleBG(true);
        lblDescription.supportEncoding = true;
        lblDescription.text            = skillItemInfo.GetExplanationText(false);
        UILabel[] lABELS_LV_HEAD = LABELS_LV_HEAD;
        foreach (UILabel uILabel in lABELS_LV_HEAD)
        {
            uILabel.get_gameObject().SetActive(true);
        }
        UILabel[] lABELS_LV = LABELS_LV;
        foreach (UILabel uILabel2 in lABELS_LV)
        {
            uILabel2.get_gameObject().SetActive(true);
            uILabel2.supportEncoding = true;
            uILabel2.text            = text;
        }
        spEnableExceed.get_gameObject().SetActive(iCON_STATUS == ItemIconDetail.ICON_STATUS.VALID_EXCEED_0);
        bool flag = iCON_STATUS == ItemIconDetail.ICON_STATUS.VALID_EXCEED || iCON_STATUS == ItemIconDetail.ICON_STATUS.VALID_EXCEED_0;

        spriteBg[0].get_gameObject().SetActive(!flag);
        spriteBg[1].get_gameObject().SetActive(flag);
        if (iCON_STATUS == ItemIconDetail.ICON_STATUS.GRAYOUT)
        {
            infoRootAry[0].SetActive(true);
        }
        GrayOut(iCON_STATUS);
    }
Ejemplo n.º 25
0
    public void SendGrowSkill(SkillItemInfo base_skill, SkillItemInfo[] material, Action <SkillItemInfo, bool> call_back)
    {
        string        suid = base_skill.uniqueID.ToString();
        List <string> list = new List <string>();
        List <AlchemyGrowModel.RequestSendForm.MagiItem> list2 = new List <AlchemyGrowModel.RequestSendForm.MagiItem>();
        int i = 0;

        for (int num = material.Length; i < num; i++)
        {
            if (material[i].tableID >= 401900001 && material[i].tableID <= 401900005)
            {
                bool flag = false;
                int  j    = 0;
                for (int count = list2.Count; j < count; j++)
                {
                    if (list2[j].uiuid == material[i].uniqueID.ToString())
                    {
                        list2[j].num++;
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    list2.Add(new AlchemyGrowModel.RequestSendForm.MagiItem
                    {
                        uiuid = material[i].uniqueID.ToString(),
                        num   = 1
                    });
                }
            }
            else
            {
                list.Add(material[i].uniqueID.ToString());
            }
        }
        AlchemyGrowModel.RequestSendForm requestSendForm = new AlchemyGrowModel.RequestSendForm();
        requestSendForm.suid   = suid;
        requestSendForm.uuids  = list;
        requestSendForm.uiuids = list2;
        Protocol.Send(AlchemyGrowModel.URL, requestSendForm, delegate(AlchemyGrowModel ret)
        {
            SkillItemInfo skillItemInfo = null;
            bool arg = false;
            if (ret.Error == Error.None)
            {
                arg           = ret.result.greatSuccess;
                skillItemInfo = MonoBehaviourSingleton <InventoryManager> .I.skillItemInventory.Find(base_skill.uniqueID);
                if (skillItemInfo != null)
                {
                    GameSaveData.instance.RemoveNewIconAndSave(ITEM_ICON_TYPE.SKILL_ATTACK, skillItemInfo.uniqueID);
                }
                MonoBehaviourSingleton <GameSceneManager> .I.SetNotify(GameSection.NOTIFY_FLAG.UPDATE_SKILL_GROW);
            }
            call_back(skillItemInfo, arg);
        }, string.Empty);
    }
Ejemplo n.º 26
0
    public override void Initialize()
    {
        object[] array = GameSection.GetEventData() as object[];
        baseSkill = (array[0] as SkillItemInfo);
        SkillItemInfo[] array2 = array[1] as SkillItemInfo[];
        material = new SkillItemInfo[array2.Length];
        int i = 0;

        for (int num = array2.Length; i < num; i++)
        {
            material[i] = array2[i];
        }
        total          = (int)(baseSkill.growCost * (float)material.Length);
        isEquipConfirm = false;
        isRareConfirm  = false;
        int j = 0;

        for (int num2 = material.Length; j < num2; j++)
        {
            if (isRareConfirm && isEquipConfirm && isExceedConfirm)
            {
                break;
            }
            if (!isRareConfirm && GameDefine.IsRare(material[j].tableData.rarity))
            {
                isRareConfirm = true;
            }
            if (!isEquipConfirm && material[j].isAttached)
            {
                isEquipConfirm = true;
            }
            if (!isExceedConfirm && material[j].IsExceeded())
            {
                isExceedConfirm = true;
            }
        }
        Array.Sort(material, delegate(SkillItemInfo l, SkillItemInfo r)
        {
            ulong num3 = (ulong)(((long)r.tableData.rarity << 61) + (long)((ulong)(uint)(-1 - (int)r.tableData.id) << 16) + r.level);
            ulong num4 = (ulong)(((long)l.tableData.rarity << 61) + (long)((ulong)(uint)(-1 - (int)l.tableData.id) << 16) + l.level);
            int num5   = (num3 != num4) ? ((num3 > num4) ? 1 : (-1)) : 0;
            if (num5 == 0)
            {
                num5 = ((r.exp != l.exp) ? ((r.exp > l.exp) ? 1 : (-1)) : 0);
                if (num5 == 0)
                {
                    num5 = ((r.uniqueID != l.uniqueID) ? ((r.uniqueID > l.uniqueID) ? 1 : (-1)) : 0);
                }
            }
            return(num5);
        });
        isExceed = baseSkill.IsLevelMax();
        base.Initialize();
    }
    public SkillItemInfo[] GetSkillInventoryClone()
    {
        SkillItemInfo[] array = new SkillItemInfo[skillItemInventory.GetCount()];
        int             num   = 0;

        for (LinkedListNode <SkillItemInfo> linkedListNode = skillItemInventory.GetFirstNode(); linkedListNode != null; linkedListNode = linkedListNode.Next)
        {
            array[num++] = linkedListNode.Value;
        }
        return(array);
    }
Ejemplo n.º 28
0
    private void UpdateMaterial()
    {
        //IL_008f: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
        SetLabelText((Enum)UI.LBL_SELECT_NUM, (10 - materialSkillItem.Count).ToString());
        needGold = (int)(skillItem.growCost * (float)materialSkillItem.Count);
        SetLabelText((Enum)UI.LBL_GOLD, needGold.ToString("N0"));
        if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.money < needGold)
        {
            SetColor((Enum)UI.LBL_GOLD, Color.get_red());
        }
        else
        {
            SetColor((Enum)UI.LBL_GOLD, goldColor);
        }
        int           exp   = 0;
        SkillItemInfo data  = ParamCopy(skillItem, false);
        int           level = data.level;

        materialSkillItem.ForEach(delegate(SkillItemInfo material)
        {
            if (!data.IsLevelMax() && material.level <= material.GetMaxLevel())
            {
                exp      += material.giveExp;
                data.exp += material.giveExp;
                do
                {
                    if (data.expNext > data.exp)
                    {
                        return;
                    }
                    data = ParamCopy(data, true);
                }while (!data.IsLevelMax());
                data.exp = data.expPrev;
            }
        });
        itemData = data;
        base.UpdateUI();
        SetLabelText(detailBase, UI.LBL_LV_NOW, data.level.ToString());
        SetLabelText(detailBase, UI.LBL_LV_MAX, data.GetMaxLevel().ToString());
        SetActive(detailBase, UI.OBJ_LV_EX, data.IsExceeded());
        SetLabelText(detailBase, UI.LBL_LV_EX, data.exceedCnt.ToString());
        SetLabelText(detailBase, UI.LBL_ATK, data.atk.ToString());
        SetLabelText(detailBase, UI.LBL_DEF, data.def.ToString());
        SetLabelText(detailBase, UI.LBL_HP, data.hp.ToString());
        SetLabelText(detailBase, UI.LBL_SELL, needGold.ToString());
        SetLabelText(detailBase, UI.STR_SELL, base.sectionData.GetText("STR_SELL"));
        SkillGrowProgress component   = FindCtrl(detailBase, UI.PRG_EXP_BAR).GetComponent <SkillGrowProgress>();
        float             fill_amount = (float)(skillItem.exp - skillItem.expPrev) / (float)(skillItem.expNext - skillItem.expPrev);

        component.SetGrowMode();
        component.SetBaseGauge(data.level == level, fill_amount);
        UpdateAnchors();
    }
 protected override void EquipImg()
 {
     if (smithType != SmithType.SKILL_GROW)
     {
         EquipItemInfo equipItemInfo = resultData.itemData as EquipItemInfo;
         SetRenderEquipModel((Enum)UI.TEX_MODEL, equipItemInfo.tableID, -1, -1, 1f);
     }
     else
     {
         SkillItemInfo skillItemInfo = resultData.itemData as SkillItemInfo;
         SetRenderSkillItemModel((Enum)UI.TEX_MODEL, skillItemInfo.tableID, true, false);
     }
 }
    protected void OnQuery_SELL()
    {
        SkillItemInfo skillItemInfo = itemData as SkillItemInfo;

        if (skillItemInfo == null)
        {
            GameSection.StopEvent();
        }
        else
        {
            SellEvent(skillItemInfo);
        }
    }