Example #1
0
 public void PlayDeathCinematic(bool isTutorial)
 {
     if (isTutorial)
     {
         playerDeathCinematic.PlayCinematic(OpenLosePanelTutorial, true);
     }
     else
     {
         playerDeathCinematic.PlayCinematic(OpenLosePanelNotTutorial, true);
     }
 }
Example #2
0
    public void StartOutro()
    {
        outroCinematicProgress = ProgressionState.InProgress;

        if (goalParameters.GetArenaGameMode != ArenaGameMode.Escape)
        {
            gameManager.Player.ShipMvt.StopShip();
        }
        else
        {
            gameManager.StopPlayerCamFollow();
        }

        if (outroCinematic != null)
        {
            if (!outroCinematic.Ended)
            {
                outroCinematic.PlayCinematic();
            }
            else
            {
                EndOutro();
            }
        }
        else
        {
            EndOutro();
        }

        gameManager.HidePlayerInterface();
    }
Example #3
0
 public override void ReceiveDamage(IDamageSource damageSource, DamagesParameters damagesParameters, ProjectileSpecialParameters projSpecialParameters)
 {
     if (damageSource.GetDamageTag == AttackTag.Player)
     {
         if (!GameManager.gameManager.CinematicMng.CinematicProcessing)
         {
             IntroControler dialogue = dialoguesToLaunchOnFleeingEnemyHitByShot[Random.Range(0, dialoguesToLaunchOnFleeingEnemyHitByShot.Length)];
             dialogue.PlayCinematic();
         }
     }
 }
Example #4
0
    public void StartIntro()
    {
        introCinematicProgress = ProgressionState.InProgress;
        gameManager.Player.ShipMvt.StopShip();

        if (introCinematic != null)
        {
            if (!introCinematic.Ended)
            {
                introCinematic.PlayCinematic();
            }
            else
            {
                EndIntro();
            }
        }
        else
        {
            EndIntro();
        }
    }
    public void PlayStepIntro()
    {
        currentPhase = TutorialStepPhase.Intro;

        foreach (Animator animator in animatorsToPlayInIntro)
        {
            animator.SetInteger("Tuto", animator.GetInteger("Tuto") + 1);
        }

        if (stopThePlayerOnIntro)
        {
            GameManager.gameManager.Player.ShipMvt.StopShip();
        }

        if (introCinematic != null)
        {
            introCinematic.PlayCinematic();
        }
        else
        {
            StartStepResolution();
        }
    }
