Example #1
0
    public static int GetNumReadyShipments()
    {
        int         num        = 0;
        IEnumerator enumerator = PersistentShipmentData.shipmentDictionary.Values.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                JamCharacterShipment jamCharacterShipment = (JamCharacterShipment)obj;
                if (PersistentShipmentData.ShipmentTypeForShipmentIsAvailable(jamCharacterShipment.ShipmentRecID))
                {
                    long num2 = GarrisonStatus.CurrentTime() - (long)jamCharacterShipment.CreationTime;
                    long num3 = (long)jamCharacterShipment.ShipmentDuration - num2;
                    if (num3 <= 0L)
                    {
                        num++;
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        return(num);
    }
    public static int GetNumReadyShipments()
    {
        int         num        = 0;
        IEnumerator enumerator = PersistentShipmentData.shipmentDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                JamCharacterShipment jamCharacterShipment = (JamCharacterShipment)enumerator.get_Current();
                long num2 = GarrisonStatus.CurrentTime() - (long)jamCharacterShipment.CreationTime;
                long num3 = (long)jamCharacterShipment.ShipmentDuration - num2;
                if (num3 <= 0L)
                {
                    num++;
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        return(num);
    }
Example #3
0
 private void Update()
 {
     this.m_currentVisibleZone = null;
     if (this.m_currentMapMission > 0)
     {
         this.m_secondsMissionHasBeenSelected += Time.deltaTime;
     }
     if (this.m_invasionNotification.gameObject.activeSelf)
     {
         long num = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime();
         num = ((num <= 0L) ? 0L : num);
         if (num > 0L)
         {
             this.m_invasionTimeRemainingDuration.FormatDurationString((int)num, false);
             this.m_invasionTimeRemaining.text = this.m_invasionTimeRemainingDuration.DurationString;
         }
         else
         {
             this.m_invasionNotification.gameObject.SetActive(false);
             if (this.m_mapInfo_BrokenIsles.gameObject.activeSelf)
             {
                 this.SetMapViewSize_BrokenIsles();
             }
             else
             {
                 this.SetMapViewSize_Argus();
             }
             Main.instance.RequestWorldQuests();
         }
     }
 }
Example #4
0
    public void CompleteAllMissions()
    {
        Debug.Log("Main.CompleteAllMissions()");
        IEnumerator enumerator = PersistentMissionData.missionDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)enumerator.get_Current();
                GarrMissionRec           record = StaticDB.garrMissionDB.GetRecord(jamGarrisonMobileMission.MissionRecID);
                if (record.GarrFollowerTypeID == 4u)
                {
                    if (jamGarrisonMobileMission.MissionState == 1)
                    {
                        long num  = GarrisonStatus.CurrentTime() - jamGarrisonMobileMission.StartTime;
                        long num2 = jamGarrisonMobileMission.MissionDuration - num;
                        if (num2 <= 0L)
                        {
                            this.CompleteMission(jamGarrisonMobileMission.MissionRecID);
                        }
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
    }
Example #5
0
    private void Update()
    {
        if (!this.m_onMission)
        {
            return;
        }
        if (this.m_isCombatAlly)
        {
            return;
        }
        long num  = GarrisonStatus.CurrentTime() - this.m_missionStartedTime;
        long num2 = this.m_missionDurationInSeconds - num;

        num2 = ((num2 <= 0L) ? 0L : num2);
        if (num2 > 0L)
        {
            this.m_missionTimeRemaining.FormatDurationString((int)num2, false);
            this.m_statusTextSB.Length = 0;
            this.m_statusTextSB.ConcatFormat("{0} {1} - {2} - {3}", FollowerListItem.m_iLvlString, this.m_itemLevel, FollowerListItem.m_onMissionString, this.m_missionTimeRemaining.DurationString);
            this.m_statusText.text = this.m_statusTextSB.ToString();
        }
        else
        {
            this.m_statusTextSB.Length = 0;
            this.m_statusTextSB.ConcatFormat("{0} {1} - {2} - {3}", FollowerListItem.m_iLvlString, this.m_itemLevel, FollowerListItem.m_onMissionString, FollowerListItem.m_missionCompleteString);
            this.m_statusText.text = this.m_statusTextSB.ToString();
        }
    }
Example #6
0
    private void HandleInvasionPOIChanged()
    {
        JamMobileAreaPOI currentInvasionPOI = LegionfallData.GetCurrentInvasionPOI();

        if (currentInvasionPOI == null)
        {
            this.m_invasionNotification.gameObject.SetActive(false);
        }
        else
        {
            this.m_invasionNotification.gameObject.SetActive(true);
            this.m_invasionTitle.text = currentInvasionPOI.Description;
            long num = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime();
            num = ((num <= 0L) ? 0L : num);
            this.m_invasionTimeRemainingDuration.FormatDurationString((int)num, false);
            this.m_invasionTimeRemaining.text = this.m_invasionTimeRemainingDuration.DurationString;
        }
        if (this.m_mapInfo_BrokenIsles.gameObject.activeSelf)
        {
            this.SetMapViewSize_BrokenIsles();
        }
        else
        {
            this.SetMapViewSize_Argus();
        }
    }
    public static int GetNumCompletedMissions()
    {
        int         num        = 0;
        IEnumerator enumerator = PersistentMissionData.missionDictionary.get_Values().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)enumerator.get_Current();
                GarrMissionRec           record = StaticDB.garrMissionDB.GetRecord(jamGarrisonMobileMission.MissionRecID);
                if (record != null)
                {
                    if (record.GarrFollowerTypeID == 4u)
                    {
                        long num2 = GarrisonStatus.CurrentTime() - jamGarrisonMobileMission.StartTime;
                        long num3 = jamGarrisonMobileMission.MissionDuration - num2;
                        if ((jamGarrisonMobileMission.MissionState == 1 && num3 <= 0L) || jamGarrisonMobileMission.MissionState == 2 || jamGarrisonMobileMission.MissionState == 3)
                        {
                            num++;
                        }
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        return(num);
    }
Example #8
0
 private void Update()
 {
     if (this.m_training)
     {
         long  num        = GarrisonStatus.CurrentTime() - (long)this.m_shipmentCreationTime;
         float fillAmount = Mathf.Clamp((float)num / (float)this.m_shipmentDuration, 0f, 1f);
         this.m_troopBuildProgressRing.set_fillAmount(fillAmount);
         this.m_troopBuildProgressFill.set_fillAmount(fillAmount);
         long num2 = (long)this.m_shipmentDuration - num;
         if (num2 < 0L)
         {
             num2 = 0L;
         }
         if (num2 > 0L)
         {
             Duration duration = new Duration((int)num2);
             this.m_timeRemainingText.set_text(duration.DurationString);
         }
         else if (this.m_glowLoopHandle == null)
         {
             this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", base.get_transform(), Vector3.get_zero(), 3f, 0f);
             this.m_timeRemainingText.set_text(StaticDB.GetString("COLLECT", null));
             Main.instance.m_UISound.Play_TroopsReadyToast();
         }
     }
 }
    private void InitMissionList()
    {
        RectTransform[] componentsInChildren = this.missionListViewContents.GetComponentsInChildren <RectTransform>(true);
        for (int i = 0; i < componentsInChildren.Length; i++)
        {
            if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionListViewContents.get_transform())
            {
                Object.DestroyImmediate(componentsInChildren[i].get_gameObject());
            }
        }
        List <JamGarrisonMobileMission> list = Enumerable.ToList <JamGarrisonMobileMission>(Enumerable.OfType <JamGarrisonMobileMission>(PersistentMissionData.missionDictionary.get_Values()));

        if (this.isInProgressMissionList)
        {
            list.Sort(new MissionListView.MissionTimeComparer());
        }
        else
        {
            list.Sort(new MissionListView.MissionLevelComparer());
        }
        using (List <JamGarrisonMobileMission> .Enumerator enumerator = list.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                JamGarrisonMobileMission current = enumerator.get_Current();
                GarrMissionRec           record  = StaticDB.garrMissionDB.GetRecord(current.MissionRecID);
                if (record != null)
                {
                    if (record.GarrFollowerTypeID == 4u)
                    {
                        if (this.isInProgressMissionList)
                        {
                            if (current.MissionState == 0)
                            {
                                continue;
                            }
                            if (current.MissionState == 1)
                            {
                                long num  = GarrisonStatus.CurrentTime() - current.StartTime;
                                long num2 = current.MissionDuration - num;
                                if (num2 <= 0L)
                                {
                                    continue;
                                }
                            }
                        }
                        if (this.isInProgressMissionList || current.MissionState == 0)
                        {
                            GameObject gameObject = Object.Instantiate <GameObject>(this.missionListItemPrefab);
                            gameObject.get_transform().SetParent(this.missionListViewContents.get_transform(), false);
                            MissionListItem component = gameObject.GetComponent <MissionListItem>();
                            component.Init(record.ID);
                        }
                    }
                }
            }
        }
    }
        public int Compare(JamGarrisonMobileMission m1, JamGarrisonMobileMission m2)
        {
            long num  = GarrisonStatus.CurrentTime() - m1.StartTime;
            long num2 = m1.MissionDuration - num;
            long num3 = GarrisonStatus.CurrentTime() - m2.StartTime;
            long num4 = m2.MissionDuration - num3;

            return((int)(num2 - num4));
        }
    private void UpdateTimeRemaining()
    {
        long num = (long)this.m_bounty.EndTime - GarrisonStatus.CurrentTime();

        num = ((num <= 0L) ? 0L : num);
        Duration duration = new Duration((int)num, false);

        this.m_timeLeft.set_text(StaticDB.GetString("TIME_LEFT", "Time Left: PH") + " " + duration.DurationString);
    }
    private void InitMissionList()
    {
        RectTransform[] componentsInChildren = this.missionListViewContents.GetComponentsInChildren <RectTransform>(true);
        for (int i = 0; i < componentsInChildren.Length; i++)
        {
            if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionListViewContents.transform)
            {
                Object.DestroyImmediate(componentsInChildren[i].gameObject);
            }
        }
        List <JamGarrisonMobileMission> list = PersistentMissionData.missionDictionary.Values.OfType <JamGarrisonMobileMission>().ToList <JamGarrisonMobileMission>();

        if (this.isInProgressMissionList)
        {
            list.Sort(new MissionListView.MissionTimeComparer());
        }
        else
        {
            list.Sort(new MissionListView.MissionLevelComparer());
        }
        foreach (JamGarrisonMobileMission jamGarrisonMobileMission in list)
        {
            GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(jamGarrisonMobileMission.MissionRecID);
            if (record != null)
            {
                if (record.GarrFollowerTypeID == 4u)
                {
                    if (this.isInProgressMissionList)
                    {
                        if (jamGarrisonMobileMission.MissionState == 0)
                        {
                            continue;
                        }
                        if (jamGarrisonMobileMission.MissionState == 1)
                        {
                            long num  = GarrisonStatus.CurrentTime() - jamGarrisonMobileMission.StartTime;
                            long num2 = jamGarrisonMobileMission.MissionDuration - num;
                            if (num2 <= 0L)
                            {
                                continue;
                            }
                        }
                    }
                    if (this.isInProgressMissionList || jamGarrisonMobileMission.MissionState == 0)
                    {
                        GameObject gameObject = Object.Instantiate <GameObject>(this.missionListItemPrefab);
                        gameObject.transform.SetParent(this.missionListViewContents.transform, false);
                        MissionListItem component = gameObject.GetComponent <MissionListItem>();
                        component.Init(record.ID);
                    }
                }
            }
        }
    }
Example #13
0
    private void Update()
    {
        long num    = this.m_endTime - GarrisonStatus.CurrentTime();
        bool active = num < 4500L;

        this.m_expiringSoon.get_gameObject().SetActive(active);
        if (num <= 0L)
        {
            Object.DestroyImmediate(base.get_gameObject());
            return;
        }
    }
 private void Update()
 {
     if (this.m_invasionZoneNameArea.activeSelf)
     {
         long num = LegionfallData.GetCurrentInvasionExpirationTime() - GarrisonStatus.CurrentTime();
         num = ((num <= 0L) ? 0L : num);
         if (num <= 0L)
         {
             this.m_invasionZoneNameArea.SetActive(false);
             this.m_zoneNameArea.SetActive(this.zoneNameTag.Length > 0);
         }
     }
 }
Example #15
0
    private void Update()
    {
        if (!this.missionTimeRemainingText.get_gameObject().get_activeSelf())
        {
            return;
        }
        long num  = GarrisonStatus.CurrentTime() - this.missionStartedTime;
        long num2 = (long)this.missionDurationInSeconds - num;

        num2 = ((num2 <= 0L) ? 0L : num2);
        Duration duration = new Duration((int)num2, false);

        this.missionTimeRemainingText.set_text(duration.DurationString + " <color=#ff0000ff>(In Progress)</color>");
    }
    private void UpdateTimeRemaining()
    {
        int num = (int)(this.m_endTime - GarrisonStatus.CurrentTime());

        if (num < 0)
        {
            num = 0;
        }
        Duration duration = new Duration(num);

        this.m_worldQuestTimeText.set_text(this.m_timeLeftString + " " + duration.DurationString);
        bool active = num < 4500;

        this.m_expiringSoon.get_gameObject().SetActive(active);
    }
Example #17
0
    private void Update()
    {
        IEnumerator enumerator = PersistentMissionData.missionDictionary.Values.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)obj;
                bool           flag   = false;
                GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(jamGarrisonMobileMission.MissionRecID);
                if (record != null)
                {
                    if (record.GarrFollowerTypeID == 4u)
                    {
                        if (jamGarrisonMobileMission.MissionState == 1)
                        {
                            long num  = GarrisonStatus.CurrentTime() - jamGarrisonMobileMission.StartTime;
                            long num2 = jamGarrisonMobileMission.MissionDuration - num;
                            if (num2 <= 0L)
                            {
                                flag = true;
                            }
                        }
                        if (jamGarrisonMobileMission.MissionState == 2)
                        {
                            flag = true;
                        }
                        if (flag)
                        {
                        }
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
    }
 private void Update()
 {
     if (this.m_mission.MissionState == 1)
     {
         long num  = GarrisonStatus.CurrentTime() - this.m_mission.StartTime;
         long num2 = this.m_mission.MissionDuration - num;
         num2 = ((num2 <= 0L) ? 0L : num2);
         Duration duration = new Duration((int)num2);
         if (num2 > 0L)
         {
             this.m_statusText.set_text(duration.DurationString + " <color=#ff0000ff>(" + StaticDB.GetString("IN_PROGRESS", null) + ")</color>");
         }
         else
         {
             this.m_statusText.set_text("<color=#00ff00ff>(" + StaticDB.GetString("TAP_TO_COMPLETE", null) + ")</color>");
         }
     }
 }
Example #19
0
    public void OnCollectTroop()
    {
        long num  = GarrisonStatus.CurrentTime() - (long)this.m_shipmentCreationTime;
        long num2 = (long)this.m_shipmentDuration - num;

        if (num2 > 0L)
        {
            return;
        }
        if (this.m_shipmentDBID != 0uL && !this.m_collected)
        {
            this.m_collected = true;
            UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.get_transform(), Vector3.get_zero(), 2f, 0f);
            Main.instance.m_UISound.Play_CollectTroop();
            MobilePlayerCompleteShipment mobilePlayerCompleteShipment = new MobilePlayerCompleteShipment();
            mobilePlayerCompleteShipment.ShipmentID = this.m_shipmentDBID;
            Login.instance.SendToMobileServer(mobilePlayerCompleteShipment);
        }
    }
Example #20
0
    private void Update()
    {
        if (!this.m_onMission)
        {
            return;
        }
        if (this.m_isCombatAlly)
        {
            return;
        }
        long num  = GarrisonStatus.CurrentTime() - this.m_missionStartedTime;
        long num2 = this.m_missionDurationInSeconds - num;

        num2 = ((num2 <= 0L) ? 0L : num2);
        if (num2 > 0L)
        {
            Duration duration = new Duration((int)num2);
            this.m_statusText.set_text(string.Concat(new object[]
            {
                FollowerListItem.m_iLvlString,
                " ",
                this.m_itemLevel,
                " - ",
                FollowerListItem.m_onMissionString,
                " - ",
                duration.DurationString
            }));
        }
        else
        {
            this.m_statusText.set_text(string.Concat(new object[]
            {
                FollowerListItem.m_iLvlString,
                " ",
                this.m_itemLevel,
                " - ",
                FollowerListItem.m_onMissionString,
                " - ",
                FollowerListItem.m_missionCompleteString
            }));
        }
    }
Example #21
0
    private void UpdateMissionRemainingTimeDisplay()
    {
        if (!this.m_inProgressMissionGroup.get_gameObject().get_activeSelf())
        {
            return;
        }
        if (this.m_missionSiteGroup != null && this.m_missionSiteGroup.get_alpha() < 0.1f)
        {
            return;
        }
        long num  = GarrisonStatus.CurrentTime() - this.m_missionStartedTime;
        long num2 = (long)this.m_missionDurationInSeconds - num;

        num2 = ((num2 <= 0L) ? 0L : num2);
        if (!this.m_isSupportMission)
        {
            Duration duration = new Duration((int)num2);
            this.m_missionTimeRemainingText.set_text(duration.DurationString);
        }
        if (num2 == 0L)
        {
            if (this.m_isSupportMission)
            {
                if (!this.m_autoCompletedSupportMission)
                {
                    if (AdventureMapPanel.instance.ShowMissionResultAction != null)
                    {
                        AdventureMapPanel.instance.ShowMissionResultAction.Invoke(this.m_garrMissionID, 1, false);
                    }
                    Main.instance.CompleteMission(this.m_garrMissionID);
                    this.m_autoCompletedSupportMission = true;
                }
            }
            else
            {
                this.m_availableMissionGroup.get_gameObject().SetActive(false);
                this.m_inProgressMissionGroup.get_gameObject().SetActive(false);
                this.m_completeMissionGroup.get_gameObject().SetActive(true);
            }
        }
    }
    private void Update()
    {
        long num    = this.m_endTime - GarrisonStatus.CurrentTime();
        bool active = num < 4500L;

        this.m_expiringSoon.gameObject.SetActive(active);
        if (num <= 0L)
        {
            StackableMapIcon component  = base.gameObject.GetComponent <StackableMapIcon>();
            GameObject       gameObject = base.gameObject;
            if (component != null)
            {
                component.RemoveFromContainer();
            }
            if (gameObject != null)
            {
                Object.DestroyImmediate(gameObject);
                return;
            }
        }
    }
Example #23
0
    public static int GetNumCompletedMissions(bool skipSupportMissions = false)
    {
        int         num        = 0;
        IEnumerator enumerator = PersistentMissionData.missionDictionary.Values.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object obj = enumerator.Current;
                JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)obj;
                GarrMissionRec           record = StaticDB.garrMissionDB.GetRecord(jamGarrisonMobileMission.MissionRecID);
                if (record != null)
                {
                    if (record.GarrFollowerTypeID == 4u)
                    {
                        if (!skipSupportMissions || (record.Flags & 16u) == 0u)
                        {
                            long num2 = GarrisonStatus.CurrentTime() - jamGarrisonMobileMission.StartTime;
                            long num3 = jamGarrisonMobileMission.MissionDuration - num2;
                            if ((jamGarrisonMobileMission.MissionState == 1 && num3 <= 0L) || jamGarrisonMobileMission.MissionState == 2 || jamGarrisonMobileMission.MissionState == 3)
                            {
                                num++;
                            }
                        }
                    }
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        return(num);
    }
Example #24
0
 public void ZoomToNextCompleteMission()
 {
     AllPanels.instance.m_orderHallMultiPanel.m_miniMissionListPanel.InitMissionList();
     MiniMissionListItem[] componentsInChildren = AllPanels.instance.m_orderHallMultiPanel.m_miniMissionListPanel.m_inProgressMission_listContents.GetComponentsInChildren <MiniMissionListItem>(true);
     foreach (MiniMissionListItem miniMissionListItem in componentsInChildren)
     {
         JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)PersistentMissionData.missionDictionary[miniMissionListItem.GetMissionID()];
         if (jamGarrisonMobileMission != null)
         {
             if (jamGarrisonMobileMission.MissionState == 1)
             {
                 long num  = GarrisonStatus.CurrentTime() - jamGarrisonMobileMission.StartTime;
                 long num2 = jamGarrisonMobileMission.MissionDuration - num;
                 if (num2 <= 0L)
                 {
                     AdventureMapPanel.instance.ShowMissionResultAction(jamGarrisonMobileMission.MissionRecID, 0, false);
                     break;
                 }
             }
         }
     }
 }
    private void Update()
    {
        if (this.m_mission.MissionState == 1)
        {
            long num  = GarrisonStatus.CurrentTime() - this.m_mission.StartTime;
            long num2 = this.m_mission.MissionDuration - num;
            num2 = ((num2 <= 0L) ? 0L : num2);
            Duration duration = new Duration((int)num2, false);
            if (num2 > 0L)
            {
                this.m_statusText.set_text(duration.DurationString + " <color=#ff0000ff>(" + StaticDB.GetString("IN_PROGRESS", null) + ")</color>");
            }
            else
            {
                this.m_statusText.set_text("<color=#00ff00ff>(" + StaticDB.GetString("TAP_TO_COMPLETE", null) + ")</color>");
            }
        }
        long num3 = GarrisonStatus.CurrentTime() - this.m_mission.OfferTime;
        long num4 = this.m_mission.OfferDuration - num3;

        num4 = ((num4 <= 0L) ? 0L : num4);
        if (num4 > 0L)
        {
            if (this.m_expirationText.get_gameObject().get_activeSelf())
            {
                this.m_missionOfferTimeRemaining.FormatDurationString((int)num4, false);
                this.m_missionOfferTimeSB.set_Length(0);
                this.m_missionOfferTimeSB.ConcatFormat("{0}", this.m_missionOfferTimeRemaining.DurationString);
                this.m_expirationText.set_text(this.m_missionOfferTimeSB.ToString());
            }
        }
        else if (this.m_mission.MissionState == 0 && this.m_mission.OfferDuration > 0L)
        {
            AdventureMapPanel.instance.SelectMissionFromList(0);
            AllPopups.instance.m_missionDialog.m_missionDetailView.get_gameObject().SetActive(false);
            Object.DestroyImmediate(base.get_gameObject());
            return;
        }
    }
Example #26
0
    private void UpdateMissionRemainingTimeDisplay()
    {
        if (!this.m_missionInProgressMessage.get_activeSelf())
        {
            return;
        }
        long num  = GarrisonStatus.CurrentTime() - this.m_missionStartedTime;
        long num2 = this.m_missionDurationInSeconds - num;
        bool flag = num2 < 0L && this.m_popupView.get_gameObject().get_activeSelf();

        num2 = ((num2 <= 0L) ? 0L : num2);
        Duration duration = new Duration((int)num2);

        this.m_missionTimeRemainingText.set_text(duration.DurationString);
        if (flag && !this.m_attemptedAutoComplete)
        {
            if (AdventureMapPanel.instance.ShowMissionResultAction != null)
            {
                AdventureMapPanel.instance.ShowMissionResultAction.Invoke(this.m_garrMissionID, 1, false);
            }
            Main.instance.CompleteMission(this.m_garrMissionID);
            this.m_attemptedAutoComplete = true;
        }
    }
Example #27
0
 public long GetRemainingRespecTime()
 {
     return((long)this.m_garrTalentRec.RespecDurationSecs - (GarrisonStatus.CurrentTime() - (long)this.m_talent.StartTime));
 }
Example #28
0
    public void Init(int missionRecID)
    {
        this.garrMissionID = missionRecID;
        GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(this.garrMissionID);

        if (record == null)
        {
            return;
        }
        if (!PersistentMissionData.missionDictionary.ContainsKey(this.garrMissionID))
        {
            return;
        }
        this.missionDurationInSeconds = record.MissionDuration;
        JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)PersistentMissionData.missionDictionary.get_Item(this.garrMissionID);

        this.missionStartedTime = jamGarrisonMobileMission.StartTime;
        Duration duration = new Duration(record.MissionDuration, false);
        string   text     = (duration.Hours < 2) ? "<color=#ffffffff>" : "<color=#ff8600ff>";
        long     num      = GarrisonStatus.CurrentTime() - this.missionStartedTime;
        long     num2     = (long)this.missionDurationInSeconds - num;

        num2 = ((num2 <= 0L) ? 0L : num2);
        bool flag = jamGarrisonMobileMission.MissionState == 1 && num2 > 0L;

        this.missionNameText.set_text(record.Name + ((!flag) ? (" (" + text + duration.DurationString + "</color>)") : string.Empty));
        this.missionLevelText.set_text(string.Empty + record.TargetLevel);
        this.inProgressDarkener.SetActive(flag);
        this.missionTimeRemainingText.get_gameObject().SetActive(flag);
        this.missionDurationInSeconds = record.MissionDuration;
        this.missionResultsText.get_gameObject().SetActive(false);
        this.isResultsItem = false;
        MissionRewardDisplay.InitMissionRewards(this.missionRewardDisplayPrefab, this.missionRewardGroup.get_transform(), jamGarrisonMobileMission.Reward);
        for (int i = 0; i < this.locationImages.Length; i++)
        {
            if (this.locationImages[i] != null)
            {
                this.locationImages[i].get_gameObject().SetActive(false);
            }
        }
        Image image          = null;
        uint  uiTextureKitID = record.UiTextureKitID;

        switch (uiTextureKitID)
        {
        case 101u:
            image = this.locationImages[1];
            this.locationIndex = 1;
            break;

        case 102u:
            image = this.locationImages[10];
            this.locationIndex = 10;
            break;

        case 103u:
            image = this.locationImages[3];
            this.locationIndex = 3;
            break;

        case 104u:
            image = this.locationImages[4];
            this.locationIndex = 4;
            break;

        case 105u:
            image = this.locationImages[9];
            this.locationIndex = 9;
            break;

        case 106u:
            image = this.locationImages[7];
            this.locationIndex = 7;
            break;

        case 107u:
            image = this.locationImages[8];
            this.locationIndex = 8;
            break;

        default:
            switch (uiTextureKitID)
            {
            case 203u:
                image = this.locationImages[2];
                this.locationIndex = 2;
                break;

            case 204u:
                image = this.locationImages[6];
                this.locationIndex = 6;
                break;

            case 205u:
                image = this.locationImages[5];
                this.locationIndex = 5;
                break;

            default:
                if (uiTextureKitID != 164u)
                {
                    if (uiTextureKitID != 165u)
                    {
                        this.locationIndex = 0;
                    }
                    else
                    {
                        image = this.locationImages[11];
                        this.locationIndex = 11;
                    }
                }
                else
                {
                    image = this.locationImages[0];
                    this.locationIndex = 0;
                }
                break;
            }
            break;
        }
        if (image != null)
        {
            image.get_gameObject().SetActive(true);
        }
        GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID);

        this.m_missionTypeImage.set_overrideSprite(TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID));
        if ((record.Flags & 1u) != 0u)
        {
            this.rareMissionText.get_gameObject().SetActive(true);
            Color color = this.levelBG.get_color();
            color.r = 0f;
            color.g = 0.211f;
            color.b = 0.506f;
            this.levelBG.set_color(color);
        }
        else
        {
            this.rareMissionText.get_gameObject().SetActive(false);
        }
    }
