コード例 #1
0
    public void ShowInfo(DisplayStates state)
    {
        activeState = state;

        if (state == DisplayStates.ActIntro)
        {
            UpdateFields_Act();
        }
        else if (state == DisplayStates.ActOutro)
        {
            UpdateFields_Act();
        }
        else if (state == DisplayStates.BossIntro)
        {
            // hack to make sure that we do not stomp on already existing info slides
            if (cg.alpha == 0)
            {
                UpdateFields_Boss();

                StartCoroutine(Spin());
                PF_GamePlay.IntroPane(gameObject, .75f);
            }
        }
        else if (state == DisplayStates.PlayerDied)
        {
            UpdateFields_Fail();
            PF_GamePlay.IntroPane(gameObject, .75f);
        }
    }
コード例 #2
0
 public void FadeAdsIn(UnityAction callback = null)
 {
     PF_GamePlay.IntroPane(AdObject, .5f, () =>
     {
         if (callback != null)
         {
             callback();
         }
     });
 }
コード例 #3
0
    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
            }
        }
    }
コード例 #4
0
    void EvaluateLevelUp()
    {
        if (XpBar.maxValue < PF_PlayerData.activeCharacter.characterData.ExpThisLevel + PF_GamePlay.QuestProgress.XpCollected)
        {
            // Level Up!!!
            PF_PlayerData.activeCharacter.PlayerVitals.didLevelUp = true;
            PF_GamePlay.IntroPane(LevelUp.gameObject, .333f, null);

            LevelUpPane.Init();
            StartCoroutine(PF_GamePlay.Wait(1.5f, () => { PF_GamePlay.IntroPane(LevelUpPane.gameObject, .333f, null); }));
        }
    }
コード例 #5
0
    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);
        }
    }
コード例 #6
0
    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));
        });
    }
コード例 #7
0
    private void OnGameplayEventReceive(string message, GamePlayManager.GameplayEvent type)
    {
        if (type == GamePlayManager.GameplayEvent.IntroQuest)
        {
            //PF_GamePlay.IntroPane(actIntroObject.gameObject, 0);
            actIntroObject.ShowInfo();
        }

        if (type == GamePlayManager.GameplayEvent.OnAllPlayerReady)
        {
            actIntroObject.RefreshConfirmPanel();
        }

        if (type == GamePlayManager.GameplayEvent.OutroAct)
        {
            actOutroObject.UpdateQuestStats();
            PF_GamePlay.IntroPane(actOutroObject.gameObject, 0);
        }
    }