private void HandleRecruitResult(int result) { if (result == 0) { LegionCompanionWrapper.RequestShipments((int)GarrisonStatus.GarrisonType); } }
private void Update() { if (this.IsResearching()) { this.m_researchProgressBG.gameObject.SetActive(true); float num = 1f - ((!this.IsRespec()) ? ((float)this.GetRemainingResearchTime().TotalSeconds / (float)this.m_garrTalentRec.ResearchDurationSecs) : ((float)this.GetRemainingRespecTime().TotalSeconds / (float)this.m_garrTalentRec.RespecDurationSecs)); this.m_researchProgressFill.fillAmount = num; this.SetVisualState(TalentVisualState.researching); if (!this.m_requestedUpdate && num >= 1f) { this.m_requestedUpdate = true; LegionCompanionWrapper.RequestGarrisonData((int)GarrisonStatus.GarrisonType); this.m_shouldShowCheckAnim = true; if (!base.GetComponentInParent <TalentTreePanel>().m_talentNavButton.IsSelected() && !this.m_playedTalentToast) { Main.instance.m_UISound.Play_TalentReadyToast(); this.m_playedTalentToast = true; } } } if (this.m_shouldShowCheckAnim && !this.m_playedShowCheckAnim && base.GetComponentInParent <TalentTreePanel>().m_talentNavButton.IsSelected()) { UiAnimMgr.instance.PlayAnim("TalentDoneAnim", base.transform, Vector3.zero, 1f, 0f); Main.instance.m_UISound.Play_TalentReadyCheck(); this.m_shouldShowCheckAnim = false; this.m_playedShowCheckAnim = true; } }
public void Recruit() { if (this.m_charShipmentRec.GarrFollowerID > 0) { TroopSlot troopSlot = null; TroopSlot[] componentsInChildren = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(true); int num = 0; while (num < (int)componentsInChildren.Length) { TroopSlot troopSlot1 = componentsInChildren[num]; if (!troopSlot1.IsEmpty()) { num++; } else { troopSlot = troopSlot1; break; } } if (troopSlot == null) { return; } troopSlot.SetPendingCreate(); this.UpdateRecruitButtonState(); } LegionCompanionWrapper.CreateShipment(this.m_charShipmentRec.ID, 1); Main.instance.m_UISound.Play_RecruitTroop(); }
private void HandleCollectTroopResult(SHIPMENT_RESULT result, ulong shipmentDBID) { if (result == SHIPMENT_RESULT.SUCCESS && shipmentDBID == this.m_shipmentDBID) { if (this.m_glowLoopHandle != null) { UiAnimation anim = this.m_glowLoopHandle.GetAnim(); if (anim != null) { anim.Stop(0.5f); } this.m_glowLoopHandle = null; } UiAnimMgr.instance.PlayAnim("GreenCheckRound", this.m_greenCheckEffectRoot, Vector3.zero, 1.8f, 0f); Main.instance.m_UISound.Play_GreenCheck(); this.m_training = false; this.m_troopOwnedCheckmark.gameObject.SetActive(true); this.m_troopPortraitImage.gameObject.SetActive(true); this.m_timeRemainingText.gameObject.SetActive(false); this.m_troopPortraitImage.material = null; PersistentShipmentData.shipmentDictionary.Remove(shipmentDBID); LegionCompanionWrapper.RequestShipmentTypes((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestShipments((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestGarrisonData((int)GarrisonStatus.GarrisonType); } }
public void StartResearch() { if (this.m_canResearch) { LegionCompanionWrapper.ResearchGarrisonTalent(this.m_garrTalentRec.ID); } }
public void OnEnable() { Main.instance.m_UISound.Play_ShowGenericTooltip(); Main.instance.m_canvasBlurManager.AddBlurRef_MainCanvas(); Main.instance.m_backButtonManager.PushBackAction(BackActionType.hideAllPopups, null); Singleton <GarrisonWrapper> .Instance.EquipmentInventoryChangedAction += this.UpdateDisplayCB; LegionCompanionWrapper.RequestFollowerEquipment((int)GarrisonStatus.GarrisonFollowerType); }
public void OnEnable() { Main.instance.m_backButtonManager.PushBackAction(BackActionType.hideAllPopups, null); Main.instance.m_UISound.Play_ShowGenericTooltip(); Main.instance.m_canvasBlurManager.AddBlurRef_MainCanvas(); Main.instance.ArmamentInventoryChangedAction += new Action(this.HandleArmamentsChanged); LegionCompanionWrapper.RequestFollowerArmamentsExtended((int)GarrisonStatus.GarrisonFollowerType); }
public WrapperItemStats?GetItemStats(int itemID, int itemContext) { if (this.m_records.ContainsKey(itemID)) { return(new WrapperItemStats?(this.m_records[itemID])); } LegionCompanionWrapper.GetItemTooltipInfo(itemID, itemContext); return(null); }
private void FollowerChangedQualityHandler(LegionCompanionWrapper.FollowerChangedQualityEvent eventArgs) { PersistentFollowerData.AddOrUpdateFollower(eventArgs.Follower); if (this.UseEquipmentResultAction != null) { this.UseEquipmentResultAction(eventArgs.OldFollower, eventArgs.Follower); } LegionCompanionWrapper.RequestFollowerEquipment((int)GarrisonStatus.GarrisonFollowerType); }
public void UseEquipment(int garrFollowerID, int itemID, int replaceThisAbilityID) { if (this.UseEquipmentStartAction != null) { this.UseEquipmentStartAction(replaceThisAbilityID); } GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(garrFollowerID); LegionCompanionWrapper.UseFollowerEquipment((int)record.GarrFollowerTypeID, garrFollowerID, itemID, replaceThisAbilityID); }
public void UseArmament(int garrFollowerID, int itemID) { if (this.UseArmamentStartAction != null) { this.UseArmamentStartAction(garrFollowerID); } GarrFollowerRec record = StaticDB.garrFollowerDB.GetRecord(garrFollowerID); LegionCompanionWrapper.UseFollowerArmament((int)record.GarrFollowerTypeID, garrFollowerID, itemID); }
public WrapperItemStats?GetItemStats(int itemID, int itemContext, WrapperItemInstance?itemInstance) { if (this.m_records.ContainsKey(itemID)) { if (this.IsCoverItem(itemID)) { LegionCompanionWrapper.GetItemTooltipInfo(itemID, itemContext, itemInstance); } return(new WrapperItemStats?(this.m_records[itemID])); } LegionCompanionWrapper.GetItemTooltipInfo(itemID, itemContext, itemInstance); return(null); }
private void HandleResearchGarrisonTalentResult(int garrTalentID, int result) { if (this.m_talentButtonLeft.GetTalentID() != garrTalentID && this.m_talentButtonRight.GetTalentID() != garrTalentID) { return; } if (result == 0) { Main.instance.m_UISound.Play_BeginResearch(); } this.m_talentTreePanel.SetNeedsFullInit(); LegionCompanionWrapper.RequestGarrisonData(3); }
private void CreateShipmentResultHandler(LegionCompanionWrapper.CreateShipmentResultEvent eventArgs) { if (eventArgs.Result == 0) { LegionCompanionWrapper.RequestShipmentTypes((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestShipments((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestGarrisonData((int)GarrisonStatus.GarrisonType); } if (this.CreateShipmentResultAction != null) { this.CreateShipmentResultAction(eventArgs.Result); } }
private void MakeContributionResultHandler(LegionCompanionWrapper.MakeContributionResultEvent eventArgs) { Debug.Log(string.Concat(new object[] { "Make Contribution Result for ID ", eventArgs.ContributionID, " is ", eventArgs.Result })); LegionCompanionWrapper.RequestContributionInfo(); if (this.ContributionInfoChangedAction != null) { this.ContributionInfoChangedAction(); } }
private void UseFollowerArmamentResultHandler(LegionCompanionWrapper.UseFollowerArmamentResultEvent eventArgs) { if (eventArgs.Result == 0) { PersistentFollowerData.AddOrUpdateFollower(eventArgs.Follower); LegionCompanionWrapper.RequestFollowerArmamentsExtended((int)GarrisonStatus.GarrisonFollowerType); } else { AllPopups.instance.ShowGenericPopupFull(StaticDB.GetString("USE_ARMAMENT_FAILED", null)); } if (this.UseArmamentResultAction != null) { this.UseArmamentResultAction(eventArgs.Result, eventArgs.OldFollower, eventArgs.Follower); } }
public void OnCollectTroop() { TimeSpan t = GarrisonStatus.CurrentTime() - this.m_shipmentCreationTime; if ((this.m_shipmentDuration - t).TotalSeconds > 0.0) { return; } if (this.m_shipmentDBID != 0UL && !this.m_collected) { this.m_collected = true; this.m_collectingSpinner.SetActive(true); UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.transform, Vector3.zero, 2f, 0f); Main.instance.m_UISound.Play_CollectTroop(); LegionCompanionWrapper.CompleteShipment(this.m_shipmentDBID); } }
private void HandleGarrisonDataResetFinished() { if (this.m_needsFullInit) { this.InitTalentTree(); } else { TalentTreeItem[] componentsInChildren = this.m_talentTreeItemRoot.GetComponentsInChildren <TalentTreeItem>(true); foreach (TalentTreeItem talentTreeItem in componentsInChildren) { talentTreeItem.HandleGarrisonDataResetFinished(); LegionCompanionWrapper.RequestCanResearchGarrisonTalent(talentTreeItem.m_talentButtonLeft.GetTalentID()); LegionCompanionWrapper.RequestCanResearchGarrisonTalent(talentTreeItem.m_talentButtonRight.GetTalentID()); } } }
private void ExpediteMissionCheatResultHandler(LegionCompanionWrapper.ExpediteMissionCheatResultEvent eventArgs) { if (eventArgs.Result == 0) { Debug.Log("Expedited completion of mission " + eventArgs.MissionRecID); LegionCompanionWrapper.RequestGarrisonData((int)GarrisonStatus.GarrisonType); } else { Debug.Log(string.Concat(new object[] { "MobileClientExpediteMissionCheatResult: Mission ID ", eventArgs.MissionRecID, " failed with error ", eventArgs.Result })); } }
private void HandleGarrisonDataResetFinished() { if (!this.m_needsFullInit) { TalentTreeItem[] componentsInChildren = this.m_talentTreeItemRoot.GetComponentsInChildren <TalentTreeItem>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { TalentTreeItem talentTreeItem = componentsInChildren[i]; talentTreeItem.HandleGarrisonDataResetFinished(); LegionCompanionWrapper.RequestCanResearchGarrisonTalent(talentTreeItem.m_talentButtonLeft.GetTalentID()); LegionCompanionWrapper.RequestCanResearchGarrisonTalent(talentTreeItem.m_talentButtonRight.GetTalentID()); } } else { this.InitTalentTree(); } }
public void MobileRequestData() { LegionCompanionWrapper.RequestShipmentTypes((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestShipments((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestWorldQuestBounties(10); this.RequestWorldQuests(); LegionCompanionWrapper.RequestFollowerEquipment((int)GarrisonStatus.GarrisonFollowerType); LegionCompanionWrapper.RequestFollowerArmamentsExtended((int)GarrisonStatus.GarrisonFollowerType); LegionCompanionWrapper.RequestFollowerActivationData((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.GetArtifactInfo(); LegionCompanionWrapper.RequestContributionInfo(); LegionCompanionWrapper.RequestAreaPoiInfo(); LegionCompanionWrapper.RequestMaxFollowers((int)GarrisonStatus.GarrisonFollowerType); LegionCompanionWrapper.RequestGarrisonData((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestAreaPoiInfo(); if (this.GarrisonDataResetFinishedAction != null) { this.GarrisonDataResetFinishedAction(); } }
private void ChangeFollowerActiveResultHandler(LegionCompanionWrapper.ChangeFollowerActiveResultEvent eventArgs) { if (eventArgs.Result == 0) { PersistentFollowerData.AddOrUpdateFollower(eventArgs.Follower); FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(eventArgs.Follower); if (followerStatus == FollowerStatus.inactive) { Debug.Log("Follower is now inactive. " + eventArgs.ActivationsRemaining + " activations remain for the day."); } else { Debug.Log("Follower is now active. " + eventArgs.ActivationsRemaining + " activations remain for the day."); } if (this.FollowerDataChangedAction != null) { this.FollowerDataChangedAction(); } LegionCompanionWrapper.RequestFollowerActivationData((int)GarrisonStatus.GarrisonType); } }
private void PrecacheMissionChances() { foreach (WrapperGarrisonMission wrapperGarrisonMission in PersistentMissionData.missionDictionary.Values) { GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonMission.MissionRecID); if (record != null && (GARR_FOLLOWER_TYPE)record.GarrFollowerTypeID == GarrisonStatus.GarrisonFollowerType) { if (wrapperGarrisonMission.MissionState == 1) { List <WrapperGarrisonFollower> list = new List <WrapperGarrisonFollower>(); foreach (WrapperGarrisonFollower item in PersistentFollowerData.followerDictionary.Values) { if (item.CurrentMissionID == wrapperGarrisonMission.MissionRecID) { list.Add(item); } } LegionCompanionWrapper.EvaluateMission(wrapperGarrisonMission.MissionRecID, (from f in list select f.GarrFollowerID).ToList <int>()); } } } }
public void MakeContribution() { if (!LegionfallData.legionfallDictionary.ContainsKey(this.m_contributionID)) { return; } WrapperContribution contribution = LegionfallData.legionfallDictionary[this.m_contributionID].contribution; if (contribution.State == 1) { LegionfallBuildingPanel.s_lastContributionID = this.m_contributionID; Debug.Log("Starting to contribute to ID " + contribution.ContributionID); if (Main.instance.MakeContributionRequestInitiatedAction != null) { Main.instance.MakeContributionRequestInitiatedAction(); } LegionCompanionWrapper.MakeContribution(contribution.ContributionID); this.m_lootDisplayPending = true; this.m_delayBeforeShowingLoot = 2f; this.m_lootDisplayTimeRemaining = 3f; Main.instance.m_UISound.Play_ButtonRedClick(); } }
public void Recruit() { if (this.m_charShipmentRec.GarrFollowerID > 0) { TroopSlot troopSlot = null; TroopSlot[] componentsInChildren = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(true); foreach (TroopSlot troopSlot2 in componentsInChildren) { if (troopSlot2.IsEmpty()) { troopSlot = troopSlot2; break; } } if (troopSlot == null) { return; } troopSlot.SetPendingCreate(); this.UpdateRecruitButtonState(); } LegionCompanionWrapper.CreateShipment(this.m_charShipmentRec.ID, 1); Main.instance.m_UISound.Play_RecruitTroop(); }
private void CompleteMissionResultHandler(LegionCompanionWrapper.GarrisonCompleteMissionResultEvent eventArgs) { PersistentMissionData.UpdateMission(eventArgs.Result.Mission); AdventureMapMissionSite[] componentsInChildren = AdventureMapPanel.instance.m_mapViewContentsRT.GetComponentsInChildren <AdventureMapMissionSite>(true); foreach (AdventureMapMissionSite adventureMapMissionSite in componentsInChildren) { if (!adventureMapMissionSite.m_isStackablePreview) { if (adventureMapMissionSite.GetGarrMissionID() == eventArgs.Result.GarrMissionID) { if (!adventureMapMissionSite.gameObject.activeSelf) { adventureMapMissionSite.gameObject.SetActive(true); } adventureMapMissionSite.HandleCompleteMissionResult(eventArgs.Result.GarrMissionID, eventArgs.Result.BonusRollSucceeded); break; } } } LegionCompanionWrapper.RequestShipmentTypes((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestShipments((int)GarrisonStatus.GarrisonType); LegionCompanionWrapper.RequestFollowerEquipment((int)GarrisonStatus.GarrisonFollowerType); LegionCompanionWrapper.RequestGarrisonData((int)GarrisonStatus.GarrisonType); }
public void ActivateFollower() { Main.instance.m_UISound.Play_ActivateChampion(); Debug.Log("Attempting to Activate follower " + this.m_garrFollowerID); LegionCompanionWrapper.ChangeFollowerActive(this.m_garrFollowerID, false); }
public void UpdateMissionStatus(int garrMissionID) { MissionMechanic[] componentsInChildren = this.enemyPortraitsGroup.GetComponentsInChildren <MissionMechanic>(true); if (componentsInChildren == null) { return; } for (int i = 0; i < (int)componentsInChildren.Length; i++) { componentsInChildren[i].SetCountered(false, false, true); } AbilityDisplay[] abilityDisplayArray = this.enemyPortraitsGroup.GetComponentsInChildren <AbilityDisplay>(true); if (abilityDisplayArray == null) { return; } for (int j = 0; j < (int)abilityDisplayArray.Length; j++) { abilityDisplayArray[j].SetCountered(false, true); } MissionMechanicTypeCounter[] missionMechanicTypeCounterArray = base.gameObject.GetComponentsInChildren <MissionMechanicTypeCounter>(true); if (missionMechanicTypeCounterArray == null) { return; } for (int k = 0; k < (int)missionMechanicTypeCounterArray.Length; k++) { missionMechanicTypeCounterArray[k].usedIcon.gameObject.SetActive(false); int num = 0; while (num < (int)componentsInChildren.Length) { if (missionMechanicTypeCounterArray[k].countersMissionMechanicTypeID != componentsInChildren[num].m_missionMechanicTypeID || componentsInChildren[num].IsCountered()) { num++; } else { componentsInChildren[num].SetCountered(true, false, false); if (num < (int)abilityDisplayArray.Length) { abilityDisplayArray[num].SetCountered(true, false); } break; } } } MissionFollowerSlot[] missionFollowerSlotArray = base.gameObject.GetComponentsInChildren <MissionFollowerSlot>(true); List <WrapperGarrisonFollower> wrapperGarrisonFollowers = new List <WrapperGarrisonFollower>(); for (int l = 0; l < (int)missionFollowerSlotArray.Length; l++) { int currentGarrFollowerID = missionFollowerSlotArray[l].GetCurrentGarrFollowerID(); if (PersistentFollowerData.followerDictionary.ContainsKey(currentGarrFollowerID)) { wrapperGarrisonFollowers.Add(PersistentFollowerData.followerDictionary[currentGarrFollowerID]); } } int item = -1000; if (!MissionDataCache.missionDataDictionary.ContainsKey(this.m_garrMissionID)) { LegionCompanionWrapper.EvaluateMission(garrMissionID, ( from f in wrapperGarrisonFollowers select f.GarrFollowerID).ToList <int>()); } else { item = MissionDataCache.missionDataDictionary[this.m_garrMissionID]; } this.OnMissionSuccessChanceChanged(item); }
public void UpdateMissionStatus(int garrMissionID) { MissionMechanic[] componentsInChildren = this.enemyPortraitsGroup.GetComponentsInChildren <MissionMechanic>(true); if (componentsInChildren == null) { return; } for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].SetCountered(false, false, true); } AbilityDisplay[] componentsInChildren2 = this.enemyPortraitsGroup.GetComponentsInChildren <AbilityDisplay>(true); if (componentsInChildren2 == null) { return; } for (int j = 0; j < componentsInChildren2.Length; j++) { componentsInChildren2[j].SetCountered(false, true); } MissionMechanicTypeCounter[] componentsInChildren3 = base.gameObject.GetComponentsInChildren <MissionMechanicTypeCounter>(true); if (componentsInChildren3 == null) { return; } for (int k = 0; k < componentsInChildren3.Length; k++) { componentsInChildren3[k].usedIcon.gameObject.SetActive(false); for (int l = 0; l < componentsInChildren.Length; l++) { if (componentsInChildren3[k].countersMissionMechanicTypeID == componentsInChildren[l].m_missionMechanicTypeID && !componentsInChildren[l].IsCountered()) { componentsInChildren[l].SetCountered(true, false, false); if (l < componentsInChildren2.Length) { componentsInChildren2[l].SetCountered(true, false); } break; } } } MissionFollowerSlot[] componentsInChildren4 = base.gameObject.GetComponentsInChildren <MissionFollowerSlot>(true); List <WrapperGarrisonFollower> list = new List <WrapperGarrisonFollower>(); for (int m = 0; m < componentsInChildren4.Length; m++) { int currentGarrFollowerID = componentsInChildren4[m].GetCurrentGarrFollowerID(); if (PersistentFollowerData.followerDictionary.ContainsKey(currentGarrFollowerID)) { WrapperGarrisonFollower item = PersistentFollowerData.followerDictionary[currentGarrFollowerID]; list.Add(item); } } int chance = -1000; if (MissionDataCache.missionDataDictionary.ContainsKey(this.m_garrMissionID)) { chance = MissionDataCache.missionDataDictionary[this.m_garrMissionID]; } else { LegionCompanionWrapper.EvaluateMission(garrMissionID, (from f in list select f.GarrFollowerID).ToList <int>()); } this.OnMissionSuccessChanceChanged(chance); }
public void DeactivateFollower() { Main.instance.m_UISound.Play_DeactivateChampion(); LegionCompanionWrapper.ChangeFollowerActive(this.m_garrFollowerID, true); }