Exemplo n.º 1
0
 public void Head()
 {
     if (!CalculationsManager.IsPlayerStandingOnBall())
     {
         return;
     }
     GameManager.instance.nextAction = new RestartAction(RestartActionType.HEAD, Side.PLAYER, true, GameManager.instance.ballPosition);
     GameManager.instance.PrepareForRestartMove();
 }
Exemplo n.º 2
0
 void ComputerCorner()
 {
     if (CalculationsManager.IsComputerCornerSuccessful(possession))
     {
         player.actionList.cornerCPU.subActions[1].MakeAction();
     }
     else
     {
         player.actionList.cornerCPU.subActions[0].MakeAction();
     }
     EndCPURestartMove();
 }
Exemplo n.º 3
0
 void ComputerFreeKick()
 {
     if (CalculationsManager.IsComputerShootSuccessful(possession))
     {
         player.actionList.FreeKickCPU.subActions[1].MakeAction();
     }
     else
     {
         player.actionList.FreeKickCPU.subActions[0].MakeAction();
     }
     EndCPURestartMove();
 }
Exemplo n.º 4
0
    void ComputerAttack()
    {
        Comments.Log(CommentsEnum.COM_ATTACK);

        Vector2 destination = CalculationsManager.GetRandomAttackingPosition(ballPosition, possession);

        SetBallPosition(destination);
        if (onComputerAttack != null)
        {
            onComputerAttack();
        }
    }
Exemplo n.º 5
0
    public void Out()
    {
        GameManager.instance.stats.AddSetPiece(Side.PLAYER, RestartActionType.OUT);
        if (!CalculationsManager.IsPositionOnTheEdge(GameManager.instance.ballPosition))
        {
            return;
        }
        bool isPlayerPerforming = GameManager.instance.ballPosition == GameManager.instance.player.position;

        GameManager.instance.nextAction = new RestartAction(RestartActionType.OUT, Side.PLAYER, isPlayerPerforming, GameManager.instance.ballPosition);
        GameManager.instance.PrepareForRestartMove();
    }
Exemplo n.º 6
0
    public void GoToClubTraining()
    {
        string randomAttributeName = CalculationsManager.GetRandomAttributeName(gameInfo.playerStats);
        int    randomExp           = Random.Range(150, 201);

        clubTrainingAttributeName.text = "Training topic: " + randomAttributeName;
        clubTrainingAttributeExp.text  = "" + randomExp;
        gameInfo.playerStats.playerAttributes[randomAttributeName].AddExp(randomExp);
        UpdateAttributeInfo();
        clubTrainingPopUp.SetActive(true);
        gameInfo.wentToClubTraining = true;
        CheckForDay();
    }
Exemplo n.º 7
0
    public float GetCurrentExpPercent()
    {
        if (value >= maxValue)
        {
            return(100f);
        }

        float currentLevelExp = CalculationsManager.GetStartingExpByLevel(value);
        float nextLevelExp    = CalculationsManager.GetStartingExpByLevel(value + 1);
        float percent         = (currentExp - currentLevelExp) * 100f / (nextLevelExp - currentLevelExp);

        return(percent);
    }
Exemplo n.º 8
0
 public void ComputerPenalty()
 {
     if (CalculationsManager.IsComputerShootSuccessful(possession))
     {
         Comments.Log(CommentsEnum.COM_PENALTY_SUCCESS);
         Goal(false, possession);
     }
     else
     {
         Comments.Log(CommentsEnum.COM_PENALTY_FAIL);
         Miss(false, possession);
     }
     ChangeBallPossession(CalculationsManager.OtherSide(possession));
 }
Exemplo n.º 9
0
    bool FightForBall()
    {
        int playerScore = CalculationsManager.GetFormationPointsInPosition(ballPosition, Side.PLAYER) + CalculationsManager.RollTheDice();
        int enemyScore  = CalculationsManager.GetFormationPointsInPosition(ballPosition, Side.ENEMY) + CalculationsManager.RollTheDice();

        if (playerScore == enemyScore)
        {
            return(true);
        }
        else
        {
            ChangeBallPossession(playerScore > enemyScore ? Side.PLAYER : Side.ENEMY);
            return(false);
        }
    }
