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