public void OkButtonClicked()
    {
        mapSFX.PlayMapSoundSFX(MapSFX.MapSoundEffect.ButtonPress);
        MapData mapData = FindObjectOfType <MapData>();

        if (currentSquare.GetIsGoal() && !mapData.GetHasGoalBeenReached())
        {
            mapData.SetWasPlayerOnGoalBeforeCombat(true);
        }
        else if (currentSquare.GetIsExtraction())
        {
            mapData.SetWasPlayerOnExtractionBeforeCombat(true);
        }
        mapData.StartBattleIfEnemyExists(currentSquare);

        if (goalAfterTrap)
        {
            mapConfig.GetGoalWindow().OpenGoalWindow(currentSquare);
        }
        else if (extractAfterTrap)
        {
            mapConfig.GetExtractionWindow().OpenExtractionWindow();
        }
        else
        {
            FindObjectOfType <MapConfig>().SetIsAMenuOpen(false);
        }
        gameObject.SetActive(false);
    }
Exemple #2
0
    public void PlayerFinishesMoving(MapSquare currentSquare)
    {
        CheckMapGridExists();
        bool moveOnToBattle  = PostMovementActions(currentSquare);
        bool trapSprung      = false;
        bool goalReady       = false;
        bool extractionReady = false;

        if (moveOnToBattle)
        {
            if (currentSquare.GetIsGoal() && !hasGoalBeenReached)
            {
                wasPlayerOnGoalBeforeCombat = true;
            }
            else if (currentSquare.GetIsExtraction())
            {
                wasPlayerOnExtractionBeforeCombat = true;
            }
            StartBattleIfEnemyExists(currentSquare);
        }
        else
        {
            if (currentSquare.GetIsGoal() && !hasGoalBeenReached && currentSquare.GetEnemy() == null)
            {
                goalReady = true;
            }
            else if (currentSquare.GetIsExtraction() && currentSquare.GetEnemy() == null)
            {
                extractionReady = true;
            }
            mapConfig.GetTrapSpringMenu().OpenMenu(currentSquare, goalReady, extractionReady);
            trapSprung = true;
        }

        if (currentSquare.GetIsGoal() && !hasGoalBeenReached && currentSquare.GetEnemy() == null && !trapSprung)
        {
            FindObjectOfType <MapConfig>().GetGoalWindow().OpenGoalWindow(currentSquare);
        }
        else if (currentSquare.GetIsExtraction() && currentSquare.GetEnemy() == null && !trapSprung)
        {
            FindObjectOfType <MapConfig>().GetExtractionWindow().OpenExtractionWindow();
        }
    }