public IEnumerator Spin() { titleAnimator.PlayForward(); descriptionAnimator.PlayForward(); startTime = Time.time; while (startTime + waitTime > Time.time) { yield return(new WaitForEndOfFrame()); } descriptionAnimator.PlayReverse(); StartCoroutine(PF_GamePlay.Wait(.55f, () => { titleAnimator.PlayReverse(); PF_GamePlay.OutroPane(gameObject, .5f); if (activeState == DisplayStates.PlayerDied) { ContinueToGameOver(); } else if (PF_GamePlay.UseRaidMode) { GameplayController.RaiseGameplayEvent(GlobalStrings.QUEST_COMPLETE_EVENT, PF_GamePlay.GameplayEventTypes.OutroQuest); } else { StartQuest(); } })); }
private void Awake() { readyBtn.onClick.RemoveAllListeners(); readyBtn.onClick.AddListener(() => { if (GamePlayManager.IsMultiPlayer) { if (!PhotonNetwork.isMasterClient) { PhotonNetwork.RaiseEvent(100, null, true, new RaiseEventOptions() { Receivers = ReceiverGroup.MasterClient }); } else if (PhotonNetwork.isMasterClient) { directController.playManager.RefreshRoomProperties(GamePlayManager.GameplayEvent.StartQuest); } } else { GamePlayManager.RaiseGameplayEvent("", GamePlayManager.GameplayEvent.StartQuest); } PF_GamePlay.OutroPane(this.gameObject, 0); } ); }
public void OnSkipClicked() { titleAnimator.PlayReverse(); if (this.activeState == DisplayStates.BossIntro) { PF_GamePlay.OutroPane(this.gameObject, .5f, () => { }); } else if (this.activeState == DisplayStates.PlayerDied) { ContinueToGameOver(); } else { if (PF_GamePlay.UseRaidMode) { GameplayController.RaiseGameplayEvent(GlobalStrings.QUEST_COMPLETE_EVENT, PF_GamePlay.GameplayEventTypes.OutroQuest); } else { StartQuest(); } PF_GamePlay.OutroPane(this.gameObject, .5f); } }
public void FadeAdsOut(UnityAction callback = null) { PF_GamePlay.OutroPane(AdObject, .5f, () => { if (callback != null) { callback(); } }); }
public void UpdateQuestStats() { //TODO update mastery stars to reflect difficulty. if (PF_GamePlay.QuestProgress != null) { this.CreepEncountersText.text = string.Format("x{0}", PF_GamePlay.QuestProgress.CreepEncounters); this.GoldCollectedText.text = string.Format("+{0:n0}", PF_GamePlay.QuestProgress.GoldCollected); this.ItemsCollectedText.text = string.Format("+{0}", PF_GamePlay.QuestProgress.ItemsFound.Count); this.HeroEncountersText.text = string.Format("x{0}", PF_GamePlay.QuestProgress.HeroRescues); this.LivesLostText.text = string.Format("- {0}", PF_GamePlay.QuestProgress.Deaths); if (PF_GamePlay.QuestProgress.isQuestWon) { PF_GamePlay.IntroPane(this.WinGraphics.gameObject, .333f, null); PF_GamePlay.OutroPane(this.LoseGraphics.gameObject, .01f, null); this.colorTweener.from = Color.blue; this.colorTweener.to = Color.magenta; this.BG.overrideSprite = this.winBG; } else { PF_GamePlay.IntroPane(this.LoseGraphics.gameObject, .333f, null); PF_GamePlay.OutroPane(this.WinGraphics.gameObject, .01f, null); this.colorTweener.from = Color.red; this.colorTweener.to = Color.yellow; this.BG.overrideSprite = this.loseBG; } } if (PF_PlayerData.activeCharacter != null && PF_GamePlay.ActiveQuest.levelIcon != null) { //this.PlayerIcon.overrideSprite = GameController.Instance.iconManager.GetIconById(PF_PlayerData.activeCharacter.baseClass.Icon); this.QuestIcon.overrideSprite = PF_GamePlay.ActiveQuest.levelIcon; this.QuestName.text = PF_GamePlay.ActiveQuest.levelName; int balance; this.LivesRemaining.text = string.Format("{0}", PF_PlayerData.characterVirtualCurrency.TryGetValue(GlobalStrings.HEART_CURRENCY, out balance) ? balance : -1); var nextLevelStr = string.Format("{0}", PF_PlayerData.activeCharacter.characterData.CharacterLevel + 1); if (PF_GameData.CharacterLevelRamp.ContainsKey(nextLevelStr) && PF_GamePlay.QuestProgress != null && PF_GamePlay.QuestProgress.isQuestWon) { this.XpBar.maxValue = PF_GameData.CharacterLevelRamp[nextLevelStr]; StartCoroutine(this.XpBar.UpdateBarWithCallback(PF_PlayerData.activeCharacter.characterData.ExpThisLevel + PF_GamePlay.QuestProgress.XpCollected, false, this.EvaluateLevelUp)); ViewItems.interactable = true; // this.PlayerLevel.text = "" + PF_PlayerData.activeCharacter.characterData.CharacterLevel; // this.PlayerName.text = PF_PlayerData.activeCharacter.characterDetails.CharacterName; } else { // do nothing } } }
void OnGameplayEventReceived(string message, PF_GamePlay.GameplayEventTypes type) { //Debug.Log(string.Format("{0} -- {1}",type.ToString(), message)); if (type == PF_GamePlay.GameplayEventTypes.IntroAct) { ActIntroObject.ShowInfo(ActIntroController.DisplayStates.ActIntro); PF_GamePlay.OutroPane(QuestIntroObject.gameObject, .75f); } // if(type == PF_GamePlay.GameplayEventTypes.OutroAct) // { // //ActIntroObject.ShowInfo(ActIntroController.DisplayStates.ActOutro); // //PF_GamePlay.IntroPane(ActIntroObject.gameObject, .75f); // } if (type == PF_GamePlay.GameplayEventTypes.IntroQuest) { //QuestIntroObject.UpdateLevedetails(); //PF_GamePlay.IntroPane(QuestIntroObject.gameObject, .75f); } if (type == PF_GamePlay.GameplayEventTypes.StartBossBattle) { ActIntroObject.ShowInfo(ActIntroController.DisplayStates.BossIntro); //PF_GamePlay.IntroPane(ActIntroObject.gameObject, .75f); } if (type == PF_GamePlay.GameplayEventTypes.PlayerDied) { ActIntroObject.ShowInfo(ActIntroController.DisplayStates.PlayerDied); PF_GamePlay.IntroPane(ActIntroObject.gameObject, .75f); this.QuestCompleteObject.UpdateQuestStats(); PF_GamePlay.IntroPane(this.QuestCompleteObject.gameObject, .75f); } if (type == PF_GamePlay.GameplayEventTypes.OutroQuest) { // if(PF_GamePlay.UseRaidMode == false) // { // //ActIntroObject.ShowInfo(ActIntroController.DisplayStates.ActOutro); // PF_GamePlay.IntroPane(ActIntroObject.gameObject, .75f); // } this.QuestCompleteObject.UpdateQuestStats(); PF_GamePlay.IntroPane(this.QuestCompleteObject.gameObject, .75f); } }
public void CastSpell(UnityAction callback = null) { //fade in PF_GamePlay.IntroPane(this.gameObject, .25f, () => { // fade out after wait period UnityAction fadeOut = () => { PF_GamePlay.OutroPane(this.gameObject, .5f, callback); }; // wait period StartCoroutine(PF_GamePlay.Wait(1.0f, fadeOut)); }); }
public void OnTryAgainClick() { //Debug.Log("Try Again not implemented"); int hearts; PF_PlayerData.virtualCurrency.TryGetValue(GlobalStrings.HEART_CURRENCY, out hearts); if (hearts > 0) { // decrement HT currency hearts -= 1; PF_PlayerData.virtualCurrency[GlobalStrings.HEART_CURRENCY] = hearts; PF_PlayerData.SubtractLifeFromPlayer(); // will need to trigger Cloud Script to tick this on the server side PF_PlayerData.activeCharacter.RefillVitals(); PF_GamePlay.OutroPane(gameObject, .333f, null); GameplayController.RaiseGameplayEvent(GlobalStrings.PLAYER_RESPAWN_EVENT, PF_GamePlay.GameplayEventTypes.EnemyTurnEnds); } }
public void AcceptLevelupInput(int spellNumber) { PF_PlayerData.activeCharacter.PlayerVitals.skillSelected = spellNumber; PF_GamePlay.OutroPane(LevelUpPane.gameObject, .333f, null); }
public void AcceptLevelupInput(int spellNumber) { Debug.Log("Level-UP: Spell Number: " + spellNumber); PF_PlayerData.activeCharacter.PlayerVitals.skillSelected = spellNumber; PF_GamePlay.OutroPane(this.LevelUpPane.gameObject, .333f, null); }
public void StartQuest() { PF_GamePlay.OutroPane(gameObject, .75f); GameplayController.RaiseGameplayEvent(GlobalStrings.QUEST_START_EVENT, PF_GamePlay.GameplayEventTypes.StartQuest); }
public void ContinueToGameOver() { GameplayController.RaiseGameplayEvent(GlobalStrings.PLAYER_DIED_EVENT, PF_GamePlay.GameplayEventTypes.EndQuest); PF_GamePlay.OutroPane(gameObject, .75f); }
public void ContinueToQuestComplete() { GameplayController.RaiseGameplayEvent(GlobalStrings.QUEST_COMPLETE_EVENT, PF_GamePlay.GameplayEventTypes.OutroQuest); PF_GamePlay.OutroPane(gameObject, .75f); }
private void OnGameplayEventReceive(string message, GamePlayManager.GameplayEvent type) { if (type == GamePlayManager.GameplayEvent.IntroQuest) { //string levelname = (string)PhotonNetwork.room.CustomProperties["Level"]; //OpenConfirmPanel(PF_GameData.Levels[levelname].Acts.Values.ToList()[0].IntroMonolog); } if (type == GamePlayManager.GameplayEvent.StartQuest) { GenerateHealthBar(); orderBarController.Init(this.unitController); Debug.Log(" Geenerate Health Bar !!!"); } if (type == GamePlayManager.GameplayEvent.MyPlayerPreMove) { if (unitController.currentUnit == null) { return; } if (GamePlayManager.IsMultiPlayer) { if (playManager.IsPhotonPlayersTurn(unitController.currentUnit.name)) { ActionBar.Init(unitController.currentUnit); } } else { ActionBar.Init(unitController.currentUnit); } } if (type == GamePlayManager.GameplayEvent.MyPlayerPreAttack) { if (unitController.currentUnit == null) { return; } if (GamePlayManager.IsMultiPlayer) { if (unitController.currentUnit.name.Contains(PhotonNetwork.player.UserId)) { ActionBar.EnableSkills(); } } else { ActionBar.EnableSkills(); } } if (type == GamePlayManager.GameplayEvent.TurnEnd) { ActionBar.Close(); orderBarController.RefreshBar(); } if (type == GamePlayManager.GameplayEvent.OutroAct) { PF_GamePlay.OutroPane(healthBarParent.gameObject, 0); } }