Ejemplo n.º 1
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();
        }
    }