Example #29
0
    public bool ShouldShowCompletedMission()
    {
        JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)PersistentMissionData.missionDictionary[this.m_garrMissionID];

        return(jamGarrisonMobileMission.MissionState == 2 || jamGarrisonMobileMission.MissionState == 3 || (jamGarrisonMobileMission.MissionState == 1 && GarrisonStatus.CurrentTime() - this.m_missionStartedTime >= (long)this.m_missionDurationInSeconds));
    }
Example #30
0
 private void Update()
 {
     if (this.m_lootDisplayPending && this.m_contributeButton.interactable)
     {
         this.m_delayBeforeShowingLoot -= Time.deltaTime;
         if (this.m_delayBeforeShowingLoot > 0f)
         {
             return;
         }
     }
     if (this.m_delayBeforeShowingLoot <= 0f && this.m_lootDisplayTimeRemaining > 0f && this.m_lootItemQuantity > 0)
     {
         if (!this.m_gotLootArea.activeSelf)
         {
             Main.instance.m_UISound.Play_GetItem();
             this.m_gotLootArea.SetActive(true);
             this.m_lootAreaCanvasGroup.alpha = 0f;
             iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
             {
                 "name",
                 "Fade Loot In",
                 "from",
                 0f,
                 "to",
                 1f,
                 "easeType",
                 "easeOutCubic",
                 "time",
                 0.5f,
                 "onupdate",
                 "FadeLootInCallback",
                 "oncomplete",
                 "FadeLootInCompleteCallback"
             }));
         }
         ItemRec record = StaticDB.itemDB.GetRecord(this.m_lootItemID);
         if (record != null)
         {
             this.m_gotLootItemName.text = record.Display + ((this.m_lootItemQuantity != 1) ? (" (" + this.m_lootItemQuantity + "x)") : string.Empty);
         }
         else
         {
             this.m_gotLootItemName.text = "???" + ((this.m_lootItemQuantity != 1) ? (" (" + this.m_lootItemQuantity + "x)") : string.Empty);
         }
         this.m_rewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, this.m_lootItemID, 1, 0, 0);
         this.m_lootDisplayTimeRemaining -= Time.deltaTime;
     }
     else if (this.m_lootDisplayTimeRemaining <= 0f && this.m_lootDisplayPending)
     {
         if (this.m_gotLootArea.activeSelf)
         {
             iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
             {
                 "name",
                 "Fade Loot Out",
                 "from",
                 0f,
                 "to",
                 1f,
                 "easeType",
                 "easeOutCubic",
                 "time",
                 0.5f,
                 "onupdate",
                 "FadeLootOutCallback",
                 "oncomplete",
                 "FadeLootOutCompleteCallback"
             }));
         }
         this.m_lootDisplayPending = false;
     }
     if (LegionfallData.legionfallDictionary.ContainsKey(this.m_contributionID))
     {
         LegionfallData.MobileContributionData mobileContributionData = (LegionfallData.MobileContributionData)LegionfallData.legionfallDictionary[this.m_contributionID];
         MobileContribution contribution = mobileContributionData.contribution;
         if (contribution.State == 3)
         {
             if (mobileContributionData.underAttackExpireTime == 0L)
             {
                 mobileContributionData.underAttackExpireTime = GarrisonStatus.CurrentTime() + (long)mobileContributionData.contribution.CurrentValue;
             }
             long num = mobileContributionData.underAttackExpireTime - GarrisonStatus.CurrentTime();
             num = ((num <= 0L) ? 0L : num);
             Duration duration = new Duration((int)num, false);
             this.m_healthText.text            = StaticDB.GetString("TIME_LEFT", null) + " " + duration.DurationString;
             this.m_progressFillBar.fillAmount = contribution.CurrentValue / contribution.UpperValue;
         }
     }
 }