示例#1
0
    public void Initialize(FieldMapPortalInfo portal_info)
    {
        portalInfo   = portal_info;
        portalData   = portalInfo.portalData;
        portalID     = portalData.portalID;
        isClearOrder = (FieldManager.IsOpenPortalClearOrder(portalData) || FieldManager.IsOpenPortal(portalData));
        if (GameSaveData.instance.isNewReleasePortal(portalID) && FieldManager.IsOpenPortal(portalData))
        {
            GameSaveData.instance.newReleasePortals.Remove(portalID);
        }
        isUnlockedTime = portal_info.portalData.isUnlockedTime();
        isToHardMap    = FieldManager.IsToHardPortal(portalData);
        nowPoint       = portal_info.GetNowPortalPoint();
        maxPoint       = (int)portal_info.GetMaxPortalPoint();
        isFull         = portal_info.IsFull();
        viewType       = VIEW_TYPE.NORMAL;
        if (!isClearOrder || !isUnlockedTime)
        {
            viewType = VIEW_TYPE.NOT_CLEAR_ORDER;
        }
        else if (portalData.dstMapID == 0)
        {
            viewType = VIEW_TYPE.TO_HOME;
        }
        else if (!MonoBehaviourSingleton <WorldMapManager> .I.IsTraveledPortal(portalData))
        {
            viewType = VIEW_TYPE.NOT_TRAVELED;
        }
        else if (isToHardMap)
        {
            viewType = VIEW_TYPE.TO_HARD_MAP;
        }
        if (portalData.dstQuestID != 0)
        {
            if (portalData.dstMapID != 0)
            {
                int num = 0;
                ClearStatusQuest clearStatusQuest = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.Find((ClearStatusQuest data) => data.questId == portalData.dstQuestID);

                if (clearStatusQuest != null)
                {
                    num = clearStatusQuest.questStatus;
                }
                if (num != 3 && num != 4)
                {
                    isLock  = true;
                    isQuest = true;
                }
            }
            else
            {
                isQuest = true;
            }
        }
        CreateView();
        if (MonoBehaviourSingleton <DropTargetMarkerManeger> .IsValid())
        {
            MonoBehaviourSingleton <DropTargetMarkerManeger> .I.CheckTarget(this);
        }
    }
    public bool AddPortalPointToPortalInfo(int addPoint)
    {
        FieldMapPortalInfo portalPointToPortalInfo = GetPortalPointToPortalInfo();

        if (portalPointToPortalInfo == null)
        {
            return(false);
        }
        return(AddPortalPointToPortalInfo(portalPointToPortalInfo, addPoint));
    }
