Пример #1
0
        public void OnEndPokemonBattle()
        {
            RpgManager.Instance.gameState = RpgManager.Instance.gameState ^ RpgManager.GameState.Minigame;

            RpgManager.SetKey(SaveKey.defeatedCerberus, -2);
            cerberusMovable.transform.position = luckyMovable.transform.position;
            StartCoroutine(EndPokemonCoroutine());
        }
Пример #2
0
        public void OnEndFacebook()
        {
            RpgManager.Instance.gameState = RpgManager.Instance.gameState ^ RpgManager.GameState.Minigame;

            AudioSource audioSource = GetComponent <AudioSource>();

            audioSource.clip   = musicAfterFb;
            audioSource.volume = 1.0f;
            audioSource.time   = musicStartAt;
            audioSource.Play();

            RpgManager.SetKey(SaveKey.facebookDone, 1);

            RpgManager.SaveGame("Bed");

            computer.active = false;
            player.Talk(tb_afterFB_1, OnEndFacebook2);
        }
Пример #3
0
        private IEnumerator EndInteraction()
        {
            player.movementEnabled = false;

            MovableEntity movable = GetComponentInChildren <MovableEntity>();
            var           rb      = movable.GetComponent <Rigidbody2D>();

            rb.bodyType = RigidbodyType2D.Dynamic;
            movable.MoveTo(RpgManager.Player.transform.position);

            yield return(new WaitWhile(() => movable.isMoving));

            character.SetActive(false);

            if (isAltea)
            {
                RpgManager.SetKey(SaveKey.metAltea, 1);
            }
            else
            {
                RpgManager.SetKey(SaveKey.metOrion, 1);
                player.attackEnabled = true;
            }

            RpgManager.SaveGame(isAltea ? "SPA" : "Orion");

            float oldvolume = RpgManager.CurrentStory.GetMusicVolume();

            RpgManager.CurrentStory.SetMusicVolume(0);
            RpgManager.PlaySFX(sfx_jingle);
            bool wait = true;

            player.Talk((isAltea ? "Altea" : "Orion") + " rejoint l'equipe !", () => wait = false);
            yield return(new WaitForSeconds(sfx_jingle.length - 1));

            yield return(new WaitWhile(() => wait));

            gameObject.SetActive(false);

            player.EndTalk();
            RpgManager.CurrentStory.SetMusicVolume(oldvolume);
        }
Пример #4
0
        private IEnumerator Beginning()
        {
            player.movementEnabled = false;

            yield return(new WaitForSeconds(1));

            bool wait = true;

            player.Talk(tb_beginning_1, () => wait = false);
            yield return(new WaitWhile(() => wait == true));

            wait = true;
            player.Talk(tb_beginning_2, () => wait = false);
            yield return(new WaitWhile(() => wait == true));

            player.EndTalk();
            RpgManager.SetKey(SaveKey.facebookDone, -1);

            RpgManager.SaveGame("Entrance");
        }
Пример #5
0
        private void Awake()
        {
            papaBullEvent.onEndInteraction += () => {
                if (RpgManager.GetKey(SaveKey.seenBull) != 1)
                {
                    RpgManager.SetKey(SaveKey.seenBull, 1);
                    snakeBefore.gameObject.SetActive(false);
                    bool b = RpgManager.GetKey(SaveKey.seenSnake) != 1 && RpgManager.GetKey(SaveKey.metAltea) == 0;
                    snakeAfter.gameObject.SetActive(b);
                }
            };

            snakeBefore.onEndInteraction += () => {
                RpgManager.SetKey(SaveKey.seenSnake, -1);
                snakeBefore.gameObject.SetActive(false);
                snakeAfter.gameObject.SetActive(false);
            };
            snakeAfter.onEndInteraction += () => {
                RpgManager.SetKey(SaveKey.seenSnake, 1);
                snakeBefore.gameObject.SetActive(false);
                snakeAfter.gameObject.SetActive(false);
            };

            entreeMontgeron.onEndInteraction += () => {
                RpgManager.SetKey(SaveKey.seenMontgeron, 1);
                entreeMontgeron.gameObject.SetActive(false);
                papaBullCreature.gameObject.SetActive(false);
                RpgManager.SaveGame("Montgeron");
            };

            maisonMontgeron.onEndInteraction += () => {
                RpgManager.SetKey(SaveKey.seenHouse, 1);
                maisonMontgeron.gameObject.SetActive(false);
                teleporterMontgeron.gameObject.SetActive(true);
            };
        }