Exemplo n.º 10
0
 public void SaveEverything()
 {
     /*
      *      Team[] teams=new Team[teamsDropdown.options.Count];
      *      string[] teamNames=teamsDropdown.options.Select(o => o.text).ToArray();
      *      for (int ii = 0; ii < teamNames.Length; ii++)
      *              teams[ii]=new Team(teamNames[ii]);*/
     teams = GenerateTeamLevels();
     CareerManager.gameInfo.calendar    = new LeagueCalendar(teams);
     playerInfo.playerAttributes        = playerAttributes;
     CareerManager.gameInfo.playerStats = playerInfo.Clone();
     CareerManager.gameInfo.marketValue = CalculationsManager.GetStartingMarketValueByTeam(playerInfo.currentTeam);
     Debug.Log("Saving statistics: ");
     Debug.Log(playerInfo.ToString());
     SaveLoad.SaveGame();
     SceneManager.LoadScene("playerMenu");
 }
Exemplo n.º 11
0
    public void UpdateInformation(MatchStatistics m)
    {
        foreach (KeyValuePair <string, Vector2> kvp in m.playerMoves)
        {
            playerMoves[kvp.Key] = playerMoves[kvp.Key] + m.playerMoves[kvp.Key];
        }
        matchesPlayed++;
        playerGoals        += m.playerGoals;
        playerYellows      += m.playerYellows;
        playerReds         += m.playerReds;
        playerFouls        += m.playerFouls;
        playerTurnsOnPitch += m.playerTurnsOnPitch;
        decimal rating = CalculationsManager.CalculatePlayerRating(m);

        playerSummedRating += rating;
        CareerManager.gameInfo.marketValue += CalculationsManager.GetMarketValueChangeByRating(rating);
    }
