private void OnEnable() { this.m_characterName.set_text(GarrisonStatus.CharacterName()); if (Main.instance.GetLocale() == "frFR") { this.m_characterClassName.set_text(string.Concat(new string[] { GarrisonStatus.CharacterClassName(), " ", StaticDB.GetString("LEVEL", null), " ", GarrisonStatus.CharacterLevel().ToString() })); } else { this.m_characterClassName.set_text(GeneralHelpers.TextOrderString(StaticDB.GetString("LEVEL", null), GarrisonStatus.CharacterLevel().ToString()) + " " + GarrisonStatus.CharacterClassName()); } this.m_characterListButton.set_text(StaticDB.GetString("CHARACTER_LIST", null)); Sprite sprite = GeneralHelpers.LoadClassIcon(GarrisonStatus.CharacterClassID()); if (sprite != null) { this.m_classIcon.set_sprite(sprite); } }
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); }
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(); } } }
private void OnEnable() { this.InitPlayerDisplay(GarrisonStatus.CharacterLevel()); Main expr_10 = Main.instance; expr_10.PlayerLeveledUpAction = (Action <int>)Delegate.Combine(expr_10.PlayerLeveledUpAction, new Action <int>(this.HandlePlayerLeveledUp)); }
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(); } }
private void SetCharShipmentTroop(MobileClientShipmentType shipmentType, CharShipmentRec charShipmentRec) { this.m_isTroop = true; this.m_shipmentType = shipmentType; this.m_troopSpecificArea.SetActive(true); this.m_itemSpecificArea.SetActive(false); this.m_troopName.get_gameObject().SetActive(true); this.m_itemName.get_gameObject().SetActive(false); GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord((int)charShipmentRec.GarrFollowerID); if (record == null) { Debug.LogError("Invalid Follower ID: " + charShipmentRec.GarrFollowerID); this.m_troopName.set_text("Invalid Follower ID: " + charShipmentRec.GarrFollowerID); return; } this.m_followerRec = record; int num = (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record.AllianceCreatureID : record.HordeCreatureID; CreatureRec record2 = StaticDB.creatureDB.GetRecord(num); if (record2 == null) { Debug.LogError("Invalid Creature ID: " + num); this.m_troopName.set_text("Invalid Creature ID: " + num); return; } string text = "Assets/BundleAssets/PortraitIcons/cid_" + record2.ID.ToString("D8") + ".png"; Sprite sprite = AssetBundleManager.portraitIcons.LoadAsset <Sprite>(text); if (sprite != null) { this.m_troopSnapshotImage.set_sprite(sprite); } for (int i = 0; i < record.Vitality; i++) { GameObject gameObject = Object.Instantiate <GameObject>(this.m_troopHeartPrefab); gameObject.get_transform().SetParent(this.m_troopHeartContainer.get_transform(), false); } this.m_troopName.set_text(record2.Name); StaticDB.garrFollowerXAbilityDB.EnumRecordsByParentID((int)charShipmentRec.GarrFollowerID, delegate(GarrFollowerXAbilityRec xAbilityRec) { if (xAbilityRec.FactionIndex == (int)GarrisonStatus.Faction()) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_abilityDisplayPrefab); gameObject2.get_transform().SetParent(this.m_traitsAndAbilitiesRootObject.get_transform(), false); AbilityDisplay component = gameObject2.GetComponent <AbilityDisplay>(); component.SetAbility(xAbilityRec.GarrAbilityID, true, true, null); } return(true); }); this.UpdateTroopSlots(); this.m_troopResourceCostText.set_text(string.Empty + shipmentType.CurrencyCost); Sprite sprite2 = GeneralHelpers.LoadCurrencyIcon(shipmentType.CurrencyTypeID); if (sprite2 != null) { this.m_troopResourceIcon.set_sprite(sprite2); } this.UpdateRecruitButtonState(); }
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 InitPlayerDisplay(int playerLevel) { this.m_characterName.text = GarrisonStatus.CharacterName(); if (Main.instance.GetLocale() == "frFR") { this.m_characterClassName.text = string.Concat(new string[] { GarrisonStatus.CharacterClassName(), " ", StaticDB.GetString("LEVEL", null), " ", playerLevel.ToString() }); } else { this.m_characterClassName.text = GeneralHelpers.TextOrderString(StaticDB.GetString("LEVEL", null), playerLevel.ToString()) + " " + GarrisonStatus.CharacterClassName(); } this.m_characterListButton.text = StaticDB.GetString("CHARACTER_LIST", null); Sprite sprite = GeneralHelpers.LoadClassIcon(GarrisonStatus.CharacterClassID()); if (sprite != null) { this.m_classIcon.sprite = sprite; } }
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(); } } }
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); }
private void OnEnable() { this.GetRequestedMissionCollectionDictionary().Clear(); this.okButton.SetActive(false); this.mainCanvas.renderMode = 1; if (GarrisonStatus.Faction() == PVP_FACTION.HORDE) { this.hordeCommander.SetActive(true); this.allianceCommander.SetActive(false); } else { this.hordeCommander.SetActive(false); this.allianceCommander.SetActive(true); } this.completedMissionsText.text = string.Empty + PersistentMissionData.GetNumCompletedMissions(false) + " Completed Missions"; MissionListItem[] componentsInChildren = this.completedMissionListContents.GetComponentsInChildren <MissionListItem>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate(componentsInChildren[i].gameObject); } MissionRewardDisplay[] componentsInChildren2 = this.missionRewardsIconArea.GetComponentsInChildren <MissionRewardDisplay>(true); for (int j = 0; j < componentsInChildren2.Length; j++) { Object.DestroyImmediate(componentsInChildren2[j].gameObject); } this.missionReportView.SetActive(true); this.missionResultsView.SetActive(false); }
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 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); }
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); }
public void Show(FollowerDetailView followerDetailView) { base.get_gameObject().SetActive(true); this.m_followerDetailView = followerDetailView; this.m_areYouSureLabel.set_text(StaticDB.GetString("ARE_YOU_SURE", null)); this.m_reactivationCostLabel.set_text(StaticDB.GetString("CHAMPION_REACTIVATION_COST", null)); this.m_cancelButtonLabel.set_text(StaticDB.GetString("NO", null)); this.m_okButtonLabel.set_text(StaticDB.GetString("YES_DEACTIVATE", null)); this.m_reactivationCostText.set_text(string.Empty + GarrisonStatus.GetFollowerActivationGoldCost()); }
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); } } } } }
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 MobileClientGarrisonDataRequestResultHandler(MobileClientGarrisonDataRequestResult msg) { PersistentFollowerData.ClearData(); PersistentMissionData.ClearData(); PersistentTalentData.ClearData(); if (this.GarrisonDataResetStartedAction != null) { this.GarrisonDataResetStartedAction.Invoke(); } GarrisonStatus.SetFaction(msg.PvpFaction); GarrisonStatus.SetGarrisonServerConnectTime(msg.ServerTime); GarrisonStatus.SetCurrencies(msg.GoldCurrency, msg.OilCurrency, msg.OrderhallResourcesCurrency); GarrisonStatus.SetCharacterName(msg.CharacterName); GarrisonStatus.SetCharacterLevel(msg.CharacterLevel); GarrisonStatus.SetCharacterClass(msg.CharacterClassID); uint num = 0u; while ((ulong)num < (ulong)((long)msg.Follower.GetLength(0))) { JamGarrisonFollower jamGarrisonFollower = msg.Follower[(int)((UIntPtr)num)]; PersistentFollowerData.AddOrUpdateFollower(jamGarrisonFollower); bool flag = (jamGarrisonFollower.Flags & 8) != 0; if (flag && jamGarrisonFollower.Durability <= 0) { Debug.Log("Follower " + jamGarrisonFollower.GarrFollowerID + " has expired."); if (this.TroopExpiredAction != null) { this.TroopExpiredAction.Invoke(jamGarrisonFollower); } } num += 1u; } uint num2 = 0u; while ((ulong)num2 < (ulong)((long)msg.Mission.GetLength(0))) { PersistentMissionData.AddMission(msg.Mission[(int)((UIntPtr)num2)]); num2 += 1u; } for (int i = 0; i < msg.Talent.GetLength(0); i++) { PersistentTalentData.AddOrUpdateTalent(msg.Talent[i]); } if (this.GarrisonDataResetFinishedAction != null) { this.GarrisonDataResetFinishedAction.Invoke(); } if (this.FollowerDataChangedAction != null) { this.FollowerDataChangedAction.Invoke(); } }
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); } } }
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); }
private void UpdateRecruitButtonState() { TroopSlot[] componentsInChildren = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(); bool flag = false; TroopSlot[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { TroopSlot troopSlot = array[i]; if (troopSlot.IsEmpty()) { flag = true; break; } } bool flag2 = GarrisonStatus.Resources() >= this.m_shipmentCost; this.m_itemResourceCostText.set_color((!flag2) ? Color.get_red() : Color.get_white()); this.m_recruitButtonText.set_color(new Color(1f, 0.82f, 0f, 1f)); if (!flag) { this.m_recruitButtonText.set_text(StaticDB.GetString("SLOTS_FULL", null)); this.m_recruitButtonText.set_color(new Color(0.5f, 0.5f, 0.5f, 1f)); } else if (!flag2) { this.m_recruitButtonText.set_text(StaticDB.GetString("CANT_AFFORD", "Can't Afford")); this.m_recruitButtonText.set_color(new Color(0.5f, 0.5f, 0.5f, 1f)); } else if (this.m_isTroop) { this.m_recruitButtonText.set_text(StaticDB.GetString("RECRUIT", null)); } else { this.m_recruitButtonText.set_text(StaticDB.GetString("PLACE_ORDER", null)); } if (flag && flag2) { this.m_recruitTroopsButton.set_interactable(true); } else { this.m_recruitTroopsButton.set_interactable(false); } }
private void SetTroopSlotForExistingFollower(TroopSlot[] troopSlots, JamGarrisonFollower follower) { if (follower.Durability <= 0) { return; } foreach (TroopSlot troopSlot in troopSlots) { int ownedFollowerID = troopSlot.GetOwnedFollowerID(); if (ownedFollowerID != 0 && ownedFollowerID == follower.GarrFollowerID) { return; } } foreach (TroopSlot troopSlot2 in troopSlots) { if (troopSlot2.IsCollected()) { GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID); int iconFileDataID = (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record.AllianceIconFileDataID : record.HordeIconFileDataID; troopSlot2.SetCharShipment(this.m_charShipmentRec.ID, 0UL, follower.GarrFollowerID, false, iconFileDataID); return; } } foreach (TroopSlot troopSlot3 in troopSlots) { if (troopSlot3.IsPendingCreate()) { GarrFollowerRec record2 = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID); int iconFileDataID2 = (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record2.AllianceIconFileDataID : record2.HordeIconFileDataID; troopSlot3.SetCharShipment(this.m_charShipmentRec.ID, 0UL, follower.GarrFollowerID, false, iconFileDataID2); return; } } foreach (TroopSlot troopSlot4 in troopSlots) { if (troopSlot4.IsEmpty()) { GarrFollowerRec record3 = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID); int iconFileDataID3 = (GarrisonStatus.Faction() != PVP_FACTION.HORDE) ? record3.AllianceIconFileDataID : record3.HordeIconFileDataID; troopSlot4.SetCharShipment(this.m_charShipmentRec.ID, 0UL, follower.GarrFollowerID, false, iconFileDataID3); return; } } }
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>"); } } }
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); } }
public void SetCombatAllyChampion(JamGarrisonFollower follower, int garrMissionID, int missionCost) { this.m_combatAllyMissionID = garrMissionID; this.m_combatAllyChampion = follower; this.m_combatAllyAbilityDisplay.SetSpell(this.m_combatAllyChampion.ZoneSupportSpellID); this.m_combatAllySlot.SetFollower(follower.GarrFollowerID); GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(follower.GarrFollowerID); CreatureRec record2 = StaticDB.creatureDB.GetRecord((GarrisonStatus.Faction() != PVP_FACTION.ALLIANCE) ? record.HordeCreatureID : record.AllianceCreatureID); if (follower.Quality == 6 && record.TitleName != null && record.TitleName.Length > 0) { this.m_combatAllyName.text = record.TitleName; } else if (record != null) { this.m_combatAllyName.text = record2.Name; } this.m_combatAllyName.color = GeneralHelpers.GetQualityColor(this.m_combatAllyChampion.Quality); if (missionCost <= GarrisonStatus.Resources()) { this.m_useItemButtonLabel.text = StaticDB.GetString("ASSIGN_CHAMPION", null); } else { this.m_useItemButtonLabel.text = StaticDB.GetString("CANT_AFFORD", "Can't Afford"); this.m_useItemButtonLabel.color = Color.red; this.m_useItemButton.interactable = false; } int numActiveChampions = GeneralHelpers.GetNumActiveChampions(); int maxActiveFollowers = GarrisonStatus.GetMaxActiveFollowers(); this.m_isOverMaxChampionSoftCap = false; this.m_needMoreResources = false; if (numActiveChampions > maxActiveFollowers) { this.m_isOverMaxChampionSoftCap = true; } if (GarrisonStatus.Resources() < missionCost) { this.m_needMoreResources = true; } this.SetCombatAllyAvailabilityStatus(); }
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 })); } }