public bool HasInStockpile()
    {
        bool hasTrees    = HomesteadStockpile.GetTreesCountAtGrade(treeGrade) >= trees;
        bool hasLogs     = HomesteadStockpile.GetLogsCountAtGrade(logGrade) >= logs;
        bool hasFirewood = HomesteadStockpile.GetFirewoodCountAtGrade(firewoodGrade) >= firewood;

        return(hasTrees && hasLogs && hasFirewood);
    }
Example #2
0
        public void UpdateLogPile()
        {
            int logsCount = HomesteadStockpile.GetLogsCountAtGrade(qualityGrade);

            interactableLog.SetActive(logsCount > 0);

            for (int i = 0; i < logPileGroup.childCount; i++)
            {
                logPileGroup.GetChild(i).gameObject.SetActive(logsCount > (15 - i));
            }
        }
Example #3
0
        void Split()
        {
            ApplySplitForce();

            LoggingActivityPlayerBehavior.UnsnapPlayer();

            int qualityAverage = QualityMinigame.CalculateAverageGrade(HomesteadStockpile.GetLogsCountAtGrade(maxQualityGrade));

            qualityAverage = Mathf.Clamp(qualityAverage, 0, maxQualityGrade.GetHashCode());

            QualityGrade gatheredQuality = (QualityGrade)qualityAverage;

            HomesteadStockpile.UpdateFirewoodCountAtGrade(gatheredQuality, QualityMinigame.GetUngradedFirewood());

            QualityMinigame.ClearUngradedFirewood();

            Debug.Log("Gathered Grade: " + gatheredQuality);

            Invoke("PhaseOutFirewood", 5f);
        }
Example #4
0
    IEnumerator WaitForFirewoodGrade()
    {
        yield return(new WaitUntil(() => !QualityMinigame.IsGradeListEmpty()));

        UnsnapPlayer();

        int qualityAverage = QualityMinigame.CalculateAverageGrade(HomesteadStockpile.GetLogsCountAtGrade(QualityMinigame.GetLastMaxFirewoodGrade()));

        qualityAverage = Mathf.Clamp(qualityAverage, 0, QualityMinigame.GetLastMaxFirewoodGrade().GetHashCode());

        QualityGrade gatheredQuality = (QualityGrade)qualityAverage;

        int ungradedCount = QualityMinigame.GetUngradedFirewood();

        HomesteadStockpile.UpdateFirewoodCountAtGrade(gatheredQuality, ungradedCount);

        QualityMinigame.ClearUngradedFirewood();

        Debug.Log("Gathered Grade: " + gatheredQuality);
        // Debug.Log("Gathered Count: " + ungradedCount);
    }
Example #5
0
        // public bool PlayerCanStore()
        // {
        //  return HomesteadStockpile.GetFirewoodCountAtGrade(qualityGrade) < PlayerSkills.GetMaxLumberFirewoodValue();
        // }

        // public QualityGrade GetQualityGrade() { return qualityGrade; }

        // public bool HasBeenSplit() { return hasBeenSplit; }

        public void ChopLog()
        {
            HomesteadStockpile.UpdateLogsCountAtGrade(maxQualityGrade, -1);
            if (HomesteadStockpile.GetLogsCountAtGrade(maxQualityGrade) > 0)
            {
                associatedLogPile.UpdateLogPile();
            }

            QualityMinigame.IncrementUngradedFirewood();
            QualityMinigame.SetLastMaxFirewoodGrade(maxQualityGrade);

            // hasBeenSplit = true;

            if (HomesteadStockpile.GetLogsCountAtGrade(maxQualityGrade) <= 0)
            {
                LoggingActivityPlayerBehavior.SetLogsRemaining(HomesteadStockpile.GetLogsCountAtGrade(maxQualityGrade));
                LoggingActivityPlayerBehavior.SetCanPerformAction(false);

                PlayerHud.ToggleQualityGame(true);
                QualityMinigame.StartGame();

                StartCoroutine(SplitAfterGrade());
            }
        }