Пример #1
0
    public void CreateDropInfoList(Coop_Model_EnemyDefeat model, out List <DropDeliveryInfo> deliveryList, out List <DropItemInfo> itemList)
    {
        itemList     = new List <DropItemInfo>();
        deliveryList = new List <DropDeliveryInfo>();
        int i = 0;

        for (int count = model.dropIds.Count; i < count; i++)
        {
            itemList.Add(new DropItemInfo((REWARD_TYPE)model.dropTypes[i], (uint)model.dropItemIds[i], model.dropNums[i]));
        }
        int mapId = MonoBehaviourSingleton <FieldManager> .I.GetMapId();

        Delivery[] deliveryList2 = MonoBehaviourSingleton <DeliveryManager> .I.GetDeliveryList(false);

        int j = 0;

        for (int num = deliveryList2.Length; j < num; j++)
        {
            DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)deliveryList2[j].dId);

            if (deliveryTableData != null)
            {
                int k = 0;
                for (int num2 = deliveryTableData.needs.Length; k < num2; k++)
                {
                    uint num3 = (uint)k;
                    if (deliveryTableData.IsNeedTarget(num3, (uint)model.eid, (uint)mapId) && (model.deliver & (1 << (int)deliveryTableData.GetRateType(num3))) > 0)
                    {
                        int have = 0;
                        int need = 0;
                        MonoBehaviourSingleton <DeliveryManager> .I.GetProgressDelivery(deliveryList2[j].dId, out have, out need, num3);

                        if (have < need)
                        {
                            int num4 = 1;
                            if ((model.boostBit & (1 << (int)deliveryTableData.GetRateType(num3))) > 0)
                            {
                                num4 += model.boostNum;
                            }
                            deliveryList.Add(new DropDeliveryInfo(deliveryList2[j].dId, (int)num3, deliveryTableData.name, deliveryTableData.GetNeedItemName(num3), num4, new List <DELIVERY_CONDITION_TYPE>
                            {
                                deliveryTableData.GetConditionType(0u),
                                deliveryTableData.GetConditionType(1u),
                                deliveryTableData.GetConditionType(2u),
                                deliveryTableData.GetConditionType(3u),
                                deliveryTableData.GetConditionType(4u)
                            }));
                        }
                    }
                }
            }
        }
    }
    private void OnQuery_SELECT_COMPLETED_RUSH()
    {
        int index = (int)GameSection.GetEventData();

        DeliveryTable.DeliveryData deliveryData = clearedDeliveries[index];
        if (deliveryData.GetConditionType(0u) == DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID)
        {
            int id = (int)deliveryData.id;
            DeliveryRewardList deliveryRewardList = new DeliveryRewardList();
            GameSection.SetEventData(new object[3]
            {
                id,
                deliveryRewardList,
                true
            });
        }
        else
        {
            ArenaTable.ArenaData arenaData = deliveryData.GetArenaData();
            MonoBehaviourSingleton <QuestManager> .I.SetCurrentQuestID((uint)arenaData.questIds[0], true);

            MonoBehaviourSingleton <QuestManager> .I.SetCurrentArenaId(arenaData.id);

            GameSection.ChangeEvent("TO_ROOM", deliveryData);
        }
    }
    private List <DeliveryTable.DeliveryData> CreateClearedDliveryList(ARENA_RANK borderRank)
    {
        List <DeliveryTable.DeliveryData> list = new List <DeliveryTable.DeliveryData>();
        List <ClearStatusDelivery>        clearStatusDelivery = MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery;
        int i = 0;

        for (int count = clearStatusDelivery.Count; i < count; i++)
        {
            ClearStatusDelivery d = clearStatusDelivery[i];
            if (d.deliveryStatus == 3)
            {
                DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)d.deliveryId);

                if (deliveryTableData.eventID == eventData.eventId && !Array.Exists(deliveryInfo, (Delivery x) => x.dId == d.deliveryId))
                {
                    ArenaTable.ArenaData arenaData = deliveryTableData.GetArenaData();
                    if (arenaData != null && arenaData.rank >= borderRank && deliveryTableData.GetConditionType(0u) != DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID)
                    {
                        list.Add(deliveryTableData);
                        if (deliveryTableData.clearEventID != 0)
                        {
                            string text = deliveryTableData.clearEventTitle;
                            if (string.IsNullOrEmpty(text))
                            {
                                text = deliveryTableData.name;
                            }
                            stories.Add(new Story((int)deliveryTableData.clearEventID, text));
                        }
                    }
                }
            }
        }
        return(list);
    }
    protected override void InitNormalDelivery(int index, Transform t)
    {
        SetEvent(t, "SELECT_RUSH", index);
        DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)visibleDeliveryList[index].dId);

        if (deliveryTableData.GetConditionType(0u) == DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID)
        {
            SetUpArenaListItemRankUp(t, deliveryTableData);
        }
        else
        {
            SetUpArenaListItem(t, deliveryTableData);
        }
    }
 protected override void InitCompletedDelivery(int completedIndex, Transform t)
 {
     DeliveryTable.DeliveryData deliveryData = clearedDeliveries[completedIndex];
     SetEvent(t, "SELECT_COMPLETED_RUSH", completedIndex);
     if (deliveryData.GetConditionType(0u) == DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID)
     {
         SetUpArenaListItemRankUp(t, deliveryData);
         SetActive(t, UI.OBJ_REQUEST_COMPLETED, true);
     }
     else
     {
         SetUpCompletedArenaListItem(t, deliveryData);
     }
     SetCompletedHaveCount(t, deliveryData);
 }