Example #6
0
    public void CheckMapProgression()
    {
        IntersceneManager intersceneManager = IntersceneManager.intersceneManager;

        if (intersceneManager != null)
        {
            bool passedTutorial = false;

            PlayerProgressionDatas progressionDatas = PlayerDataSaver.LoadProgressionDatas();

            ArenaIntersceneInformations arenaIntersceneInformations = intersceneManager.ArenaInterscInformations;

            #region Tutorial
            if (arenaIntersceneInformations.GetNeedToPassTutorial)
            {
                if (arenaIntersceneInformations.GetArenaPassed)
                {
                    progressionDatas.SetPassedTutorial();
                    arenaIntersceneInformations.SetNeedToPassTutorial(false);
                    PlayerDataSaver.SavePlayerProgressionDatas(progressionDatas.GetAllPassedArenaDatas, true);
                }
            }

            if (progressionDatas != null)
            {
                passedTutorial = progressionDatas.GetPassedTuto;
            }
            #endregion

            #region Already Unlocked

            #region V2
            List <PassedArenaData> allPassedArenaDatas = new List <PassedArenaData>();
            if (progressionDatas != null)
            {
                allPassedArenaDatas = progressionDatas.GetAllPassedArenaDatas;
                if (allPassedArenaDatas == null)
                {
                    allPassedArenaDatas = new List <PassedArenaData>();
                }

                foreach (PassedArenaData datas in allPassedArenaDatas)
                {
                    foreach (MapArenaSpot arenaSpot in allMapArenaSpots)
                    {
                        if (arenaSpot.GetArenaParameters.GetSceneToLoadName == datas.GetArenaName && datas.GetArenaPassed)
                        {
                            arenaSpot.UnlockNextProgressionContent(false, datas.GetNumberOfStars);
                            break;
                        }
                    }
                }
            }
            else
            {
                Debug.Log("pas encore d'arènes débloquées");
            }
            #endregion
            #endregion

            #region Just Unlocked
            ArenaParameters lastArenaParameters = arenaIntersceneInformations.GetLaunchedArenaParameters;
            if (lastArenaParameters == null)
            {
                arenaIntersceneInformations.SetArenaPassed(false, 0);

                if (intersceneManager.ArenaInterscInformations.GetJustPassedTutorial)
                {
                    intersceneManager.ArenaInterscInformations.SetJustPassedTutorial(false);
                    if (cinematicToPlayAfterTutorial != null)
                    {
                        cinematicToPlayAfterTutorial.PlayCinematic();
                    }
                }

                return;
            }

            #region V2
            List <string> passedArenaNames = new List <string>();

            if (allPassedArenaDatas == null)
            {
                allPassedArenaDatas = new List <PassedArenaData>();
            }

            foreach (PassedArenaData datas in allPassedArenaDatas)
            {
                if (datas.GetArenaPassed)
                {
                    passedArenaNames.Add(datas.GetArenaName);
                }
            }

            if (arenaIntersceneInformations.GetArenaPassed)
            {
                int stars = arenaIntersceneInformations.GetNumberOfStars;

                if (passedArenaNames.Contains(lastArenaParameters.GetSceneToLoadName))
                {
                    foreach (MapArenaSpot arenaSpot in allMapArenaSpots)
                    {
                        if (arenaSpot.GetArenaParameters.GetSceneToLoadName == lastArenaParameters.GetSceneToLoadName)
                        {
                            if (stars > arenaSpot.GetStarsNumber)
                            {
                                arenaSpot.UnlockNextProgressionContent(false, stars);
                            }

                            foreach (PassedArenaData datas in allPassedArenaDatas)
                            {
                                if (datas.GetArenaName == lastArenaParameters.GetSceneToLoadName)
                                {
                                    datas.ChangeNumberOfStars(stars);
                                    break;
                                }
                            }
                            PlayerDataSaver.SavePlayerProgressionDatas(allPassedArenaDatas, passedTutorial);
                            break;
                        }
                    }
                    return;
                }

                foreach (MapArenaSpot arenaSpot in allMapArenaSpots)
                {
                    if (arenaSpot.GetArenaParameters.GetSceneToLoadName == lastArenaParameters.GetSceneToLoadName)
                    {
                        arenaSpot.UnlockNextProgressionContent(true, stars);
                        break;
                    }
                }

                allPassedArenaDatas.Add(new PassedArenaData(lastArenaParameters, true, stars));
                PlayerDataSaver.SavePlayerProgressionDatas(allPassedArenaDatas, passedTutorial);
            }
            #endregion
            #endregion

            bool arenaPassed   = arenaIntersceneInformations.GetArenaPassed;
            int  numberOfStars = arenaIntersceneInformations.GetNumberOfStars;

            //arenaIntersceneInformations.SetArenaLaunchInformations(null);
            arenaIntersceneInformations.SetArenaPassed(false, 0);
        }
    }
