Ejemplo n.º 1
0
    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();
            }
        }));
    }
Ejemplo n.º 2
0
    public void ContinueToNextAct()
    {
        dirCanvasController.gameplayController.turnController.AdvanceAct();

        UnityAction afterActAdvances = () => { ShowInfo(DisplayStates.ActIntro); };

        PF_GamePlay.Wait(1.0f, afterActAdvances);
    }
Ejemplo n.º 3
0
    // NEED TO MAKE THIS A COROUTINE
    public void CloseSettingsMenu()
    {
        TweenPos.Tween(this.menuOverlayPanel.gameObject, .5f, new Vector3(Screen.width / 2, Screen.height / 2, 0), new Vector3(0, 0, 0), TweenMain.Style.Once, TweenMain.Method.EaseIn, null, Space.World);
        TweenScale.Tween(this.menuOverlayPanel.gameObject, .5f, new Vector3(1, 1, 1), new Vector3(0, 0, 0), TweenMain.Style.Once, TweenMain.Method.EaseIn, null);

        StartCoroutine(PF_GamePlay.Wait(.75f, () =>
        {
            menuOverlayPanel.gameObject.SetActive(false);
            ToggleOpenCloseButtons();
        }));
    }
Ejemplo n.º 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); }));
        }
    }
Ejemplo n.º 5
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));
        });
    }
    void OnGameplayEventReceived(string message, PF_GamePlay.GameplayEventTypes type)
    {
        if (type == PF_GamePlay.GameplayEventTypes.IntroQuest)
        {
            ActionBar.UpdateSpellBar();
            Init();
        }

        if (type == PF_GamePlay.GameplayEventTypes.IntroEncounter)
        {
            StartCoroutine(PF_GamePlay.Wait(.5f, () => { TransitionEncounterBarIn(); }));
        }

        if (type == PF_GamePlay.GameplayEventTypes.PlayerTurnBegins)
        {
            TransitionActionBarIn();
        }
    }
    IEnumerator Shake(float seconds, PF_GamePlay.ShakeEffects effect = PF_GamePlay.ShakeEffects.None)
    {
        yield return(new WaitForSeconds(seconds));

        this.shaker.ResetToBeginning();             //new Vector3 (0,this.transform.position.y, this.transform.position.z);
        this.isShaking      = false;
        this.shaker.enabled = false;

        if (effect == PF_GamePlay.ShakeEffects.DecreaseHealth)
        {
            int remainingHP = LifeBar.currentValue - this.pendingValue;
            yield return(StartCoroutine(LifeBar.UpdateBar(remainingHP)));

            if (remainingHP > 0)
            {
                StartCoroutine(PF_GamePlay.Wait(1.0f, () => { GameplayController.RaiseGameplayEvent(GlobalStrings.ENEMY_TURN_END_EVENT, PF_GamePlay.GameplayEventTypes.EnemyTurnEnds); }));
            }
            else
            {
                GameplayController.RaiseGameplayEvent(GlobalStrings.OUTRO_PLAYER_DEATH_EVENT, PF_GamePlay.GameplayEventTypes.OutroEncounter);
            }
        }
        else if (effect == PF_GamePlay.ShakeEffects.IncreaseHealth)
        {
            int remainingHP = LifeBar.currentValue + this.pendingValue;
            yield return(StartCoroutine(LifeBar.UpdateBar(remainingHP)));

            StartCoroutine(PF_GamePlay.Wait(.5f, () => { GameplayController.RaiseGameplayEvent(GlobalStrings.PLAYER_TURN_END_EVENT, PF_GamePlay.GameplayEventTypes.PlayerTurnEnds); }));
        }
        else if (effect == PF_GamePlay.ShakeEffects.DecreaseMana)
        {
            StartCoroutine(ManaBar.UpdateBar(LifeBar.currentValue - this.pendingValue));
        }
        else if (effect == PF_GamePlay.ShakeEffects.IncreaseMana)
        {
            StartCoroutine(ManaBar.UpdateBar(LifeBar.currentValue + this.pendingValue));
        }

        this.pendingValue = 0;

        yield break;
    }
Ejemplo n.º 8
0
    IEnumerator Shake(float seconds, PF_GamePlay.ShakeEffects effect = PF_GamePlay.ShakeEffects.None)
    {
        yield return(new WaitForSeconds(seconds));

        this.shaker.value   = new Vector3(this.shaker.from.x + (this.shaker.to.x - this.shaker.from.x) / 2, this.shaker.from.y, this.shaker.from.z);
        this.isShaking      = false;
        this.shaker.enabled = false;

        if (effect == PF_GamePlay.ShakeEffects.DecreaseHealth)
        {
            yield return(StartCoroutine(bar.UpdateBar(this.pendingValue)));

            if (this.pendingValue > 0)
            {
                StartCoroutine(PF_GamePlay.Wait(.5f, () => { GameplayController.RaiseGameplayEvent(GlobalStrings.PLAYER_TURN_END_EVENT, PF_GamePlay.GameplayEventTypes.PlayerTurnEnds); }));
            }
            else
            {
                GameplayController.RaiseGameplayEvent(GlobalStrings.OUTRO_ENEMY_DIED_EVENT, PF_GamePlay.GameplayEventTypes.OutroEncounter);
            }
        }
        else if (effect == PF_GamePlay.ShakeEffects.IncreaseHealth)
        {
            StartCoroutine(bar.UpdateBar(this.pendingValue));
        }
        else if (effect == PF_GamePlay.ShakeEffects.DecreaseMana)
        {
            StartCoroutine(bar.UpdateBar(this.pendingValue));
        }
        else if (effect == PF_GamePlay.ShakeEffects.IncreaseMana)
        {
            StartCoroutine(bar.UpdateBar(this.pendingValue));
        }

        this.pendingValue = 0;



        yield break;
    }
Ejemplo n.º 9
0
    public void TogglePushNotification()
    {
        if (!PF_PlayerData.isRegisteredForPush)
        {
            DialogCanvasController.RequestLoadingPrompt(PlayFabAPIMethods.Generic);
            UnityAction afterPush = () =>
            {
                changedLoginState = true;
                PF_PlayerData.isRegisteredForPush = true;
                SetCheckBox(registerPush.GetComponent <Image>(), true);
                Debug.Log("AccountStatusController: PUSH ENABLED!");
                PF_Bridge.RaiseCallbackSuccess(string.Empty, PlayFabAPIMethods.Generic, MessageDisplayStyle.none);
            };

            StartCoroutine(PF_GamePlay.Wait(1.5f, () =>
            {
                PF_PlayerData.RegisterForPushNotification(pushToken, afterPush);
            }));
        }
        else
        {
            Action <bool> processResponse = response =>
            {
                if (!response)
                {
                    return;
                }

                changedLoginState = true;
                PF_PlayerData.isRegisteredForPush = false;
                SetCheckBox(registerPush.GetComponent <Image>(), false);
                Debug.Log("AccountStatusController: PUSH DISABLED!");
            };

            DialogCanvasController.RequestConfirmationPrompt(GlobalStrings.PUSH_NOTIFY_PROMPT, GlobalStrings.PUSH_NOTIFY_MSG, processResponse);
        }
    }