示例#3
0
    public void UpdateView()
    {
        if (viewType == VIEW_TYPE.NOT_TRAVELED && !isFull)
        {
            float num = (float)nowPoint / (float)maxPoint;
            if (num > 1f)
            {
                num = 1f;
            }
            if (!isClearOrder)
            {
                num = 0f;
            }
            if (viewAnimator != null)
            {
                viewAnimator.set_speed(1f);
                viewAnimator.Play("ef_btl_warp_unuse_01", 0, num);
                viewAnimator.Update(0f);
                viewAnimator.set_speed(0f);
            }
            if (viewParticles != null)
            {
                bool flag = false;
                FieldMapPortalInfo portalPointToPortalInfo = MonoBehaviourSingleton <FieldManager> .I.GetPortalPointToPortalInfo();

                if (isClearOrder && (portalPointToPortalInfo == portalInfo || portalInfo.IsFull()))
                {
                    flag = true;
                }
                int i = 0;
                for (int num2 = viewParticles.Length; i < num2; i++)
                {
                    if (viewParticles[i] != null)
                    {
                        if (flag)
                        {
                            if (viewParticles[i].get_isStopped())
                            {
                                viewParticles[i].Play();
                            }
                        }
                        else if (!viewParticles[i].get_isStopped())
                        {
                            viewParticles[i].Stop();
                        }
                    }
                }
            }
        }
    }
 public void OnDiff(BaseModelDiff.DiffFieldPortal diff)
 {
     if (!QuestManager.IsValidExplore())
     {
         bool flag = false;
         if (Utility.IsExist(diff.add))
         {
             int i = 0;
             for (int count = diff.add.Count; i < count; i++)
             {
                 FieldMapPortalInfo fieldMapPortalInfo = current.fieldPortalInfoList.Find((FieldMapPortalInfo p) => p.IsValid() && p.portalData.portalID == diff.add[i].pId);
                 if (fieldMapPortalInfo != null)
                 {
                     fieldMapPortalInfo.fieldPortal = diff.add[i];
                     flag |= fieldMapPortalInfo.IsFull();
                 }
             }
         }
         if (Utility.IsExist(diff.update))
         {
             int j = 0;
             for (int count2 = diff.update.Count; j < count2; j++)
             {
                 FieldMapPortalInfo fieldMapPortalInfo2 = current.fieldPortalInfoList.Find((FieldMapPortalInfo p) => p.IsValid() && p.portalData.portalID == diff.update[j].pId);
                 if (fieldMapPortalInfo2 != null)
                 {
                     if (fieldMapPortalInfo2.fieldPortal != null)
                     {
                         fieldMapPortalInfo2.fieldPortal.used  = diff.update[j].used;
                         fieldMapPortalInfo2.fieldPortal.point = diff.update[j].point;
                     }
                     else
                     {
                         fieldMapPortalInfo2.fieldPortal = MonoBehaviourSingleton <WorldMapManager> .I.GetFieldPortal(diff.update[j].pId);
                     }
                     flag |= fieldMapPortalInfo2.IsFull();
                 }
             }
         }
         if (flag)
         {
             _ResetPortalPointToIndex(0);
         }
     }
 }
    public bool AddPortalPointToPortalInfo(FieldMapPortalInfo portalInfo, int addPoint)
    {
        FieldPortal fieldPortal = portalInfo.fieldPortal;

        if (fieldPortal == null)
        {
            fieldPortal = MonoBehaviourSingleton <WorldMapManager> .I.GetFieldPortal((int)portalInfo.portalData.portalID);

            if (fieldPortal == null)
            {
                fieldPortal       = new FieldPortal();
                fieldPortal.pId   = (int)portalInfo.portalData.portalID;
                fieldPortal.used  = false;
                fieldPortal.point = 0;
            }
            else if (QuestManager.IsValidExplore())
            {
                FieldPortal fieldPortal2 = new FieldPortal();
                fieldPortal2.pId   = fieldPortal.pId;
                fieldPortal2.used  = fieldPortal.used;
                fieldPortal2.point = fieldPortal.point;
                fieldPortal        = fieldPortal2;
            }
            portalInfo.fieldPortal = fieldPortal;
        }
        fieldPortal.point += addPoint;
        if (!portalInfo.IsFull())
        {
            return(false);
        }
        _ResetPortalPointToIndex(current.portalPointToIndex);
        if (QuestManager.IsValidExplore())
        {
            _ResetPortalPointToIndex(0);
        }
        return(true);
    }
示例#6
0
    public static PortalObject Create(FieldMapPortalInfo portal_info, Transform parent)
    {
        //IL_003f: Unknown result type (might be due to invalid IL or missing references)
        //IL_004a: Unknown result type (might be due to invalid IL or missing references)
        if (portal_info == null)
        {
            return(null);
        }
        if (portal_info.portalData == null)
        {
            return(null);
        }
        Transform val = Utility.CreateGameObject("PortalObject", parent, 19);

        val.set_position(new Vector3(portal_info.portalData.srcX, 0f, portal_info.portalData.srcZ));
        PortalObject portalObject = val.get_gameObject().AddComponent <PortalObject>();

        if (portalObject == null)
        {
            return(null);
        }
        portalObject.Initialize(portal_info);
        return(portalObject);
    }