Example #7
0
    public List <IDamageReceiver> SpawnEnemies()
    {
        spawned = true;

        List <EnemySpawnPoint> availableCommonSpawnPoints = new List <EnemySpawnPoint>(commonEnemiesSpawnPoints);
        List <EnemySpawnPoint> availableRareSpawnPoints   = new List <EnemySpawnPoint>(rareEnemiesSpawnPoints);

        spawnedEnemies = new List <IDamageReceiver>();

        bool stopSpawnedEnemies = false;

        if (cinematicToPlayOnWaveStart != null)
        {
            stopSpawnedEnemies = cinematicToPlayOnWaveStart.StopSpawnedEnemies || spawnedEnemiesAreStopped;
        }
        else
        {
            stopSpawnedEnemies = spawnedEnemiesAreStopped;
        }

        List <EnemyShip> allSpawnedEnemies = new List <EnemyShip>();

        PlayerShip playerShip = GameManager.gameManager.Player;

        #region Common
        for (int i = 0; i < numberOfCommonEnemies; i++)
        {
            if (availableCommonSpawnPoints.Count == 0)
            {
                Debug.Log("pas de spawn points disponibles : impossible de spawner l'ennemi commun");
                break;
            }
            EnemySpawnPoint chosenSpawnPoint = availableCommonSpawnPoints.GetRandomMemberOfTheList();

            EnemyShipPoolTag enemyPoolTag = commonEnemies.GetRandomElementFromSystem();

            EnemyShip spawnedEnemy = GameManager.gameManager.PoolManager.GetEnemyShip(enemyPoolTag, PoolInteractionType.GetFromPool);
            spawnedEnemy.transform.position = chosenSpawnPoint.transform.position;
            spawnedEnemy.transform.rotation = chosenSpawnPoint.transform.rotation;

            spawnedEnemy.ExternalSetUp(chosenSpawnPoint.GetLinkedWatchingRoundParameters);

            availableCommonSpawnPoints.Remove(chosenSpawnPoint);

            spawnedEnemies.Add(spawnedEnemy.GetShipDamageReceiver);
            spawnedEnemy.GetShipDamageReceiver.OnDeath += new OnLifeEvent(RemoveSpawnedEnemy);

            spawnedEnemy.SetDropParameters(dropParameters.GetEnemyDropParameters(enemyPoolTag));

            allSpawnedEnemies.Add(spawnedEnemy);

            if (commonEnemiesHighlightingType != HighlightingType.None)
            {
                spawnedEnemy.StartEnemyHighlighting(playerShip, commonEnemiesHighlightingType == HighlightingType.Important);
                //if (!spawnedEnemiesArentHighlighted)
                //playerShip.StartEnemyHighlighting(spawnedEnemy);
            }

            if (stopSpawnedEnemies)
            {
                spawnedEnemy.ShipMvt.InstantStopShip();
            }

            if (spawnedEnemiesAutoDetectPlayer)
            {
                spawnedEnemy.AutoDetectPlayer();
            }
        }
        #endregion

        #region Rare
        for (int i = 0; i < numberOfRareEnemies; i++)
        {
            if (availableRareSpawnPoints.Count == 0)
            {
                Debug.Log("pas de spawn points disponibles : impossible de spawner l'ennemi rare");
                break;
            }

            EnemySpawnPoint chosenSpawnPoint = availableRareSpawnPoints.GetRandomMemberOfTheList();

            EnemyShipPoolTag enemyPoolTag = rareEnemies.GetRandomElementFromSystem();

            EnemyShip spawnedEnemy = GameManager.gameManager.PoolManager.GetEnemyShip(enemyPoolTag, PoolInteractionType.GetFromPool);
            spawnedEnemy.transform.position = chosenSpawnPoint.transform.position;
            spawnedEnemy.transform.rotation = chosenSpawnPoint.transform.rotation;

            spawnedEnemy.ExternalSetUp(chosenSpawnPoint.GetLinkedWatchingRoundParameters);

            availableCommonSpawnPoints.Remove(chosenSpawnPoint);

            spawnedEnemies.Add(spawnedEnemy.GetShipDamageReceiver);
            spawnedEnemy.GetShipDamageReceiver.OnDeath += new OnLifeEvent(RemoveSpawnedEnemy);

            spawnedEnemy.SetDropParameters(dropParameters.GetEnemyDropParameters(enemyPoolTag));

            allSpawnedEnemies.Add(spawnedEnemy);

            if (rareEnemiesHighlightingType != HighlightingType.None)
            {
                spawnedEnemy.StartEnemyHighlighting(playerShip, rareEnemiesHighlightingType == HighlightingType.Important);
            }
            //if (!spawnedEnemiesArentHighlighted)
            //playerShip.StartEnemyHighlighting(spawnedEnemy);

            if (stopSpawnedEnemies)
            {
                spawnedEnemy.ShipMvt.InstantStopShip();
            }

            if (spawnedEnemiesAutoDetectPlayer)
            {
                spawnedEnemy.AutoDetectPlayer();
            }
        }
        #endregion

        if (cinematicToPlayOnWaveStart != null)
        {
            if (stopSpawnedEnemies)
            {
                cinematicToPlayOnWaveStart.PlayCinematic(allSpawnedEnemies);
            }
            else
            {
                cinematicToPlayOnWaveStart.PlayCinematic();
            }
        }
        else
        {
            if (stopSpawnedEnemies)
            {
                GameManager.gameManager.CinematicMng.SetShipsToStart(allSpawnedEnemies);
            }
        }

        //GameManager.gameManager.ShowDebugText(waveName + " started (after enemy spawn)");
        return(spawnedEnemies);
    }