Пример #6
0
    private void CheckCompletableClearStatus(ClearStatusDelivery data)
    {
        if (MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(data.deliveryId))
        {
            DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)data.deliveryId);

            if (!deliveryTableData.IsStoryDelivery() && deliveryTableData.GetConditionType(0u) != 0 && !IsDefeatFieldConditionType(deliveryTableData.GetConditionType(0u)) && !IsDeliveryArena(deliveryTableData) && MonoBehaviourSingleton <UIAnnounceBand> .IsValid())
            {
                string empty = string.Empty;
                empty = ((!IsDeliveryBingo(deliveryTableData)) ? StringTable.Get(STRING_CATEGORY.DELIVERY_COMPLETE, 1u) : StringTable.Get(STRING_CATEGORY.DELIVERY_COMPLETE, 2u));
                MonoBehaviourSingleton <UIAnnounceBand> .I.SetAnnounce(deliveryTableData.name, empty);

                SoundManager.PlayOneshotJingle(40000030, null, null);
            }
            CheckAnnounceHomeReturn(data.deliveryId);
        }
    }
    private void OnQuery_SELECT_RUSH()
    {
        int  index = (int)GameSection.GetEventData();
        bool flag  = MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(visibleDeliveryList[index].dId);

        int delivery_id = visibleDeliveryList[index].dId;

        if (flag)
        {
            DeliveryTable.DeliveryData table = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)visibleDeliveryList[index].dId);

            changeToDeliveryClearEvent = true;
            bool is_tutorial        = !TutorialStep.HasFirstDeliveryCompleted();
            bool enable_clear_event = table.clearEventID != 0;
            GameSection.StayEvent();
            MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
            MonoBehaviourSingleton <DeliveryManager> .I.SendDeliveryComplete(visibleDeliveryList[index].uId, enable_clear_event, delegate(bool is_success, DeliveryRewardList recv_reward)
            {
                if (is_success)
                {
                    if (is_tutorial)
                    {
                        TutorialStep.isSendFirstRewardComplete = true;
                    }
                    if (!enable_clear_event)
                    {
                        MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
                        GameSection.ChangeStayEvent("RUSH_REWARD", new object[2]
                        {
                            delivery_id,
                            recv_reward
                        });
                    }
                    else
                    {
                        GameSection.ChangeStayEvent("CLEAR_EVENT", new object[3]
                        {
                            (int)table.clearEventID,
                            delivery_id,
                            recv_reward
                        });
                    }
                }
                else
                {
                    changeToDeliveryClearEvent = false;
                }
                GameSection.ResumeEvent(is_success, null);
            });
        }
        else
        {
            DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)delivery_id);

            if (deliveryTableData.GetConditionType(0u) == DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID)
            {
                GameSection.SetEventData(new object[2]
                {
                    delivery_id,
                    null
                });
            }
            else
            {
                ArenaTable.ArenaData arenaData = deliveryTableData.GetArenaData();
                MonoBehaviourSingleton <QuestManager> .I.SetCurrentQuestID((uint)arenaData.questIds[0], true);

                MonoBehaviourSingleton <QuestManager> .I.SetCurrentArenaId(arenaData.id);

                GameSection.ChangeEvent("TO_ROOM", deliveryTableData);
            }
        }
    }
    public override void UpdateUI()
    {
        //IL_0089: Unknown result type (might be due to invalid IL or missing references)
        //IL_0145: Unknown result type (might be due to invalid IL or missing references)
        //IL_014f: Unknown result type (might be due to invalid IL or missing references)
        //IL_01df: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e4: Expected O, but got Unknown
        //IL_05e2: Unknown result type (might be due to invalid IL or missing references)
        //IL_05ff: Unknown result type (might be due to invalid IL or missing references)
        //IL_07e0: Unknown result type (might be due to invalid IL or missing references)
        //IL_07ed: Unknown result type (might be due to invalid IL or missing references)
        OpenTutorial();
        UpdateTitle();
        SetSprite(baseRoot, UI.SPR_WINDOW, SPR_WINDOW_TYPE[info.DeliveryTypeIndex()]);
        SetSprite(baseRoot, UI.SPR_MESSAGE_BG, SPR_MESSAGE_BG_TYPE[info.DeliveryTypeIndex()]);
        bool flag = false;

        if (Object.op_Implicit(submissionFrame))
        {
            UpdateSubMissionButton();
            UpdateSubMission();
            flag = submissionFrame.get_gameObject().get_activeSelf();
            SetActive((Enum)UI.STR_BTN_SUBMISSION, !flag);
            SetActive((Enum)UI.STR_BTN_SUBMISSION_BACK, flag);
        }
        Transform root = targetFrame;

        MonoBehaviourSingleton <DeliveryManager> .I.GetTargetEnemyData(deliveryID, out targetQuestID, out targetMapID, out string map_name, out string enemy_name, out DIFFICULTY_TYPE?difficulty, out targetPortalID);

        SetLabelText(root, UI.LBL_PLACE_NAME, map_name);
        MonoBehaviourSingleton <DeliveryManager> .I.GetAllProgressDelivery(deliveryID, out int have, out int need);

        SetLabelText(root, UI.LBL_HAVE, (!isComplete) ? have.ToString() : need.ToString());
        SetColor(root, UI.LBL_HAVE, (!isComplete) ? Color.get_red() : Color.get_white());
        SetLabelText(root, UI.LBL_NEED, need.ToString());
        SetLabelText(root, UI.LBL_NEED_ITEM_NAME, MonoBehaviourSingleton <DeliveryManager> .I.GetTargetItemName(deliveryID, 0u));
        if (info.IsDefeatCondition(0u))
        {
            if (targetQuestID != 0)
            {
                isQuestEnemy = true;
                Transform val   = FindCtrl(root, UI.OBJ_DIFFICULTY_ROOT);
                int       value = (int)difficulty.Value;
                int       j     = 0;
                for (int childCount = val.get_childCount(); j < childCount; j++)
                {
                    Transform t2 = val.GetChild(j);
                    SetActive(t2, j <= value);
                }
                SetLabelText(root, UI.LBL_GET_PLACE, base.sectionData.GetText("GET_QUEST"));
            }
            else
            {
                isQuestEnemy = false;
                SetLabelText(root, UI.LBL_GET_PLACE, base.sectionData.GetText("GET_AREA"));
            }
            SetLabelText(root, UI.LBL_ENEMY_NAME, string.Format(StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 3u), enemy_name));
        }
        else
        {
            isQuestEnemy = false;
            SetLabelText(root, UI.LBL_GET_PLACE, StringTable.Get(STRING_CATEGORY.DELIVERY_CONDITION_PLACE, (uint)info.GetConditionType(0u)));
            SetLabelText(root, UI.LBL_ENEMY_NAME, enemy_name);
        }
        SetActive(root, UI.OBJ_DIFFICULTY_ROOT, isQuestEnemy);
        SetActive(root, UI.OBJ_ENEMY_NAME_ROOT, !isQuestEnemy);
        UpdateNPC(map_name, enemy_name);
        if ((isComplete || isNotice) && !isCompletedEventDelivery)
        {
            SetActive((Enum)UI.OBJ_BACK, false);
            SetActive((Enum)UI.BTN_CREATE, false);
            SetActive((Enum)UI.BTN_JOIN, false);
            SetActive((Enum)UI.BTN_MATCHING, false);
            UpdateUIJumpButton(JumpButtonType.Complete);
        }
        else
        {
            SetActive((Enum)UI.OBJ_BACK, true);
            bool flag2 = true;
            bool flag3 = false;
            if (info == null || info.IsDefeatCondition(0u) || targetMapID != 0)
            {
                if (isQuestEnemy)
                {
                    if (isInGameScene)
                    {
                        flag2 = false;
                    }
                }
                else
                {
                    bool flag4 = FieldManager.HasWorldMap(targetMapID);
                    if (isInGameScene)
                    {
                        if (MonoBehaviourSingleton <FieldManager> .I.currentMapID == targetMapID)
                        {
                            if (flag4)
                            {
                                flag3 = true;
                            }
                            else
                            {
                                flag2 = false;
                            }
                        }
                        else if (flag4)
                        {
                            if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID) || WorldMapManager.IsValidPortalIDs(targetPortalID))
                            {
                                flag3 = true;
                            }
                        }
                        else if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID))
                        {
                            flag2 = false;
                        }
                    }
                    else if (flag4)
                    {
                        if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID) || WorldMapManager.IsValidPortalIDs(targetPortalID))
                        {
                            flag3 = true;
                        }
                    }
                    else if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID))
                    {
                        flag2 = false;
                    }
                }
            }
            else
            {
                flag2 = (info.GetDeliveryJumpType() != DeliveryTable.DELIVERY_JUMPTYPE.UNDEFINED);
            }
            JumpButtonType jumpButtonType = JumpButtonType.Invalid;
            if (flag2)
            {
                if (info != null && info.GetDeliveryJumpType() != 0)
                {
                    jumpButtonType = ConvertDeliveryJumpType();
                }
                else
                {
                    if (info != null)
                    {
                        QuestTable.QuestTableData questData = info.GetQuestData();
                        if (questData != null && questData.questType == QUEST_TYPE.WAVE)
                        {
                            jumpButtonType = JumpButtonType.WaveRoom;
                        }
                    }
                    if (jumpButtonType != JumpButtonType.WaveRoom)
                    {
                        jumpButtonType = ((!flag3) ? JumpButtonType.Quest : JumpButtonType.Map);
                    }
                }
                UpdateUIJumpButton(jumpButtonType);
            }
            else
            {
                SetActive(baseRoot, UI.BTN_JUMP_QUEST, false);
                SetActive(baseRoot, UI.BTN_JUMP_MAP, false);
                SetActive(baseRoot, UI.BTN_JUMP_GACHATOP, false);
                SetActive(baseRoot, UI.BTN_JUMP_INVALID, false);
                SetActive(baseRoot, UI.BTN_WAVEMATCH_NEW, false);
                SetActive(baseRoot, UI.BTN_WAVEMATCH_PASS, false);
                SetActive(baseRoot, UI.BTN_WAVEMATCH_AUTO, false);
                SetActive(baseRoot, UI.BTN_COMPLETE, false);
            }
            if (flag3 && MonoBehaviourSingleton <FieldManager> .I.currentMapID != targetMapID)
            {
                SetColor(baseRoot, UI.LBL_PLACE_NAME, Color.get_red());
            }
            else
            {
                SetColor(baseRoot, UI.LBL_PLACE_NAME, Color.get_white());
            }
        }
        int money = 0;
        int exp   = 0;

        if (rewardData != null)
        {
            SetGrid(baseRoot, UI.GRD_REWARD, string.Empty, rewardData.Length, false, delegate(int i, Transform t, bool is_recycle)
            {
                DeliveryRewardTable.DeliveryRewardData.Reward reward = rewardData[i].reward;
                bool is_visible = false;
                if (reward.type == REWARD_TYPE.MONEY)
                {
                    money += reward.num;
                }
                else if (reward.type == REWARD_TYPE.EXP)
                {
                    exp += reward.num;
                }
                else
                {
                    is_visible        = true;
                    ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(reward.type, reward.item_id, t, reward.num, string.Empty, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_DETAIL);
                    SetMaterialInfo(itemIcon.transform, reward.type, reward.item_id, null);
                    itemIcon.SetRewardBG(true);
                }
                SetActive(t, is_visible);
            });
        }
        SetLabelText(baseRoot, UI.LBL_MONEY, money.ToString());
        SetLabelText(baseRoot, UI.LBL_EXP, exp.ToString());
        SetActive(baseRoot, UI.OBJ_COMPLETE_ROOT, isComplete && !flag);
        SetActive(baseRoot, UI.OBJ_UNLOCK_PORTAL_ROOT, isComplete);
        if (isComplete)
        {
            string text = string.Empty;
            List <FieldMapTable.PortalTableData> deliveryRelationPortalData = Singleton <FieldMapTable> .I.GetDeliveryRelationPortalData(info.id);

            switch (deliveryRelationPortalData.Count)
            {
            case 1:
            {
                FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData(deliveryRelationPortalData[0].srcMapID);

                if (fieldMapData != null)
                {
                    text = fieldMapData.mapName;
                }
                break;
            }

            default:
                text = base.sectionData.GetText("MULTI_UNLOCK");
                break;

            case 0:
                break;
            }
            bool flag5 = !string.IsNullOrEmpty(text);
            if (!TutorialStep.HasFirstDeliveryCompleted())
            {
                flag5 = false;
            }
            SetActive(baseRoot, UI.OBJ_UNLOCK_PORTAL_ROOT, flag5 && !isCompletedEventDelivery);
            SetLabelText(baseRoot, UI.LBL_UNLOCK_PORTAL, text);
            if (isCompletedEventDelivery)
            {
                SkipTween(baseRoot, UI.OBJ_COMPLETE_ROOT, true, 0);
            }
            else
            {
                this.StartCoroutine(StartTweenCoroutine(flag5));
            }
        }
        this.StartCoroutine(SetPointShopGetPointUI());
    }