Example #1
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 #2
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);
    }
 public void SubtractFromStockpile()
 {
     HomesteadStockpile.UpdateTreesCountAtGrade(treeGrade, -trees);
     HomesteadStockpile.UpdateLogsCountAtGrade(logGrade, -logs);
     HomesteadStockpile.UpdateFirewoodCountAtGrade(firewoodGrade, -firewood);
 }