Exemplo n.º 12
0
 bool CheckTheType(checkTypes type)
 {
     if (type == checkTypes.BALL_ON_SIDES)
     {
         return(CalculationsManager.IsPositionOnTheEdge(GameManager.instance.ballPosition));
     }
     else if (type == checkTypes.PLAYER_ON_PENALTY)
     {
         return(CalculationsManager.IsPlayerOnPenaltyArea());
     }
     else if (type == checkTypes.PLAYER_SAME_SECTOR_AS_BALL)
     {
         return(CalculationsManager.IsPlayerStandingOnBall());
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 13
0
    public void Penalty()
    {
        actionCompleted = "Penalty";
        if (!CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Penalties").value, Vector2.right, Vector2.right))
        {
            actionList.Penalty.subActions[0].MakeAction();
            if (onActionFail != null)
            {
                onActionFail();
            }
        }
        else
        {
            actionList.Penalty.subActions[1].MakeAction();
            if (onActionSuccess != null)
            {
                onActionSuccess();
            }
        }

        GameManager.instance.EndPlayerRestartMove();
    }
Exemplo n.º 14
0
    void StartTurn()
    {
        if (onTurnStart != null)
        {
            onTurnStart();
        }
        turnStarted = true;

        UpdateCoachSatisfaction(player.IsOnPreferredPosition());
        if (coachSatisfactionUpdate != null)
        {
            coachSatisfactionUpdate(CoachSatisfaction);
        }

        if (CalculationsManager.CanPlayerStart())
        {
            playerHasBall = true;
            BeginPlayerTurn();
        }
        else if (CalculationsManager.CanPlayerTackle() && !noFightNextTurn)
        {
            bool wasTackleSuccessful = player.Tackle();
            if (wasTackleSuccessful)
            {
                ChangeBallPossession(Side.PLAYER);
                playerHasBall = true;
                BeginPlayerTurn();
            }
            else
            {
                playerHasBall = false;
                BeginComputerTurn();
            }
        }
        else
        {
            BeginComputerTurn();
        }
    }
Exemplo n.º 15
0
 public bool Tackle()
 {
     actionCompleted = "Tackle";
     if (CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Tackling").value, position, position))
     {
         actionList.Tackle.subActions[1].MakeAction();
         if (onActionSuccess != null)
         {
             onActionSuccess();
         }
         return(true);
     }
     else
     {
         actionList.Tackle.subActions[0].MakeAction();
         if (onActionFail != null)
         {
             onActionFail();
         }
         return(false);
     }
 }
    void ViewStatistics(CareerStatistics s)
    {
        PlayerName.text     = CareerManager.gameInfo.playerStats.playerName + " " + CareerManager.gameInfo.playerStats.playerSurname;
        playerTeamName.text = CareerManager.gameInfo.playerStats.currentTeam.name;

        playerTurnsOnPitch.text = "Minutes played: " + s.playerTurnsOnPitch;
        PlayerGoals.text        = "Goals: " + s.playerGoals.ToString();
        playerShots.text        = "Shots: " + CalculationsManager.StripVector2(s.playerMoves["Shoot"]);
        playerPassess.text      = "Passess: " + CalculationsManager.StripVector2(s.playerMoves["Pass"]);
        playerDribbles.text     = "Dribbles: " + CalculationsManager.StripVector2(s.playerMoves["Dribble"]);
        playerTackles.text      = "Tackles: " + CalculationsManager.StripVector2(s.playerMoves["Tackle"]);
        playerCrosses.text      = "Crosses: " + CalculationsManager.StripVector2(s.playerMoves["Cross"]);
        playerCorners.text      = "Corners: " + CalculationsManager.StripVector2(s.playerMoves["Corner"]);
        playerLongShots.text    = "Long Shots: " + CalculationsManager.StripVector2(s.playerMoves["LongShot"]);
        playerThrowIns.text     = "Throw Ins: " + CalculationsManager.StripVector2(s.playerMoves["Out"]);
        playerFreeKicks.text    = "Free Kicks: " + CalculationsManager.StripVector2(s.playerMoves["FreeKick"]);
        playerPenalties.text    = "Penalties: " + CalculationsManager.StripVector2(s.playerMoves["Penalty"]);
        playerHeaders.text      = "Headers: " + CalculationsManager.StripVector2(s.playerMoves["Head"]);
        playerFouls.text        = "Fouls: " + s.playerFouls.ToString();
        playerYellows.text      = "Yellow cards: " + s.playerYellows.ToString();
        playerReds.text         = "Red cards: " + s.playerReds.ToString();
        marketValue.text        = CalculationsManager.MarketValueToPrettyString(CareerManager.gameInfo.marketValue);
    }
Exemplo n.º 17
0
    public void FreeKick()
    {
        actionCompleted = "FreeKick";
        GameManager.instance.SetBallPosition(Vector2.right);
        if (!CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Free Kicks").value, Vector2.right, Vector2.right))
        {
            actionList.FreeKick.subActions[0].MakeAction();
            if (onActionFail != null)
            {
                onActionFail();
            }
        }
        else
        {
            actionList.FreeKick.subActions[1].MakeAction();
            if (onActionSuccess != null)
            {
                onActionSuccess();
            }
        }

        GameManager.instance.EndPlayerRestartMove();
    }
Exemplo n.º 18
0
    public void Head(Vector2 destination)
    {
        actionCompleted = "Head";
        GameManager.instance.SetBallPosition(destination);
        if (!CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Heading").value, destination, destination))
        {
            GameManager.instance.ChangeBallPossession(Side.ENEMY);
            if (onActionFail != null)
            {
                onActionFail();
            }
        }
        else
        {
            GameManager.instance.ChangeBallPossession(Side.PLAYER);
            if (onActionSuccess != null)
            {
                onActionSuccess();
            }
        }

        GameManager.instance.EndPlayerRestartMove();
    }
Exemplo n.º 19
0
    public void FreeKickAction()
    {
        GameManager.instance.stats.AddSetPiece(GameManager.instance.possession, RestartActionType.FREEKICK);
        GameManager.instance.logs.FlushTheBuffer();
        RestartActionType moveType = RestartActionType.FREEKICK;
        string            move     = "Freekick";

        if (CalculationsManager.IsBallOnPenaltyArea() && CalculationsManager.GetResultByPercent(0.5f))
        {
            moveType = RestartActionType.PENALTY;
            move     = "Penalty";
        }
        if (CalculationsManager.IsPlayerStandingOnBall() && GameManager.instance.player.contusion == null && !GameManager.instance.player.IsEnergyDepleted())
        {
            GameManager.instance.nextAction = new RestartAction(moveType, Side.PLAYER, true, GameManager.instance.ballPosition);
        }
        else
        {
            GameManager.instance.nextAction = new RestartAction(moveType, CalculationsManager.OtherSide(GameManager.instance.possession), false, GameManager.instance.ballPosition);
        }
        GameManager.instance.SetSelectedMove(move);
        GameManager.instance.PrepareForRestartMove();
    }
Exemplo n.º 20
0
    public void Out()
    {
        actionCompleted = "Out";
        if (!CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Long Throws").value + 6, position, position))
        {
            actionList.ThrowIn.subActions[0].MakeAction();
            GameManager.instance.ChangeBallPossession(Side.ENEMY);
            if (onActionFail != null)
            {
                onActionFail();
            }
        }
        else
        {
            actionList.ThrowIn.subActions[1].MakeAction();
            GameManager.instance.ChangeBallPossession(Side.PLAYER);
            if (onActionSuccess != null)
            {
                onActionSuccess();
            }
        }

        GameManager.instance.EndPlayerRestartMove();
    }
Exemplo n.º 21
0
    public void Pass(Vector2 destination)
    {
        actionCompleted = "Pass";
        GameManager.instance.SetBallPosition(destination);
        if (!CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Passing").value, position, destination))
        {
            GameManager.instance.ChangeBallPossession(Side.ENEMY);
            if (onActionFail != null)
            {
                onActionFail();
            }
        }
        else
        {
            if (onActionSuccess != null)
            {
                onActionSuccess();
            }
        }

        GameManager.instance.noFightNextTurn = true;
        GameManager.instance.playerHasBall   = false;
        GameManager.instance.EndPlayerTurn();
    }
Exemplo n.º 22
0
    public void Corner()
    {
        actionCompleted = "Corner";
        MoveYourself(GameManager.instance.nextAction.source);
        GameManager.instance.SetBallPosition(Vector2.right);
        if (!CalculationsManager.IsMoveSuccessful(playerInfo.GetAttribute("Corners").value, Vector2.zero, Vector2.right))
        {
            GameManager.instance.ChangeBallPossession(Side.ENEMY);
            if (onActionFail != null)
            {
                onActionFail();
            }
        }
        else
        {
            GameManager.instance.ChangeBallPossession(Side.PLAYER);
            if (onActionSuccess != null)
            {
                onActionSuccess();
            }
        }

        GameManager.instance.EndPlayerRestartMove();
    }
Exemplo n.º 23
0
    public void Click(string which)
    {
        if ((which.First().ToString().ToUpper() + which.Substring(1)).Remove(which.Length - 6).Equals("Head"))
        {
            if (GameManager.instance.nextAction.source == Vector2.right)
            {
                GameManager.instance.MakeMove("Head", Vector2.right);
            }
            else
            {
                SetCurrentlyAvailable();
                GameManager.instance.SetSelectedMove("Head");
                pitch.HighlightSelected(CalculationsManager.GetPositions("Head", GameManager.instance.GetPlayerPosition()));
            }
        }

        if (!stageButtons.Contains(which))
        {
            pitch.UnHighlightEverything();
            if (which.Equals("startButton"))
            {
                if (!GameManager.instance.HasTheGameStarted())
                {
                    GameManager.instance.StartTheMatch();
                }
                else if (GameManager.instance.IsGamePaused())
                {
                    GameManager.instance.Unpause();
                }
                else
                {
                    GameManager.instance.Pause();
                }
            }
            else if (which.Equals("shootButton"))
            {
                GameManager.instance.MakeMove("Shoot", Vector2.right);
            }
            else if (which.Equals("longShotButton"))
            {
                GameManager.instance.MakeMove("LongShot", Vector2.right);
            }
        }
        else
        {
            SetCurrentlyAvailable();
            string move;
            if (!which.Equals("outButton"))
            {
                pitch.UnHighlightEverything();
                SetInteractable(which, false);
                move = (which.First().ToString().ToUpper() + which.Substring(1)).Remove(which.Length - 6);
            }
            else
            {
                shortOut = !shortOut;
                if (shortOut)
                {
                    move = "Out";
                }
                else
                {
                    move = "LongOut";
                }
            }
            Debug.Log("Selected move: " + move);

            if (move.Equals("Move"))
            {
                GameManager.instance.Pause();
            }

            GameManager.instance.SetSelectedMove(move);
            pitch.HighlightSelected(CalculationsManager.GetPositions(move, GameManager.instance.GetPlayerPosition()));
        }
    }
Exemplo n.º 24
0
    public void ReduceFormationPoints(string formation, Side side)
    {
        if (playerTeam.attack + playerTeam.midfield + playerTeam.defence == 0)
        {
            GameManager.instance.EndTheMatch();
        }
        else if (enemyTeam.attack + enemyTeam.midfield + enemyTeam.defence == 0)
        {
            GameManager.instance.EndTheMatch();
        }


        if (formation.Equals("attack") && side == Side.PLAYER)
        {
            if (playerTeam.attack >= 0)
            {
                playerTeam.attack--;
            }
            else
            {
                ReduceFormationPoints(CalculationsManager.GetFormationWithMostPoints(playerTeam), side);
            }
        }
        else if (formation.Equals("midfield") && side == Side.PLAYER)
        {
            if (playerTeam.midfield >= 0)
            {
                playerTeam.midfield--;
            }
            else
            {
                ReduceFormationPoints(CalculationsManager.GetFormationWithMostPoints(playerTeam), side);
            }
        }
        else if (formation.Equals("defence") && side == Side.PLAYER)
        {
            if (playerTeam.defence >= 0)
            {
                playerTeam.defence--;
            }
            else
            {
                ReduceFormationPoints(CalculationsManager.GetFormationWithMostPoints(playerTeam), side);
            }
        }
        else if (formation.Equals("attack") && side == Side.ENEMY)
        {
            if (enemyTeam.attack >= 0)
            {
                enemyTeam.attack--;
            }
            else
            {
                ReduceFormationPoints(CalculationsManager.GetFormationWithMostPoints(enemyTeam), side);
            }
        }
        else if (formation.Equals("midfield") && side == Side.ENEMY)
        {
            if (enemyTeam.midfield >= 0)
            {
                enemyTeam.midfield--;
            }
            else
            {
                ReduceFormationPoints(CalculationsManager.GetFormationWithMostPoints(enemyTeam), side);
            }
        }
        else if (formation.Equals("defence") && side == Side.ENEMY)
        {
            if (enemyTeam.defence >= 0)
            {
                enemyTeam.defence--;
            }
            else
            {
                ReduceFormationPoints(CalculationsManager.GetFormationWithMostPoints(enemyTeam), side);
            }
        }
    }
Exemplo n.º 25
0
    public void SetCurrentlyAvailable()
    {
        SetInteractableToAll(false);
        if (GameManager.instance.IsGameHardPaused())
        {
            return;
        }
        SetInteractable("startButton", true);


        if (GameManager.instance.currentMinute != 46)
        {
            if (GameManager.instance.gameStarted)
            {
                if (!GameManager.instance.IsGamePaused())
                {
                    SetButtonText("startButton", "Pause");
                }
                else
                {
                    SetButtonText("startButton", "Play");
                }
            }
            else
            {
                SetButtonText("startButton", "Play Match");
            }
        }

        if (GameManager.instance.IsGamePaused() || GameManager.instance.player.IsEnergyDepleted() || GameManager.instance.player.contusion != null || GameManager.instance.player.HasRed())
        {
            return;
        }

        if (!GameManager.instance.playerHasBall && !GameManager.instance.playerRestartMoveRemaining && !GameManager.instance.IsGamePaused() && !GameManager.instance.player.movedThisTurn && !GameManager.instance.player.IsWithdrawn())
        {
            SetInteractable("moveButton", true);
        }

        if (GameManager.instance.IsPlayerWaitingForRestart())
        {
            if (GameManager.instance.nextAction.type == RestartActionType.CORNER)
            {
                SetInteractable("cornerButton", true);
            }
            else if (GameManager.instance.nextAction.type == RestartActionType.OUT)
            {
                SetInteractable("outButton", true);
            }
            else if (GameManager.instance.nextAction.type == RestartActionType.HEAD)
            {
                SetInteractable("headButton", true);
            }
            else if (GameManager.instance.nextAction.type == RestartActionType.FREEKICK)
            {
                SetInteractable("freekickButton", true);
            }
            else if (GameManager.instance.nextAction.type == RestartActionType.PENALTY)
            {
                SetInteractable("penaltyButton", true);
            }
            return;
        }

        if (!GameManager.instance.playerTurn)
        {
            return;
        }



        if (GameManager.instance.playerHasBall)
        {
            SetInteractable("dribbleButton", true);
            SetInteractable("passButton", true);
            if (CalculationsManager.IsPlayerOnPenaltyArea())
            {
                SetInteractable("shootButton", true);
            }
            else
            {
                SetInteractable("longShotButton", true);
                SetInteractable("crossButton", true);
            }
        }
    }
Exemplo n.º 26
0
    void CreateExpPopUp(string move)
    {
        Text statText;

        if (move.Equals("Shoot"))
        {
            statText = playerShots;
        }
        else if (move.Equals("LongShot"))
        {
            statText = playerLongShots;
        }
        else if (move.Equals("Pass"))
        {
            statText = playerPassess;
        }
        else if (move.Equals("Dribble"))
        {
            statText = playerDribbles;
        }
        else if (move.Equals("Tackle"))
        {
            statText = playerTackles;
        }
        else if (move.Equals("Corner"))
        {
            statText = playerCorners;
        }
        else if (move.Equals("FreeKick"))
        {
            statText = playerFreeKicks;
        }
        else if (move.Equals("Out"))
        {
            statText = playerThrowIns;
        }
        else if (move.Equals("Head"))
        {
            statText = playerHeaders;
        }
        else if (move.Equals("Cross"))
        {
            statText = playerCrossing;
        }
        else
        {
            return;
        }

        int expGained = CalculationsManager.GetExpBySkillUsage(statisticsToView.playerMoves[move]);

        if (expGained <= 0)
        {
            return;
        }

        Text text = Instantiate(expGainedPrefab).GetComponent <Text>();

        text.transform.SetParent(GameObject.Find("Canvas").transform);
        text.transform.localScale = Vector3.one;
        text.transform.position   = statText.transform.position + Vector3.right * 450;
        text.text = "+" + expGained + " Exp";

        CareerManager.gameInfo.playerStats.playerAttributes[CalculationsManager.MoveNameToSkillName(move)].AddExp(expGained);
    }
Exemplo n.º 27
0
 public void AddExp(int exp)
 {
     this.currentExp += exp;
     this.value       = CalculationsManager.GetLevelByExp(this.currentExp);
 }
Exemplo n.º 28
0
 public void SetStartingAttributeValueAndExp(int value)
 {
     this.value      = value;
     this.currentExp = CalculationsManager.GetStartingExpByLevel(value);
 }
Exemplo n.º 29
0
 public void FoulContusion()
 {
     GameManager.instance.stats.AddFoul(Side.ENEMY);
     GameManager.instance.player.GetContusion(CalculationsManager.GetRandomContusion());
     FreeKickAction();
 }
Exemplo n.º 30
0
    public void ViewStatistics(MatchStatistics stats)
    {
        foreach (Slider s in comparisonBars)
        {
            s.transform.Find("Fill Area").Find("Fill").GetComponent <Image>().color = stats.playerTeam.bgColor;
            s.transform.Find("Background").GetComponent <Image>().color             = stats.enemyTeam.bgColor;
        }

        playerTeamNameDisplay.text = stats.playerTeam.name;
        enemyTeamNameDisplay.text  = stats.enemyTeam.name;
        score.text     = stats.playerTeamGoals + ":" + stats.enemyTeamGoals;
        TeamNames.text = stats.playerTeam.name + " - " + stats.enemyTeam.name;
        if (stats.playerTurnsOnPitch <= 15)
        {
            ratingText.text = "N/A";
            playerRating    = 0.0m;
        }
        else
        {
            playerRating    = CalculationsManager.CalculatePlayerRating(stats);
            ratingText.text = playerRating.ToString();
        }

        //Tabela statów drużyn
        TeamShots.value     = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamShots, stats.enemyTeamShots);
        TeamCorners.value   = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamCorners, stats.enemyTeamCorners);
        TeamFreeKicks.value = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamFreeKicks, stats.enemyTeamFreeKicks);
        TeamThrowIns.value  = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamThrowIns, stats.enemyTeamThrowIns);
        TeamFouls.value     = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamFouls, stats.enemyTeamFouls);
        TeamYellows.value   = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamYellows, stats.enemyTeamYellows);
        TeamReds.value      = CalculationsManager.GetPercentageOfFirstValue(stats.playerTeamReds, stats.enemyTeamReds);

        playerTeamShots.text     = stats.playerTeamShots.ToString();
        playerTeamCorners.text   = stats.playerTeamCorners.ToString();
        playerTeamFreeKicks.text = stats.playerTeamFreeKicks.ToString();
        playerTeamThrowIns.text  = stats.playerTeamThrowIns.ToString();
        playerTeamFouls.text     = stats.playerTeamFouls.ToString();
        playerTeamYellows.text   = stats.playerTeamYellows.ToString();
        playerTeamReds.text      = stats.playerTeamReds.ToString();

        enemyTeamShots.text     = stats.enemyTeamShots.ToString();
        enemyTeamCorners.text   = stats.enemyTeamCorners.ToString();
        enemyTeamFreeKicks.text = stats.enemyTeamFreeKicks.ToString();
        enemyTeamThrowIns.text  = stats.enemyTeamThrowIns.ToString();
        enemyTeamFouls.text     = stats.enemyTeamFouls.ToString();
        enemyTeamYellows.text   = stats.enemyTeamYellows.ToString();
        enemyTeamReds.text      = stats.enemyTeamReds.ToString();

        PlayerName.text = CareerManager.gameInfo.playerStats.playerName + " " + CareerManager.gameInfo.playerStats.playerSurname;
        //Tabela statów piłkarza
        playerTurnsOnPitch.text = "Time Alive: " + stats.playerTurnsOnPitch;
        PlayerGoals.text        = "Goals: " + stats.playerGoals.ToString();
        playerShots.text        = "Shots: " + CalculationsManager.StripVector2(stats.playerMoves["Shoot"]);
        playerLongShots.text    = "Long Shots: " + CalculationsManager.StripVector2(stats.playerMoves["LongShot"]);
        playerPassess.text      = "Passess: " + CalculationsManager.StripVector2(stats.playerMoves["Pass"]);
        playerDribbles.text     = "Dribbles: " + CalculationsManager.StripVector2(stats.playerMoves["Dribble"]);
        playerTackles.text      = "Tackles: " + CalculationsManager.StripVector2(stats.playerMoves["Tackle"]);
        playerCorners.text      = "Corners: " + CalculationsManager.StripVector2(stats.playerMoves["Corner"]);
        playerFreeKicks.text    = "Free Kicks: " + CalculationsManager.StripVector2(stats.playerMoves["FreeKick"]);
        playerThrowIns.text     = "Throw-ins: " + CalculationsManager.StripVector2(stats.playerMoves["Out"]);
        playerHeaders.text      = "Headers: " + CalculationsManager.StripVector2(stats.playerMoves["Head"]);
        playerCrossing.text     = "Crosses: " + CalculationsManager.StripVector2(stats.playerMoves["Cross"]);
        playerFouls.text        = "Fouls: " + stats.playerFouls.ToString();
        playerYellows.text      = "Yellow cards: " + stats.playerYellows.ToString();
        playerReds.text         = "Red cards: " + stats.playerReds.ToString();

        foreach (KeyValuePair <string, Vector2> kvp in stats.playerMoves)
        {
            CreateExpPopUp(kvp.Key);
        }
    }