Пример #1
0
        void Fall(int side)
        {
            int oppositeSide = side % 2 == 0 ? (side + 1) : (side - 1);

            transform.parent.GetComponentInChildren <LoggingActivityInteractPrompt>().HideUI();

            ApplyFallingForce(oppositeSide);
            hasFallen = true;

            foreach (ForestTreeSnapSpot snap in transform.GetComponentsInChildren <ForestTreeSnapSpot>())
            {
                snap.enabled = false;
            }
            LoggingActivityPlayerBehavior.UnsnapPlayer();
            GetComponent <ForestTreeBehavior>().enabled = false;

            int qualityAverage = QualityMinigame.CalculateAverageGrade();

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

            QualityGrade gatheredQuality = (QualityGrade)qualityAverage;

            HomesteadStockpile.UpdateTreesCountAtGrade(gatheredQuality, 1);

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

            //Visually phase tree out
            Invoke("PhaseOutTree", 5);
        }
Пример #2
0
        void SawThrough(int loc)
        {
            if (locationFullySawed[0] && locationFullySawed[1])
            {
                LoggingActivityPlayerBehavior.UnsnapPlayer();

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

                QualityGrade gatheredQuality = (QualityGrade)qualityAverage;

                HomesteadStockpile.UpdateLogsCountAtGrade(gatheredQuality, 3);
                HomesteadStockpile.UpdateTreesCountAtGrade(maxQualityGrade, -1);

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

                Invoke("PhaseOutLogs", 1.0f);
            }
        }
 public void SubtractFromStockpile()
 {
     HomesteadStockpile.UpdateTreesCountAtGrade(treeGrade, -trees);
     HomesteadStockpile.UpdateLogsCountAtGrade(logGrade, -logs);
     HomesteadStockpile.UpdateFirewoodCountAtGrade(firewoodGrade, -firewood);
 }