示例#7
0
    private void OnTriggerEnter(Collider collider)
    {
        //IL_0001: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
        //IL_01ec: Expected O, but got Unknown
        //IL_023e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0274: Expected O, but got Unknown
        //IL_0298: Unknown result type (might be due to invalid IL or missing references)
        //IL_02a5: Expected O, but got Unknown
        //IL_02fd: Unknown result type (might be due to invalid IL or missing references)
        //IL_030a: Expected O, but got Unknown
        //IL_0349: Unknown result type (might be due to invalid IL or missing references)
        //IL_0356: Expected O, but got Unknown
        //IL_0386: Unknown result type (might be due to invalid IL or missing references)
        //IL_0393: Expected O, but got Unknown
        //IL_03f3: Unknown result type (might be due to invalid IL or missing references)
        //IL_0400: Expected O, but got Unknown
        if (collider.get_gameObject().GetComponent <Self>() == null)
        {
            return;
        }
        if (!MonoBehaviourSingleton <InGameProgress> .I.isBattleStart)
        {
            return;
        }
        if (MonoBehaviourSingleton <InGameProgress> .I.progressEndType != 0)
        {
            return;
        }
        if (MonoBehaviourSingleton <InGameProgress> .I.isHappenQuestDirection)
        {
            return;
        }
        if (MonoBehaviourSingleton <StageObjectManager> .I.self == null)
        {
            return;
        }
        if (MonoBehaviourSingleton <StageObjectManager> .I.self.isDead)
        {
            return;
        }
        if (isClearOrder && isUnlockedTime)
        {
            if (!isFull)
            {
                FieldMapPortalInfo portalPointToPortalInfo = MonoBehaviourSingleton <FieldManager> .I.GetPortalPointToPortalInfo();

                if (portalPointToPortalInfo == portalInfo || portalInfo.IsFull())
                {
                    if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible())
                    {
                        MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_NOT_FULL", new object[2]
                        {
                            nowPoint.ToString(),
                            maxPoint.ToString()
                        }, null, true);
                    }
                }
                else if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible())
                {
                    MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_NOT_ACTIVE", null, null, true);
                }
            }
            else
            {
                MonoBehaviourSingleton <InGameProgress> .I.checkPortalObject = this;
                if (isQuest)
                {
                    if (isLock)
                    {
                        if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible() && MonoBehaviourSingleton <GameSceneManager> .I.CheckPortalAndOpenUpdateAppDialog(portalData, true, true))
                        {
                            MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_QUEST_LOCK", null, null, true);
                        }
                    }
                    else if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible() && MonoBehaviourSingleton <GameSceneManager> .I.CheckQuestAndOpenUpdateAppDialog(portalData.dstQuestID, true))
                    {
                        MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_QUEST", null, null, true);
                    }
                }
                else if (viewType == VIEW_TYPE.TO_HOME)
                {
                    if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible())
                    {
                        MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_HOME", null, null, true);
                    }
                }
                else if (MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible())
                {
                    if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep == 0)
                    {
                        MonoBehaviourSingleton <GoWrapManager> .I.trackTutorialStep(TRACK_TUTORIAL_STEP_BIT.tutorial_guide_movement4, "Tutorial");
                    }
                    if (MonoBehaviourSingleton <GameSceneManager> .I.CheckPortalAndOpenUpdateAppDialog(portalData, false, true))
                    {
                        MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_NEXT", null, null, true);
                    }
                }
            }
            return;
        }
        string text = portalData.notAppearText;

        if (portalData.appearQuestId != 0 && string.IsNullOrEmpty(text) && !MonoBehaviourSingleton <QuestManager> .I.IsClearQuest(portalData.appearQuestId))
        {
            QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData(portalData.appearQuestId);

            text = StringTable.Format(STRING_CATEGORY.IN_GAME, 7000u, questData.questText);
        }
        if (portalData.appearDeliveryId != 0 && string.IsNullOrEmpty(text) && !MonoBehaviourSingleton <DeliveryManager> .I.IsClearDelivery(portalData.appearDeliveryId))
        {
            DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData(portalData.appearDeliveryId);

            text = StringTable.Format(STRING_CATEGORY.IN_GAME, 7001u, deliveryTableData.name);
        }
        if (portalData.travelMapId != 0 && string.IsNullOrEmpty(text) && MonoBehaviourSingleton <WorldMapManager> .I.IsTraveledMap((int)portalData.travelMapId))
        {
            goto IL_0198;
        }
        goto IL_0198;
IL_0198:
        if (!isUnlockedTime)
        {
            text = StringTable.Get(STRING_CATEGORY.IN_GAME, NOT_UNLOCKED_TIME);
        }
        if (!string.IsNullOrEmpty(text) && MonoBehaviourSingleton <GameSceneManager> .I.IsEventExecutionPossible())
        {
            MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("PortalObject.OnTriggerEnter", this.get_gameObject(), "PORTAL_NOT_APPEAR", new object[1]
            {
                text
            }, null, true);
        }
    }