Ejemplo n.º 1
0
    public void OnQuery_SELECT_DELIVERY()
    {
        DeliveryDataAndUId dataAndUId = (DeliveryDataAndUId)GameSection.GetEventData();

        DeliveryTable.DeliveryData data = dataAndUId.data;
        int  id = (int)dataAndUId.data.id;
        bool is_enough_material = MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(id);

        if (!is_enough_material)
        {
            GameSection.SetEventData(new object[4]
            {
                id,
                null,
                false,
                mapData
            });
        }
        else
        {
            bool flag  = FieldManager.IsValidInGame();
            bool flag2 = data.clearEventID != 0;
            if (flag)
            {
                if (data.IsInvalidClearIngame() || flag2)
                {
                    GameSection.ChangeEvent("DELIVERY_ITEM_COMPLETE", null);
                }
                else
                {
                    GameSection.StayEvent();
                    MonoBehaviourSingleton <CoopManager> .I.coopStage.fieldRewardPool.SendFieldDrop(delegate(bool b)
                    {
                        if (b)
                        {
                            SendDeliveryComplete(data, dataAndUId.uId, is_enough_material);
                        }
                    });
                }
            }
            else
            {
                GameSection.StayEvent();
                SendDeliveryComplete(data, dataAndUId.uId, is_enough_material);
            }
        }
    }
    public void OnQuery_SELECT_DELIVERY()
    {
        int  index = (int)GameSection.GetEventData();
        bool is_enough_material = MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(deliveryInfo[index].dId);

        int  delivery_id     = deliveryInfo[index].dId;
        bool is_happen_quest = false;

        DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)delivery_id);

        if (deliveryTableData != null)
        {
            QuestTable.QuestTableData questData = deliveryTableData.GetQuestData();
            if (questData != null && questData.questType == QUEST_TYPE.HAPPEN)
            {
                is_happen_quest = true;
            }
        }
        if (is_enough_material)
        {
            if (isInGameScene && deliveryTableData.IsInvalidClearIngame())
            {
                GameSection.ChangeEvent("DELIVERY_ITEM_COMPLETE", null);
            }
            else if (isInGameScene)
            {
                GameSection.StayEvent();
                MonoBehaviourSingleton <CoopManager> .I.coopStage.fieldRewardPool.SendFieldDrop(delegate(bool b)
                {
                    if (b)
                    {
                        SendDeliveryComplete(index, delivery_id, is_enough_material, is_happen_quest);
                        if (Singleton <FieldMapTable> .I.GetDeliveryRelationPortalData((uint)delivery_id) != null)
                        {
                            MonoBehaviourSingleton <DeliveryManager> .I.CheckAnnouncePortalOpen();
                        }
                    }
                });
            }
            else
            {
                GameSection.StayEvent();
                SendDeliveryComplete(index, delivery_id, is_enough_material, is_happen_quest);
            }
        }
        else if (is_happen_quest)
        {
            GameSection.ChangeEvent("SELECT_DELIVERY_HAPPEN", new object[2]
            {
                delivery_id,
                null
            });
        }
        else
        {
            GameSection.SetEventData(new object[2]
            {
                delivery_id,
                null
            });
        }
    }