Пример #6
0
        private IEnumerator EndPokemonCoroutine()
        {
            bool wait = true;

            RpgManager.Instance.discussionInterface.SetImage(false, alteaSprite);
            player.Dialog(false, "Altea : Tu l'as vaincu ! Tu as vaincu le démon ! Nous sommes sauvés !", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, orionSprite);
            player.Dialog(false, "Orion : Attendez, il se passe quelque chose ! Mais quelle est cette lumière ?", () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();

            wait = true;
            BossExplosion explosion = Instantiate(explosionPrefab).GetComponent <BossExplosion>();

            explosion.OnWhiteScreenEvent += () => wait = false;
            explosion.OnFinishedEvent    += () => wait = false;

            cerberusMovable.Hit();

            yield return(new WaitWhile(() => wait));

            wait = true;
            cerberusMovable.gameObject.SetActive(false);
            luckyMovable.gameObject.SetActive(true);
            luckyMovable.LookAt(morganePos1);

            yield return(new WaitWhile(() => wait));

            orionMovable.MoveTo(morganePos1 + Vector3.up + Vector3.right);
            maximeMovable.MoveTo(morganePos1 + Vector3.up + Vector3.right);
            yield return(new WaitWhile(() => maximeMovable.isMoving));

            maximeMovable.MoveTo(morganePos1 + Vector3.right);
            yield return(new WaitWhile(() => maximeMovable.isMoving));

            maximeMovable.LookTowards(Vector3.down);

            audioSource.clip = baseMusic;
            audioSource.time = 12f;
            audioSource.Play();

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, maximeSprite);
            player.Dialog(false, "Maxime : Ca alors, il s'est transformé !", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, orionSprite);
            player.Dialog(false, "Orion : Et je ne sens plus aucune aura maléfique. Il semblerait que le démon ait disparu.", () => wait = false);
            alteaMovable.MoveTo(player.transform.position + Vector3.up + Vector3.left);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, alteaSprite);
            player.Dialog(false, "Altea : Morgane a reussi à l'exorciser. Cette chienne était sous son emprise, c'est terrible.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            player.Dialog(true, "Morgane : C'est pas faux.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, luckySprite);
            player.Dialog(false, "????? : Merci de m'avoir libérée, Humaine. Tes amis ont raison. J'étais possédée par ce démon depuis bien longtemps.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            player.Dialog(true, "Morgane : Si tu n'es plus le démon, qui es-tu ? Je m'appelle Morgane.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, luckySprite);
            player.Dialog(false, "Lucky : Tu peux m'appeler Lucky. Cela symbolisera la chance que j'ai de vous avoir rencontrés, toi et Maxime.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, luckySprite);
            player.Dialog(false, "Lucky : Il t'aime beaucoup tu sais ? Je crois qu'il avait quelque chose à te montrer.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            luckyMovable.MoveTo(luckyMovable.transform.position + Vector3.down);
            maximeMovable.LookAt(player.transform.position);
            yield return(new WaitForSeconds(0.3f));

            playerMovable.LookAt(maximeMovable.transform.position);
            yield return(new WaitForSeconds(0.2f));

            yield return(new WaitWhile(() => luckyMovable.isMoving));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, maximeSprite);
            player.Dialog(false, "Maxime : Merci de m'avoir libéré. Tu es exceptionnelle.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            player.Dialog(true, "Morgane : Oh, Chaton !", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, maximeSprite);
            player.Dialog(false, "Maxime : Que dis-tu de t'installer ici ? On y est super bien, il y a de la place pour tout le monde.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, alteaSprite);
            player.Dialog(false, "Altea : Ce serait un honneur de vivre ici avec vous. Il me faura juste un temps d'adaptation.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            luckyMovable.MoveTo(luckyMovable.transform.position + Vector3.up);

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, orionSprite);
            player.Dialog(false, "Orion : Ouais, ouais, c'est pas mal.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, luckySprite);
            player.Dialog(false, "Lucky : Je vous innonderai d'amour !", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            player.Dialog(true, "Morgane : Arrêtez, je pleure déjà !", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            RpgManager.Instance.discussionInterface.SetImage(false, maximeSprite);
            player.Dialog(false, "Maxime : Morgane. Tu devrais faire le tour de la maison. Quelque chose t'attend à l'étage.", () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            player.Dialog(true, "Morgane : A l'étage ?", () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            playerMovable.enabled   = false;
            player.overrideMovement = false;
            RpgManager.SetKey(SaveKey.defeatedCerberus, 1);
            RpgManager.LoadScene("Montgeron", "Entrance");
            RpgManager.SaveGame("Entrance");
        }
Пример #7
0
        private IEnumerator FindMaxime()
        {
            entrance.gameObject.SetActive(false);
            player.overrideMovement = true;

            if (playerMovable == null)
            {
                playerMovable = player.gameObject.GetComponent <MovableEntity>();
            }
            if (playerMovable == null)
            {
                playerMovable = player.gameObject.AddComponent <MovableEntity>();
            }

            maximeMovable.transform.position   = maxPosition;
            alteaMovable.transform.position    = startPos;
            orionMovable.transform.position    = startPos;
            cerberusMovable.transform.position = startPos;
            cerberusMovable.gameObject.SetActive(false);
            luckyMovable.transform.position = morganePos1 + Vector3.down * 2;
            luckyMovable.gameObject.SetActive(false);

            playerMovable.LookTowards(Vector3.up);
            alteaMovable.MoveTo(startPos - Vector3.right);
            orionMovable.MoveTo(startPos + Vector3.right);
            yield return(new WaitWhile(() => alteaMovable.isMoving));

            alteaMovable.LookTowards(Vector3.up);
            orionMovable.LookTowards(Vector3.up);
            wait = true;
            player.Talk("Max ?", () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            playerMovable.MoveTo(morganePos1, speed_walk);
            yield return(new WaitWhile(() => playerMovable.isMoving));

            wait = true;
            player.Talk("Maxime !", () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            playerMovable.MoveTo(morganePos2, speed_run);
            yield return(new WaitUntil(() => playerMovable.isMoving == false));

            RpgManager.Instance.discussionInterface.SetImage(false, maximeSprite);
            counter = 0;
            while (counter < firstDialogue.Count)
            {
                wait = true;
                bool isMorgane = firstDialogue[counter].Split(':')[0] == "Morgane ";
                player.Dialog(isMorgane, firstDialogue[counter], () => wait = false);
                counter++;
                yield return(new WaitWhile(() => wait));
            }

            player.EndTalk();
            alteaMovable.MoveTo(catsPosition - Vector3.right);
            orionMovable.MoveTo(catsPosition + Vector3.right);
            yield return(new WaitWhile(() => alteaMovable.isMoving));

            orionMovable.LookTowards(Vector3.down);
            RpgManager.Instance.discussionInterface.SetImage(false, alteaSprite);
            wait = true;
            player.Dialog(false, talk_altea, () => wait = false);
            yield return(new WaitWhile(() => wait));

            playerMovable.LookTowards(Vector3.down);
            RpgManager.Instance.discussionInterface.SetImage(false, orionSprite);
            wait = true;
            player.Dialog(false, talk_orion, () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            audioSource.clip = bossMusic;
            audioSource.Play();
            cerberusMovable.gameObject.SetActive(true);
            cerberusMovable.LookTowards(Vector3.up);
            alteaMovable.LookTowards(Vector3.down);
            playerMovable.MoveTo(morganePos1, speed_walk);
            yield return(new WaitWhile(() => playerMovable.isMoving));

            wait = true;
            player.Dialog(false, talk_orion_dog1, () => wait = false);
            yield return(new WaitWhile(() => wait));

            wait = true;
            player.Dialog(false, talk_orion_dog2, () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            wait = true;
            player.Talk(talk_dog, () => wait = false);
            yield return(new WaitWhile(() => wait));

            player.EndTalk();
            cerberusMovable.MoveTo(morganePos1 + Vector3.down, speed_walk);
            yield return(new WaitWhile(() => cerberusMovable.isMoving));

            cerberusMovable.Hit();

            RpgManager.SetKey(SaveKey.defeatedCerberus, -1);

            RpgManager.Instance.gameState = RpgManager.Instance.gameState ^ RpgManager.GameState.Minigame;
            TransitionBattle trbattle = TransitionBattle.Instance;

            trbattle.onClosureFinished = () => { SceneManager.LoadScene("PokemonBattle", LoadSceneMode.Additive); };
            trbattle.StartSpiralCoroutine();
        }